Sample PDL device definition for an async driver

This sample driver shows the structure and components of an async driver:

Structure         | define device;
                  | type: async;
                  | path: device-path;
                  | baud: baud-rate
                  | parity: parity-mode
                  | data-bits: data-bits;
                  | stop-bits: stop-bits;
                  | xon-xoff: sw-flow-flag
                  | hw-flow-control: hw-flow-flag
                  | require-cd: cd-mode flag
                  | end device;

Options for async drivers

Option Description
path: device-path Identifies the path to the UNIX device file that represents the async line to drive. This is a required attribute.
baud: baud-rate Uses an integer constant from this list:
  • 50
  • 75
  • 110
  • 134
  • 150
  • 200
  • 300
  • 600
  • 1200
  • 2400
  • 4800
  • 9600
  • 19200
  • 38400

If omitted, then baud-rate defaults to 9600.

parity: parity-mode Specifies the available parity-modes: even, odd, and none. If the parity is not specified, then it defaults to none.
data-bits: data-bits Specifies the number of data bits.
  • If data-bits is specified, then it must be 5, 6, 7, or 8.
  • If a number is not specified, then it defaults to 8.
stop-bits: stop-bits Controls the number of stop bits in the async frame and is an integer constant (1 or 2). If an integer constant is not specified, then it defaults to 1.
xon-off: sw-flow-flag Determines whether to use software flow control (that is, xon/xoff).
  • If sw-flow-flag indicates a true value, then software flow control is enabled.
  • If not specified, then it defaults to disabled.
hw-flow-control: hw-flow-flag Controls whether to use hardware flow control (RTS and CTS signals).
  • If hw-flow-flag indicates a true value, then hardware flow control is used.
  • If not specified, then it defaults to disabled.
require-cd: cd-mode-flag Controls whether CD (Carrier Detect) is used and required.
  • If cd-mode-flag is a true value, then carrier detect is required. In this case, a loss of carrier at any time generates a line error. The invocation to hci_pd_open_device does not complete until it detects a carrier. This is appropriate when connected to a modem, but is also useful in other hardware circumstances.
  • If cd-mode-flag is a false value, then the carrier detect signal on the line is ignored. The open completes without it, and losing the signal does not indicate a lost connection.
  • If a flag is not specified, then it defaults to no.

Example

For example, a typical device declaration for driving tty0 would look similar to this sample:

define device;
type: async;
path: "/dev/tty0";
baud: 9600;
end device;

Many options can default to the commonplace values.