Loading system/stack/btm/btm_main.cc +4 −6 Original line number Diff line number Diff line Loading @@ -32,13 +32,12 @@ #include "osi/include/log.h" #include "stack/include/btm_client_interface.h" #include "stack/include/inq_hci_link_interface.h" #include "stack_config.h" #include "stack/include/security_client_callbacks.h" #include "types/raw_address.h" /* Global BTM control block structure */ tBTM_CB btm_cb; tBTM_SEC_CB btm_sec_cb; /******************************************************************************* * Loading @@ -54,9 +53,8 @@ tBTM_SEC_CB btm_sec_cb; ******************************************************************************/ void btm_init(void) { btm_cb.Init(); btm_sec_cb.Init(stack_config_get_interface()->get_pts_secure_only_mode() ? BTM_SEC_MODE_SC : BTM_SEC_MODE_SP); get_security_client_interface().BTM_Sec_Init(); #ifdef TARGET_FLOSS // Need to set inquery by rssi flag for Floss since Floss doesn't do // btm_inq_db_init Loading @@ -66,8 +64,8 @@ void btm_init(void) { /** This function is called to free dynamic memory and system resource allocated by btm_init */ void btm_free(void) { get_security_client_interface().BTM_Sec_Free(); btm_cb.Free(); btm_sec_cb.Free(); } constexpr size_t kMaxLogHistoryTagLength = 6; Loading system/stack/btm/btm_sec_cb.cc +11 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include "osi/include/fixed_queue.h" #include "osi/include/list.h" #include "stack/btm/security_device_record.h" #include "stack_config.h" #include "types/raw_address.h" void tBTM_SEC_CB::Init(uint8_t initial_security_mode) { Loading Loading @@ -66,3 +67,13 @@ void tBTM_SEC_CB::Free() { alarm_free(execution_wait_timer); execution_wait_timer = nullptr; } tBTM_SEC_CB btm_sec_cb; void BTM_Sec_Init() { btm_sec_cb.Init(stack_config_get_interface()->get_pts_secure_only_mode() ? BTM_SEC_MODE_SC : BTM_SEC_MODE_SP); } void BTM_Sec_Free() { btm_sec_cb.Free(); } system/stack/btm/btm_sec_cb.h +3 −0 Original line number Diff line number Diff line Loading @@ -96,3 +96,6 @@ class tBTM_SEC_CB { }; extern tBTM_SEC_CB btm_sec_cb; void BTM_Sec_Init(); void BTM_Sec_Free(); system/stack/btm/btm_security_client_interface.cc +3 −0 Original line number Diff line number Diff line Loading @@ -17,11 +17,14 @@ #include "stack/btm/btm_dev.h" #include "stack/btm/btm_sec.h" #include "stack/btm/btm_sec_cb.h" #include "stack/include/btm_ble_sec_api.h" #include "stack/include/btm_sec_api.h" #include "stack/include/security_client_callbacks.h" static SecurityClientInterface security = { .BTM_Sec_Init = BTM_Sec_Init, .BTM_Sec_Free = BTM_Sec_Free, .BTM_SecAddDevice = BTM_SecAddDevice, .BTM_SecAddRmtNameNotifyCallback = BTM_SecAddRmtNameNotifyCallback, .BTM_SecDeleteDevice = BTM_SecDeleteDevice, Loading system/stack/include/security_client_callbacks.h +2 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,8 @@ struct tBTM_APPL_INFO { }; typedef struct { void (*BTM_Sec_Init)(); void (*BTM_Sec_Free)(); bool (*BTM_SecAddDevice)(const RawAddress& bd_addr, DEV_CLASS dev_class, const BD_NAME& bd_name, uint8_t* features, LinkKey* link_key, uint8_t key_type, Loading Loading
system/stack/btm/btm_main.cc +4 −6 Original line number Diff line number Diff line Loading @@ -32,13 +32,12 @@ #include "osi/include/log.h" #include "stack/include/btm_client_interface.h" #include "stack/include/inq_hci_link_interface.h" #include "stack_config.h" #include "stack/include/security_client_callbacks.h" #include "types/raw_address.h" /* Global BTM control block structure */ tBTM_CB btm_cb; tBTM_SEC_CB btm_sec_cb; /******************************************************************************* * Loading @@ -54,9 +53,8 @@ tBTM_SEC_CB btm_sec_cb; ******************************************************************************/ void btm_init(void) { btm_cb.Init(); btm_sec_cb.Init(stack_config_get_interface()->get_pts_secure_only_mode() ? BTM_SEC_MODE_SC : BTM_SEC_MODE_SP); get_security_client_interface().BTM_Sec_Init(); #ifdef TARGET_FLOSS // Need to set inquery by rssi flag for Floss since Floss doesn't do // btm_inq_db_init Loading @@ -66,8 +64,8 @@ void btm_init(void) { /** This function is called to free dynamic memory and system resource allocated by btm_init */ void btm_free(void) { get_security_client_interface().BTM_Sec_Free(); btm_cb.Free(); btm_sec_cb.Free(); } constexpr size_t kMaxLogHistoryTagLength = 6; Loading
system/stack/btm/btm_sec_cb.cc +11 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include "osi/include/fixed_queue.h" #include "osi/include/list.h" #include "stack/btm/security_device_record.h" #include "stack_config.h" #include "types/raw_address.h" void tBTM_SEC_CB::Init(uint8_t initial_security_mode) { Loading Loading @@ -66,3 +67,13 @@ void tBTM_SEC_CB::Free() { alarm_free(execution_wait_timer); execution_wait_timer = nullptr; } tBTM_SEC_CB btm_sec_cb; void BTM_Sec_Init() { btm_sec_cb.Init(stack_config_get_interface()->get_pts_secure_only_mode() ? BTM_SEC_MODE_SC : BTM_SEC_MODE_SP); } void BTM_Sec_Free() { btm_sec_cb.Free(); }
system/stack/btm/btm_sec_cb.h +3 −0 Original line number Diff line number Diff line Loading @@ -96,3 +96,6 @@ class tBTM_SEC_CB { }; extern tBTM_SEC_CB btm_sec_cb; void BTM_Sec_Init(); void BTM_Sec_Free();
system/stack/btm/btm_security_client_interface.cc +3 −0 Original line number Diff line number Diff line Loading @@ -17,11 +17,14 @@ #include "stack/btm/btm_dev.h" #include "stack/btm/btm_sec.h" #include "stack/btm/btm_sec_cb.h" #include "stack/include/btm_ble_sec_api.h" #include "stack/include/btm_sec_api.h" #include "stack/include/security_client_callbacks.h" static SecurityClientInterface security = { .BTM_Sec_Init = BTM_Sec_Init, .BTM_Sec_Free = BTM_Sec_Free, .BTM_SecAddDevice = BTM_SecAddDevice, .BTM_SecAddRmtNameNotifyCallback = BTM_SecAddRmtNameNotifyCallback, .BTM_SecDeleteDevice = BTM_SecDeleteDevice, Loading
system/stack/include/security_client_callbacks.h +2 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,8 @@ struct tBTM_APPL_INFO { }; typedef struct { void (*BTM_Sec_Init)(); void (*BTM_Sec_Free)(); bool (*BTM_SecAddDevice)(const RawAddress& bd_addr, DEV_CLASS dev_class, const BD_NAME& bd_name, uint8_t* features, LinkKey* link_key, uint8_t key_type, Loading