Skip to content

More Bluetooth 5.0+ packets#4905

Open
sacca97 wants to merge 14 commits intosecdev:masterfrom
sacca97:master
Open

More Bluetooth 5.0+ packets#4905
sacca97 wants to merge 14 commits intosecdev:masterfrom
sacca97:master

Conversation

@sacca97
Copy link

@sacca97 sacca97 commented Feb 3, 2026

Introduces various stuff from Bluetooth 5.0+ plus some standardized field naming across packets for clarity and interoperability. Additionally covers an edge case in the HCI command handling.

What was added:

  • HCI_LE_Meta_Enhanced_Connection_Complete
  • HCI_Cmd_LE_Set_Extended_Advertising_Parameters
  • HCI_Cmd_LE_Set_Extended_Advertising_Data
  • HCI_Cmd_LE_Set_Advertising_Set_Random_Address
  • HCI_Cmd_LE_Set_Extended_Scan_Parameters
  • HCI_Cmd_LE_Set_Extended_Scan_Enable
  • HCI_Cmd_LE_Extended_Create_Connection
  • HCI_Cmd_LE_Set_Event_Mask (update 8-byte bitmask)

What was modified:

  • atype / oatype / datype --> own_addr_type, peer_addr_type, or addr_type.
  • address / paddr / daddr --> addr or peer_addr
  • HCI receive now checks r.code in (0x0e, 0x0f) to cope with commands such as "Create Connection" which is async and returns a "Pending" status.

I also added and executed the tests in bluetooth.uts

@polydroi
Copy link

polydroi commented Feb 4, 2026

Thanks for your pr. could you please revert all changes introduced from your code formatter.

@sacca97
Copy link
Author

sacca97 commented Feb 4, 2026

@polydroi sorry for that, should be good now

@sacca97
Copy link
Author

sacca97 commented Feb 10, 2026

Added relevant tests to bluetooth.uts

I did not add tests for, e.g., HCI_Cmd_LE_Set_Extended_Scan_Parameters, as the original version did not have them either.

@sacca97 sacca97 marked this pull request as ready for review February 10, 2026 13:00
1: "random",
0xff: "anonymous"}),
LEMACField("address", None)]
LEMACField("addr", None)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add deprecated fields

@polybassa
Copy link
Contributor

Please fix flake8. Then we can merge this PR.

Thanks a lot!

@codecov
Copy link

codecov bot commented Mar 19, 2026

Codecov Report

❌ Patch coverage is 84.37500% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.27%. Comparing base (f303033) to head (a5fa581).
⚠️ Report is 39 commits behind head on master.

Files with missing lines Patch % Lines
scapy/layers/bluetooth.py 84.37% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4905      +/-   ##
==========================================
- Coverage   80.84%   80.27%   -0.57%     
==========================================
  Files         369      376       +7     
  Lines       90968    92555    +1587     
==========================================
+ Hits        73544    74301     +757     
- Misses      17424    18254     +830     
Files with missing lines Coverage Δ
scapy/layers/bluetooth.py 90.30% <84.37%> (-0.23%) ⬇️

... and 44 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants