Carapace

Serial Port Communications

The Serial module gives you access to a device attached to a serial port on your computer -- this device could be a modem or a branch controller, for example. For modem communications, a Tapi object is more frequently used.

The Serial module sits at the bottom of a communications stack -- other protocol modules may be stacked on top of it.

Serial Creation

To make serial communications available, load the library caraserial.dll as follows:

    (loadLibrary "caraserial")

The create function can be used to create a Serial module eg.

    (create Serial)
Once created, this module is tailored using its properties and methods.

Serial Properties

A Serial module supports the following properties:

property name property type description
serialPort String the serial port to be used: this must start with COM and be immediately followed by an integer
speed Integer this is the speed at which the communication device operates
stopBits String the number of stop bits to be used: legal values are "1", "1.5" or "2"
dataBits Integer the number of data bits to be used -- typically 7 or 8
parity String the parity scheme to be used: legal values are none, odd, even, mark, space,
log Log a log for the communications
statusReporter Object this object is required to have a method called status which takes a single string argument -- the Serial module will then invoke this method whenever the communication state changes

Serial Methods

The Serial module supports the following standard comms module methods:

method name description
connect connect this module
receive receive data
receiveInto receive data into the supplied buffer
send send data
disconnect disconnect this module

The following methods for receiving connections are not yet implemented for the Serial module...but will be soon!

method name description
bind bind address information for this module
listen prepare to listen for new connections
accept wait for a new connection to arrive and, if it does, accept it


Contents Index Current topic: communications Related topics: communications classes, objects