% Scapy Bluetooth layer tests + Bluetooth LE Advertising / Scan Response Data Parsing = Parse EIR_Flags, EIR_CompleteList16BitServiceUUIDs, EIR_CompleteLocalName and EIR_TX_Power_Level ad_report_raw_data = \ "043e2b020100016522c00181781f0201020303d9fe1409" \ "506562626c652054696d65204c452037314536020a0cde".decode('hex') scapy_packet = HCI_Hdr(ad_report_raw_data) assert(scapy_packet[EIR_Flags].flags == 0x02) assert(scapy_packet[EIR_CompleteList16BitServiceUUIDs].svc_uuids == [0xfed9]) assert(scapy_packet[EIR_CompleteLocalName].local_name == 'Pebble Time LE 71E6') assert(scapy_packet[EIR_TX_Power_Level].level == 12) = Parse EIR_Manufacturer_Specific_Data scan_resp_raw_data = \ "043e2302010401be5e0eb9f04f1716ff5401005f423331" \ "3134374432343631fc00030c0000de".decode('hex') scapy_packet = HCI_Hdr(scan_resp_raw_data) assert(scapy_packet[EIR_Manufacturer_Specific_Data].data == '\x00_B31147D2461\xfc\x00\x03\x0c\x00\x00') assert(scapy_packet[EIR_Manufacturer_Specific_Data].company_id == 0x154)