Home > Language Reference > Classes
StreamSerial Class
+ Object
+ Stream
+ StreamSerial
Description
The StreamSerial class encapsulates all the necessary methods for communicating via the serial port of the device, which can either be infrared, RS232 or USB. This class is instantiable but not derivable or cloneable (see also Data Streams).
Once a StreamSerial object is instantiated, the communication port must be opened by calling the Open method. This method accepts by parameter a constant that specifies both the physical port and the protocol to use.
Note: on certain models of handheld device, the same UART is used for all the ports. Because of this, it is not possible to simultaneously initiate an infra-red communication and a serial communication - hence the HB++ debugger is disabled.
It is then possible to read and write in the stream as in any other stream by using the Read and Write methods. However, in the case of the IrDA port, the direction of the data flow has to be priorly specified with the Direction property: actually, this protocol is bidirectional, but does not allow a full-duplex communication. The Flush method allows to actually transmit or receive the data present on standby in the internal buffer.
The Ready method returns the number of bytes available in the reception buffer, and on certain ports, the number of bytes in the transmission buffer. Typically, this method is used together with a timer to carry out polling.
Finally, the port has to be closed by invoking the Close method as soon as it is not used any more.
Note: this StreamSerial class relies on the Palm OS New Serial Manager first released with Palm OS 3.3, therefore it won't work with earlier devices.
Members
| Members | Description |
| BitsPerChar | Number of data bits. |
| BufferSize | Sets the size of the receive queue. |
| Close | Closes the communication port. |
| Direction | Direction of communication. |
| DTR | State of the DTR signal. |
| FlowControl | Flow control options. |
| Flush | Flushes a buffer. |
| Open | Opens a communication port. |
| Parity | Parity scheme to be used. |
| PortID | Port identifier. |
| PowerOut | State of the power out pin of the universal connector. |
| Ready | Number of bytes ready for reading or writing in a buffer. |
| StopBits | Number of stop bits to be used. |
| Timeout | Delay before raising an error. |
| Inherited from Stream | Description |
| Position | Stream pointer position. |
| Read | Reads data from a stream. |
| Seek | Moves the stream pointer. |
| SeekToBegin | Moves the pointer to the beginning of the stream. |
| SeekToEnd | Moves the pointer to the end of the stream. |
| Size | Total size of the data in a stream. |
| Write | Writes data to a stream. |
| Inherited from Object | Description |
| ClassID | Returns the type identifier corresponding to the actual class of the object. |
| Implements | Determines whether the object implements the features of a given class. |
| Iterate | Event raised to iterate over the elements of a container object. |
| Recipient | Recipient of events sent by the object. |
| Serialize | Event raised to serialize the object content into a stream. |
System requirements
| System | Minimal version | Remarks |
| Palm OS | Palm OS 3.3 | N/A |