Roku BrightSign Bedienungsanleitung Seite 25

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 26
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 24
25
roSerialPort
This object controls the RS232 serial port, allowing you to receive input and send responses.
roSerialPort has these interfaces:
1. ifStream
2. ifSerialControl
ifStream has these member functions:
rotVOID SendByte(rotINT32 byte)
rotVOID SendLine(rotSTRING line)
rotVOID SendBlock(rotSTRING block)
rotVOID SetEol(rotSTRING eol)
rotVOID SetLineEventPort(rotOBJECT port)
rotVOID SetByteEventPort(rotOBJECT port)
ifSerialControl has this member function:
rotBOOL SetBaudRate(roINT32 baud_rate)
Supported baud rates are:
1800, 2000, 2400, 3600, 4800, 7200, 9600,
12800, 14400, 19200, 23040, 28800, 38400, 57600,
115200
roSerialPort sends events of the following type:
1. roStreamLineEvent - The line event is generated whenever the end of line string set using
SetEol is found and contains a rotString for the whole line.
2. roStreamByteEvent - The byte event is generated on every byte received.
Example: This code waits for a serial event, and echos the input received on the serial port to the
shell
serial = CreateObject("roSerialPort", 0, 9600)
p = CreateObject("roMessagePort")
serial.SetLineEventPort(p)
serial_only:
msg = wait(0,p) ' Wait forever for a message.
if(type(msg) <> "roStreamLineEvent") goto serial_only 'Accept serial
messages only.
serial.SendLine(msg) ' Echo the message back to serial.
Seitenansicht 24
1 2 ... 20 21 22 23 24 25 26

Kommentare zu diesen Handbüchern

Keine Kommentare