diff --git a/scapy/layers/bluetooth.py b/scapy/layers/bluetooth.py index d9b258c116a54eaba0e40e1da419cefdad691cb2..c608181423f6502864c202dbe30fad714007b10c 100644 --- a/scapy/layers/bluetooth.py +++ b/scapy/layers/bluetooth.py @@ -479,6 +479,9 @@ class HCI_Cmd_LE_Create_Connection(Packet): LEShortField("min_ce", 0), LEShortField("max_ce", 0), ] +class HCI_Cmd_LE_Create_Connection_Cancel(Packet): + name = "LE Create Connection Cancel" + class HCI_Cmd_LE_Read_Buffer_Size(Packet): name = "LE Read Buffer Size" @@ -611,6 +614,7 @@ bind_layers( HCI_Command_Hdr, HCI_Cmd_LE_Set_Advertise_Enable, opcode=0x200a) bind_layers( HCI_Command_Hdr, HCI_Cmd_LE_Set_Scan_Parameters, opcode=0x200b) bind_layers( HCI_Command_Hdr, HCI_Cmd_LE_Set_Scan_Enable, opcode=0x200c) bind_layers( HCI_Command_Hdr, HCI_Cmd_LE_Create_Connection, opcode=0x200d) +bind_layers( HCI_Command_Hdr, HCI_Cmd_LE_Create_Connection_Cancel, opcode=0x200e) bind_layers( HCI_Command_Hdr, HCI_Cmd_LE_Long_Term_Key_Request_Reply, opcode=0x201a) bind_layers( HCI_Command_Hdr, HCI_Cmd_LE_Long_Term_Key_Request_Negative_Reply, opcode=0x201b) diff --git a/test/bluetooth.uts b/test/bluetooth.uts index 4613e4e0532095254836dfe4e1da3604a98b2264..0f3e8c02562e18a33042dd3d07ecb7fd85f2e468 100644 --- a/test/bluetooth.uts +++ b/test/bluetooth.uts @@ -1,5 +1,12 @@ % Scapy Bluetooth layer tests ++ HCI Commands += LE Create Connection Cancel + +expected_cmd_raw_data = "010e2000".decode('hex') +cmd_raw_data = str(HCI_Hdr() / HCI_Command_Hdr() / HCI_Cmd_LE_Create_Connection_Cancel()) +assert(expected_cmd_raw_data == cmd_raw_data) + + Bluetooth LE Advertising / Scan Response Data Parsing = Parse EIR_Flags, EIR_CompleteList16BitServiceUUIDs, EIR_CompleteLocalName and EIR_TX_Power_Level