feat(bt/bluedroid): Support hid device control point

This commit is contained in:
zhanghaipeng 2023-10-24 15:17:26 +08:00
parent 35afc37f1a
commit 6a94399233

View File

@ -318,6 +318,10 @@ void ble_hid_demo_task(void *pvParameters)
void ble_hid_task_start_up(void)
{
if (s_ble_hid_param.task_hdl) {
// Task already exists
return;
}
xTaskCreate(ble_hid_demo_task, "ble_hid_demo_task", 2 * 1024, NULL, configMAX_PRIORITIES - 3,
&s_ble_hid_param.task_hdl);
}
@ -352,6 +356,14 @@ static void ble_hidd_event_callback(void *handler_args, esp_event_base_t base, i
}
case ESP_HIDD_CONTROL_EVENT: {
ESP_LOGI(TAG, "CONTROL[%u]: %sSUSPEND", param->control.map_index, param->control.control ? "EXIT_" : "");
if (param->control.control)
{
// exit suspend
ble_hid_task_start_up();
} else {
// suspend
ble_hid_task_shut_down();
}
break;
}
case ESP_HIDD_OUTPUT_EVENT: {