Loading system/bta/hh/bta_hh_act.cc +1 −1 Original line number Diff line number Diff line Loading @@ -75,7 +75,7 @@ static const char* bta_hh_hid_event_name(uint16_t event); * Returns void * ******************************************************************************/ void bta_hh_api_enable(tBTA_HH_DATA* p_data) { void bta_hh_api_enable(const tBTA_HH_DATA* p_data) { tBTA_HH_STATUS status = BTA_HH_ERR; uint8_t xx; Loading system/bta/hh/bta_hh_api.cc +15 −11 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ #include "bta/sys/bta_sys.h" #include "osi/include/allocator.h" #include "osi/include/osi.h" // UNUSED_ATTR #include "stack/include/btu.h" #include "types/raw_address.h" /***************************************************************************** Loading @@ -56,16 +57,22 @@ static const tBTA_SYS_REG bta_hh_reg = {bta_hh_hdl_event, BTA_HhDisable}; * ******************************************************************************/ void BTA_HhEnable(tBTA_HH_CBACK* p_cback) { tBTA_HH_API_ENABLE* p_buf = (tBTA_HH_API_ENABLE*)osi_calloc(sizeof(tBTA_HH_API_ENABLE)); /* register with BTA system manager */ bta_sys_register(BTA_ID_HH, &bta_hh_reg); p_buf->hdr.event = BTA_HH_API_ENABLE_EVT; p_buf->p_cback = p_cback; bta_sys_sendmsg(p_buf); post_on_bt_main([p_cback]() { tBTA_HH_DATA data = { .api_enable = { .hdr = { .event = BTA_HH_API_ENABLE_EVT, }, .p_cback = p_cback, }, }; bta_hh_api_enable(&data); }); } /******************************************************************************* Loading @@ -79,12 +86,9 @@ void BTA_HhEnable(tBTA_HH_CBACK* p_cback) { * ******************************************************************************/ void BTA_HhDisable(void) { BT_HDR* p_buf = (BT_HDR*)osi_malloc(sizeof(BT_HDR)); bta_sys_deregister(BTA_ID_HH); p_buf->event = BTA_HH_API_DISABLE_EVT; bta_sys_sendmsg(p_buf); post_on_bt_main([]() { bta_hh_api_disable(); }); } /******************************************************************************* Loading system/bta/hh/bta_hh_int.h +1 −1 Original line number Diff line number Diff line Loading @@ -297,7 +297,7 @@ extern void bta_hh_cleanup_disable(tBTA_HH_STATUS status); extern uint8_t bta_hh_dev_handle_to_cb_idx(uint8_t dev_handle); /* action functions used outside state machine */ extern void bta_hh_api_enable(tBTA_HH_DATA* p_data); extern void bta_hh_api_enable(const tBTA_HH_DATA* p_data); extern void bta_hh_api_disable(void); extern void bta_hh_disc_cmpl(void); Loading Loading
system/bta/hh/bta_hh_act.cc +1 −1 Original line number Diff line number Diff line Loading @@ -75,7 +75,7 @@ static const char* bta_hh_hid_event_name(uint16_t event); * Returns void * ******************************************************************************/ void bta_hh_api_enable(tBTA_HH_DATA* p_data) { void bta_hh_api_enable(const tBTA_HH_DATA* p_data) { tBTA_HH_STATUS status = BTA_HH_ERR; uint8_t xx; Loading
system/bta/hh/bta_hh_api.cc +15 −11 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ #include "bta/sys/bta_sys.h" #include "osi/include/allocator.h" #include "osi/include/osi.h" // UNUSED_ATTR #include "stack/include/btu.h" #include "types/raw_address.h" /***************************************************************************** Loading @@ -56,16 +57,22 @@ static const tBTA_SYS_REG bta_hh_reg = {bta_hh_hdl_event, BTA_HhDisable}; * ******************************************************************************/ void BTA_HhEnable(tBTA_HH_CBACK* p_cback) { tBTA_HH_API_ENABLE* p_buf = (tBTA_HH_API_ENABLE*)osi_calloc(sizeof(tBTA_HH_API_ENABLE)); /* register with BTA system manager */ bta_sys_register(BTA_ID_HH, &bta_hh_reg); p_buf->hdr.event = BTA_HH_API_ENABLE_EVT; p_buf->p_cback = p_cback; bta_sys_sendmsg(p_buf); post_on_bt_main([p_cback]() { tBTA_HH_DATA data = { .api_enable = { .hdr = { .event = BTA_HH_API_ENABLE_EVT, }, .p_cback = p_cback, }, }; bta_hh_api_enable(&data); }); } /******************************************************************************* Loading @@ -79,12 +86,9 @@ void BTA_HhEnable(tBTA_HH_CBACK* p_cback) { * ******************************************************************************/ void BTA_HhDisable(void) { BT_HDR* p_buf = (BT_HDR*)osi_malloc(sizeof(BT_HDR)); bta_sys_deregister(BTA_ID_HH); p_buf->event = BTA_HH_API_DISABLE_EVT; bta_sys_sendmsg(p_buf); post_on_bt_main([]() { bta_hh_api_disable(); }); } /******************************************************************************* Loading
system/bta/hh/bta_hh_int.h +1 −1 Original line number Diff line number Diff line Loading @@ -297,7 +297,7 @@ extern void bta_hh_cleanup_disable(tBTA_HH_STATUS status); extern uint8_t bta_hh_dev_handle_to_cb_idx(uint8_t dev_handle); /* action functions used outside state machine */ extern void bta_hh_api_enable(tBTA_HH_DATA* p_data); extern void bta_hh_api_enable(const tBTA_HH_DATA* p_data); extern void bta_hh_api_disable(void); extern void bta_hh_disc_cmpl(void); Loading