}
#endif
-static int set_adv_data_flag(uint8_t *adv_data, uint8_t *data, int data_len)
+static int set_adv_data_flag(uint8_t *adv_data, uint8_t *data, int data_len, void *user_data)
{
+ struct btd_adapter *adapter = user_data;
+
adv_data[0] = 2;
adv_data[1] = EIR_FLAGS;
- adv_data[2] = EIR_GEN_DISC | EIR_CONTROLLER |
- EIR_SIM_HOST | EIR_BREDR_UNSUP;
+
+ if (adapter->le_static_addr.b[5] != 0)
+ adv_data[2] = EIR_GEN_DISC | EIR_CONTROLLER |
+ EIR_SIM_HOST | EIR_BREDR_UNSUP;
+ else
+ adv_data[2] = EIR_GEN_DISC | EIR_CONTROLLER | EIR_SIM_HOST;
memcpy(adv_data + 3, data, data_len);
return data_len + 3;
}
-int adapter_le_set_missed_adv_data(uint8_t *p_data, uint8_t data_len,
- gboolean is_scan_rsp, char *adapter_name, int8_t tx_power, uint8_t **adv_data, int *adv_len)
+static int adapter_le_set_missed_adv_data(uint8_t *p_data, uint8_t data_len,
+ gboolean is_scan_rsp, char *adapter_name, int8_t tx_power, uint8_t **adv_data, int *adv_len,
+ void *user_data)
{
uint8_t *data;
int len;
/* In case multi advertising, need to update the below AD type
since it handled into kernel */
if (!is_scan_rsp) {
- len = set_adv_data_flag(data, p_data, data_len);
+ len = set_adv_data_flag(data, p_data, data_len, user_data);
}
len = set_adv_data_tx_power(data, len, tx_power);
}
adapter_le_set_missed_adv_data(value, len, FALSE,
- adapter_name, adapter->adv_tx_power, &adv_data, &adv_len);
+ adapter_name, adapter->adv_tx_power, &adv_data, &adv_len, adapter);
if (adapter_le_is_supported_multi_advertising() && slot_id > 0) {
if (adapter_le_set_multi_adv_data(slot_id, FALSE, adv_len, adv_data)) {
}
adapter_le_set_missed_adv_data(value, len, TRUE,
- adapter_name, adapter->adv_tx_power, &adv_data, &adv_len);
+ adapter_name, adapter->adv_tx_power, &adv_data, &adv_len, adapter);
if (adapter_le_is_supported_multi_advertising() && slot_id > 0) {
if (adapter_le_set_multi_adv_data(slot_id, TRUE, adv_len, (uint8_t *)adv_data)) {