1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
51
52
53
62
63
64
65
66
69
70
71
76
77
78
84
85
86
87
88
89
90
91
92
93
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/* ... */
#ifndef BTC_HD_H
#define BTC_HD_H
#if BTC_HD_INCLUDED == TRUE
#include <stdint.h>
#include "bta/bta_hd_api.h"
#include "btc/btc_task.h"
#include "esp_hidd_api.h"
typedef enum {
BTC_HD_INIT_EVT = 0,
BTC_HD_DEINIT_EVT,
BTC_HD_REGISTER_APP_EVT,
BTC_HD_UNREGISTER_APP_EVT,
BTC_HD_CONNECT_EVT,
BTC_HD_DISCONNECT_EVT,
BTC_HD_SEND_REPORT_EVT,
BTC_HD_REPORT_ERROR_EVT,
BTC_HD_UNPLUG_EVT,
}{...} BTC_HD_EVT;
typedef enum {
BTC_HD_DISABLED = 0,
BTC_HD_ENABLED,
BTC_HD_DISABLING,
BTC_HD_CONNECTING,
BTC_HD_CONNECTED,
BTC_HD_DISCONNECTING,
BTC_HD_DISCONNECTED,
}{...} BTC_HD_STATUS;
typedef struct {
BTC_HD_STATUS status;
bool app_registered;
bool service_dereg_active;
bool forced_disc;
tBTA_HD_APP_INFO app_info;
tBTA_HD_QOS_INFO in_qos;
tBTA_HD_QOS_INFO out_qos;
}{...} btc_hd_cb_t;
typedef union {
struct hd_connect_arg {
BD_ADDR bd_addr;
}{...} connect;
struct register_app_arg {
esp_hidd_app_param_t *app_param;
esp_hidd_qos_param_t *in_qos;
esp_hidd_qos_param_t *out_qos;
}{...} register_app;
struct send_report_arg {
esp_hidd_report_type_t type;
uint8_t id;
uint16_t len;
uint8_t *data;
}{...} send_report;
uint8_t error;
}{...} btc_hidd_args_t;
#ifdef __cplusplus
extern "C" {
#endif
/* ... */
void btc_hd_call_handler(btc_msg_t *msg);
void btc_hd_cb_handler(btc_msg_t *msg);
void btc_hd_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src);
void btc_hd_cb_arg_deep_free(btc_msg_t *msg);
#ifdef __cplusplus
}{...}
#endif
/* ... */
#endif /* ... */
#endif