feat(split): Use directed advertising.

* Split centrals to scan with their identity so they receive direct
  advertising packets.
* Split peripherals to use direct advertising if they have an existing
  bond to a split central.
This commit is contained in:
Peter Johanson
2023-09-02 01:45:12 -07:00
committed by Pete Johanson
parent 3936298260
commit 718500543b
3 changed files with 45 additions and 4 deletions

View File

@@ -511,8 +511,10 @@ static void split_central_device_found(const bt_addr_le_t *addr, int8_t rssi, ui
LOG_DBG("[DEVICE]: %s, AD evt type %u, AD data len %u, RSSI %i", dev, type, ad->len, rssi);
/* We're only interested in connectable events */
if (type == BT_GAP_ADV_TYPE_ADV_IND || type == BT_GAP_ADV_TYPE_ADV_DIRECT_IND) {
if (type == BT_GAP_ADV_TYPE_ADV_IND) {
bt_data_parse(ad, split_central_eir_parse, (void *)addr);
} else if (type == BT_GAP_ADV_TYPE_ADV_DIRECT_IND) {
split_central_eir_found(addr);
}
}