Important: The information in this document is obsolete and should not be used for new development.
Chapter 7 - Serial Driver
This chapter describes how you can use the Serial Driver to transfer data to a device connected to a Macintosh modem or printer port. The Serial Driver supports asynchronous serial data communication between applications and serial devices through these ports.The Serial Driver provides low-level support for communicating with serial devices that cannot be accessed through the Communications Toolbox or Printing Manager. For example, a scientific instrument or a printer that does not support QuickDraw. Before you decide to use the Serial Driver, you should determine whether it is the appropriate solution for your communication needs.
The Communications Toolbox is the recommended method for integrating modems and other telecommunications devices into the Macintosh environment. The Communications Toolbox provides hardware-independent services and a standard interface that offers compatibility with all Macintosh models. To find out more about the Communications Toolbox, see Inside the Macintosh Communications Toolbox.
Likewise, the Printing Manager is the recommended interface for printers and similar output devices. Using the Printing Manager makes your hardware or software product compatible with every other device or application that supports this standard interface. Refer to Inside Macintosh: Imaging With QuickDraw for more information.
To use the Serial Driver, you should understand how to open, close, and communicate with device drivers using the Device Manager. You can find this information in the chapter "Device Manager" in this book. For information about the Macintosh serial port hardware, including circuit diagrams and signal descriptions, see Guide to the Macintosh Family Hardware, second edition.
This chapter begins with a brief summary of key concepts in serial data communication, then describes how you can use the Serial Driver to
- configure a Macintosh serial port
- specify a data transfer buffer
- send and receive data through a serial port
- interpret serial communication errors
Chapter Contents
- Introduction to Serial Communication
- Asynchronous and Synchronous Communication
- Duplex Communication
- Flow Control Methods
- Asynchronous Serial Communication Protocol
- The RS-422 Serial Interface
- About the Serial Driver
- Macintosh Serial Architecture
- Serial Communication Errors
- Using the Serial Driver
- Opening the Serial Driver
- Specifying an Alternate Input Buffer
- Setting the Handshaking Options
- Setting the Baud Rate and Data Format
- Reading and Writing to the Serial Ports
- Synchronous I/O Requests
- Asynchronous I/O Requests
- Closing the Serial Driver
- Synchronous Clocking
- Serial Driver Reference
- Serial Driver Routines
- Low-Level Routines
- Serial Driver Version [status code 9]
- Set Baud Rate [control code 13]
- Set Handshaking Options [control code 14]
- Set Miscellaneous Options [control code 16]
- Assert DTR [control code 17]
- Negate DTR [control code 18]
- Simple Parity Error Replacement [control code 19]
- Extended Parity Error Replacement [control code 20]
- Set XOFF State [control code 21]
- Clear XOFF State [control code 22]
- Send XON Conditional [control code 23]
- Send XON Unconditional [control code 24]
- Send XOFF Conditional [control code 25]
- Send XOFF Unconditional [control code 26]
- Serial Hardware Reset [control code 27]
- Summary of the Serial Driver
- Pascal Summary
- Constants
- Data Types
- Routines
- C Summary
- Constants
- Data Types
- Functions
- Assembly-Language Summary
- Data Structures
- Device Manager Interface
- Result Codes