24 #define HID_BUFFERSIZE 50 // Size of the buffer for the Playstation Motion Controller
28 #define L2CAP_CONTROL_REQUEST 1
29 #define L2CAP_CONTROL_SUCCESS 2
30 #define L2CAP_INTERRUPT_SETUP 3
31 #define L2CAP_INTERRUPT_REQUEST 4
32 #define L2CAP_INTERRUPT_SUCCESS 5
33 #define L2CAP_HID_ENABLE_SIXAXIS 6
34 #define L2CAP_HID_PS3_LED 7
36 #define L2CAP_INTERRUPT_DISCONNECT 9
37 #define L2CAP_CONTROL_DISCONNECT 10
40 #define L2CAP_FLAG_CONNECTION_CONTROL_REQUEST 0x01
41 #define L2CAP_FLAG_CONFIG_CONTROL_REQUEST 0x02
42 #define L2CAP_FLAG_CONFIG_CONTROL_SUCCESS 0x04
43 #define L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST 0x08
44 #define L2CAP_FLAG_CONFIG_INTERRUPT_REQUEST 0x10
45 #define L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS 0x20
46 #define L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE 0x40
47 #define L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE 0x80
50 #define l2cap_connection_request_control_flag (l2cap_event_flag & L2CAP_FLAG_CONNECTION_CONTROL_REQUEST)
51 #define l2cap_config_request_control_flag (l2cap_event_flag & L2CAP_FLAG_CONFIG_CONTROL_REQUEST)
52 #define l2cap_config_success_control_flag (l2cap_event_flag & L2CAP_FLAG_CONFIG_CONTROL_SUCCESS)
53 #define l2cap_connection_request_interrupt_flag (l2cap_event_flag & L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST)
54 #define l2cap_config_request_interrupt_flag (l2cap_event_flag & L2CAP_FLAG_CONFIG_INTERRUPT_REQUEST)
55 #define l2cap_config_success_interrupt_flag (l2cap_event_flag & L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS)
56 #define l2cap_disconnect_response_control_flag (l2cap_event_flag & L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE)
57 #define l2cap_disconnect_response_interrupt_flag (l2cap_event_flag & L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE)
74 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);
172 void setRumbleOn(uint8_t rightDuration, uint8_t rightPower, uint8_t leftDuration, uint8_t leftPower);
227 uint8_t remote_name[30];
228 bool activeConnection;
232 uint16_t l2cap_event_flag;
236 uint32_t ButtonState;
237 uint32_t OldButtonState;
238 uint32_t ButtonClickState;
241 uint32_t timerBulbRumble;
248 uint8_t control_scid[2];
249 uint8_t control_dcid[2];
250 uint8_t interrupt_scid[2];
251 uint8_t interrupt_dcid[2];
255 void HID_Command(uint8_t* data, uint8_t nbytes);
256 void HIDMove_Command(uint8_t* data, uint8_t nbytes);
257 void enable_sixaxis();