1 // Copyright 2017-2019 Espressif Systems (Shanghai) PTE LTD 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #pragma once 16 17 #include "esp_err.h" 18 #include "esp_hidd.h" 19 #include "esp_hid_common.h" 20 21 #ifdef __cplusplus 22 extern "C" { 23 #endif 24 25 struct esp_hidd_dev_s { 26 void *dev; 27 esp_hid_transport_t transport; 28 29 bool (*connected) (void *dev); 30 esp_err_t (*deinit) (void *dev); 31 esp_err_t (*battery_set) (void *dev, uint8_t level); 32 esp_err_t (*input_set) (void *dev, size_t map_index, size_t report_id, uint8_t *data, size_t length); 33 esp_err_t (*feature_set) (void *dev, size_t map_index, size_t report_id, uint8_t *data, size_t length); 34 esp_err_t (*event_handler_register) (void *dev, esp_event_handler_t callback, esp_hidd_event_t event); 35 esp_err_t (*event_handler_unregister) (void *dev, esp_event_handler_t callback, esp_hidd_event_t event); 36 }; 37 38 typedef struct esp_hidd_dev_s esp_hidd_dev_t; 39 40 #ifdef __cplusplus 41 } 42 #endif 43