Esempio n. 1
0
    def parse_frame(self, time, payload):
        # Parse the data into bytes
        data = struct.unpack("<BBHBB", payload)

        # Put the bytes into the dictionary
        self.dict["current_time"] = str(time)
        self.dict["current_slot"] = str(data[0])
        self.dict["data_state"] = self._parse_data(data[1])
        self.dict["data_address"] = str(data[2])
        self.dict["data_rssi"] = uint2int(data[3])

        return self.dict
Esempio n. 2
0
 def parse_frame(self, time, payload):
     # Parse the data into bytes
     data = struct.unpack('<BBBBBBBBBBHHHHHHHHHH', payload)
     
     # Put the bytes into the dictionary
     self.dict['current_time'] = str(time)
     self.dict['arp1_state'] = self._parse_arp(data[0])
     self.dict['arp1_random'] = str(data[10])
     self.dict['arp1_rssi'] = uint2int(data[4])
     self.dict['arp2_state'] = self._parse_arp(data[1])
     self.dict['arp2_random'] = str(data[11])
     self.dict['arp2_rssi'] = uint2int(data[5])
     self.dict['arp3_state'] = self._parse_arp(data[2])
     self.dict['arp3_random'] = str(data[12])
     self.dict['arp3_rssi'] = uint2int(data[6])
     self.dict['data_state'] = self._parse_data(data[3])
     self.dict['data_address'] = str(data[13])
     self.dict['data_arp'] = str(data[7])
     self.dict['crq_global'] = str(data[15])
     self.dict['dtq_global'] = str(data[18])
     
     return self.dict