Home > Language Reference > Classes > StreamSerial
Open Method
Opens a communication port.
Syntax
Public Sub Open(ByVal ePort As HbPort, ByVal lBaudRate As Long)
| Parameter | Description |
| ePort | Port to open and protocol to use |
| lBaudRate | Initial 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:
| Constant | Value | Description |
| hbPortSerial | &H00008000 | Designates the HotSync® communication port. This can be the RS232 port or the USB port depending on the handheld device. |
| hbPortIrDA | &H00008001 | Designates the IrDA port. |
| hbPortIrComm | &H6972636D | Designates 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"), 57600If 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
| System | Minimal version | Remarks |
| Palm OS | Palm OS 3.3 | N/A |