gatt test: Fix NCS v1.6.1 crash in portGattSubscribeAttrWrite
In newer versions of Zephyr the BLE notification callback will be called
with data pointer set to NULL on disconnect.
@@ -628,10 +628,14 @@ static uPortGattIter_t gattNotifyFunc(int32_t connHandle,
notify->connHandle = connHandle;
notify->length = length;
notify->pParams = pParams;
+ if (pData) {
uPortLog("U_PORT_TEST: Notified with %d bytes of data\n", length);
if (length <= sizeof(notify->data)) {
memcpy(notify->data, (const uint8_t *)pData, sizeof(notify->data));
}
+ } else {
+ uPortLog("U_PORT_TEST: Notification removed\n");
+ }
if (!enqueueEvt(&evt)) {
uPortLog("U_PORT_TEST: ERROR: failed to queue GATT notify evt\n");
