mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2024-11-21 20:50:55 +01:00
Remove some asserts.
This commit is contained in:
parent
62d1f67d8b
commit
d38865e022
1 changed files with 10 additions and 3 deletions
|
@ -337,7 +337,9 @@ NimBLEConnInfo NimBLEServer::getPeerIDInfo(uint16_t id) {
|
||||||
server->m_connectedPeersVec.push_back(event->connect.conn_handle);
|
server->m_connectedPeersVec.push_back(event->connect.conn_handle);
|
||||||
|
|
||||||
rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
|
rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
|
||||||
assert(rc == 0);
|
if (rc != 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
server->m_pServerCallbacks->onConnect(server);
|
server->m_pServerCallbacks->onConnect(server);
|
||||||
server->m_pServerCallbacks->onConnect(server, &desc);
|
server->m_pServerCallbacks->onConnect(server, &desc);
|
||||||
|
@ -392,7 +394,9 @@ NimBLEConnInfo NimBLEServer::getPeerIDInfo(uint16_t id) {
|
||||||
(it->getProperties() & BLE_GATT_CHR_F_READ_ENC))
|
(it->getProperties() & BLE_GATT_CHR_F_READ_ENC))
|
||||||
{
|
{
|
||||||
rc = ble_gap_conn_find(event->subscribe.conn_handle, &desc);
|
rc = ble_gap_conn_find(event->subscribe.conn_handle, &desc);
|
||||||
assert(rc == 0);
|
if (rc != 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if(!desc.sec_state.encrypted) {
|
if(!desc.sec_state.encrypted) {
|
||||||
NimBLEDevice::startSecurity(event->subscribe.conn_handle);
|
NimBLEDevice::startSecurity(event->subscribe.conn_handle);
|
||||||
|
@ -449,7 +453,10 @@ NimBLEConnInfo NimBLEServer::getPeerIDInfo(uint16_t id) {
|
||||||
|
|
||||||
/* Delete the old bond. */
|
/* Delete the old bond. */
|
||||||
rc = ble_gap_conn_find(event->repeat_pairing.conn_handle, &desc);
|
rc = ble_gap_conn_find(event->repeat_pairing.conn_handle, &desc);
|
||||||
assert(rc == 0);
|
if (rc != 0){
|
||||||
|
return BLE_GAP_REPEAT_PAIRING_IGNORE;
|
||||||
|
}
|
||||||
|
|
||||||
ble_store_util_delete_peer(&desc.peer_id_addr);
|
ble_store_util_delete_peer(&desc.peer_id_addr);
|
||||||
|
|
||||||
/* Return BLE_GAP_REPEAT_PAIRING_RETRY to indicate that the host should
|
/* Return BLE_GAP_REPEAT_PAIRING_RETRY to indicate that the host should
|
||||||
|
|
Loading…
Reference in a new issue