VEX IQ Python API
|
Config Serial port to host. More...
Public Member Functions | |
def | __init__ (self) |
def | write (self, data, null_terminate_string=True) |
Write the data to the serial port. More... | |
def | bytes_to_read (self) |
Get the number of bytes available for reading. More... | |
def | read_bytes (self, length=None, stop_byte=None) |
Read the given number of bytes from the port. More... | |
def | read_bytes_list (self, length=None, stop_byte=None) |
Read the given number of bytes from the port. More... | |
def | read_byte (self) |
Read a single byte from the port. More... | |
def | read_string (self) |
Read a null-terminated string from the port. More... | |
def | log (self, item) |
Log an item to the host using the RM protocol. More... | |
Config Serial port to host.
def vexiq.Serial.__init__ | ( | self | ) |
def vexiq.Serial.write | ( | self, | |
data, | |||
null_terminate_string = True |
|||
) |
Write the data to the serial port.
data | bytes to send. Type can be:
|
null_terminate_string | send '\0' at the end if data type is string. Default True. |
def vexiq.Serial.bytes_to_read | ( | self | ) |
Get the number of bytes available for reading.
def vexiq.Serial.read_bytes | ( | self, | |
length = None , |
|||
stop_byte = None |
|||
) |
Read the given number of bytes from the port.
Blocks until data is available, returns string of bytes.
length | number of bytes to read, zero for all. |
stop_byte | byte that halts the stream, usually \0 for strings. |
def vexiq.Serial.read_bytes_list | ( | self, | |
length = None , |
|||
stop_byte = None |
|||
) |
Read the given number of bytes from the port.
Blocks until data is available, returns list of bytes.
length | number of bytes to read, zero for all. |
stop_byte | byte that halts the stream, usually \0 for strings. |
def vexiq.Serial.read_byte | ( | self | ) |
Read a single byte from the port.
Blocks until the byte arrives.
def vexiq.Serial.read_string | ( | self | ) |
Read a null-terminated string from the port.
Blocks until one is available.
def vexiq.Serial.log | ( | self, | |
item | |||
) |
Log an item to the host using the RM protocol.
item | item to log (string, tuple or list) |