BLECharacteristic falls back to immed call if ada callback failed

This commit is contained in:
hathach committed 2019-09-23 15:32:36 +07:00
1 parent 31ed8a4fbb
commit 940e902edd
3 files changed
+18 -37

No files matched your search

@@ -411,10 +411,8 @@ void BLEClientCharacteristic::_eventHandler(ble_evt_t* evt)
if (_notify_cb)
{
// use AdaCallback or invoke directly
if (_use_ada_cb.notify)
{
ada_callback(hvx->data, hvx->len, _notify_cb, this, hvx->data, hvx->len);
}else
if ( !(_use_ada_cb.notify &&
ada_callback(hvx->data, hvx->len, _notify_cb, this, hvx->data, hvx->len)) )
{
_notify_cb(this, hvx->data, hvx->len);
}
@@ -425,10 +423,8 @@ void BLEClientCharacteristic::_eventHandler(ble_evt_t* evt)
if (_indicate_cb)
{
// use AdaCallback or invoke directly
if (_use_ada_cb.indicate)
{
ada_callback(hvx->data, hvx->len, _indicate_cb, this, hvx->data, hvx->len);
}else
if ( !(_use_ada_cb.indicate &&
ada_callback(hvx->data, hvx->len, _indicate_cb, this, hvx->data, hvx->len)) )
{
_indicate_cb(this, hvx->data, hvx->len);
}