예제 #1
0
    def recv(self):
        essx_debug.log('recv')
        recv_data = self._recv()

        self.response_raw = recv_data
        res = {}
        (_sfd, _len, _ad1, _ad2, _cmd) = unpack("BBBBB", recv_data[0:5])
        if _cmd == 0x1a:  #ACK
            (_dvg, _drg, _chksum) = unpack("<HHH", recv_data[5:])
            _dvg = eza2500_util.q_denormalize(_dvg, 14, '380', '260', '390',
                                              'dvg')
            _drg = eza2500_util.q_denormalize(_drg, 13, '1', '0', '3.999',
                                              'drg')
            res["dvg"] = _dvg
            res["drg"] = _drg
            res["chksum"] = _chksum
            self.response = res
        elif _cmd == 0x9a:  #NAK
            (_ercd, _chksum) = unpack("<HH", recv_data[5:])
            res["ercd"] = _ercd
            res["chksum"] = _chksum
            self.response = res
            raise ESSXDeviceException("error: ERCD=%x" % _ercd)
        else:
            raise ESSXValueException("bad response")

        self.response = res
        essx_debug.log('recv')
        #essx_debug.dump(recv_data)
        return recv_data
예제 #2
0
    def recv(self):
        essx_debug.log('recv')
        recv_data = self._recv()

        self.response_raw = recv_data
        res = {}
        (_sfd, _len, _ad1, _ad2, _cmd) = unpack("BBBBB", recv_data[0:5])
        if _cmd == 0x16:  #ACK
            (_ccr, _ddr, _chksum) = unpack("<HHH", recv_data[5:])
            _ccr = eza2500_util.q_denormalize(_ccr, 14, '48', '0', '12', 'ccr')
            _ddr = eza2500_util.q_denormalize(_ddr, 14, '48', '0', '12', 'ddr')
            res["ccr"] = _ccr
            res["ddr"] = _ddr
            res["chksum"] = _chksum
            self.response = res
        elif _cmd == 0x96:  #NAK
            (_ercd, _chksum) = unpack("<HH", recv_data[5:])
            res["ercd"] = _ercd
            res["chksum"] = _chksum
            self.response = res
            raise ESSXDeviceException("error: ERCD=%x" % _ercd)
        else:
            raise ESSXValueException("bad response")

        self.response = res
        essx_debug.log('recv')
        #essx_debug.dump(recv_data)
        return recv_data
예제 #3
0
  def recv(self):
    essx_debug.log('recv')
    recv_data = self._recv()

    self.response_raw = recv_data
    res = {}
    (_sfd, _len, _ad1, _ad2, _cmd) = unpack("BBBBB", recv_data[0:5])
    if _cmd == 0x17: #ACK
      (_pdz ,_mdz ,_chksum) = unpack("<HHH", recv_data[5:])
      _pdz = eza2500_util.q_denormalize(_pdz, 14, '380', '0', '57', 'pdz')
      _mdz = eza2500_util.q_denormalize(_mdz, 14, '380', '0', '57', 'mdz')
      res["pdz"] = _pdz
      res["mdz"] = _mdz
      res["chksum"] = _chksum
      self.response = res
    elif _cmd == 0x97: #NAK
      (_ercd ,_chksum) = unpack("<HH", recv_data[5:])
      res["ercd"] = _ercd
      res["chksum"] = _chksum
      self.response = res
      raise ESSXDeviceException("error: ERCD=%x" % _ercd)
    else:
      raise ESSXValueException("bad response")

    self.response = res
    essx_debug.log('recv')
    #essx_debug.dump(recv_data)
    return recv_data
예제 #4
0
  def recv(self):
    essx_debug.log('recv')
    recv_data = self._recv()

    self.response_raw = recv_data
    res = {}
    (_sfd, _len, _ad1, _ad2, _cmd) = unpack("BBBBB", recv_data[0:5])
    if _cmd == 0x1d: #ACK
      (_bcf ,_cvb ,_dlb ,_cdb ,_ddb ,_chksum) = unpack("<HHHHHH", recv_data[5:])
      _cvb = eza2500_util.q_denormalize(_cvb, 14, '48', '32', '62', 'cvb')
      _dlb = eza2500_util.q_denormalize(_dlb, 14, '48', '32', '64', 'dlb')
      _cdb = eza2500_util.q_denormalize(_cdb, 14, '48', '0', '12', 'cdb')
      _ddb = eza2500_util.q_denormalize(_ddb, 14, '48', '0', '12', 'ddb')
      res["bcf"] = _bcf
      res["cvb"] = _cvb
      res["dlb"] = _dlb
      res["cdb"] = _cdb
      res["ddb"] = _ddb
      res["chksum"] = _chksum
      self.response = res
    elif _cmd == 0x9d: #NAK
      (_ercd ,_chksum) = unpack("<HH", recv_data[5:])
      res["ercd"] = _ercd
      res["chksum"] = _chksum
      self.response = res
      raise ESSXDeviceException("error: ERCD=%x" % _ercd)
    else:
      raise ESSXValueException("bad response")

    self.response = res
    essx_debug.log('recv')
    #essx_debug.dump(recv_data)
    return recv_data
