24 #define HID_BUFFERSIZE 50 // size of the buffer for the Playstation Motion Controller
25 #define OUTPUT_REPORT_BUFFER_SIZE 48 //Size of the output report buffer for the controllers
29 #define L2CAP_CONTROL_REQUEST 1
30 #define L2CAP_CONTROL_SUCCESS 2
31 #define L2CAP_INTERRUPT_SETUP 3
32 #define L2CAP_INTERRUPT_REQUEST 4
33 #define L2CAP_INTERRUPT_SUCCESS 5
34 #define L2CAP_HID_ENABLE_SIXAXIS 6
35 #define L2CAP_HID_PS3_LED 7
37 #define L2CAP_INTERRUPT_DISCONNECT 9
38 #define L2CAP_CONTROL_DISCONNECT 10
41 #define L2CAP_FLAG_CONNECTION_CONTROL_REQUEST 0x01
42 #define L2CAP_FLAG_CONFIG_CONTROL_REQUEST 0x02
43 #define L2CAP_FLAG_CONFIG_CONTROL_SUCCESS 0x04
44 #define L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST 0x08
45 #define L2CAP_FLAG_CONFIG_INTERRUPT_REQUEST 0x10
46 #define L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS 0x20
47 #define L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE 0x40
48 #define L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE 0x80
51 #define l2cap_connection_request_control_flag (l2cap_event_flag & L2CAP_FLAG_CONNECTION_CONTROL_REQUEST)
52 #define l2cap_config_request_control_flag (l2cap_event_flag & L2CAP_FLAG_CONFIG_CONTROL_REQUEST)
53 #define l2cap_config_success_control_flag (l2cap_event_flag & L2CAP_FLAG_CONFIG_CONTROL_SUCCESS)
54 #define l2cap_connection_request_interrupt_flag (l2cap_event_flag & L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST)
55 #define l2cap_config_request_interrupt_flag (l2cap_event_flag & L2CAP_FLAG_CONFIG_INTERRUPT_REQUEST)
56 #define l2cap_config_success_interrupt_flag (l2cap_event_flag & L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS)
57 #define l2cap_disconnect_response_control_flag (l2cap_event_flag & L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE)
58 #define l2cap_disconnect_response_interrupt_flag (l2cap_event_flag & L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE)
75 PS3BT(
BTD *pBtd, uint8_t btadr5=0, uint8_t btadr4=0, uint8_t btadr3=0, uint8_t btadr2=0, uint8_t btadr1=0, uint8_t btadr0=0);
214 uint8_t remote_name[30];
215 bool activeConnection;
219 uint16_t l2cap_event_flag;
223 uint32_t ButtonState;
224 uint32_t OldButtonState;
225 uint32_t ButtonClickState;
228 uint32_t timerBulbRumble;
235 uint8_t control_scid[2];
236 uint8_t control_dcid[2];
237 uint8_t interrupt_scid[2];
238 uint8_t interrupt_dcid[2];
242 void HID_Command(uint8_t* data, uint8_t nbytes);
243 void HIDMove_Command(uint8_t* data, uint8_t nbytes);
244 void enable_sixaxis();