...
Writes the specified characters to the stream. This method can support either a string or an roByteArray. If the block is a string, any null bytes will terminate the block.
Flush()
ifStreamReceive
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 to be posted to the message port when data is received. For some object types (for 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 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 chr()
global function or an roByteArray. If 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 | ||
---|---|---|
| ||
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.
ifSerialControl
SetBaudRate(baud_rate As Integer) As Boolean
...
Inverts the TX/RX signal levels on the serial port. This allows the player to communicate with devices that use -12V to 12V signaling. Inversion is supported on the DE9 DE-9 (more commonly referred to as DB-9) and USB ports only. Passing True to the method enables inversion, whereas passing False disables it.
...