#NEWLINE# def __init__( self , name = '' , uid = 0 , port = None , speed = 9600 , bs = 1024 , server = None ) : #NEWLINE# #INDENT# '\n        Initialization method for instance.\n\n        Parameters:\n            name = user friendly name for driver\n            uid = unique identifier for driver\n            port = serial device port path string\n            speed = serial port speed in bps\n            canonical = canonical mode True or False\n            bs = buffer size for reads\n            server = serial port device server if any\n\n        Attributes:\n           name = user friendly name for driver\n           uid = unique identifier for driver\n           server = serial device server nonblocking\n           txes = deque of data bytes to send\n           rxbs = bytearray of data bytes received\n\n        ' #NEWLINE# self . name = name #NEWLINE# self . uid = uid #NEWLINE# if ( not server ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# import serial #NEWLINE# self . server = SerialNb ( port = port , speed = speed , bs = bs ) #NEWLINE# #UNINDENT# except ImportError as ex : #NEWLINE# #INDENT# console . terse ( 'Error: importing pyserial\n{0}\n' . format ( ex ) ) #NEWLINE# self . server = DeviceNb ( port = port , speed = speed , bs = bs ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . server = server #NEWLINE# #UNINDENT# self . txes = deque ( ) #NEWLINE# self . rxbs = bytearray ( )