Home > Language Reference > Classes > StreamSerial

Open Method

Opens a communication port.

Syntax

Public Sub Open(ByVal ePort As HbPort, ByVal lBaudRate As Long)

ParameterDescription
ePortPort to open and protocol to use
lBaudRateInitial Baudrate

Remarks

The Open method opens a communication port. It should be called before using any other method or property of the StreamSerial object. The ePort parameter specifies the physical port to open, and possibly the protocol to use. It can take one of the following values:

ConstantValueDescription
hbPortSerial&H00008000Designates the HotSync® communication port. This can be the RS232 port or the USB port depending on the handheld device.
hbPortIrDA&H00008001Designates the IrDA port.
hbPortIrComm&H6972636DDesignates the IrDA port using the IrComm protocol.

You can also specify any other hardware specific value for this parameter. Most of the time, those values are built using a four character string ; the CreatorToLong function can be used to convert such a value to a Long value suitable for this method. For example:

Dim s As New StreamSerial
s.Open CreatorToLong("ABCD"), 57600

If the method does not raise an error, the port has been opened successfully. You should then close it by calling the Close method once it is no longer used. The initial configuration of the port is as follows:

System requirements

SystemMinimal versionRemarks
Palm OSPalm OS 3.3N/A