Serial Port
Previous Topic  Next Topic 

Product

Serial Port

Manufacturer

Standard Satellite Forms component

Website

http://www.satelliteforms.net/

Source code provided

Yes (for Palm OS only)

Platform

PalmOS, PocketPC

Sample project(s)

Terminal

Keywords

serial, data, async, send, receive, port, rs232


SerialPort is an extension which may be used to access the handheld’s Serial Port.


Scripts API      

All of the methods are global.


Usage:  [Name of method]

Example of usage:  SerialPortAbout()


SerialPortAbout()

Show the extension's about box. 

Sample usage:  SerialPortAbout()


SerialPortAllocate()

Creates an instance of a serial port. 

Sample usage:  SerialPort = SerialPortAllocate()


SerialPortClose(integer)

Closes serial port. 

Sample usage:  SerialPort = SerialPortClose(SerialPort)



SerialPortConfigure(integer, integer, integer, string, integer, string)

Configures serial port. 

Sample usage:  SerialPort = SerialPortConfigure(SerialPort, Baud, DataBits, Parity, StopBits, FlowControl) 

where

DataBits: 5,6,7, or 8

Parity: Odd, Even, or None

StopBits: 1 or 2

FlowControl: Hardware, XON/XOFF, or None


SerialPortFree(integer)

Deletes an instance of a serial port (returns 0). 

Sample usage:  SerialPort = SerialPortFree(SerialPort)


SerialPortGetBytesAvailable(integer)

Returns the number of bytes available, -1 on error. 

Sample usage:  BytesAvailable = SerialPortGetBytesAvailable(SerialPort)


SerialPortGetLastError(integer)

Returns a string containing the last error message. 

Sample usage:  LastError = SerialPortGetLastError(SerialPort)


SerialPortOpenBinary(integer, integer, integer)

Opens serial port in binary mode. 

Sample usage:  SerialPort = SerialPortOpenBinary(SerialPort, PortNumber, Baud)  SerialPort: created by calling SerialPortAllocate()where 

PortNumber: 0 (or 1 for development only). 

Baud: 300-115200


SerialPortOpenText(integer, integer, integer, string, string)

Opens serial port in text mode. 

Sample usage:  SerialPort = SerialPortOpenText(SerialPort, PortNumber, Baud, ReadNewline, WriteNewline) 

where

SerialPort: created by calling SerialPortAllocate()

PortNumber: 0 (or 1 for development only)

Baud: 300-115200

ReadNewline: CR or LF or CRLF

WriteNewline: CR or LF or CRLF


SerialPortRead(integer, integer, integer)

Reads data from serial port. 

Sample usage:  SerialPort = SerialPortRead(SerialPort, Memory, Size)


SerialPortReadByte(integer)

Reads a byte of data from serial port. 

Sample usage:  Byte = SerialPortReadByte(SerialPort)


SerialPortReadString(integer, integer)

Reads a string of data from serial port. 

Sample usage:  String = SerialPortReadString(SerialPort, Size)


SerialPortSetBuffer(integer, integer, integer)

Sets the data buffer. The default data buffer is 512 bytes. The buffer should allow for 32 bytes of overhead. 

Sample usage:  SerialPort = SerialPortSetBuffer(SerialPort, Memory, Size)


SerialPortWrite(integer, integer, integer)

Writes data to serial port. 

Sample usage:  SerialPort = SerialPortWrite(SerialPort, Memory, Size)


SerialPortWriteByte(integer, integer)

Writes a byte of data to serial port. 

Sample usage:  SerialPort = SerialPortWriteByte(SerialPort, Byte)


SerialPortWriteString(integer, string)

Writes a string of data to serial port. 

Sample usage:  SerialPort = SerialPortWriteString(SerialPort, String)


DocID: 10148  DocDate: 2008-05-26