Ejemplo n.º 1
0
    def __init__(self, *args, **kwargs):
        self.parser = None

        parser = kwargs.pop('parser', 'shell')

        self.dev = BaseDevice(*args, **kwargs)
        if parser == 'shell':
            self.parser = ShellParser(self.dev)
        elif parser == 'json':
            # pylint: disable=R0204
            self.parser = JSONParser(self.dev)
        else:
            raise NotImplementedError()
Ejemplo n.º 2
0
	def start(self):
		self.s = serial.Serial(self.port, 2400)
		self.s.setDTR(True)
		self.s.setRTS(False)
		self.s.nonblocking()
		BaseDevice.start(self)
Ejemplo n.º 3
0
	def __init__(self, port):
		BaseDevice.__init__(self)
		self.port = port
		self.buff = []
		self.start()
Ejemplo n.º 4
0
	def stop(self):
		BaseDevice.stop(self)
		self.s.close()
		self.buff = []
Ejemplo n.º 5
0
 def __init__(self):
     BaseDevice.__init__(self)
Ejemplo n.º 6
0
 def start(self):
     self.s = serial.Serial(self.port, 9600)
     self.s.nonblocking()
     BaseDevice.start(self)