added sm_le_device_index for use by gatt client/server

This commit is contained in:
matthias.ringwald@gmail.com 2015-03-05 10:48:26 +00:00
parent 85cacb82ec
commit 5c52231480
2 changed files with 18 additions and 0 deletions

View File

@ -2147,6 +2147,17 @@ void sm_passkey_input(uint8_t addr_type, bd_addr_t address, uint32_t passkey){
sm_run();
}
/**
* @brief Identify device in LE Device DB
* @param handle
* @returns index from le_device_db or -1 if not found/identified
*/
int sm_le_device_index(uint16_t handle ){
sm_connection_t * sm_conn = sm_get_connection_for_handle(handle);
if (!sm_conn) return -1;
return sm_conn->sm_le_db_index;
}
// GAP LE API
void gap_random_address_set_mode(gap_random_address_type_t random_address_type){
gap_random_address_update_stop();

View File

@ -254,6 +254,13 @@ void sm_authorization_grant(uint8_t addr_type, bd_addr_t address);
int sm_cmac_ready();
void sm_cmac_start(sm_key_t k, uint16_t message_len, uint8_t * message, void (*done_handler)(uint8_t hash[8]));
/**
* @brief Identify device in LE Device DB
* @param handle
* @returns index from le_device_db or -1 if not found/identified
*/
int sm_le_device_index(uint16_t handle );
// Testing support only
void sm_test_set_irk(sm_key_t irk);
#if defined __cplusplus