Exemplo n.º 1
0
    def __init__(self, com_port, baudrate):
        '''
        Constructor
        '''
        BloodAnalyserBase.__init__(self, "mythic")

        self._type = "haem"

        if com_port=="TEST":
            self._ser = self._testmode()
        else:
            self._ser = serial.Serial(port=com_port, baudrate=baudrate, 
                                  bytesize=serial.EIGHTBITS, timeout=0.1)
        self._state = "WAIT_REQ"
        
        self._inbuf = ""
Exemplo n.º 2
0
 def __init__(self, com_port, baudrate, bid):
     '''
     Constructor
     '''
     BloodAnalyserBase.__init__(self, bid)
     
     if com_port=="TEST":
         self._ser = self._testmode()
     else:
         self._ser = serial.Serial(port=com_port, baudrate=baudrate, 
                               bytesize=serial.SEVENBITS, parity=serial.PARITY_EVEN,
                               stopbits=serial.STOPBITS_TWO,
                               timeout=0.1)
     self._state = "WAIT_BLOCK_START"
     self._data = ''
     self._result = None