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, myfreeweb
Priority: normal Keywords:

Created on 2020-06-26 19:00 by myfreeweb, last changed 2020-06-26 19:00 by myfreeweb.

Messages (1)
msg372439 - (view) Author: (myfreeweb) 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
2020-06-26 19:00:41myfreewebcreate