microbit-dal: BUGFIX maintain cccd state when service changed fails
Previously, we would rely on service changed to complete successfully to signify a successful cccd state restore. However, android doesn’t register for service_changed notifications, and as a result sd_ble_gatts_service_changed always returns an error. This meant that cccds would be erased when the complete flag was not one, which would have been all the time.
This commit is contained in:
parent
5505fc6687
commit
e115e5af8d
1 changed files with 3 additions and 6 deletions
|
@ -105,13 +105,10 @@ static void bleSysAttrMissingCallback(const GattSysAttrMissingCallbackParams *pa
|
|||
{
|
||||
ret = sd_ble_gatts_sys_attr_set(params->connHandle, b->sysAttrs[deviceID].sys_attr, sizeof(b->sysAttrs[deviceID].sys_attr), BLE_GATTS_SYS_ATTR_FLAG_SYS_SRVCS);
|
||||
|
||||
if(ret == 0)
|
||||
{
|
||||
ret = sd_ble_gatts_service_changed(params->connHandle, 0x000c, 0xffff);
|
||||
complete = 1;
|
||||
|
||||
if (ret == 0)
|
||||
complete = 1;
|
||||
}
|
||||
if(ret == 0)
|
||||
ret = sd_ble_gatts_service_changed(params->connHandle, 0x000c, 0xffff);
|
||||
}
|
||||
|
||||
delete b;
|
||||
|
|
Loading…
Reference in a new issue