diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2023-02-22 14:06:05 -0800 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2023-03-10 13:41:06 -0800 |
commit | f95ffcc8b1fe67c4b0443747c08f8e9d853025cf (patch) | |
tree | 7fdad674daf27808531a6585cdec3f7d6cf97d16 /src | |
parent | 3815ad119dcdc03df2a027f0eda4979d8d601846 (diff) | |
download | bluez-f95ffcc8b1fe67c4b0443747c08f8e9d853025cf.tar.gz |
core: Check if device has RSI
This checks if device is advertising an RSI and if so disregards if it
is not discoverable since other members can be.
Diffstat (limited to 'src')
-rw-r--r-- | src/adapter.c | 4 | ||||
-rw-r--r-- | src/eir.c | 3 | ||||
-rw-r--r-- | src/eir.h | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/src/adapter.c b/src/adapter.c index ae0eb364b..7947160a6 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -7122,7 +7122,7 @@ void btd_adapter_update_found_device(struct btd_adapter *adapter, dev = btd_adapter_find_device(adapter, bdaddr, bdaddr_type); if (!dev) { - if (!discoverable && !monitoring) { + if (!discoverable && !monitoring && !eir_data.rsi) { eir_data_free(&eir_data); return; } @@ -7169,7 +7169,7 @@ void btd_adapter_update_found_device(struct btd_adapter *adapter, /* If there is no matched Adv monitors, don't continue if not * discoverable or if active discovery filter don't match. */ - if (!monitoring && (!discoverable || + if (!eir_data.rsi && !monitoring && (!discoverable || (adapter->filtered_discovery && !is_filter_match( adapter->discovery_list, &eir_data, rssi)))) { eir_data_free(&eir_data); @@ -236,6 +236,9 @@ static void eir_parse_data(struct eir_data *eir, uint8_t type, memcpy(ad->data, data, len); eir->data_list = g_slist_append(eir->data_list, ad); + + if (type == EIR_CSIP_RSI) + eir->rsi = true; } void eir_parse(struct eir_data *eir, const uint8_t *eir_data, uint8_t eir_len) @@ -37,6 +37,7 @@ #define EIR_SVC_DATA32 0x20 /* LE: Service data, 32-bit UUID */ #define EIR_SVC_DATA128 0x21 /* LE: Service data, 128-bit UUID */ #define EIR_TRANSPORT_DISCOVERY 0x26 /* Transport Discovery Service */ +#define EIR_CSIP_RSI 0x2e /* Resolvable Set Identifier */ #define EIR_MANUFACTURER_DATA 0xFF /* Manufacturer Specific Data */ /* Flags Descriptions */ @@ -76,6 +77,7 @@ struct eir_data { uint32_t class; uint16_t appearance; bool name_complete; + bool rsi; int8_t tx_power; uint8_t *hash; uint8_t *randomizer; |