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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
65
66
67
71
72
73
76
77
78
81
82
83
86
87
88
91
92
93
96
97
98
101
102
103
106
107
108
111
112
113
114
115
119
120
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/* ... */
/* ... */
#ifndef HCI_TRANSPORT_H
#define HCI_TRANSPORT_H
#include "btstack_config.h"
#include "btstack_defines.h"
#include <stdint.h>
#if defined __cplusplus
extern "C" {
#endif
typedef struct {
/* ... */
const char * name;
/* ... */
void (*init) (const void *transport_config);
/* ... */
int (*open)(void);
/* ... */
int (*close)(void);
/* ... */
void (*register_packet_handler)(void (*handler)(uint8_t packet_type, uint8_t *packet, uint16_t size));
/* ... */
int (*can_send_packet_now)(uint8_t packet_type);
/* ... */
int (*send_packet)(uint8_t packet_type, uint8_t *packet, int size);
/* ... */
int (*set_baudrate)(uint32_t baudrate);
/* ... */
void (*reset_link)(void);
/* ... */
void (*set_sco_config)(uint16_t voice_setting, int num_connections);
...} hci_transport_t;
typedef enum {
HCI_TRANSPORT_CONFIG_UART,
HCI_TRANSPORT_CONFIG_USB
...} hci_transport_config_type_t;
typedef struct {
hci_transport_config_type_t type;
...} hci_transport_config_t;
typedef struct {
hci_transport_config_type_t type;
uint32_t baudrate_init;
uint32_t baudrate_main;
int flowcontrol;
const char *device_name;
int parity;
...} hci_transport_config_uart_t;
#if defined __cplusplus
}extern "C" { ... }
#endif
/* ... */
#endif