mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2025-01-22 09:20:51 +01:00
change(RemoteServ): Revert characteristicDiscCB partially
This commit is contained in:
parent
6116237d6b
commit
99a82116f9
1 changed files with 10 additions and 8 deletions
|
@ -133,15 +133,17 @@ int NimBLERemoteService::characteristicDiscCB(uint16_t connHandle,
|
||||||
const ble_gatt_chr* chr,
|
const ble_gatt_chr* chr,
|
||||||
void* arg) {
|
void* arg) {
|
||||||
const int rc = error->status;
|
const int rc = error->status;
|
||||||
const bool ok = (rc == 0);
|
|
||||||
auto pTaskData = (NimBLETaskData*)arg;
|
auto pTaskData = (NimBLETaskData*)arg;
|
||||||
const auto pSvc = (NimBLERemoteService*)pTaskData->m_pInstance;
|
const auto pSvc = (NimBLERemoteService*)pTaskData->m_pInstance;
|
||||||
NIMBLE_LOGD(LOG_TAG, "Characteristic Discovery >> status: %d handle: %d", rc, ok ? chr->def_handle : -1);
|
NIMBLE_LOGD(LOG_TAG, "Characteristic Discovery >> status: %d handle: %d", rc, (rc == 0) ? chr->def_handle : -1);
|
||||||
|
|
||||||
// Make sure the discovery is for this device
|
// Make sure the discovery is for this device
|
||||||
if (ok || pSvc->getClient()->getConnHandle() != connHandle) {
|
if (pSvc->getClient()->getConnHandle() != connHandle) {
|
||||||
ok ? pSvc->m_vChars.push_back(new NimBLERemoteCharacteristic(pSvc, chr))
|
return 0;
|
||||||
: (void)0;
|
}
|
||||||
|
|
||||||
|
if (rc == 0) {
|
||||||
|
pSvc->m_vChars.push_back(new NimBLERemoteCharacteristic(pSvc, chr));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue