sm: fix event format of SM_EVENT_IDENTITY_CREATED, fix SM_EVENT_IDENTITY_CREATED and SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED

This commit is contained in:
Matthias Ringwald 2018-08-24 15:51:05 +02:00
parent 616878112b
commit fccb5f315e
3 changed files with 6 additions and 6 deletions

View File

@ -694,11 +694,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[19];
uint8_t event[20];
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;
little_endian_store_32(event, 18, index);
sm_dispatch_event(HCI_EVENT_PACKET, 0, event, sizeof(event));
}

View File

@ -932,7 +932,7 @@ typedef uint8_t sm_key_t[16];
/**
* @brief Emitted during pairing to inform app about address used as identity
*
* @format H1B1B1
* @format H1B1B2
* @param handle
* @param addr_type
* @param address

View File

@ -2873,10 +2873,10 @@ static inline void sm_event_identity_created_get_identity_address(const uint8_t
* @brief Get field index from event SM_EVENT_IDENTITY_CREATED
* @param event packet
* @return index
* @note: btstack_type 1
* @note: btstack_type 2
*/
static inline uint8_t sm_event_identity_created_get_index(const uint8_t * event){
return event[18];
static inline uint16_t sm_event_identity_created_get_index(const uint8_t * event){
return little_endian_read_16(event, 18);
}
#endif