Three primary steps are required to open the serial device: * Create a message port using createport(). reply messages from the device must be directed to a message port. * Create an extended I/O request structure of type IOExtSer using createextio(). createextio() will initialize the i/o request to point to your reply port. * Open the serial device. Call opendevice(), passing the i/o request. struct MsgPort *SerialMP; /* Define storage for one pointer */ struct IOExtSer *SerialIO; /* Define storage for one pointer */ if (SerialMP=CreatePort(0,0) ) if (SerialIO=(struct IOExtSer *) CreateExtIO(SerialMP,sizeof(struct IOExtSer)) ) SerialIO->io_SerFlags=SERF_SHARED; /* Turn on SHARED mode */ if (OpenDevice(SERIALNAME,0L,(struct IORequest *)SerialIO,0) ) printf("%s did not open\n",SERIALNAME); During the open, the serial device pays attention to a subset of the flags in the io_SerFlags field. The flag bits, serf_shared and serf_7wire, must be set before open. For consistency, the other flag bits should also be properly set. Full descriptions of all flags will be given later. The serial device automatically fills in default settings for all parameters - stop bits, parity, baud rate, etc. For the default unit, the settings will come from Preferences. You may need to change certain parameters, such as the baud rate, to match your requirements. Once the serial device is opened, all characters received will be buffered, even if there is no current request for them.