# Communications ToolBox

The Macintosh Communications Toolbox, generally shortened to CommToolbox or CTB, was a suite of application programming interfaces, libraries and dynamically loaded code modules for the classic Mac OS that implemented a wide variety of serial and network communication protocols, as well as file transfer protocols and terminal emulations.
Using CommToolbox, one could write an application that would seamlessly work over AppleTalk, a modem or any variety of other connections, transfer files using XMODEM, Kermit or other file transfer protocols, and provide DEC VT102, VT220, IBM 3270 and other terminal emulation services. Developers could also write plug-in communications modules known as "Tools", allowing any CommToolbox-aware application to use that connection method.
CommToolbox was claimed by some to be slow and buggy, and received mixed support from developers. Examples of applications using it for simple tasks were common, but single-purpose applications would have higher performance when bypassing system API's implementations and rolling their own.
CommToolbox was initially released independent of the main Mac system releases but was finally integrated and delivered with System 7. The development team was part of the Apple Networking and Communications Division, not part of the main System Software team.

## Description

CommToolbox was perhaps one of the first implementations of shared libraries on the early Mac OS. Applications would find installed tools at launch time. In fact, applications could automatically discover and use newly installed tools without having to quit and relaunch.
CommToolbox API's consisted of 4 managers:
* Communications Resource Manager (CRM)
* Connection Manager (CM)
* File Transfer Manager (FTM)
* Terminal Manager (TM)
The CRM provided the Mac with its first centralized repository to register and enumerate serial devices. Early Macs only had two serial ports and with later Macs allowing expandability, including serial port cards, the CRM filled a critical hole in the Mac OS software architecture. Device manufacturers would create a pair of drivers that provided the same interface as Apple's built-in serial port drivers (but named differently from .AIn/.AOut .BIn/.BOut) and register these drivers with the CRM.
The Connection, File Transfer and Terminal Managers all worked with their respective tools which were dynamically loaded code modules providing the interface between the Manager-specific API and the code implementing the particular functionality. In this manner, an application could be written "agnostically" without implementation-specific knowledge of any particular data connection, file transfer, or terminal emulation protocols. In addition, these tools also provided a set of system-wide standard UI implementations that could be automatically invoked and used for configuration.
Connection Tools provided a byte-oriented communication channel interface, implementing basic functionality such as opening/closing a connection, reading/writing data, as well as callbacks to implement a user interface.
Terminal Tools implemented the character conversion and command string interpretation needed to support any sort of terminal emulator (mainly text terminals, graphics terminal tools were never released), and would be responsible for handling rendering into a QuickDraw GrafPort, user interactions including copying text out of the terminal buffer, and managing keystrokes to send terminal-specific control strings.
File Transfer Tools implemented all of the underlying implementation details involved with file transfers as well as providing callbacks to implement a user interface.
Applications could use either a subset or all of the CTB Managers. A typical terminal emulator application would use all of them, connecting a Connection Tool selected in the Connection Manager to Terminal Tool in the Terminal Manager, and then periodically using a File Transfer Tool in the File Transfer Manager on user request. Such was the case for common terminal emulators like VersaTerm and MacTerminal. However, another application might use only one of these, say the Connection Manager to set up communications. QuickMail and Eudora are well-known examples. Applications typically used the GUI elements supplied by the Managers to handle user interaction, but could also enumerate the tools on their own to provide a custom GUI.
Perhaps the best known tool was the Apple Modem Tool, which provided the serial communications drivers as well as a system for storing setup commands. This was during an era where there was a proliferation of different modem vendors, each with subtly and not-so-subtly different AT command strings needed for configuration. When a connection was initiated using the Modem Tool, the link to the modem was opened, commands sent to it, and the link established by dialling. The Apple Modem Tool faced challenges with keeping with the rapidly changing modem landscape with needing to track higher speeds and new features being regularly introduced by modem vendors.
Providing CTB updates in general was also a challenge as the CTB development was, at first, not part of the main System Software effort, but rather part of the Networking and Communications division. When a 1.5 version addressing some of the problems was released in 1993, even finding it proved difficult. A further update was needed to support higher speeds when 28 kbit/s modems become common.
Some of the other Apple provided tools included the simple Serial Tool and AppleTalk Tools using AppleTalk's Apple Data Stream Protocol as additional connection methods, the TTY and VT102 Tools for terminal emulation, and the Text and XModem tools for file transfers.
Third party tools were common for supporting connections, including the Global Village TelePort modem which plugged into the Apple Desktop Bus and thus required custom drivers, Apple's own X.25 and ISDN tools, and a variety of other examples. There were also third-party Telnet Connection Tools released when TCP/IP started becoming prevalent.
CommToolbox was an important part of the DTO-1208 experiment onboard the Space Shuttle Atlantis which saw the first email from space in 1991. The equipment set-up was a backlit Mac Portable using a PSI Integration internal fax modem (used in half duplex mode due to the nature of the shuttle air-to-ground voice links). The communications software used was a specially modified version of AppleLink that used the CommToolbox Connection Manager (instead of directly accessing serial ports) and a custom Connection Tool written pro bono by three Apple engineers in their spare time to hide the half-duplex nature of the air-to-ground link from the application (which was expecting a full-duplex connection).