![]() |
Magic Internet Kit
|
Additionally, MIK provides several template packages to start from, so you can pick the perfect starting point for your own development. These templates start at the most basic "empty" communications package and go up to a dumb terminal package with complete user interface.
Figure 2 NewCommsApp script dialog
The next section to look at, Hardware Support, deals with what physical means that you'll use for communicating. These options are dependent on what connection types you have set up, for example you cannot use the Xircom Netwave PC Card for a direct serial connection. Don't worry if you're not familiar with all of the hardware or connection types; these will all be discussed shortly. The following tables illustrate how the hardware and connection types are interrelated:
Hardware | Serial Connection |
---|---|
Built-in Modem | Serial modem |
Serial port | Direct serial via MagicBus port |
MagicBus Modem | Serial via external modem on MagicBus port |
Xircom Netwave | (not available) |
Hardware | TCP/IP Connection |
---|---|
Built-in Modem | PPP via built-in modem |
Serial port | (not available) |
MagicBus Modem | PPP via external modem on MagicBus port |
Xircom Netwave | Wireless Ethernet via Xircom Netwave card |
In the above table, the Built-in modem refers to the internal modem that is present in all Magic Cap communicators. The serial port refers to using a communicator's MagicBus port as a passive serial port. The next two options, MagicBus modem and Xircom Netwave, use custom drivers that are included with the Magic Internet Kit. These drivers are provided as source code so that you can learn from and modify them if you so desire. The MagicBus modem driver lets you use an external modem connected to the MagicBus port via the same APIs as the internal modem. For example, you can use this driver to provide native support for Metricom's Ricochet wireless modem. The Xircom Netwave driver allows you to use these PC Cards as a data link server for MIK's TCP/IP stack. These two drivers will be discussed in much greater detail in later chapters.
The third part of New Comms App to consider is the section for TCP Options. This section only contains one checkbox for the DNS resolver. As you might imagine, this option only applies to TCP/IP connections; if you don't use TCP/IP, this box will be grayed out. If you are using TCP/IP, DNS will allow you to specify symbolic host names as the destination for a TCP stream instead of needing IP numbers. For example, "www.genmagic.com" could be used as a valid destination name instead of it's IP address, which is currently 192.216.22.142.
The final section of New Comms App is used to select the template to use when creating the new package. The following section explains the features of each template.
This section will discuss the templates that are included with the Magic Internet Kit so you can decided which ones you want to use for your own projects.
CujoTerm comes with a user interface for setting up connections, and you may find these components useful in your own application. The UI for setting up the connection is totally independent of the terminal code, so you can tear up the other parts of CujoTerm and the setup scene will still work.
Another key component of CujoTerm is its architecture; this terminal, while basic in user-level features, has an advanced multi-threaded structure behind it that can even support multiple simultaneous TCP/IP connections. The two key classes that implement this functionality are the CommsActor and CommsManager. The code that executes on its own thread is part of the CommsActor, and the CommsManager is used to easily create and destroy CommsActors. Both of these classes will be discussed in much greater detail in the Multithreaded Communications chapter of this document.