mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
feat(bt/bluedroid): Support hid device control point
This commit is contained in:
parent
35afc37f1a
commit
6a94399233
@ -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: {
|
||||
|
Loading…
Reference in New Issue
Block a user