Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
myinfo = None
if code.val == 0x01:
#Flag
myinfo=BitFieldByte("flags",0,["Undef","Undef","Simul LE - BR/EDR (Host)","Simul LE - BR/EDR (Control.)","BR/EDR Not Supported",
"LE General Disc.","LE Limited Disc."])
elif code.val == 0x02:
myinfo=NBytes_List("Incomplete uuids",2)
elif code.val == 0x03:
myinfo=NBytes_List("Complete uuids",2)
elif code.val == 0x04:
myinfo=NBytes_List("Incomplete uuids",4)
elif code.val == 0x05:
myinfo=NBytes_List("Complete uuids",4)
elif code.val == 0x06:
myinfo=NBytes_List("Incomplete uuids",16)
elif code.val == 0x07:
myinfo=NBytes_List("Complete uuids",16)
elif code.val == 0x08:
myinfo=String("Short Name")
elif code.val == 0x09:
myinfo=String("Complete Name")
elif code.val == 0x14:
myinfo=NBytes_List("Service Solicitation uuid",2)
elif code.val == 0x15:
myinfo=NBytes_List("Service Solicitation uuid",16)
elif code.val == 0x16:
myinfo=Adv_Data("Advertised Data",2)
elif code.val == 0x1f:
myinfo=NBytes_List("Service Solicitation uuid",4)
elif code.val == 0x20:
myinfo=Adv_Data("Advertised Data",4)
elif code.val == 0x03:
myinfo=NBytes_List("Complete uuids",2)
elif code.val == 0x04:
myinfo=NBytes_List("Incomplete uuids",4)
elif code.val == 0x05:
myinfo=NBytes_List("Complete uuids",4)
elif code.val == 0x06:
myinfo=NBytes_List("Incomplete uuids",16)
elif code.val == 0x07:
myinfo=NBytes_List("Complete uuids",16)
elif code.val == 0x08:
myinfo=String("Short Name")
elif code.val == 0x09:
myinfo=String("Complete Name")
elif code.val == 0x14:
myinfo=NBytes_List("Service Solicitation uuid",2)
elif code.val == 0x15:
myinfo=NBytes_List("Service Solicitation uuid",16)
elif code.val == 0x16:
myinfo=Adv_Data("Advertised Data",2)
elif code.val == 0x1f:
myinfo=NBytes_List("Service Solicitation uuid",4)
elif code.val == 0x20:
myinfo=Adv_Data("Advertised Data",4)
elif code.val == 0x21:
myinfo=Adv_Data("Advertised Data",16)
elif code.val == 0xff:
myinfo=ManufacturerSpecificData()
else:
myinfo=Itself("Payload for %s"%code.strval)
xx=myinfo.decode(data[:length.val-len(code)])
if code.val == 0x01:
#Flag
myinfo=BitFieldByte("flags",0,["Undef","Undef","Simul LE - BR/EDR (Host)","Simul LE - BR/EDR (Control.)","BR/EDR Not Supported",
"LE General Disc.","LE Limited Disc."])
elif code.val == 0x02:
myinfo=NBytes_List("Incomplete uuids",2)
elif code.val == 0x03:
myinfo=NBytes_List("Complete uuids",2)
elif code.val == 0x04:
myinfo=NBytes_List("Incomplete uuids",4)
elif code.val == 0x05:
myinfo=NBytes_List("Complete uuids",4)
elif code.val == 0x06:
myinfo=NBytes_List("Incomplete uuids",16)
elif code.val == 0x07:
myinfo=NBytes_List("Complete uuids",16)
elif code.val == 0x08:
myinfo=String("Short Name")
elif code.val == 0x09:
myinfo=String("Complete Name")
elif code.val == 0x14:
myinfo=NBytes_List("Service Solicitation uuid",2)
elif code.val == 0x15:
myinfo=NBytes_List("Service Solicitation uuid",16)
elif code.val == 0x16:
myinfo=Adv_Data("Advertised Data",2)
elif code.val == 0x1f:
myinfo=NBytes_List("Service Solicitation uuid",4)
elif code.val == 0x20:
myinfo=Adv_Data("Advertised Data",4)
elif code.val == 0x21:
myinfo=Adv_Data("Advertised Data",16)
while datalength > 0:
length=UIntByte("sublen")
data=length.decode(data)
code=EIR_Hdr()
data=code.decode(data)
myinfo = None
if code.val == 0x01:
#Flag
myinfo=BitFieldByte("flags",0,["Undef","Undef","Simul LE - BR/EDR (Host)","Simul LE - BR/EDR (Control.)","BR/EDR Not Supported",
"LE General Disc.","LE Limited Disc."])
elif code.val == 0x02:
myinfo=NBytes_List("Incomplete uuids",2)
elif code.val == 0x03:
myinfo=NBytes_List("Complete uuids",2)
elif code.val == 0x04:
myinfo=NBytes_List("Incomplete uuids",4)
elif code.val == 0x05:
myinfo=NBytes_List("Complete uuids",4)
elif code.val == 0x06:
myinfo=NBytes_List("Incomplete uuids",16)
elif code.val == 0x07:
myinfo=NBytes_List("Complete uuids",16)
elif code.val == 0x08:
myinfo=String("Short Name")
elif code.val == 0x09:
myinfo=String("Complete Name")
elif code.val == 0x14:
myinfo=NBytes_List("Service Solicitation uuid",2)
elif code.val == 0x15:
myinfo=NBytes_List("Service Solicitation uuid",16)
data=length.decode(data)
code=EIR_Hdr()
data=code.decode(data)
myinfo = None
if code.val == 0x01:
#Flag
myinfo=BitFieldByte("flags",0,["Undef","Undef","Simul LE - BR/EDR (Host)","Simul LE - BR/EDR (Control.)","BR/EDR Not Supported",
"LE General Disc.","LE Limited Disc."])
elif code.val == 0x02:
myinfo=NBytes_List("Incomplete uuids",2)
elif code.val == 0x03:
myinfo=NBytes_List("Complete uuids",2)
elif code.val == 0x04:
myinfo=NBytes_List("Incomplete uuids",4)
elif code.val == 0x05:
myinfo=NBytes_List("Complete uuids",4)
elif code.val == 0x06:
myinfo=NBytes_List("Incomplete uuids",16)
elif code.val == 0x07:
myinfo=NBytes_List("Complete uuids",16)
elif code.val == 0x08:
myinfo=String("Short Name")
elif code.val == 0x09:
myinfo=String("Complete Name")
elif code.val == 0x14:
myinfo=NBytes_List("Service Solicitation uuid",2)
elif code.val == 0x15:
myinfo=NBytes_List("Service Solicitation uuid",16)
elif code.val == 0x16:
myinfo=Adv_Data("Advertised Data",2)
data=code.decode(data)
myinfo = None
if code.val == 0x01:
#Flag
myinfo=BitFieldByte("flags",0,["Undef","Undef","Simul LE - BR/EDR (Host)","Simul LE - BR/EDR (Control.)","BR/EDR Not Supported",
"LE General Disc.","LE Limited Disc."])
elif code.val == 0x02:
myinfo=NBytes_List("Incomplete uuids",2)
elif code.val == 0x03:
myinfo=NBytes_List("Complete uuids",2)
elif code.val == 0x04:
myinfo=NBytes_List("Incomplete uuids",4)
elif code.val == 0x05:
myinfo=NBytes_List("Complete uuids",4)
elif code.val == 0x06:
myinfo=NBytes_List("Incomplete uuids",16)
elif code.val == 0x07:
myinfo=NBytes_List("Complete uuids",16)
elif code.val == 0x08:
myinfo=String("Short Name")
elif code.val == 0x09:
myinfo=String("Complete Name")
elif code.val == 0x14:
myinfo=NBytes_List("Service Solicitation uuid",2)
elif code.val == 0x15:
myinfo=NBytes_List("Service Solicitation uuid",16)
elif code.val == 0x16:
myinfo=Adv_Data("Advertised Data",2)
elif code.val == 0x1f:
myinfo=NBytes_List("Service Solicitation uuid",4)
datalength = self.payload[-1].val
while datalength > 0:
length=UIntByte("sublen")
data=length.decode(data)
code=EIR_Hdr()
data=code.decode(data)
myinfo = None
if code.val == 0x01:
#Flag
myinfo=BitFieldByte("flags",0,["Undef","Undef","Simul LE - BR/EDR (Host)","Simul LE - BR/EDR (Control.)","BR/EDR Not Supported",
"LE General Disc.","LE Limited Disc."])
elif code.val == 0x02:
myinfo=NBytes_List("Incomplete uuids",2)
elif code.val == 0x03:
myinfo=NBytes_List("Complete uuids",2)
elif code.val == 0x04:
myinfo=NBytes_List("Incomplete uuids",4)
elif code.val == 0x05:
myinfo=NBytes_List("Complete uuids",4)
elif code.val == 0x06:
myinfo=NBytes_List("Incomplete uuids",16)
elif code.val == 0x07:
myinfo=NBytes_List("Complete uuids",16)
elif code.val == 0x08:
myinfo=String("Short Name")
elif code.val == 0x09:
myinfo=String("Complete Name")
elif code.val == 0x14:
myinfo=NBytes_List("Service Solicitation uuid",2)
elif code.val == 0x06:
myinfo=NBytes_List("Incomplete uuids",16)
elif code.val == 0x07:
myinfo=NBytes_List("Complete uuids",16)
elif code.val == 0x08:
myinfo=String("Short Name")
elif code.val == 0x09:
myinfo=String("Complete Name")
elif code.val == 0x14:
myinfo=NBytes_List("Service Solicitation uuid",2)
elif code.val == 0x15:
myinfo=NBytes_List("Service Solicitation uuid",16)
elif code.val == 0x16:
myinfo=Adv_Data("Advertised Data",2)
elif code.val == 0x1f:
myinfo=NBytes_List("Service Solicitation uuid",4)
elif code.val == 0x20:
myinfo=Adv_Data("Advertised Data",4)
elif code.val == 0x21:
myinfo=Adv_Data("Advertised Data",16)
elif code.val == 0xff:
myinfo=ManufacturerSpecificData()
else:
myinfo=Itself("Payload for %s"%code.strval)
xx=myinfo.decode(data[:length.val-len(code)])
self.payload.append(myinfo)
datalength -= length.val + len(code)
data=data[length.val-len(code):]
if data:
elif code.val == 0x04:
myinfo=NBytes_List("Incomplete uuids",4)
elif code.val == 0x05:
myinfo=NBytes_List("Complete uuids",4)
elif code.val == 0x06:
myinfo=NBytes_List("Incomplete uuids",16)
elif code.val == 0x07:
myinfo=NBytes_List("Complete uuids",16)
elif code.val == 0x08:
myinfo=String("Short Name")
elif code.val == 0x09:
myinfo=String("Complete Name")
elif code.val == 0x14:
myinfo=NBytes_List("Service Solicitation uuid",2)
elif code.val == 0x15:
myinfo=NBytes_List("Service Solicitation uuid",16)
elif code.val == 0x16:
myinfo=Adv_Data("Advertised Data",2)
elif code.val == 0x1f:
myinfo=NBytes_List("Service Solicitation uuid",4)
elif code.val == 0x20:
myinfo=Adv_Data("Advertised Data",4)
elif code.val == 0x21:
myinfo=Adv_Data("Advertised Data",16)
elif code.val == 0xff:
myinfo=ManufacturerSpecificData()
else:
myinfo=Itself("Payload for %s"%code.strval)
xx=myinfo.decode(data[:length.val-len(code)])
self.payload.append(myinfo)