mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Check for IOGEAR GBU521 manually
This commit is contained in:
parent
e1e159b560
commit
64cdcf51f4
2 changed files with 19 additions and 21 deletions
17
BTD.cpp
17
BTD.cpp
|
@ -187,26 +187,21 @@ uint8_t BTD::Init(uint8_t parent, uint8_t port, bool lowspeed) {
|
||||||
// First interface in the configuration must have Bluetooth assigned Class/Subclass/Protocol
|
// First interface in the configuration must have Bluetooth assigned Class/Subclass/Protocol
|
||||||
// And 3 endpoints - interrupt-IN, bulk-IN, bulk-OUT, not necessarily in this order
|
// And 3 endpoints - interrupt-IN, bulk-IN, bulk-OUT, not necessarily in this order
|
||||||
for (uint8_t i = 0; i < num_of_conf; i++) {
|
for (uint8_t i = 0; i < num_of_conf; i++) {
|
||||||
|
if (VID == IOGEAR_GBU521_VID && PID == IOGEAR_GBU521_PID) {
|
||||||
|
ConfigDescParser<USB_CLASS_VENDOR_SPECIFIC, WI_SUBCLASS_RF, WI_PROTOCOL_BT, CP_MASK_COMPARE_ALL> confDescrParser(this); // Needed for the IOGEAR GBU521
|
||||||
|
rcode = pUsb->getConfDescr(bAddress, 0, i, &confDescrParser);
|
||||||
|
} else {
|
||||||
ConfigDescParser<USB_CLASS_WIRELESS_CTRL, WI_SUBCLASS_RF, WI_PROTOCOL_BT, CP_MASK_COMPARE_ALL> confDescrParser(this);
|
ConfigDescParser<USB_CLASS_WIRELESS_CTRL, WI_SUBCLASS_RF, WI_PROTOCOL_BT, CP_MASK_COMPARE_ALL> confDescrParser(this);
|
||||||
rcode = pUsb->getConfDescr(bAddress, 0, i, &confDescrParser);
|
rcode = pUsb->getConfDescr(bAddress, 0, i, &confDescrParser);
|
||||||
if (rcode)
|
}
|
||||||
|
if (rcode) // Check error code
|
||||||
goto FailGetConfDescr;
|
goto FailGetConfDescr;
|
||||||
if (bNumEP >= BTD_MAX_ENDPOINTS) // All endpoints extracted
|
if (bNumEP >= BTD_MAX_ENDPOINTS) // All endpoints extracted
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bNumEP < BTD_MAX_ENDPOINTS) {
|
|
||||||
for (uint8_t i = 0; i < num_of_conf; i++) {
|
|
||||||
ConfigDescParser<USB_CLASS_VENDOR_SPECIFIC, WI_SUBCLASS_RF, WI_PROTOCOL_BT, CP_MASK_COMPARE_ALL> confDescrParser(this); // Needed for the IOGEAR GBU521
|
|
||||||
rcode = pUsb->getConfDescr(bAddress, 0, i, &confDescrParser);
|
|
||||||
if (rcode)
|
|
||||||
goto FailGetConfDescr;
|
|
||||||
if (bNumEP >= BTD_MAX_ENDPOINTS) // All endpoints extracted
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (bNumEP < BTD_MAX_ENDPOINTS)
|
if (bNumEP < BTD_MAX_ENDPOINTS)
|
||||||
goto FailUnknownDevice;
|
goto FailUnknownDevice;
|
||||||
}
|
|
||||||
|
|
||||||
// Assign epInfo to epinfo pointer - this time all 3 endpoins
|
// Assign epInfo to epinfo pointer - this time all 3 endpoins
|
||||||
rcode = pUsb->setEpInfoEntry(bAddress, bNumEP, epInfo);
|
rcode = pUsb->setEpInfoEntry(bAddress, bNumEP, epInfo);
|
||||||
|
|
5
BTD.h
5
BTD.h
|
@ -27,6 +27,9 @@
|
||||||
#define PS3NAVIGATION_PID 0x042F // Navigation controller
|
#define PS3NAVIGATION_PID 0x042F // Navigation controller
|
||||||
#define PS3MOVE_PID 0x03D5 // Motion controller
|
#define PS3MOVE_PID 0x03D5 // Motion controller
|
||||||
|
|
||||||
|
#define IOGEAR_GBU521_VID 0x0A5C // The IOGEAR GBU521 dongle does not presents itself correctly, so we have to check for it manually
|
||||||
|
#define IOGEAR_GBU521_PID 0x4500
|
||||||
|
|
||||||
/* Bluetooth dongle data taken from descriptors */
|
/* Bluetooth dongle data taken from descriptors */
|
||||||
#define BULK_MAXPKTSIZE 64 // max size for ACL data
|
#define BULK_MAXPKTSIZE 64 // max size for ACL data
|
||||||
|
|
||||||
|
@ -209,7 +212,7 @@ public:
|
||||||
* @return Returns true if the device's VID and PID matches this driver.
|
* @return Returns true if the device's VID and PID matches this driver.
|
||||||
*/
|
*/
|
||||||
virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid) {
|
virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid) {
|
||||||
return (vid == PS3_VID && (pid == PS3_PID || pid == PS3NAVIGATION_PID || pid == PS3MOVE_PID));
|
return ((vid == PS3_VID || vid == IOGEAR_GBU521_VID) && (pid == PS3_PID || pid == PS3NAVIGATION_PID || pid == PS3MOVE_PID || pid == IOGEAR_GBU521_PID));
|
||||||
};
|
};
|
||||||
/**@}*/
|
/**@}*/
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue