bluetooth: add missing HCI events, EIR elements, and SMP packet types#4987
Merged
Conversation
New packet definitions covering frequently-seen Bluetooth Core 5.4 events and Generic Access Profile data types that scapy did not yet decode: HCI events - HCI_Event_Connection_Request (code=0x04) - HCI_Event_Remote_Host_Supported_Features_Notification (code=0x3d) - HCI_Event_Vendor (vendor-specific debug) (code=0xff) - HCI_LE_Meta_LE_Read_Remote_Features_Complete (LE Meta event=0x04) EIR/AD elements - EIR_RandomTargetAddress (type=0x18) - EIR_LERole (type=0x1c) - EIR_BroadcastName (type=0x30) - EIR_3DInformation (type=0x3d) SMP - SM_Keypress_Notification (sm_command=0x0e) Each packet has an entry in test/scapy/layers/bluetooth.uts with a sample drawn from a real HCI snoop log (BR/EDR Connection Request, Remote Host Supported Features Notification, LE Read Remote Features Complete, vendor-specific debug event, EIR 3D Information, EIR Broadcast Name) and synthetic round-trip build/parse tests for the remainder.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4987 +/- ##
=======================================
Coverage 80.28% 80.29%
=======================================
Files 383 383
Lines 94703 94739 +36
=======================================
+ Hits 76031 76067 +36
Misses 18672 18672
🚀 New features to boost your workflow:
|
gpotter2
reviewed
May 9, 2026
Co-authored-by: Gabriel <10530980+gpotter2@users.noreply.github.com>
antoniovazquezblanco
approved these changes
May 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've been using the following definitions on my fork for a long time, because I didn't know how to make unit tests. So @antoniovazquezblanco just upstreamed some of my stuff when he had time. Well I still don't know how to make unit tests, but Claude does if I just point it at pcaps/HCI logs. So this is now a PR of stuff I've confirmed was working long ago, but now it meets the ask for unit tests. Note: the packet definitions themselves aren't AI generated, I made them. But the unit tests are AI generated based on real pcaps/HCI logs I collected in field.
HCI events
EIR/AD elements
SMP
Each packet has an entry in test/scapy/layers/bluetooth.uts with a sample drawn from a real HCI snoop log (BR/EDR Connection Request, Remote Host Supported Features Notification, LE Read Remote Features Complete, vendor-specific debug event, EIR 3D Information, EIR Broadcast Name) and synthetic round-trip build/parse tests for the remainder (which are rare and weren't present in any of the pcap/HCI logs.)
Checklist :
tox)I understand that failing to mention the use of AI may result in a ban. (We do not forbid it, but you must play fair. Be warned !)
Adds missing Bluetooth definitions from the spec.