mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-25 06:40:10 +00:00
added sm_le_device_index for use by gatt client/server
This commit is contained in:
parent
85cacb82ec
commit
5c52231480
11
ble/sm.c
11
ble/sm.c
@ -2147,6 +2147,17 @@ void sm_passkey_input(uint8_t addr_type, bd_addr_t address, uint32_t passkey){
|
|||||||
sm_run();
|
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
|
// GAP LE API
|
||||||
void gap_random_address_set_mode(gap_random_address_type_t random_address_type){
|
void gap_random_address_set_mode(gap_random_address_type_t random_address_type){
|
||||||
gap_random_address_update_stop();
|
gap_random_address_update_stop();
|
||||||
|
7
ble/sm.h
7
ble/sm.h
@ -254,6 +254,13 @@ void sm_authorization_grant(uint8_t addr_type, bd_addr_t address);
|
|||||||
int sm_cmac_ready();
|
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]));
|
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
|
// Testing support only
|
||||||
void sm_test_set_irk(sm_key_t irk);
|
void sm_test_set_irk(sm_key_t irk);
|
||||||
#if defined __cplusplus
|
#if defined __cplusplus
|
||||||
|
Loading…
x
Reference in New Issue
Block a user