The current IrCOMM code has to be made available to the rest of the OS by posing as a regular serial port. The communication system architecture on the Newton is layered, and the serial ports are at the very bottom. The system is managed by the CommunicationsManager (CM) that coordinates a number of communication tools. You can request an endpoint from the CM, specifying which CommTool should be used. One of these CommTools is the serial tool (others are the infrared, AppleTask etc). The serial tool knows about different serial ports via their location. Predefined locations are for example the PCMCIA slots and the external port.
A serial port driver implements the TSerialChip interface. It is not too complicated and hopefully, the IrCOMM code fits right in. But making it known to the rest of the system is a bit more difficult. First, the implementation has to be registered via the NameServer so that it can be instantiated. The Packager tool will take care of this. Then, the object has to be made known to the serial chip registry, along with the hardware location of the new port. The location can actually be anything, it will be used when requesting an Endpoint from the CM. Finally, the registered port must be added to the modem setup (the global variable ModemLocations is used for that).
All of the used classes are declared and documented in the DDK. But their exact behaviour has to be verified in many cases, as it is not clear how e.g. a TSerialChip implementation will be called from the serial tool. Hammer time.
Posted by Eckhart at January 24, 2003 03:37 PM