Loading system/btif/co/bta_hh_co.cc +8 −8 Original line number Diff line number Diff line Loading @@ -171,7 +171,7 @@ static int uhid_read_event(btif_hh_device_t* p_dev) { APPL_TRACE_ERROR("%s: UHID_FEATURE: Invalid report type = %d", __func__, ev.u.feature.rtype); break; #ifdef OS_ANDROID // Host kernel does not support UHID_SET_REPORT #if ENABLE_UHID_SET_REPORT case UHID_SET_REPORT: { bool sent = true; Loading Loading @@ -211,7 +211,7 @@ static int uhid_read_event(btif_hh_device_t* p_dev) { } break; } #endif // ifdef OS_ANDROID #endif // ENABLE_UHID_SET_REPORT default: APPL_TRACE_DEBUG("Invalid event from uhid-dev: %u\n", ev.type); } Loading Loading @@ -418,10 +418,10 @@ void bta_hh_co_open(uint8_t dev_handle, uint8_t sub_class, p_dev->dev_status = BTHH_CONN_STATE_CONNECTED; p_dev->get_rpt_id_queue = fixed_queue_new(SIZE_MAX); CHECK(p_dev->get_rpt_id_queue); #ifdef OS_ANDROID // Host kernel does not support UHID_SET_REPORT #if ENABLE_UHID_SET_REPORT p_dev->set_rpt_id_queue = fixed_queue_new(SIZE_MAX); CHECK(p_dev->set_rpt_id_queue); #endif // OS_ANDROID #endif // ENABLE_UHID_SET_REPORT APPL_TRACE_DEBUG("%s: Return device status %d", __func__, p_dev->dev_status); } Loading Loading @@ -455,11 +455,11 @@ void bta_hh_co_close(uint8_t dev_handle, uint8_t app_id) { fixed_queue_flush(p_dev->get_rpt_id_queue, osi_free); fixed_queue_free(p_dev->get_rpt_id_queue, NULL); p_dev->get_rpt_id_queue = NULL; #ifdef OS_ANDROID // Host kernel does not support UHID_SET_REPORT #if ENABLE_UHID_SET_REPORT fixed_queue_flush(p_dev->set_rpt_id_queue, osi_free); fixed_queue_free(p_dev->set_rpt_id_queue, nullptr); p_dev->set_rpt_id_queue = nullptr; #endif // S_ANDROID #endif // ENABLE_UHID_SET_REPORT if (p_dev->dev_status != BTHH_CONN_STATE_UNKNOWN && p_dev->dev_handle == dev_handle) { APPL_TRACE_WARNING( Loading Loading @@ -607,7 +607,7 @@ void bta_hh_co_send_hid_info(btif_hh_device_t* p_dev, const char* dev_name, * ******************************************************************************/ void bta_hh_co_set_rpt_rsp(uint8_t dev_handle, uint8_t status) { #ifdef OS_ANDROID // Host kernel does not support UHID_SET_REPORT #if ENABLE_UHID_SET_REPORT LOG_VERBOSE("dev_handle = %d", dev_handle); btif_hh_device_t* p_dev = btif_hh_find_connected_dev_by_handle(dev_handle); Loading Loading @@ -639,7 +639,7 @@ void bta_hh_co_set_rpt_rsp(uint8_t dev_handle, uint8_t status) { } #else LOG_ERROR("Error: UHID_SET_REPORT_REPLY not supported"); #endif // OS_ANDROID #endif // ENABLE_UHID_SET_REPORT } /******************************************************************************* Loading system/btif/include/btif_hh.h +10 −2 Original line number Diff line number Diff line Loading @@ -45,6 +45,14 @@ #define BTIF_HH_MAX_POLLING_ATTEMPTS 10 #define BTIF_HH_POLLING_SLEEP_DURATION_US 5000 #ifndef ENABLE_UHID_SET_REPORT #if defined(OS_ANDROID) || defined(TARGET_FLOSS) #define ENABLE_UHID_SET_REPORT 1 #else #define ENABLE_UHID_SET_REPORT 0 #endif #endif /******************************************************************************* * Type definitions and return values ******************************************************************************/ Loading Loading @@ -94,9 +102,9 @@ typedef struct { uint8_t hh_keep_polling; alarm_t* vup_timer; fixed_queue_t* get_rpt_id_queue; #ifdef OS_ANDROID #if ENABLE_UHID_SET_REPORT fixed_queue_t* set_rpt_id_queue; #endif // OS_ANDROID #endif // ENSABLE_UHID_SET_REPORT uint8_t get_rpt_snt; bool local_vup; // Indicated locally initiated VUP } btif_hh_device_t; Loading system/btif/src/btif_hh.cc +2 −2 Original line number Diff line number Diff line Loading @@ -918,7 +918,7 @@ static void btif_hh_upstreams_evt(uint16_t event, char* p_param) { HAL_CBACK(bt_hh_callbacks, handshake_cb, (RawAddress*)&(p_dev->bd_addr), (bthh_status_t)p_data->hs_data.status); #ifdef OS_ANDROID // Host kernel does not support UHID_SET_REPORT #if ENABLE_UHID_SET_REPORT if (p_dev->le_hid && p_dev->set_rpt_id_queue) { /* There is no handshake response for HOGP. Conclude the * UHID_SET_REPORT procedure here. */ Loading @@ -928,7 +928,7 @@ static void btif_hh_upstreams_evt(uint16_t event, char* p_param) { bta_hh_co_set_rpt_rsp(p_dev->dev_handle, p_data->dev_status.status); } } #endif #endif // ENABLE_UHID_SET_REPORT } break; Loading Loading
system/btif/co/bta_hh_co.cc +8 −8 Original line number Diff line number Diff line Loading @@ -171,7 +171,7 @@ static int uhid_read_event(btif_hh_device_t* p_dev) { APPL_TRACE_ERROR("%s: UHID_FEATURE: Invalid report type = %d", __func__, ev.u.feature.rtype); break; #ifdef OS_ANDROID // Host kernel does not support UHID_SET_REPORT #if ENABLE_UHID_SET_REPORT case UHID_SET_REPORT: { bool sent = true; Loading Loading @@ -211,7 +211,7 @@ static int uhid_read_event(btif_hh_device_t* p_dev) { } break; } #endif // ifdef OS_ANDROID #endif // ENABLE_UHID_SET_REPORT default: APPL_TRACE_DEBUG("Invalid event from uhid-dev: %u\n", ev.type); } Loading Loading @@ -418,10 +418,10 @@ void bta_hh_co_open(uint8_t dev_handle, uint8_t sub_class, p_dev->dev_status = BTHH_CONN_STATE_CONNECTED; p_dev->get_rpt_id_queue = fixed_queue_new(SIZE_MAX); CHECK(p_dev->get_rpt_id_queue); #ifdef OS_ANDROID // Host kernel does not support UHID_SET_REPORT #if ENABLE_UHID_SET_REPORT p_dev->set_rpt_id_queue = fixed_queue_new(SIZE_MAX); CHECK(p_dev->set_rpt_id_queue); #endif // OS_ANDROID #endif // ENABLE_UHID_SET_REPORT APPL_TRACE_DEBUG("%s: Return device status %d", __func__, p_dev->dev_status); } Loading Loading @@ -455,11 +455,11 @@ void bta_hh_co_close(uint8_t dev_handle, uint8_t app_id) { fixed_queue_flush(p_dev->get_rpt_id_queue, osi_free); fixed_queue_free(p_dev->get_rpt_id_queue, NULL); p_dev->get_rpt_id_queue = NULL; #ifdef OS_ANDROID // Host kernel does not support UHID_SET_REPORT #if ENABLE_UHID_SET_REPORT fixed_queue_flush(p_dev->set_rpt_id_queue, osi_free); fixed_queue_free(p_dev->set_rpt_id_queue, nullptr); p_dev->set_rpt_id_queue = nullptr; #endif // S_ANDROID #endif // ENABLE_UHID_SET_REPORT if (p_dev->dev_status != BTHH_CONN_STATE_UNKNOWN && p_dev->dev_handle == dev_handle) { APPL_TRACE_WARNING( Loading Loading @@ -607,7 +607,7 @@ void bta_hh_co_send_hid_info(btif_hh_device_t* p_dev, const char* dev_name, * ******************************************************************************/ void bta_hh_co_set_rpt_rsp(uint8_t dev_handle, uint8_t status) { #ifdef OS_ANDROID // Host kernel does not support UHID_SET_REPORT #if ENABLE_UHID_SET_REPORT LOG_VERBOSE("dev_handle = %d", dev_handle); btif_hh_device_t* p_dev = btif_hh_find_connected_dev_by_handle(dev_handle); Loading Loading @@ -639,7 +639,7 @@ void bta_hh_co_set_rpt_rsp(uint8_t dev_handle, uint8_t status) { } #else LOG_ERROR("Error: UHID_SET_REPORT_REPLY not supported"); #endif // OS_ANDROID #endif // ENABLE_UHID_SET_REPORT } /******************************************************************************* Loading
system/btif/include/btif_hh.h +10 −2 Original line number Diff line number Diff line Loading @@ -45,6 +45,14 @@ #define BTIF_HH_MAX_POLLING_ATTEMPTS 10 #define BTIF_HH_POLLING_SLEEP_DURATION_US 5000 #ifndef ENABLE_UHID_SET_REPORT #if defined(OS_ANDROID) || defined(TARGET_FLOSS) #define ENABLE_UHID_SET_REPORT 1 #else #define ENABLE_UHID_SET_REPORT 0 #endif #endif /******************************************************************************* * Type definitions and return values ******************************************************************************/ Loading Loading @@ -94,9 +102,9 @@ typedef struct { uint8_t hh_keep_polling; alarm_t* vup_timer; fixed_queue_t* get_rpt_id_queue; #ifdef OS_ANDROID #if ENABLE_UHID_SET_REPORT fixed_queue_t* set_rpt_id_queue; #endif // OS_ANDROID #endif // ENSABLE_UHID_SET_REPORT uint8_t get_rpt_snt; bool local_vup; // Indicated locally initiated VUP } btif_hh_device_t; Loading
system/btif/src/btif_hh.cc +2 −2 Original line number Diff line number Diff line Loading @@ -918,7 +918,7 @@ static void btif_hh_upstreams_evt(uint16_t event, char* p_param) { HAL_CBACK(bt_hh_callbacks, handshake_cb, (RawAddress*)&(p_dev->bd_addr), (bthh_status_t)p_data->hs_data.status); #ifdef OS_ANDROID // Host kernel does not support UHID_SET_REPORT #if ENABLE_UHID_SET_REPORT if (p_dev->le_hid && p_dev->set_rpt_id_queue) { /* There is no handshake response for HOGP. Conclude the * UHID_SET_REPORT procedure here. */ Loading @@ -928,7 +928,7 @@ static void btif_hh_upstreams_evt(uint16_t event, char* p_param) { bta_hh_co_set_rpt_rsp(p_dev->dev_handle, p_data->dev_status.status); } } #endif #endif // ENABLE_UHID_SET_REPORT } break; Loading