sm: don't notify client upon new le device entry if entry creation failed

This commit is contained in:
Matthias Ringwald 2017-11-24 16:29:20 +01:00
parent 3b70da213b
commit 4816392915

View File

@ -1382,10 +1382,10 @@ static void sm_key_distribution_handle_all_received(sm_connection_t * sm_conn){
le_db_index = le_device_db_add(setup->sm_peer_addr_type, setup->sm_peer_address, setup->sm_peer_irk); le_db_index = le_device_db_add(setup->sm_peer_addr_type, setup->sm_peer_address, setup->sm_peer_irk);
} }
sm_notify_client_index(SM_EVENT_IDENTITY_CREATED, sm_conn->sm_handle, setup->sm_peer_addr_type, setup->sm_peer_address, le_db_index);
if (le_db_index >= 0){ if (le_db_index >= 0){
sm_notify_client_index(SM_EVENT_IDENTITY_CREATED, sm_conn->sm_handle, setup->sm_peer_addr_type, setup->sm_peer_address, le_db_index);
#ifdef ENABLE_LE_SIGNED_WRITE #ifdef ENABLE_LE_SIGNED_WRITE
// store local CSRK // store local CSRK
if (setup->sm_key_distribution_send_set & SM_KEYDIST_FLAG_SIGNING_IDENTIFICATION){ if (setup->sm_key_distribution_send_set & SM_KEYDIST_FLAG_SIGNING_IDENTIFICATION){