-
Notifications
You must be signed in to change notification settings - Fork 63
TSerialChipEinstein
The TSerialChipEinstein class implements the TSerialChip protocol to provide access to host-side serial ports or pseudo terminals. It presents a serial chip to NewtonOS which can be linked to the four serial port locations (internal, external, IrDA and modem). The implementation is part of the REx like other host drivers.
The class serves two purposes:
- Allow intercepting any calls from NewtonOS to the actual driver in the host OS via TNativePrimitives
- Hold the configuration values for each enabled serial port location
The instantiation and enabling of a TSerialChipEinstein based driver happens in the EinsteinPortEnabler package (part of the Newton preferences):
- Create a new instance of the TSerialChipEinstein class: Since TSerialChipEinstein is a protocol, NewtonOS is able to instantiate it by name as protocol implementation of TSerialChip
- Register the instance for the desired serial port location in the serial chip registry
- Start processing the options given to the driver:
- Driver type (host serial port or host PTY)
- Host file name
Note that it is also possible to perform the above steps as part of a regular Newton application, e.g. as part of a driver for external Bluetooth devices. EinsteinPortEnabler just allows configuration of the Newton serial port locations on a general level for existing Newton applications.