Rosequencematcher – BrightSign Object Reference Manual (FW 5.1) User Manual
Page 296
288
roSequenceMatcher
This object is used to send
events when the specified byte sequence patterns are matched.
Once a pattern has been matched and the event has been posted, all contributing bytes are discarded. As a result, if one
pattern is a prefix of another pattern, then the second, longer pattern will never be matched by the object.
Interfaces: ifStreamReceiveObserver, ifSequenceMatcher
The ifSequenceMatcher interface provides the following:
•
SetMessagePort(a As Object): Specifies the message port where roSequenceMatchEvent objects will be
posted.
•
Add(pattern As Object, user_data As Object) As Boolean: Adds a pattern to be matched by the
roSequenceMatcher object instance. The pattern should be specified as an object that is convertible to a byte
sequence (e.g. roByteArray, roString). For the user data, pass the object that should be returned if the specified
pattern is matched.
Example
Function FromHex(hex as String) as Object
bytes = CreateObject("roByteArray")
bytes.FromHexString(hex)
return bytes
End Function
Sub Main()
serial = CreateObject("roSerialPort", 1, 115200)
mp = CreateObject("roMessagePort")