How to use the aioblescan.NBytes function in aioblescan

To help you get started, we’ve selected a few aioblescan examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github frawau / aioblescan / aioblescan / plugins / eddystone.py View on Github external
def tlm_encoder(self):
        encodedurl = []
        encodedurl.append(aios.NBytes("VBATT",2))
        if "battery" in self.type_payload:
            encodedurl[-1].val = self.type_payload["battery"]
        else:
            encodedurl[-1].val = -128
        encodedurl.append(aios.Float88("Temperature"))
        if "temperature" in self.type_payload:
            encodedurl[-1].val = self.type_payload["temperature"]
        else:
            encodedurl[-1].val = -128

        encodedurl.append(aios.ULongInt("Count"))
        if "count" in self.type_payload:
            encodedurl[-1].val = self.type_payload["count"]
        else:
            encodedurl[-1].val = 0
github frawau / aioblescan / aioblescan / plugins / eddystone.py View on Github external
def uid_encoder(self):
        encodedurl = []
        encodedurl.append(aios.IntByte("Tx Power",self.power))
        encodedurl.append(aios.NBytes("Namespace",10))
        encodedurl[-1].val = self.type_payload["namespace"]
        encodedurl.append(aios.NBytes("Instance",6))
        encodedurl[-1].val = self.type_payload["instance"]
        encodedurl.append(aios.NBytes("RFU",2))
        encodedurl[-1].val = b'\x00\x00'
        self.service_data_length.val = 23 #Update the payload length/ways the same for uid
        return encodedurl
github frawau / aioblescan / aioblescan / plugins / eddystone.py View on Github external
def uid_encoder(self):
        encodedurl = []
        encodedurl.append(aios.IntByte("Tx Power",self.power))
        encodedurl.append(aios.NBytes("Namespace",10))
        encodedurl[-1].val = self.type_payload["namespace"]
        encodedurl.append(aios.NBytes("Instance",6))
        encodedurl[-1].val = self.type_payload["instance"]
        encodedurl.append(aios.NBytes("RFU",2))
        encodedurl[-1].val = b'\x00\x00'
        self.service_data_length.val = 23 #Update the payload length/ways the same for uid
        return encodedurl
github frawau / aioblescan / aioblescan / plugins / eddystone.py View on Github external
def uid_encoder(self):
        encodedurl = []
        encodedurl.append(aios.IntByte("Tx Power",self.power))
        encodedurl.append(aios.NBytes("Namespace",10))
        encodedurl[-1].val = self.type_payload["namespace"]
        encodedurl.append(aios.NBytes("Instance",6))
        encodedurl[-1].val = self.type_payload["instance"]
        encodedurl.append(aios.NBytes("RFU",2))
        encodedurl[-1].val = b'\x00\x00'
        self.service_data_length.val = 23 #Update the payload length/ways the same for uid
        return encodedurl
github frawau / aioblescan / aioblescan / plugins / eddystone.py View on Github external
def eid_encoder(self):
        encodedurl = []
        encodedurl.append(aios.IntByte("Tx Power",self.power))
        encodedurl.append(aios.NBytes("Namespace",8))
        encodedurl[-1].val = self.type_payload
        self.service_data_length.val = 13
        return encodedurl