29 #define L2CAP_CONTROL_SUCCESS 1
30 #define L2CAP_INTERRUPT_SETUP 2
33 #define L2CAP_CONTROL_CONNECT_REQUEST 3
34 #define L2CAP_CONTROL_CONFIG_REQUEST 4
35 #define L2CAP_INTERRUPT_CONNECT_REQUEST 5
37 #define L2CAP_INTERRUPT_CONFIG_REQUEST 6
40 #define L2CAP_INTERRUPT_DISCONNECT 8
41 #define L2CAP_CONTROL_DISCONNECT 9
44 #define L2CAP_FLAG_CONTROL_CONNECTED 0x01
45 #define L2CAP_FLAG_INTERRUPT_CONNECTED 0x02
46 #define L2CAP_FLAG_CONFIG_CONTROL_SUCCESS 0x04
47 #define L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS 0x08
48 #define L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE 0x10
49 #define L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE 0x20
50 #define L2CAP_FLAG_CONNECTION_CONTROL_REQUEST 0x40
51 #define L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST 0x80
54 #define l2cap_connected_control_flag (l2cap_event_flag & L2CAP_FLAG_CONTROL_CONNECTED)
55 #define l2cap_connected_interrupt_flag (l2cap_event_flag & L2CAP_FLAG_INTERRUPT_CONNECTED)
56 #define l2cap_config_success_control_flag (l2cap_event_flag & L2CAP_FLAG_CONFIG_CONTROL_SUCCESS)
57 #define l2cap_config_success_interrupt_flag (l2cap_event_flag & L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS)
58 #define l2cap_disconnect_response_control_flag (l2cap_event_flag & L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE)
59 #define l2cap_disconnect_response_interrupt_flag (l2cap_event_flag & L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE)
60 #define l2cap_connection_request_control_flag (l2cap_event_flag & L2CAP_FLAG_CONNECTION_CONTROL_REQUEST)
61 #define l2cap_connection_request_interrupt_flag (l2cap_event_flag & L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST)
63 #define KEYBOARD_PARSER_ID 0
64 #define MOUSE_PARSER_ID 1
76 BTHID(
BTD *p,
bool pair =
false,
const char *pin =
"1234");
93 return pRptParser[id];
119 pFuncOnInit = funcOnInit;
129 uint8_t protocolMode;
140 void (*pFuncOnInit)(void);
146 bool activeConnection;
150 uint8_t l2cap_event_flag;
152 uint8_t ButtonState, OldButtonState, ButtonClickState;
153 int16_t xAxis, yAxis, scroll;
156 uint8_t control_scid[2];
157 uint8_t control_dcid[2];
158 uint8_t interrupt_scid[2];
159 uint8_t interrupt_dcid[2];
virtual void ACLData(uint8_t *ACLData)
void attachOnInit(void(*funcOnInit)(void))
virtual void disconnect()
HIDReportParser * GetReportParser(uint8_t id)
BTHID(BTD *p, bool pair=false, const char *pin="1234")
void setProtocolMode(uint8_t mode)
bool SetReportParser(uint8_t id, HIDReportParser *prs)