Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e9e559f5 authored by Andre Eisenbach's avatar Andre Eisenbach
Browse files

LE: Remove general/limited discoverability bits for non-connectable adv

According to the Bluetooth spec, section 9.1.1.2, "A device in the
broadcast mode shall not set the ‘LE General Discoverable Mode’
flag or the ‘LE Limited Discoverable Mode’ flag in the Flags AD Type.

This patch masks out the specific bits for non-connectable
advertisements.

Bug: 16924631
Change-Id: Ia2c0011fb31de3e4166a8bd2c2732e50aad3a610
parent 19125877
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -30,8 +30,8 @@
#define STD_ADV_INSTID 0

/* Default ADV flags for general and limited discoverability */
#define ADV_FLAGS_LIMITED 0x01
#define ADV_FLAGS_GENERAL 0x02
#define ADV_FLAGS_LIMITED BTA_DM_LIMITED_DISC
#define ADV_FLAGS_GENERAL BTA_DM_GENERAL_DISC

typedef struct
{
+5 −0
Original line number Diff line number Diff line
@@ -273,6 +273,11 @@ BOOLEAN btif_gattc_copy_datacb(int cbindex, btif_adv_data_t *p_adv_data, BOOLEAN
         p_multi_adv_data_cb->inst_cb[cbindex].data.flag = ADV_FLAGS_GENERAL;
         if (p_multi_adv_data_cb->inst_cb[cbindex].timeout_s)
             p_multi_adv_data_cb->inst_cb[cbindex].data.flag = ADV_FLAGS_LIMITED;
         if (p_multi_adv_data_cb->inst_cb[cbindex].param.adv_type == BTA_BLE_NON_CONNECT_EVT)
             p_multi_adv_data_cb->inst_cb[cbindex].data.flag &=
                    ~(BTA_DM_LIMITED_DISC | BTA_DM_GENERAL_DISC);
         if (p_multi_adv_data_cb->inst_cb[cbindex].data.flag == 0)
            p_multi_adv_data_cb->inst_cb[cbindex].mask = 0;
    }

    if (p_adv_data->include_name)