Exemple #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()
	def start(self):
		self.s = serial.Serial(self.port, 2400)
		self.s.setDTR(True)
		self.s.setRTS(False)
		self.s.nonblocking()
		BaseDevice.start(self)
	def __init__(self, port):
		BaseDevice.__init__(self)
		self.port = port
		self.buff = []
		self.start()
	def stop(self):
		BaseDevice.stop(self)
		self.s.close()
		self.buff = []
 def __init__(self):
     BaseDevice.__init__(self)
 def start(self):
     self.s = serial.Serial(self.port, 9600)
     self.s.nonblocking()
     BaseDevice.start(self)