예제 #5
0
    def recv(self):
        essx_debug.log('recv')
        recv_data = self._recv()

        self.response_raw = recv_data
        res = {}
        (_sfd, _len, _ad1, _ad2, _cmd) = unpack("BBBBB", recv_data[0:5])
        if _cmd == 0x09:  #ACK
            (_vg, _ig, _vb, _ib, _wg, _wb, _ic, _tmp,
             _chksum) = unpack("<hhhhhhhhH", recv_data[5:])
            _vg = eza2500_util.q_denormalize(_vg, 14, '380', 'None', 'None',
                                             'vg')
            _ig = eza2500_util.q_denormalize(_ig, 13, '7.8125', 'None', 'None',
                                             'ig')
            _vb = eza2500_util.q_denormalize(_vb, 14, '48', 'None', 'None',
                                             'vb')
            _ib = eza2500_util.q_denormalize(_ib, 13, '52.08', 'None', 'None',
                                             'ib')
            _wg = eza2500_util.q_denormalize(_wg, 11, '2500', 'None', 'None',
                                             'wg')
            _wb = eza2500_util.q_denormalize(_wb, 11, '2500', 'None', 'None',
                                             'wb')
            _tmp = eza2500_util.q_denormalize(_tmp, 7, '1', 'None', 'None',
                                              'tmp')
            res["vg"] = _vg
            res["ig"] = _ig
            res["vb"] = _vb
            res["ib"] = _ib
            res["wg"] = _wg
            res["wb"] = _wb
            res["ic"] = _ic
            res["tmp"] = _tmp
            res["chksum"] = _chksum
            self.response = res
        elif _cmd == 0x89:  #NAK
            (_ercd, _chksum) = unpack("<HH", recv_data[5:])
            res["ercd"] = _ercd
            res["chksum"] = _chksum
            self.response = res
            raise ESSXDeviceException("error: ERCD=%x" % _ercd)
        else:
            raise ESSXValueException("bad response")

        self.response = res
        essx_debug.log('recv')
        #essx_debug.dump(recv_data)
        return recv_data
예제 #6
0
    def recv(self):
        essx_debug.log('recv')
        recv_data = self._recv()

        self.response_raw = recv_data
        res = {}
        (_sfd, _len, _ad1, _ad2, _cmd) = unpack("BBBBB", recv_data[0:5])
        if _cmd == 0x1c:  #ACK
            (_cib, _dig, _ubv, _ugv, _obv, _ogv,
             _chksum) = unpack("<HHHHHHH", recv_data[5:])
            _cib = eza2500_util.q_denormalize(_cib, 13, '52.08', '0', '56.77',
                                              'cib')
            _dig = eza2500_util.q_denormalize(_dig, 13, '7.8125', '0',
                                              '8.5162', 'dig')
            _ubv = eza2500_util.q_denormalize(_ubv, 14, '48', '32', '68',
                                              'ubv')
            _ugv = eza2500_util.q_denormalize(_ugv, 14, '380', '260', '425',
                                              'ugv')
            _obv = eza2500_util.q_denormalize(_obv, 14, '48', '32', '68',
                                              'obv')
            _ogv = eza2500_util.q_denormalize(_ogv, 14, '380', '260', '425',
                                              'ogv')
            res["cib"] = _cib
            res["dig"] = _dig
            res["ubv"] = _ubv
            res["ugv"] = _ugv
            res["obv"] = _obv
            res["ogv"] = _ogv
            res["chksum"] = _chksum
            self.response = res
        elif _cmd == 0x9c:  #NAK
            (_ercd, _chksum) = unpack("<HH", recv_data[5:])
            res["ercd"] = _ercd
            res["chksum"] = _chksum
            self.response = res
            raise ESSXDeviceException("error: ERCD=%x" % _ercd)
        else:
            raise ESSXValueException("bad response")

        self.response = res
        essx_debug.log('recv')
        #essx_debug.dump(recv_data)
        return recv_data
예제 #7
0
  def recv(self):
    essx_debug.log('recv')
    recv_data = self._recv()

    self.response_raw = recv_data
    res = {}
    (_sfd, _len, _ad1, _ad2, _cmd) = unpack("BBBBB", recv_data[0:5])
    if _cmd == 0x0a: #ACK
      (_ts ,_tp ,_v5s ,_fan1 ,_fan2 ,_fan3 ,_fan4 ,_fan5 ,_chksum) = unpack("<hhhhhhhhH", recv_data[5:])
      _v5s = eza2500_util.q_denormalize(_v5s, 10, '1', 'None', 'None', 'v5s')
      _fan1 = eza2500_util.q_denormalize(_fan1, 0, '1', 'None', 'None', 'fan1')
      _fan2 = eza2500_util.q_denormalize(_fan2, 0, '1', 'None', 'None', 'fan2')
      _fan3 = eza2500_util.q_denormalize(_fan3, 0, '1', 'None', 'None', 'fan3')
      _fan4 = eza2500_util.q_denormalize(_fan4, 0, '1', 'None', 'None', 'fan4')
      _fan5 = eza2500_util.q_denormalize(_fan5, 0, '1', 'None', 'None', 'fan5')
      res["ts"] = _ts
      res["tp"] = _tp
      res["v5s"] = _v5s
      res["fan1"] = _fan1
      res["fan2"] = _fan2
      res["fan3"] = _fan3
      res["fan4"] = _fan4
      res["fan5"] = _fan5
      res["chksum"] = _chksum
      self.response = res
    elif _cmd == 0x8a: #NAK
      (_ercd ,_chksum) = unpack("<HH", recv_data[5:])
      res["ercd"] = _ercd
      res["chksum"] = _chksum
      self.response = res
      raise ESSXDeviceException("error: ERCD=%x" % _ercd)
    else:
      raise ESSXValueException("bad response")

    self.response = res
    essx_debug.log('recv')
    #essx_debug.dump(recv_data)
    return recv_data