Important: The information in this document is obsolete and should not be used for new development.
I_SetFramingType
This command sets the framing type for a serial port. Currently, serial ports can support four different framing types, as enumerated in thefCapabilities
field of theOTPortRecord
. These arekOTSerialFramingAsync
,kOTSerialFramingHDLC
,kOTSerialFramingSDLC
, andkOTSerialFramingAsyncPackets
. The normal mode of operation iskOTSerialFramingAsync
. You can change the mode of operation to the asynchronous packet framing type by making this OTIoctl command:
OTIoctl(theSerialEndpoint, I_OTSetFramingType, kOTSerialFramingAsyncPackets);If you select thekOTSerialFramingAsyncPackets
type, the underlying serial provider assumes that each individual message that arrives is a separate packet, and should be sent as such. It also means that the underlying provider ensures that if data is flushed, all data will be flushed except any packet that is being processed at the time of the flush. This behavior is important to technologies such as Apple Remote Access (ARA) or Point-to-Point Protocol (PPP) implementations, which use the serial port for delivery of discrete packets, because
- stopping a packet in the middle of a transfer causes a performance degradation while the upper protocols expend effort to resynchronize
- both protocols want to ensure that if they have to flush the queue of waiting messages that all waiting messages are flushed, even if they are queued up in the protocol module.