SerialOpen                                                                                              Function

 

SERIALOPEN(port as integer, baudRate as integer)

 

Description

Opens the serial port to prepare for subsequent use for input and/or output.  Port is the serial port number, which will normally be zero. See table below for other values BaudRate is the transmission speed to communicate at: all standard baud rates to 57600 have been tested. Palm states that rates up to 1mBit are theoretically possible. Returns an integer error code.  See Tech Note 16 for more information on Communications.

 

Port Values

 

0

Cradle Port (USB or RS-232)

32768

Cradle Port (USB or RS-232)

32769

IR – Raw IR (also called SIR), no protocol support

32770

Debug console port

32771

Cradle - RS-232

32772

Cradle - USB

1651794800

'btcp' Bluetooth Connection Manager

1769104237

'ircm' IR Comm Protocol.

1919312749

'rcfm' Bluetooth Virtual port

Physical and virtual port number are also allowed. For more information, see the Palm OS docs. To convert a virtual port name (such as 'rfcm' for the Bluetooth virtual plug in), use the String4ToInt function in NSBSystemlib.

 

Serial Result Codes

 

0

Operation successful

1

Operation failed

2

Internal state machine error

104

Not enough memory to open port

769

Bad Parameter

770

Bad Port

771

No Memory

772

Bad Connect ID

773

Time Out

774

Line Error

775

Already Open

776

Still Open

777

Not Open

778

Not Supported

779

No devices available

780

Configuration failed

1286

Time Out

4353

No dial tone

4354

No carrier/tmeout

4355

Busy signal

4356

Cancelled by user

4357

Command error

4358

No modem detected

4359

Not enough memory

4360

Modem prefs not set  up

4361

Dial command error: dial string too long or  bad characters

4362

No phone number and not :"direct connect"

 

Example

Err=SerialOpen(0,28800)