How to use the aioblescan.aioblescan.UShortInt 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 / aioblescan.py View on Github external
def __init__(self, name="Manufacturer Specific Data"):
        self.name = name
        self.payload = [UShortInt("Manufacturer ID", endian="little"), Itself("Payload")]
github frawau / aioblescan / aioblescan / aioblescan.py View on Github external
def __init__(self,scan_type=0x1,interval=10, window=750, oaddr_type=0,filter=0):

        super(self.__class__, self).__init__(b"\x08",b"\x0b")
        self.payload.append(EnumByte("scan type",scan_type,
                                     {0: "Passive",
                                      1: "Active"}))
        self.payload.append(UShortInt("Interval",int(round(min(10240,max(2.5,interval))/0.625)),endian="little"))
        self.payload.append(UShortInt("Window",int(round(min(10240,max(2.5,min(interval,window)))/0.625)),endian="little"))
        self.payload.append(EnumByte("own addresss type",oaddr_type,
                                     {0: "Public",
                                      1: "Random",
                                      2: "Private IRK or Public",
                                      3: "Private IRK or Random"}))
        self.payload.append(EnumByte("filter policy",filter,
                                     {0: "None",
                                      1: "Sender In White List",
                                      2: "Almost None",
                                      3: "SIWL and some"}))
github frawau / aioblescan / aioblescan / aioblescan.py View on Github external
def __init__(self,interval_min=500, interval_max=750,
                       adv_type=0x3, oaddr_type=0, paddr_type=0,
                       peer_addr="00:00:00:00:00:00", cmap=0x7, filter=0):

        super(self.__class__, self).__init__(b"\x08",b"\x06")
        self.payload.append(UShortInt("Adv minimum",int(round(min(10240,max(20,interval_min))/0.625)),endian="little"))
        self.payload.append(UShortInt("Adv maximum",int(round(min(10240,max(20,max(interval_min,interval_max)))/0.625)),endian="little"))
        self.payload.append(EnumByte("adv type",adv_type,
                                        {0: "ADV_IND",
                                         1: "ADV_DIRECT_IND high",
                                         2: "ADV_SCAN_IND",
                                         3: "ADV_NONCONN_IND",
                                         4: "ADV_DIRECT_IND low"}))
        self.payload.append(EnumByte("own addresss type",paddr_type,
                                     {0: "Public",
                                      1: "Random",
                                      2: "Private IRK or Public",
                                      3: "Private IRK or Random"}))
        self.payload.append(EnumByte("peer addresss type",oaddr_type,
                                     {0: "Public",
                                      1: "Random"}))
        self.payload.append(MACAddr("peer",mac=peer_addr))
github frawau / aioblescan / aioblescan / aioblescan.py View on Github external
def __init__(self,scan_type=0x1,interval=10, window=750, oaddr_type=0,filter=0):

        super(self.__class__, self).__init__(b"\x08",b"\x0b")
        self.payload.append(EnumByte("scan type",scan_type,
                                     {0: "Passive",
                                      1: "Active"}))
        self.payload.append(UShortInt("Interval",int(round(min(10240,max(2.5,interval))/0.625)),endian="little"))
        self.payload.append(UShortInt("Window",int(round(min(10240,max(2.5,min(interval,window)))/0.625)),endian="little"))
        self.payload.append(EnumByte("own addresss type",oaddr_type,
                                     {0: "Public",
                                      1: "Random",
                                      2: "Private IRK or Public",
                                      3: "Private IRK or Random"}))
        self.payload.append(EnumByte("filter policy",filter,
                                     {0: "None",
                                      1: "Sender In White List",
                                      2: "Almost None",
                                      3: "SIWL and some"}))
github frawau / aioblescan / aioblescan / aioblescan.py View on Github external
def __init__(self,interval_min=500, interval_max=750,
                       adv_type=0x3, oaddr_type=0, paddr_type=0,
                       peer_addr="00:00:00:00:00:00", cmap=0x7, filter=0):

        super(self.__class__, self).__init__(b"\x08",b"\x06")
        self.payload.append(UShortInt("Adv minimum",int(round(min(10240,max(20,interval_min))/0.625)),endian="little"))
        self.payload.append(UShortInt("Adv maximum",int(round(min(10240,max(20,max(interval_min,interval_max)))/0.625)),endian="little"))
        self.payload.append(EnumByte("adv type",adv_type,
                                        {0: "ADV_IND",
                                         1: "ADV_DIRECT_IND high",
                                         2: "ADV_SCAN_IND",
                                         3: "ADV_NONCONN_IND",
                                         4: "ADV_DIRECT_IND low"}))
        self.payload.append(EnumByte("own addresss type",paddr_type,
                                     {0: "Public",
                                      1: "Random",
                                      2: "Private IRK or Public",
                                      3: "Private IRK or Random"}))
        self.payload.append(EnumByte("peer addresss type",oaddr_type,
                                     {0: "Public",
                                      1: "Random"}))
        self.payload.append(MACAddr("peer",mac=peer_addr))
        self.payload.append(BitFieldByte("Channels",cmap,["Channel 37","Channel 38","Channel 39","RFU","RFU","RFU","RFU", "RFU"]))