|
|
|
|
|
|
|
|
{ return ((btdevice == nullptr) || (btdevice->strbuf == nullptr)) ? nullptr : &btdevice->strbuf->buffer[btdevice->strbuf->iStrings[strbuf_t::STR_ID_PROD]]; } |
|
|
{ return ((btdevice == nullptr) || (btdevice->strbuf == nullptr)) ? nullptr : &btdevice->strbuf->buffer[btdevice->strbuf->iStrings[strbuf_t::STR_ID_PROD]]; } |
|
|
const uint8_t *serialNumber() |
|
|
const uint8_t *serialNumber() |
|
|
{ return ((btdevice == nullptr) || (btdevice->strbuf == nullptr)) ? nullptr : &btdevice->strbuf->buffer[btdevice->strbuf->iStrings[strbuf_t::STR_ID_SERIAL]]; } |
|
|
{ return ((btdevice == nullptr) || (btdevice->strbuf == nullptr)) ? nullptr : &btdevice->strbuf->buffer[btdevice->strbuf->iStrings[strbuf_t::STR_ID_SERIAL]]; } |
|
|
|
|
|
|
|
|
private: |
|
|
private: |
|
|
virtual bool claim_bluetooth(BluetoothController *driver, uint32_t bluetooth_class) {return false;} |
|
|
virtual bool claim_bluetooth(BluetoothController *driver, uint32_t bluetooth_class) {return false;} |
|
|
virtual bool process_bluetooth_HID_data(const uint8_t *data, uint16_t length) {return false;} |
|
|
virtual bool process_bluetooth_HID_data(const uint8_t *data, uint16_t length) {return false;} |
|
|
|
|
|
|
|
|
// Class specific |
|
|
// Class specific |
|
|
void init(); |
|
|
void init(); |
|
|
USBHIDParser *driver_ = nullptr; |
|
|
USBHIDParser *driver_ = nullptr; |
|
|
|
|
|
BluetoothController *btdriver_ = nullptr; |
|
|
|
|
|
|
|
|
joytype_t mapVIDPIDtoJoystickType(uint16_t idVendor, uint16_t idProduct, bool exclude_hid_devices); |
|
|
joytype_t mapVIDPIDtoJoystickType(uint16_t idVendor, uint16_t idProduct, bool exclude_hid_devices); |
|
|
bool transmitPS4UserFeedbackMsg(); |
|
|
bool transmitPS4UserFeedbackMsg(); |
|
|
bool transmitPS3UserFeedbackMsg(); |
|
|
bool transmitPS3UserFeedbackMsg(); |
|
|
|
|
|
|
|
|
enum {BT_CLASS_DEVICE= 0x0804}; // Toy - Robot |
|
|
enum {BT_CLASS_DEVICE= 0x0804}; // Toy - Robot |
|
|
static void driver_ready_for_bluetooth(BTHIDInput *driver); |
|
|
static void driver_ready_for_bluetooth(BTHIDInput *driver); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// BUGBUG version to allow some of the controlled objects to call? |
|
|
|
|
|
|
|
|
|
|
|
void sendL2CapCommand(uint8_t* data, uint8_t nbytes, uint8_t channelLow = 0x01, uint8_t channelHigh = 0x00) { |
|
|
|
|
|
sendL2CapCommand (device_connection_handle_, data, nbytes, channelLow, channelHigh); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
protected: |
|
|
protected: |
|
|
virtual bool claim(Device_t *device, int type, const uint8_t *descriptors, uint32_t len); |
|
|
virtual bool claim(Device_t *device, int type, const uint8_t *descriptors, uint32_t len); |
|
|
virtual void control(const Transfer_t *transfer); |
|
|
virtual void control(const Transfer_t *transfer); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BTHIDInput * find_driver(uint32_t device_type); |
|
|
BTHIDInput * find_driver(uint32_t device_type); |
|
|
private: |
|
|
private: |
|
|
|
|
|
friend class BTHIDInput; |
|
|
static void rx_callback(const Transfer_t *transfer); |
|
|
static void rx_callback(const Transfer_t *transfer); |
|
|
static void rx2_callback(const Transfer_t *transfer); |
|
|
static void rx2_callback(const Transfer_t *transfer); |
|
|
static void tx_callback(const Transfer_t *transfer); |
|
|
static void tx_callback(const Transfer_t *transfer); |