mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2024-11-21 20:50:55 +01:00
Allow custom scan response data without custom advertising.
This lets applications use custom scan response data while using the advertisment data added by the NimBLEAdvertising add/set methods.
This commit is contained in:
parent
b290ca9077
commit
6e104dfb45
1 changed files with 2 additions and 2 deletions
|
@ -419,7 +419,7 @@ bool NimBLEAdvertising::start(uint32_t duration, void (*advCompleteCB)(NimBLEAdv
|
||||||
|
|
||||||
// check if there is room for the name, if not put it in scan data
|
// check if there is room for the name, if not put it in scan data
|
||||||
if((payloadLen + (2 + m_advData.name_len)) > BLE_HS_ADV_MAX_SZ) {
|
if((payloadLen + (2 + m_advData.name_len)) > BLE_HS_ADV_MAX_SZ) {
|
||||||
if(m_scanResp){
|
if(m_scanResp && !m_customScanResponseData){
|
||||||
m_scanData.name = m_advData.name;
|
m_scanData.name = m_advData.name;
|
||||||
m_scanData.name_len = m_advData.name_len;
|
m_scanData.name_len = m_advData.name_len;
|
||||||
if(m_scanData.name_len > BLE_HS_ADV_MAX_SZ - 2) {
|
if(m_scanData.name_len > BLE_HS_ADV_MAX_SZ - 2) {
|
||||||
|
@ -446,7 +446,7 @@ bool NimBLEAdvertising::start(uint32_t duration, void (*advCompleteCB)(NimBLEAdv
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_scanResp) {
|
if(m_scanResp && !m_customScanResponseData) {
|
||||||
rc = ble_gap_adv_rsp_set_fields(&m_scanData);
|
rc = ble_gap_adv_rsp_set_fields(&m_scanData);
|
||||||
switch(rc) {
|
switch(rc) {
|
||||||
case 0:
|
case 0:
|
||||||
|
|
Loading…
Reference in a new issue