ChristianKuehnel / btlewrap

Bluetooth LowEnergy wrapper for different python backends.
MIT License
35 stars 19 forks source link

Add address_type argument for backends #5

Closed javl closed 6 years ago

javl commented 6 years ago

Thanks for this wrapper. I wanted to use it with a completely different device, one that needs the 'random' address type instead of 'public'.

I've added an aditional argument to the bluetooth interface to allow this. The default is still 'public' so BluetoothInterface(backend, adapter) is equal to BluetoothInterface(backend, adapter, address_type='public') meaning scripts implementing btewrap in the 'old' way should still work the same, but it also allows you run run BluetoothInterface(backend, adapter, address_type='random') to use the random address type.

I've implemented this in all three backends but was only able to test it for bluepy and gatttool as pygatt doesn't seem to work on my system. I think it should work, maybe you can take a look and confirm this?

javl commented 6 years ago

Sorry for the sloppy commits, I'll close this pull request and create a new one with a simple commit

coveralls commented 6 years ago

Pull Request Test Coverage Report for Build 29


Totals Coverage Status
Change from base Build 28: 0.0%
Covered Lines:
Relevant Lines: 0

💛 - Coveralls