This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Improve/fix FreeBSD Bluetooth socket support
Type: enhancement Stage:
Components: FreeBSD Versions: Python 3.10, Python 3.9, Python 3.8, Python 3.7, Python 3.6, Python 3.5
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: koobs, valpackett
Priority: normal Keywords:

Created on 2020-06-26 19:00 by valpackett, last changed 2022-04-11 14:59 by admin.

Messages (1)
msg372439 - (view) Author: Val Packett (valpackett) Date: 2020-06-26 19:00
1) BTPROTO_HCI addresses only expect string identifiers on NetBSD and DragonFly: https://github.com/python/cpython/blob/2e0a920e9eb540654c0bb2298143b00637dc5961/Modules/socketmodule.c#L1931

But of course this is true on FreeBSD too. (DragonFly inherited the BT stack from FreeBSD!)
For example this is how hccontrol creates an address:
https://github.com/freebsd/freebsd/blob/6bb9221a9b865ee432269099f341e4230a6cbcd4/usr.sbin/bluetooth/hccontrol/hccontrol.c#L115-L129

So currently it is not possible to bind an HCI socket (without using FFI to directly use the libc bind function) :(

2) BTPROTO_SCO is excluded on FreeBSD: https://github.com/python/cpython/blob/2e0a920e9eb540654c0bb2298143b00637dc5961/Modules/socketmodule.c#L1953

But SCO has been supported since 2008: https://github.com/freebsd/freebsd/commit/bb4c6de0cf336d006e41521cbbd4706f60a0dfe0
History
Date User Action Args
2022-04-11 14:59:32adminsetgithub: 85302
2020-06-26 19:00:41valpackettcreate