@@ -266,10 +266,10 @@ int NimBLECharacteristic::handleGapEvent(uint16_t conn_handle, uint16_t attr_han
266
266
NIMBLE_LOGW (LOG_TAG, " Conn_handle (%d) is above the maximum value (%d)" , conn_handle, BLE_HCI_LE_CONN_HANDLE_MAX);
267
267
return BLE_ATT_ERR_INVALID_HANDLE;
268
268
}
269
-
269
+
270
270
const ble_uuid_t *uuid;
271
271
int rc;
272
- struct ble_gap_conn_desc desc;
272
+ struct ble_gap_conn_desc desc{} ;
273
273
NimBLECharacteristic* pCharacteristic = (NimBLECharacteristic*)arg;
274
274
275
275
NIMBLE_LOGD (LOG_TAG, " Characteristic %s %s event" , pCharacteristic->getUUID ().toString ().c_str (),
@@ -279,8 +279,7 @@ int NimBLECharacteristic::handleGapEvent(uint16_t conn_handle, uint16_t attr_han
279
279
if (ble_uuid_cmp (uuid, &pCharacteristic->getUUID ().getNative ()->u ) == 0 ){
280
280
switch (ctxt->op ) {
281
281
case BLE_GATT_ACCESS_OP_READ_CHR: {
282
- rc = ble_gap_conn_find (conn_handle, &desc);
283
- assert (rc == 0 );
282
+ ble_gap_conn_find (conn_handle, &desc);
284
283
285
284
// If the packet header is only 8 bytes this is a follow up of a long read
286
285
// so we don't want to call the onRead() callback again.
@@ -317,8 +316,8 @@ int NimBLECharacteristic::handleGapEvent(uint16_t conn_handle, uint16_t attr_han
317
316
len += next->om_len ;
318
317
next = SLIST_NEXT (next, om_next);
319
318
}
320
- rc = ble_gap_conn_find (conn_handle, &desc);
321
- assert (rc == 0 );
319
+
320
+ ble_gap_conn_find (conn_handle, &desc );
322
321
pCharacteristic->setValue (buf, len);
323
322
pCharacteristic->m_pCallbacks ->onWrite (pCharacteristic);
324
323
pCharacteristic->m_pCallbacks ->onWrite (pCharacteristic, &desc);
0 commit comments