Serial Line (cont’d)
err = SysLibFind("Serial Library", &serRefNum);
ErrFatalDisplayIf(err, "Can't find Serial Library!");
if (err) SerClose(serRefNum);
/* open the serial connection at the specified baud rate */
err = SerOpen(serRefNum, 0, BaudRate);
ErrFatalDisplayIf(err, "Problem opening the serial port!");
settings.baudRate = BaudRate;
settings.flags = serSettingsFlagStopBits1 |
serSettingsFlagBitsPerChar8 |
SerSetSettings(serRefNum, &settings);