Beispiel #1
0
 def getValueFromRawData(self, rawdata):
     """
      Converts raw data to value
     """
     if (rawdata == None): return None
     r = super(Tag70, self).getValueFromRawData(rawdata)
     res = {}
     for idx in range(16):
         varname = 'din' + str(idx)
         res[varname] = bits.bitValue(r, idx)
     return res
Beispiel #2
0
 def getValueFromRawData(self, rawdata):
     """
      Converts raw data to value
     """
     if (rawdata == None): return None
     r = super(Tag213, self).getValueFromRawData(rawdata)
     res = {}
     for idx in range(8):
         varname = 'ibutton_connected_' + str(idx + 1)
         res[varname] = bits.bitValue(r, idx)
     return res
Beispiel #3
0
 def getValueFromRawData(self, rawdata):
     """
      Converts raw data to value
     """
     if (rawdata == None): return None
     r = super(Tag64, self).getValueFromRawData(rawdata)
     return {
       'moving': bits.bitValue(r,  0),
       'critical_angle': bits.bitValue(r,  1),
       'gsm_no_sim_card': bits.bitValue(r,  3),
       'geofence_presence': bits.bitValue(r,  4),
       'int_battery_low_level': bits.bitValue(r,  5),
       'sat_antenna_connected': 1 - bits.bitValue(r,  6),
       'bad_bus_voltage': bits.bitValue(r,  7),
       'bad_ext_voltage': bits.bitValue(r,  8),
       'acc': bits.bitValue(r,  9),
       'critical_vibration':  bits.bitValue(r, 10),
       'sat_glonass_enabled': bits.bitValue(r, 11),
       'gsm_signal_quality': bits.bitValue(r, 12) \
                         + (2 * bits.bitValue(r, 13)),
       'armed': bits.bitValue(r, 14),
       'sos': bits.bitValue(r, 15)
     }