sm: provide le_device_db_index in SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED again

This commit is contained in:
Matthias Ringwald 2016-11-21 15:01:29 +01:00
parent 273591ab9d
commit 334126b319
3 changed files with 13 additions and 4 deletions

View File

@ -697,10 +697,11 @@ static void sm_notify_client_index(uint8_t type, hci_con_handle_t con_handle, ui
int identity_address_type;
le_device_db_info(index, &identity_address_type, identity_address, NULL);
uint8_t event[18];
uint8_t event[19];
sm_setup_event_base(event, sizeof(event), type, con_handle, addr_type, address);
event[11] = identity_address_type;
reverse_bd_addr(identity_address, &event[12]);
event[18] = index;
sm_dispatch_event(HCI_EVENT_PACKET, 0, event, sizeof(event));
}

View File

@ -833,14 +833,13 @@ typedef uint8_t sm_key_t[16];
/**
* @brief Identify resolving succeeded
*
* @format H1B1B
* @format H1B1B2
* @param handle
* @param addr_type
* @param address
* @param identity_addr_type
* @param identity_address
*
* @note le_device_db_index was removed, please use provided identity information directly
* @param index_internal
*
*/
#define SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED 0xDA

View File

@ -2616,6 +2616,15 @@ static inline uint8_t sm_event_identity_resolving_succeeded_get_identity_addr_ty
static inline void sm_event_identity_resolving_succeeded_get_identity_address(const uint8_t * event, bd_addr_t identity_address){
reverse_bd_addr(&event[12], identity_address);
}
/**
* @brief Get field index_internal from event SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED
* @param event packet
* @return index_internal
* @note: btstack_type 2
*/
static inline uint16_t sm_event_identity_resolving_succeeded_get_index_internal(const uint8_t * event){
return little_endian_read_16(event, 18);
}
#endif
#ifdef ENABLE_BLE