Skip to content

Commit

Permalink
drv/bluetooth_stm32_cc2640: enable connect whitelist when broadcasting
Browse files Browse the repository at this point in the history
This changes the GAP discoverable parameters to limit connecting to
devices in a whitelist. Normally, when broadcasting, the hub should
not be connectable, but due to some quirks of the Bluetooth chip,
ADV_NONCONN_IND doesn't work under all circumstances and we have to use
ADV_IND which makes the device connectable. If another device connects
while broadcasting, it currently causes things to lock up. However,
we can prevent devices from connecting in the first place by enabling
the whitelist (which is empty).
  • Loading branch information
dlech committed Nov 4, 2023
1 parent b301d97 commit c2bb78d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/pbio/drv/bluetooth/bluetooth_stm32_cc2640.c
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ static PT_THREAD(broadcast_task(struct pt *pt, pbio_task_t *task)) {
(conn_handle == NO_CONNECTION && remote_handle == NO_CONNECTION) ? ADV_IND : ADV_NONCONN_IND,
#endif
GAP_INITIATOR_ADDR_TYPE_PRIVATE_NON_RESOLVE, NULL,
GAP_CHANNEL_MAP_ALL, GAP_FILTER_POLICY_SCAN_ANY_CONNECT_ANY);
GAP_CHANNEL_MAP_ALL, GAP_FILTER_POLICY_SCAN_ANY_CONNECT_WHITELIST);
PT_WAIT_UNTIL(pt, hci_command_status);

if (read_buf[8] != bleSUCCESS) {
Expand Down

0 comments on commit c2bb78d

Please sign in to comment.