Commit 93f50e78 authored by schneider's avatar schneider

fix(ble): Update advertising data even when it is empty

parent bace0f82
...@@ -206,6 +206,12 @@ static void appSetAdvScanDataFrag(uint8_t advHandle, uint8_t location) ...@@ -206,6 +206,12 @@ static void appSetAdvScanDataFrag(uint8_t advHandle, uint8_t location)
remainLen = appSlaveCb.maxAdvDataLen[advHandle]; remainLen = appSlaveCb.maxAdvDataLen[advHandle];
} }
if(remainLen == 0)
{
op = HCI_ADV_DATA_OP_COMP_FRAG;
DmAdvSetData(advHandle, op, APP_LOC_2_DM_LOC(location), 0, NULL);
}
/* while there remains data to be sent */ /* while there remains data to be sent */
while (remainLen > 0) while (remainLen > 0)
{ {
...@@ -257,13 +263,15 @@ static void appSetAdvScanData(uint8_t advHandle, uint8_t mode) ...@@ -257,13 +263,15 @@ static void appSetAdvScanData(uint8_t advHandle, uint8_t mode)
scanLoc = APP_MODE_2_SCAN_LOC(mode); scanLoc = APP_MODE_2_SCAN_LOC(mode);
/* set advertising data */ /* set advertising data */
if (appSlaveCb.advDataOffset[advHandle][advLoc] < appSlaveCb.advDataLen[advHandle][advLoc]) if (appSlaveCb.advDataOffset[advHandle][advLoc] < appSlaveCb.advDataLen[advHandle][advLoc] ||
appSlaveCb.advDataLen[advHandle][advLoc] == 0)
{ {
appSetAdvScanDataFrag(advHandle, advLoc); appSetAdvScanDataFrag(advHandle, advLoc);
} }
/* set scan data */ /* set scan data */
if (appSlaveCb.advDataOffset[advHandle][scanLoc] < appSlaveCb.advDataLen[advHandle][scanLoc]) if (appSlaveCb.advDataOffset[advHandle][scanLoc] < appSlaveCb.advDataLen[advHandle][scanLoc] ||
appSlaveCb.advDataLen[advHandle][scanLoc] == 0)
{ {
appSetAdvScanDataFrag(advHandle, scanLoc); appSetAdvScanDataFrag(advHandle, scanLoc);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment