Skip to content

feat: expose address type - #2010

Open
wiomoc wants to merge 1 commit into
hbldh:developfrom
wiomoc:feat/expose-address-type
Open

feat: expose address type#2010
wiomoc wants to merge 1 commit into
hbldh:developfrom
wiomoc:feat/expose-address-type

Conversation

@wiomoc

@wiomoc wiomoc commented Jul 3, 2026

Copy link
Copy Markdown

closes #1414

Motivation: on linux connecting to a ble peripheral via a l2cap socket requires you to specify the address type (l2_bdaddr_type).

Tested on Linux with bluez 5.82 and Windows 11
Untested on Android

@wiomoc
wiomoc force-pushed the feat/expose-address-type branch from a032ccb to 1883d89 Compare July 3, 2026 23:16
@wiomoc
wiomoc marked this pull request as ready for review July 3, 2026 23:23
@wiomoc
wiomoc force-pushed the feat/expose-address-type branch from 1883d89 to 77dfa2b Compare July 3, 2026 23:56
@codecov

codecov Bot commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 40.35088% with 34 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.71%. Comparing base (496d16e) to head (b5d13ff).

Files with missing lines Patch % Lines
bleak/backends/winrt/adapter.py 16.66% 10 Missing ⚠️
bleak/backends/p4android/scanner.py 0.00% 8 Missing ⚠️
bleak/backends/winrt/scanner.py 22.22% 7 Missing ⚠️
bleak/backends/winrt/client.py 28.57% 3 Missing and 2 partials ⚠️
bleak/backends/p4android/defs.py 0.00% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2010      +/-   ##
===========================================
- Coverage    53.00%   52.71%   -0.29%     
===========================================
  Files           43       43              
  Lines         4094     4137      +43     
  Branches       504      513       +9     
===========================================
+ Hits          2170     2181      +11     
- Misses        1792     1822      +30     
- Partials       132      134       +2     
Flag Coverage Δ
bluez-integration-py310 39.49% <28.07%> (-0.20%) ⬇️
bluez-integration-py311 39.42% <28.07%> (-0.20%) ⬇️
bluez-integration-py312 39.42% <28.07%> (-0.20%) ⬇️
bluez-integration-py313 39.42% <28.07%> (-0.20%) ⬇️
bluez-integration-py314 37.94% <26.78%> (-0.19%) ⬇️
macos-latest-py310 20.01% <19.29%> (-0.04%) ⬇️
macos-latest-py311 20.01% <19.29%> (-0.04%) ⬇️
macos-latest-py312 20.01% <19.29%> (-0.04%) ⬇️
macos-latest-py313 20.01% <19.29%> (-0.04%) ⬇️
macos-latest-py314 19.82% <17.85%> (-0.04%) ⬇️
ubuntu-latest-py310 23.68% <21.05%> (-0.08%) ⬇️
ubuntu-latest-py311 23.68% <21.05%> (-0.08%) ⬇️
ubuntu-latest-py312 23.68% <21.05%> (-0.08%) ⬇️
ubuntu-latest-py313 23.68% <21.05%> (-0.08%) ⬇️
ubuntu-latest-py314 21.80% <19.64%> (-0.06%) ⬇️
windows-latest-py310 18.70% <28.07%> (-0.03%) ⬇️
windows-latest-py311 18.70% <28.07%> (-0.03%) ⬇️
windows-latest-py312 18.70% <28.07%> (-0.03%) ⬇️
windows-latest-py313 18.70% <28.07%> (-0.03%) ⬇️
windows-latest-py314 18.43% <26.78%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@dlech

dlech commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

Thanks. A bit of feedback:

  • Would be nice to have some integration tests for this.
  • I would prefer the enum to have an UNKNOWN option rather than allowing None. This way we don't have to add extra explanation in the docs about what None means in this context.
  • It would be nice if we could make this a non-breaking change to the BLEDevice constructor as we have some 3rd-party backends now. So either move the new parameter to the end of the list and give it a default value or if we want to keep a more logical order to the args, add an overload and handle it based on the number of args.

@wiomoc
wiomoc force-pushed the feat/expose-address-type branch 2 times, most recently from ad9700a to 552cdfb Compare July 5, 2026 19:36
@wiomoc
wiomoc force-pushed the feat/expose-address-type branch from 552cdfb to b5d13ff Compare July 6, 2026 09:52
@wiomoc

wiomoc commented Jul 6, 2026

Copy link
Copy Markdown
Author

I've followed your feedback up to the integration tests, since I wasn't able to get them to run locally.

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.

2 participants