Created attachment 213720 [details] Adds commands to hccontrol to support advertising Add LE_Set_Advertising_Parameters, LE_Read_Advertising_Physical_Channel_Tx_Power, LE_Set_Advertising_Data, LE_Set_Advertising_Enable commands. This makes it possible to make a FreeBSD host 'scannable' through hccontrol. hccontrol -n ubt0hci le_set_advertising_enable disable hccontrol -n ubt0hci le_set_advertising_param hccontrol -n ubt0hci le_read_advertising_channel_tx_power hccontrol -n ubt0hci le_set_advertising_data hccontrol -n ubt0hci le_set_scan_response -n FBSD_Host hccontrol -n ubt0hci le_set_advertising_enable enable Also add LE command to manpage.
We have a bluetooth pairing script in base: usr.sbin/bluetooth/bluetooth-config/bluetooth-config.sh Should this be updated too? --HPS
(In reply to Hans Petter Selasky from comment #1) No.
(In reply to Marc Veldman from comment #2) Apologies. That was a bit too terse. I should not have updated the title and tried to write a reply at the same time. These commands only make the host a scannable LE device.
A commit references this bug: Author: hselasky Date: Fri Apr 24 08:08:00 UTC 2020 New revision: 360243 URL: https://svnweb.freebsd.org/changeset/base/360243 Log: Add support for LE advertising to hccontrol(8). Submitted by: Marc Veldman <marc@bumblingdork.com> PR: 245848 MFC after: 1 week Sponsored by: Mellanox Technologies Changes: head/usr.sbin/bluetooth/hccontrol/hccontrol.8 head/usr.sbin/bluetooth/hccontrol/le.c
Thank you! Some minor modifications made prior to commit.
Hi, These two commands don't yet work: Read_LE_Host_Support Write_LE_Host_Support I think they are spelled: write_le_host_supported_command and read_le_host_supported_command Please fix! --HPS
The command names I added in the manpage are actually correct. See Bluetooth Core specification V5.2 Vol.4 Part E 7.3.78 and .79 However, I did overlook the actual command in hccontrol itself, which is wrong. I put a fix in. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245868 Additionally, and what I suspect is the original reason for 'read_le_host_supported_command' is in sys/netgraph/bluetooth/include/ng_hci.h line 1314-1327: #define NG_HCI_OCF_READ_LE_HOST_SUPPORTED 0x6c typedef struct { u_int8_t status; /* 0x00 - success */ u_int8_t le_supported_host ;/* LE host supported?*/ u_int8_t simultaneous_le_host; /* BR/LE simulateneous? */ } __attribute__ ((packed)) ng_hci_read_le_host_supported_rp; #define NG_HCI_OCF_WRITE_LE_HOST_SUPPORTED 0x6d typedef struct { u_int8_t le_supported_host; /* LE host supported?*/ u_int8_t simultaneous_le_host; /* LE host supported?*/ } __attribute__ ((packed)) ng_hci_write_le_host_supported_cp; typedef ng_hci_status_rp ng_hci_write_le_host_supported_rp; I think those should be renamed. Shall I make a patch for that as well?
I think we can keep the defines as-is. --HPS
A commit references this bug: Author: hselasky Date: Sat Apr 25 00:57:49 UTC 2020 New revision: 360288 URL: https://svnweb.freebsd.org/changeset/base/360288 Log: Put advertising data in correct place. Submitted by: Marc Veldman <marc@bumblingdork.com> PR: 245848 MFC after: 1 week Sponsored by: Mellanox Technologies Changes: head/usr.sbin/bluetooth/hccontrol/le.c
A commit references this bug: Author: hselasky Date: Mon May 18 09:13:04 UTC 2020 New revision: 361182 URL: https://svnweb.freebsd.org/changeset/base/361182 Log: MFC r360243: Add support for LE advertising to hccontrol(8). Submitted by: Marc Veldman <marc@bumblingdork.com> PR: 245848 Sponsored by: Mellanox Technologies Changes: _U stable/12/ stable/12/usr.sbin/bluetooth/hccontrol/hccontrol.8 stable/12/usr.sbin/bluetooth/hccontrol/le.c
A commit references this bug: Author: hselasky Date: Mon May 18 09:13:35 UTC 2020 New revision: 361183 URL: https://svnweb.freebsd.org/changeset/base/361183 Log: MFC r360243: Add support for LE advertising to hccontrol(8). Submitted by: Marc Veldman <marc@bumblingdork.com> PR: 245848 Sponsored by: Mellanox Technologies Changes: _U stable/11/ stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.8 stable/11/usr.sbin/bluetooth/hccontrol/le.c
A commit references this bug: Author: hselasky Date: Mon May 18 09:15:45 UTC 2020 New revision: 361186 URL: https://svnweb.freebsd.org/changeset/base/361186 Log: MFC r360288: Put advertising data in correct place. Submitted by: Marc Veldman <marc@bumblingdork.com> PR: 245848 Sponsored by: Mellanox Technologies Changes: _U stable/12/ stable/12/usr.sbin/bluetooth/hccontrol/le.c
A commit references this bug: Author: hselasky Date: Mon May 18 09:16:18 UTC 2020 New revision: 361187 URL: https://svnweb.freebsd.org/changeset/base/361187 Log: MFC r360288: Put advertising data in correct place. Submitted by: Marc Veldman <marc@bumblingdork.com> PR: 245848 Sponsored by: Mellanox Technologies Changes: _U stable/11/ stable/11/usr.sbin/bluetooth/hccontrol/le.c