Package pymata_aio :: Module pymata_serial :: Class PymataSerial
[hide private]
[frames] | no frames]

Class PymataSerial

source code

This class encapsulates management of the serial port that communicates with the Arduino Firmata It provides a 'futures' interface to make Pyserial compatible with asyncio

Instance Methods [hide private]
 
__init__(self, com_port='/dev/ttyACM0', speed=57600, sleep_tune=.001)
This is the constructor for the aio serial handler :param com_port: Com port designator :param speed: baud rate :return: None
source code
 
get_serial(self)
This method returns a reference to the serial port in case the user wants to call pyserial methods directly :return: pyserial instance
source code
 
write(self, data)
This is an asyncio adapted version of pyserial write.
source code
 
readline(self)
This is an asyncio adapted version of pyserial read.
source code
 
read(self)
This is an asyncio adapted version of pyserial read that provides non-blocking read.
source code
 
close(self)
This is an asyncio adapted version of pyserial read.
source code
Method Details [hide private]

write(self, data)

source code 

This is an asyncio adapted version of pyserial write. It provides a non-blocking write and returns the number of bytes written upon completion :param data: Data to be written :return: Number of bytes written

Decorators:
  • @asyncio.coroutine

readline(self)

source code 

This is an asyncio adapted version of pyserial read. It provides a non-blocking read and returns a line of data read. :return: A line of data

Decorators:
  • @asyncio.coroutine

read(self)

source code 

This is an asyncio adapted version of pyserial read that provides non-blocking read. :return: One character

Decorators:
  • @asyncio.coroutine

close(self)

source code 

This is an asyncio adapted version of pyserial read. It provides a non-blocking read and returns a line of data read. :return: A line of data

Decorators:
  • @asyncio.coroutine