From ad39ce87061e080a09748ca5367a4a18e45c08b6 Mon Sep 17 00:00:00 2001 From: sacca <26978820+sacca97@users.noreply.github.com> Date: Wed, 30 Oct 2024 11:46:01 +0100 Subject: [PATCH] Add Enhanced_Connection_Complete HCI event --- scapy/layers/bluetooth.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/scapy/layers/bluetooth.py b/scapy/layers/bluetooth.py index c86906aa370..ecdab7c41aa 100644 --- a/scapy/layers/bluetooth.py +++ b/scapy/layers/bluetooth.py @@ -2156,6 +2156,23 @@ def answers(self, other): other[HCI_Cmd_LE_Create_Connection].paddr == self.paddr) +class HCI_LE_Meta_Enhanced_Connection_Complete(Packet): + name = "Enhanced Connection Complete" + fields_desc = [ + ByteEnumField("status", 0, {0: "success"}), + LEShortField("handle", 0), + ByteEnumField("role", 0, {0: "master"}), + ByteEnumField("patype", 0, {0: "public", 1: "random"}), + LEMACField("paddr", None), + LEMACField("lrpa", None), + LEMACField("prpa", None), + LEShortField("interval", 54), + LEShortField("latency", 0), + LEShortField("supervision", 42), + XByteField("clock_latency", 5), + ] + + class HCI_LE_Meta_Connection_Update_Complete(Packet): name = "Connection Update Complete" fields_desc = [ByteEnumField("status", 0, {0: "success"}), @@ -2324,6 +2341,7 @@ class HCI_LE_Meta_Long_Term_Key_Request(Packet): bind_layers(HCI_Event_LE_Meta, HCI_LE_Meta_Advertising_Reports, event=2) bind_layers(HCI_Event_LE_Meta, HCI_LE_Meta_Connection_Update_Complete, event=3) bind_layers(HCI_Event_LE_Meta, HCI_LE_Meta_Long_Term_Key_Request, event=5) +bind_layers(HCI_Event_LE_Meta, HCI_LE_Meta_Enhanced_Connection_Complete, event=0x0A) bind_layers(EIR_Hdr, EIR_Flags, type=0x01) bind_layers(EIR_Hdr, EIR_IncompleteList16BitServiceUUIDs, type=0x02)