-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
backends/corebluetooth/scanner: add use_bdaddr option
This adds an CoreBluetooth=specific option `use_bdaddr` to BleakScanner. When enabled, the BLEDevice objects will use the actual Bluetooth address instead of the UUID identifier provided by the CoreBluetooth APIs. This uses an undocumented IOBluetoothDevice method to convert the CBPeripheral object to an IOBluetoothDevice object so could stop working in future macOS releases.
- Loading branch information
Showing
4 changed files
with
63 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# no upstream bindings https://github.com/ronaldoussoren/pyobjc/issues/381 | ||
|
||
import objc | ||
|
||
io_bluetooth = objc.ObjCLazyModule( | ||
"IOBluetooth", | ||
frameworkIdentifier="com.apple.IOBluetooth", | ||
frameworkPath=objc.pathForFramework( | ||
"/System/Library/Frameworks/IOBluetooth.framework" | ||
), | ||
metadict=globals(), | ||
) | ||
|
||
locals().update( | ||
{ | ||
a: getattr(io_bluetooth, a) | ||
for a in dir(io_bluetooth) | ||
if a.startswith("IOBluetooth") | ||
} | ||
) | ||
|
||
del io_bluetooth | ||
del objc |
This file contains 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