Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: updated as per DOCS-794
Panel
borderColor#3D3D3D
bgColor#F4F4F4
titleColor#3D3D3D
borderWidth0
titleBGColor#3D3D3D
borderStylesolid

ON THIS PAGE

Table of Contents
indent20px

...

SetLineEventPort(port As Object) As Void 

Sets the message port that roStreamLineEvent events will be posted to.

SetByteEventPort(port As Object) As Void

Sets the message port that roStreamByteEvent events will be posted to.

SetByteArrayEventPort(port As Object) As Void

This method works like SetByteEventPort but causes roStreamByteArrayEvent messages like SetByteEventPort but causes roStreamByteArrayEvent messages to be posted to the message port when data is received. For some object types (e.g. roTCPStreamfor example, roTCPStream), this can be much more efficient since data no longer needs to be delivered to BrightScript a byte at a time, but since serial ports are comparatively slow it's possible that each event will still contain only a single character

SetReceiveEol(eol_sequence As String)

Sets the EOL sequence to detect when receiving the stream. The default value is CR (ASCII value 13). sequence that will signify the end of line and cause a roStreamLineEvent to be delivered to the message port set by SetLineEventPort. If you need to set this value to a non-printing character,  use the use the chr() global function or an roByteArrayIf the sequence contains NUL bytes it must be passed as an roByteArray since strings may not contain NUL bytes.

To use a NUL byte as a line terminator:

Code Block
languagejs
eol = CreateObject("roByteArray")
eol.Push(0)
mp = CreateObject("roMessagePort")
client = CreateObject("roSerialPort", 0, 115200)
client.SetReceiveEol(eol)
client.SetLineEventPort(mp)
SetMatcher(matcher As Object) As Boolean

Instructs the stream to use the specified matcher. This method returns True if successful. Pass Invalid to this method to stop using the specified matcher.

...