30 connectToHIDDevice(false),
31 pairWithHIDDevice(false),
50 uint8_t buf[constBufSize];
99 Notify(
PSTR(
"\r\nOut of address space"), 0x80);
113 #ifdef DEBUG_USB_HOST
122 uint8_t
BTD::Init(uint8_t parent, uint8_t port,
bool lowspeed) {
134 #ifdef DEBUG_USB_HOST
144 #ifdef DEBUG_USB_HOST
146 D_PrintHex<uint8_t > (rcode, 0x80);
153 D_PrintHex<uint8_t > (
bAddress, 0x80);
160 #ifdef DEBUG_USB_HOST
170 goto FailSetDevTblEntry;
176 goto FailSetConfDescr;
178 #ifdef DEBUG_USB_HOST
181 Notify(
PSTR(
"\r\nDualshock 3 Controller Connected"), 0x80);
183 Notify(
PSTR(
"\r\nNavigation Controller Connected"), 0x80);
185 Notify(
PSTR(
"\r\nMotion Controller Connected"), 0x80);
189 #ifdef DEBUG_USB_HOST
190 Notify(
PSTR(
"\r\nPlease plug in the dongle before trying to pair with the PS3 Controller\r\nor set the Bluetooth address in the constructor of the PS3BT class"), 0x80);
197 #ifdef DEBUG_USB_HOST
198 Notify(
PSTR(
"\r\nBluetooth Address was set to: "), 0x80);
199 for(int8_t i = 5; i > 0; i--) {
200 D_PrintHex<uint8_t > (
my_bdaddr[i], 0x80);
203 D_PrintHex<uint8_t > (
my_bdaddr[0], 0x80);
215 for(uint8_t i = 0; i < num_of_conf; i++) {
224 goto FailGetConfDescr;
230 goto FailUnknownDevice;
235 goto FailSetDevTblEntry;
240 goto FailSetConfDescr;
242 hci_num_reset_loops = 100;
248 #ifdef DEBUG_USB_HOST
249 Notify(
PSTR(
"\r\nBluetooth Dongle Initialized"), 0x80);
256 #ifdef DEBUG_USB_HOST
262 #ifdef DEBUG_USB_HOST
268 #ifdef DEBUG_USB_HOST
274 #ifdef DEBUG_USB_HOST
280 #ifdef DEBUG_USB_HOST
281 Notify(
PSTR(
"\r\nBTD Init Failed, error code: "), 0x80);
288 void BTD::Initialize() {
298 btService[i]->
Reset();
341 if(pollInterval < pep->bInterval)
348 Notify(
PSTR(
"\r\nEndpoint descriptor:"), 0x80);
350 D_PrintHex<uint8_t > (ep_ptr->
bLength, 0x80);
360 D_PrintHex<uint8_t > (ep_ptr->
bInterval, 0x80);
389 void BTD::HCI_event_task() {
393 if(!rcode || rcode ==
hrNAK) {
398 if((hcibuf[3] == 0x01) && (hcibuf[4] == 0x10)) {
401 }
else if((hcibuf[3] == 0x09) && (hcibuf[4] == 0x10)) {
402 for(uint8_t i = 0; i < 6; i++)
411 #ifdef DEBUG_USB_HOST
412 Notify(
PSTR(
"\r\nHCI Command Failed: "), 0x80);
413 D_PrintHex<uint8_t > (hcibuf[2], 0x80);
421 #ifdef DEBUG_USB_HOST
423 Notify(
PSTR(
"\r\nCouldn't find Wiimote"), 0x80);
425 Notify(
PSTR(
"\r\nCouldn't find HID device"), 0x80);
439 Notify(
PSTR(
"\r\nNumber of responses: "), 0x80);
442 for(uint8_t i = 0; i < hcibuf[2]; i++) {
443 uint8_t offset = 8 * hcibuf[2] + 3 * i;
445 for(uint8_t j = 0; j < 3; j++)
446 classOfDevice[j] = hcibuf[j + 4 + offset];
448 if(
pairWithWii && classOfDevice[2] == 0x00 && (classOfDevice[1] & 0x05) && (classOfDevice[0] & 0x0C)) {
449 if(classOfDevice[0] & 0x08)
454 for(uint8_t j = 0; j < 6; j++)
459 }
else if(
pairWithHIDDevice && (classOfDevice[1] & 0x05) && (classOfDevice[0] & 0xC8)) {
460 #ifdef DEBUG_USB_HOST
461 if(classOfDevice[0] & 0x80)
463 if(classOfDevice[0] & 0x40)
465 if(classOfDevice[0] & 0x08)
469 for(uint8_t j = 0; j < 6; j++)
478 D_PrintHex<uint8_t > (classOfDevice[2], 0x80);
480 D_PrintHex<uint8_t > (classOfDevice[1], 0x80);
482 D_PrintHex<uint8_t > (classOfDevice[0], 0x80);
493 Notify(
PSTR(
"\r\nConnection established"), 0x80);
495 hci_handle = hcibuf[3] | ((hcibuf[4] & 0x0F) << 8);
499 #ifdef DEBUG_USB_HOST
500 Notify(
PSTR(
"\r\nConnection Failed: "), 0x80);
501 D_PrintHex<uint8_t > (hcibuf[2], 0x80);
515 for(uint8_t i = 0; i < min(
sizeof (
remote_name),
sizeof (hcibuf) - 9); i++) {
526 for(uint8_t i = 0; i < 6; i++)
529 for(uint8_t i = 0; i < 3; i++)
530 classOfDevice[i] = hcibuf[i + 8];
532 if((classOfDevice[1] & 0x05) && (classOfDevice[0] & 0xC8)) {
533 #ifdef DEBUG_USB_HOST
534 if(classOfDevice[0] & 0x80)
535 Notify(
PSTR(
"\r\nMouse is connecting"), 0x80);
536 if(classOfDevice[0] & 0x40)
537 Notify(
PSTR(
"\r\nKeyboard is connecting"), 0x80);
538 if(classOfDevice[0] & 0x08)
539 Notify(
PSTR(
"\r\nGamepad is connecting"), 0x80);
546 D_PrintHex<uint8_t > (classOfDevice[2], 0x80);
548 D_PrintHex<uint8_t > (classOfDevice[1], 0x80);
550 D_PrintHex<uint8_t > (classOfDevice[0], 0x80);
557 #ifdef DEBUG_USB_HOST
558 Notify(
PSTR(
"\r\nPairing with wiimote"), 0x80);
561 }
else if(
btdPin != NULL) {
562 #ifdef DEBUG_USB_HOST
563 Notify(
PSTR(
"\r\nBluetooth pin is set too: "), 0x80);
568 #ifdef DEBUG_USB_HOST
576 #ifdef DEBUG_USB_HOST
577 Notify(
PSTR(
"\r\nReceived Key Request"), 0x80);
584 #ifdef DEBUG_USB_HOST
585 Notify(
PSTR(
"\r\nPairing successful with Wiimote"), 0x80);
589 #ifdef DEBUG_USB_HOST
590 Notify(
PSTR(
"\r\nPairing successful with HID device"), 0x80);
610 if(hcibuf[0] != 0x00) {
611 Notify(
PSTR(
"\r\nUnmanaged HCI Event: "), 0x80);
612 D_PrintHex<uint8_t > (hcibuf[0], 0x80);
621 D_PrintHex<uint8_t > (rcode, 0x80);
627 void BTD::HCI_task() {
631 if(hci_counter > hci_num_reset_loops) {
642 #ifdef DEBUG_USB_HOST
647 }
else if(hci_counter > hci_num_reset_loops) {
648 hci_num_reset_loops *= 10;
649 if(hci_num_reset_loops > 2000)
650 hci_num_reset_loops = 2000;
651 #ifdef DEBUG_USB_HOST
652 Notify(
PSTR(
"\r\nNo response to HCI Reset"), 0x80);
661 #ifdef DEBUG_USB_HOST
662 Notify(
PSTR(
"\r\nWrite class of device"), 0x80);
671 #ifdef DEBUG_USB_HOST
672 Notify(
PSTR(
"\r\nLocal Bluetooth Address: "), 0x80);
673 for(int8_t i = 5; i > 0; i--) {
674 D_PrintHex<uint8_t > (
my_bdaddr[i], 0x80);
677 D_PrintHex<uint8_t > (my_bdaddr[0], 0x80);
696 #ifdef DEBUG_USB_HOST
697 Notify(
PSTR(
"\r\nThe name is set to: "), 0x80);
706 #ifdef DEBUG_USB_HOST
708 Notify(
PSTR(
"\r\nStarting inquiry\r\nPress 1 & 2 on the Wiimote\r\nOr press sync if you are using a Wii U Pro Controller"), 0x80);
710 Notify(
PSTR(
"\r\nPlease enable discovery of your device"), 0x80);
721 #ifdef DEBUG_USB_HOST
727 Notify(
PSTR(
"\r\nNow just create the instance like so:"), 0x80);
733 Notify(
PSTR(
"\r\nAnd then press any button on the "), 0x80);
749 #ifdef DEBUG_USB_HOST
751 Notify(
PSTR(
"\r\nConnecting to Wiimote"), 0x80);
753 Notify(
PSTR(
"\r\nConnecting to HID device"), 0x80);
763 #ifdef DEBUG_USB_HOST
765 Notify(
PSTR(
"\r\nConnected to Wiimote"), 0x80);
767 Notify(
PSTR(
"\r\nConnected to HID device"), 0x80);
772 #ifdef DEBUG_USB_HOST
773 Notify(
PSTR(
"\r\nTrying to connect one more time..."), 0x80);
782 #ifdef DEBUG_USB_HOST
783 Notify(
PSTR(
"\r\nWait For Incoming Connection Request"), 0x80);
794 #ifdef DEBUG_USB_HOST
795 Notify(
PSTR(
"\r\nIncoming Connection Request"), 0x80);
805 #ifdef DEBUG_USB_HOST
810 if(strncmp((
const char*)
remote_name,
"Nintendo", 8) == 0) {
812 #ifdef DEBUG_USB_HOST
813 Notify(
PSTR(
"\r\nWiimote is connecting"), 0x80);
815 if(strncmp((
const char*)
remote_name,
"Nintendo RVL-CNT-01-TR", 22) == 0) {
816 #ifdef DEBUG_USB_HOST
817 Notify(
PSTR(
" with Motion Plus Inside"), 0x80);
820 }
else if(strncmp((
const char*)
remote_name,
"Nintendo RVL-CNT-01-UC", 22) == 0) {
821 #ifdef DEBUG_USB_HOST
822 Notify(
PSTR(
" - Wii U Pro Controller"), 0x80);
831 if(classOfDevice[2] == 0 && classOfDevice[1] == 0x25 && classOfDevice[0] == 0x08 && strncmp((
const char*)
remote_name,
"Wireless Controller", 19) == 0) {
832 #ifdef DEBUG_USB_HOST
833 Notify(
PSTR(
"\r\nPS4 controller is connecting"), 0x80);
848 #ifdef DEBUG_USB_HOST
849 Notify(
PSTR(
"\r\nConnected to Device: "), 0x80);
850 for(int8_t i = 5; i > 0; i--) {
854 D_PrintHex<uint8_t > (disc_bdaddr[0], 0x80);
871 if(hci_counter > 1000) {
879 #ifdef DEBUG_USB_HOST
880 Notify(
PSTR(
"\r\nHCI Disconnected from Device"), 0x80);
900 void BTD::ACL_event_task() {
908 btService[i]->
ACLData(l2capinbuf);
913 else if(rcode !=
hrNAK) {
914 Notify(
PSTR(
"\r\nACL data in error: "), 0x80);
915 D_PrintHex<uint8_t > (rcode, 0x80);
929 pUsb->
ctrlReq(
bAddress,
epInfo[
BTD_CONTROL_PIPE ].epAddr,
bmREQ_HCI_OUT, 0x00, 0x00, 0x00, 0x00, nbytes, nbytes, data, NULL);
935 hcibuf[1] = 0x03 << 2;
944 hcibuf[1] = 0x03 << 2;
956 hcibuf[1] = 0x03 << 2;
966 hcibuf[1] = 0x04 << 2;
975 hcibuf[1] = 0x04 << 2;
984 hcibuf[1] = 0x01 << 2;
986 hcibuf[3] = disc_bdaddr[0];
987 hcibuf[4] = disc_bdaddr[1];
988 hcibuf[5] = disc_bdaddr[2];
989 hcibuf[6] = disc_bdaddr[3];
990 hcibuf[7] = disc_bdaddr[4];
991 hcibuf[8] = disc_bdaddr[5];
1000 hcibuf[1] = 0x01 << 2;
1002 hcibuf[3] = disc_bdaddr[0];
1003 hcibuf[4] = disc_bdaddr[1];
1004 hcibuf[5] = disc_bdaddr[2];
1005 hcibuf[6] = disc_bdaddr[3];
1006 hcibuf[7] = disc_bdaddr[4];
1007 hcibuf[8] = disc_bdaddr[5];
1018 hcibuf[1] = 0x03 << 2;
1019 hcibuf[2] = strlen(name) + 1;
1021 for(i = 0; i < strlen(name); i++)
1022 hcibuf[i + 3] = name[i];
1023 hcibuf[i + 3] = 0x00;
1031 hcibuf[1] = 0x01 << 2;
1044 hcibuf[1] = 0x01 << 2;
1057 hcibuf[1] = 0x01 << 2;
1059 hcibuf[3] = bdaddr[0];
1060 hcibuf[4] = bdaddr[1];
1061 hcibuf[5] = bdaddr[2];
1062 hcibuf[6] = bdaddr[3];
1063 hcibuf[7] = bdaddr[4];
1064 hcibuf[8] = bdaddr[5];
1078 hcibuf[1] = 0x01 << 2;
1080 hcibuf[3] = disc_bdaddr[0];
1081 hcibuf[4] = disc_bdaddr[1];
1082 hcibuf[5] = disc_bdaddr[2];
1083 hcibuf[6] = disc_bdaddr[3];
1084 hcibuf[7] = disc_bdaddr[4];
1085 hcibuf[8] = disc_bdaddr[5];
1089 #ifdef DEBUG_USB_HOST
1090 Notify(
PSTR(
"\r\nParing with Wii U Pro Controller"), 0x80);
1092 for(uint8_t i = 0; i < 6; i++)
1095 for(uint8_t i = 0; i < 6; i++)
1096 hcibuf[10 + i] = disc_bdaddr[i];
1098 for(uint8_t i = 16; i < 26; i++)
1101 hcibuf[9] = strlen(
btdPin);
1103 for(i = 0; i < strlen(
btdPin); i++)
1104 hcibuf[i + 10] =
btdPin[i];
1106 hcibuf[i + 10] = 0x00;
1114 hcibuf[1] = 0x01 << 2;
1116 hcibuf[3] = disc_bdaddr[0];
1117 hcibuf[4] = disc_bdaddr[1];
1118 hcibuf[5] = disc_bdaddr[2];
1119 hcibuf[6] = disc_bdaddr[3];
1120 hcibuf[7] = disc_bdaddr[4];
1121 hcibuf[8] = disc_bdaddr[5];
1128 hcibuf[1] = 0x01 << 2;
1130 hcibuf[3] = disc_bdaddr[0];
1131 hcibuf[4] = disc_bdaddr[1];
1132 hcibuf[5] = disc_bdaddr[2];
1133 hcibuf[6] = disc_bdaddr[3];
1134 hcibuf[7] = disc_bdaddr[4];
1135 hcibuf[8] = disc_bdaddr[5];
1142 hcibuf[1] = 0x01 << 2;
1145 hcibuf[4] = (uint8_t)((
hci_handle >> 8) & 0x0F);
1153 hcibuf[1] = 0x01 << 2;
1155 hcibuf[3] = (uint8_t)(handle & 0xFF);
1156 hcibuf[4] = (uint8_t)((handle >> 8) & 0x0F);
1164 hcibuf[1] = 0x03 << 2;
1198 void BTD::L2CAP_Command(uint16_t handle, uint8_t* data, uint8_t nbytes, uint8_t channelLow, uint8_t channelHigh) {
1199 uint8_t buf[8 + nbytes];
1200 buf[0] = (uint8_t)(handle & 0xff);
1201 buf[1] = (uint8_t)(((handle >> 8) & 0x0f) | 0x20);
1202 buf[2] = (uint8_t)((4 + nbytes) & 0xff);
1203 buf[3] = (uint8_t)((4 + nbytes) >> 8);
1204 buf[4] = (uint8_t)(nbytes & 0xff);
1205 buf[5] = (uint8_t)(nbytes >> 8);
1206 buf[6] = channelLow;
1207 buf[7] = channelHigh;
1209 for(uint16_t i = 0; i < nbytes; i++)
1210 buf[8 + i] = data[i];
1215 #ifdef DEBUG_USB_HOST
1216 Notify(
PSTR(
"\r\nError sending L2CAP message: 0x"), 0x80);
1217 D_PrintHex<uint8_t > (rcode, 0x80);
1219 D_PrintHex<uint8_t > (channelHigh, 0x80);
1221 D_PrintHex<uint8_t > (channelLow, 0x80);
1228 l2capoutbuf[1] = rxid;
1229 l2capoutbuf[2] = 0x04;
1230 l2capoutbuf[3] = 0x00;
1231 l2capoutbuf[4] = (uint8_t)(psm & 0xff);
1232 l2capoutbuf[5] = (uint8_t)(psm >> 8);
1233 l2capoutbuf[6] = scid[0];
1234 l2capoutbuf[7] = scid[1];
1241 l2capoutbuf[1] = rxid;
1242 l2capoutbuf[2] = 0x08;
1243 l2capoutbuf[3] = 0x00;
1244 l2capoutbuf[4] = dcid[0];
1245 l2capoutbuf[5] = dcid[1];
1246 l2capoutbuf[6] = scid[0];
1247 l2capoutbuf[7] = scid[1];
1248 l2capoutbuf[8] = result;
1249 l2capoutbuf[9] = 0x00;
1250 l2capoutbuf[10] = 0x00;
1251 l2capoutbuf[11] = 0x00;
1258 l2capoutbuf[1] = rxid;
1259 l2capoutbuf[2] = 0x08;
1260 l2capoutbuf[3] = 0x00;
1261 l2capoutbuf[4] = dcid[0];
1262 l2capoutbuf[5] = dcid[1];
1263 l2capoutbuf[6] = 0x00;
1264 l2capoutbuf[7] = 0x00;
1265 l2capoutbuf[8] = 0x01;
1266 l2capoutbuf[9] = 0x02;
1267 l2capoutbuf[10] = 0xFF;
1268 l2capoutbuf[11] = 0xFF;
1275 l2capoutbuf[1] = rxid;
1276 l2capoutbuf[2] = 0x0A;
1277 l2capoutbuf[3] = 0x00;
1278 l2capoutbuf[4] = scid[0];
1279 l2capoutbuf[5] = scid[1];
1280 l2capoutbuf[6] = 0x00;
1281 l2capoutbuf[7] = 0x00;
1282 l2capoutbuf[8] = 0x00;
1283 l2capoutbuf[9] = 0x00;
1284 l2capoutbuf[10] = 0x01;
1285 l2capoutbuf[11] = 0x02;
1286 l2capoutbuf[12] = 0xA0;
1287 l2capoutbuf[13] = 0x02;
1294 l2capoutbuf[1] = rxid;
1295 l2capoutbuf[2] = 0x04;
1296 l2capoutbuf[3] = 0x00;
1297 l2capoutbuf[4] = dcid[0];
1298 l2capoutbuf[5] = dcid[1];
1299 l2capoutbuf[6] = scid[0];
1300 l2capoutbuf[7] = scid[1];
1307 l2capoutbuf[1] = rxid;
1308 l2capoutbuf[2] = 0x04;
1309 l2capoutbuf[3] = 0x00;
1310 l2capoutbuf[4] = dcid[0];
1311 l2capoutbuf[5] = dcid[1];
1312 l2capoutbuf[6] = scid[0];
1313 l2capoutbuf[7] = scid[1];
1320 l2capoutbuf[1] = rxid;
1321 l2capoutbuf[2] = 0x08;
1322 l2capoutbuf[3] = 0x00;
1323 l2capoutbuf[4] = infoTypeLow;
1324 l2capoutbuf[5] = infoTypeHigh;
1325 l2capoutbuf[6] = 0x00;
1326 l2capoutbuf[7] = 0x00;
1327 l2capoutbuf[8] = 0x00;
1328 l2capoutbuf[9] = 0x00;
1329 l2capoutbuf[10] = 0x00;
1330 l2capoutbuf[11] = 0x00;
1336 void BTD::setBdaddr(uint8_t* bdaddr) {
1342 for(uint8_t i = 0; i < 6; i++)
1343 buf[i + 2] = bdaddr[5 - i];
1346 pUsb->
ctrlReq(
bAddress,
epInfo[
BTD_CONTROL_PIPE].epAddr,
bmREQ_HID_OUT,
HID_REQUEST_SET_REPORT, 0xF5, 0x03, 0x00, 8, 8, buf, NULL);
1349 void BTD::setMoveBdaddr(uint8_t* bdaddr) {
1358 for(uint8_t i = 0; i < 6; i++)
1359 buf[i + 1] = bdaddr[i];
1362 pUsb->
ctrlReq(
bAddress,
epInfo[
BTD_CONTROL_PIPE].epAddr,
bmREQ_HID_OUT,
HID_REQUEST_SET_REPORT, 0x05, 0x03, 0x00, 11, 11, buf, NULL);
static const uint8_t BTD_DATAOUT_PIPE
uint8_t getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t *dataptr)
void l2cap_connection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid, uint8_t result)
#define HCI_SCANNING_STATE
#define USB_ERROR_EPINFO_IS_NULL
void l2cap_connection_request(uint16_t handle, uint8_t rxid, uint8_t *scid, uint16_t psm)
#define EV_COMMAND_STATUS
#define EV_REMOTE_NAME_COMPLETE
bool sdpConnectionClaimed
void l2cap_disconnection_request(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)
bool rfcommConnectionClaimed
#define EV_INQUIRY_COMPLETE
static const uint8_t BTD_EVENT_PIPE
#define HID_REQUEST_SET_REPORT
void hci_write_scan_disable()
#define HCI_SET_NAME_STATE
void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
#define EV_LINK_KEY_REQUEST
#define EV_DATA_BUFFER_OVERFLOW
#define HCI_DISCONNECT_STATE
#define HCI_FLAG_CONNECT_COMPLETE
#define EV_PIN_CODE_REQUEST
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value)
#define EV_AUTHENTICATION_COMPLETE
#define HCI_FLAG_CONNECT_EVENT
#define HCI_FLAG_DISCONNECT_COMPLETE
#define HCI_REMOTE_NAME_STATE
#define USB_ERROR_FailGetDevDescr
#define HCI_FLAG_CMD_COMPLETE
#define NotifyFailGetDevDescr(...)
uint8_t setEpInfoEntry(uint8_t addr, uint8_t epcount, EpInfo *eprecord_ptr)
#define EV_MAX_SLOTS_CHANGE
static const uint8_t BTD_DATAIN_PIPE
void hci_set_local_name(const char *name)
#define EV_QOS_SETUP_COMPLETE
void hci_write_scan_enable()
virtual void FreeAddress(uint8_t addr)=0
void l2cap_disconnection_response(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)
uint8_t ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bRequest, uint8_t wValLo, uint8_t wValHi, uint16_t wInd, uint16_t total, uint16_t nbytes, uint8_t *dataptr, USBReadParser *p)
virtual UsbDevice * GetUsbDevicePtr(uint8_t addr)=0
#define HCI_CONNECT_DEVICE_STATE
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr)
#define NotifyFailGetConfDescr(...)
#define NotifyFailUnknownDevice(...)
#define USB_NAK_MAX_POWER
#define EV_CONNECT_COMPLETE
void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)
#define EV_DISCONNECT_COMPLETE
#define HCI_FLAG_READ_BDADDR
#define IOGEAR_GBU521_PID
uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)
#define HCI_LOCAL_VERSION_STATE
virtual void disconnect()=0
uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
void hci_disconnect(uint16_t handle)
uint8_t outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *data)
void hci_inquiry_cancel()
#define L2CAP_CMD_INFORMATION_RESPONSE
#define EV_INCOMING_CONNECT
#define HCI_CONNECT_IN_STATE
#define HCI_INQUIRY_STATE
virtual uint8_t AllocAddress(uint8_t parent, bool is_hub=false, uint8_t port=0)=0
#define HCI_CONNECTED_STATE
#define EV_INQUIRY_RESULT
#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE
#define L2CAP_CMD_CONFIG_REQUEST
#define L2CAP_CMD_DISCONNECT_REQUEST
static const uint8_t BTD_CONTROL_PIPE
#define HCI_FLAG_READ_VERSION
bool l2capConnectionClaimed
#define HCI_FLAG_INCOMING_REQUEST
#define EV_NUM_COMPLETE_PKT
#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL
EpInfo epInfo[BTD_MAX_ENDPOINTS]
#define IOGEAR_GBU521_VID
uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t *data)
#define BTD_MAX_ENDPOINTS
#define PS3NAVIGATION_PID
#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED
#define L2CAP_CMD_DISCONNECT_RESPONSE
#define EV_READ_REMOTE_VERSION_INFORMATION_COMPLETE
#define EV_COMMAND_COMPLETE
void l2cap_information_response(uint16_t handle, uint8_t rxid, uint8_t infoTypeLow, uint8_t infoTypeHigh)
#define L2CAP_CMD_CONNECTION_RESPONSE
#define L2CAP_CMD_CONFIG_RESPONSE
#define hci_set_flag(flag)
void hci_write_class_of_device()
#define HCI_CONNECTED_DEVICE_STATE
void hci_pin_code_negative_request_reply()
#define EV_CHANGE_CONNECTION_LINK
virtual void ACLData(uint8_t *ACLData)=0
uint8_t bNumConfigurations
#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
#define hci_check_flag(flag)
AddressPool & GetAddressPool()
#define HCI_CHECK_DEVICE_SERVICE
void hci_link_key_request_negative_reply()
#define EV_LOOPBACK_COMMAND
void L2CAP_Command(uint16_t handle, uint8_t *data, uint8_t nbytes, uint8_t channelLow=0x01, uint8_t channelHigh=0x00)
#define EV_LINK_KEY_NOTIFICATION
void l2cap_config_response(uint16_t handle, uint8_t rxid, uint8_t *scid)
void l2cap_config_request(uint16_t handle, uint8_t rxid, uint8_t *dcid)
void hci_pin_code_request_reply()
#define L2CAP_CMD_CONNECTION_REQUEST
uint8_t RegisterDeviceClass(USBDeviceConfig *pdev)
#define EV_ENCRYPTION_CHANGE
#define NotifyFailSetConfDescr(...)
#define hci_clear_flag(flag)
void hci_authentication_request()
void hci_read_local_version_information()
#define HCI_FLAG_REMOTE_NAME_COMPLETE
void hci_accept_connection()
#define EV_PAGE_SCAN_REP_MODE
#define HCI_FLAG_DEVICE_FOUND
uint8_t getDevDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t *dataptr)
defined(USB_METHODS_INLINE)
#define NotifyFailSetDevTblEntry(...)
#define USB_ERROR_CONFIG_REQUIRES_ADDITIONAL_RESET
void HCI_Command(uint8_t *data, uint16_t nbytes)