ChristianKuehnel / btlewrap

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

Add socket backend (for FreeBSD) #26

Open valpackett opened 4 years ago

valpackett commented 4 years ago

This backend uses system bluetooth sockets (raw HCI for advertisements, L2CAP for ATT) and is designed for FreeBSD. (note: LE L2CAP outgoing packets currently require a little fix in the kernel)

Might work on other systems depending on how the sockaddrs and the filter sockopt look. (directly using the HCI set filter message would be more portable than the sockopt..)

No unit tests yet, I've only manually tested with miflora.

coveralls commented 4 years ago

Pull Request Test Coverage Report for Build 129


Changes Missing Coverage Covered Lines Changed/Added Lines %
btlewrap/socket.py 40 125 32.0%
<!-- Total: 42 127 33.07% -->
Totals Coverage Status
Change from base Build 128: -23.5%
Covered Lines: 256
Relevant Lines: 347

💛 - Coveralls
ChristianKuehnel commented 4 years ago

@myfreeweb thx for the contribution 👍 I never looked into FreeBSD.

Happy to merge it, when we've sorted out a bunch of smaller things:

  1. Can you please fix the flake8 and pylint findings (see linked build results).
  2. Please also update the Readme on how to use it. E.g. pointing to the kernel patch.
  3. Does it make sense to add a bunch of unit tests?
  4. Optional: It would be interesting to know if this also works for Linux. Could you take a look?