Home > Language Reference > Classes > StreamSerial

Direction Property

Direction of communication.

Syntax

Public Property Get Direction() As HbStream
Public Property Let Direction(ByVal
eDirection As HbStream)

ParameterDescription
eDirectionDirection of communication.

Remarks

This property is only useable on open ports using the IrDA protocol and indicates the direction of the data stream. You can change the communication direction on an open port at any time.

The following example illustrates this by sending a byte to a external device via the IrDA port, then waits for a byte in response.

Private Sub Button1_Click()
  Dim s as new StreamSerial
  Dim b as Byte

  s.Open hbPortIrDA, 32900

  On Error Goto ERR

  s.Direction = hbStreamWrite
  s.Write CByte(10) ' send a byte

  s.Direction = hbStreamRead
  s.Read b ' wait for a byte
 
ERR:
  s.Close
End Sub

If you try to write on a port configured for reception, or read on a port configured for transmission, runtime error occurs.

System requirements

SystemMinimal versionRemarks
Palm OSPalm OS 3.3N/A