Skip to content

Commit 6e42e93

Browse files
committed
adding wr_cb to adacallback (pending) #88
1 parent d6f81a2 commit 6e42e93

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

libraries/Bluefruit52Lib/src/BLECharacteristic.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,19 @@ void BLECharacteristic::_eventHandler(ble_evt_t* event)
366366
LOG_LV2_BUFFER(NULL, request->data, request->len);
367367

368368
// TODO Ada callback
369-
if (_wr_cb) _wr_cb(*this, request->data, request->len, request->offset);
369+
if (_wr_cb)
370+
{
371+
// uint8_t* data = (uint8_t*) rtos_malloc(request->len);
372+
//
373+
// if (data)
374+
// {
375+
// ada_callback(data, _wr_cb, *this, data, request->len, request->offset);
376+
// }else
377+
{
378+
// invoke directly if cannot allocate memory for data
379+
_wr_cb(*this, request->data, request->len, request->offset);
380+
}
381+
}
370382
}
371383

372384
// CCCD write

0 commit comments

Comments
 (0)