30 connectToHIDDevice(false),
31 pairWithHIDDevice(false),
50 uint8_t buf[constBufSize];
59 Notify(PSTR(
"\r\nBTD ConfigureDevice"), 0x80);
64 Notify(PSTR(
"\r\nAddress in use"), 0x80);
72 Notify(PSTR(
"\r\nAddress not found"), 0x80);
79 Notify(PSTR(
"\r\nepinfo is null"), 0x80);
98 Notify(PSTR(
"\r\nOut of address space"), 0x80);
112 #ifdef DEBUG_USB_HOST
121 uint8_t
BTD::Init(uint8_t parent, uint8_t port,
bool lowspeed) {
128 Notify(PSTR(
"\r\nBTD Init"), 0x80);
133 #ifdef DEBUG_USB_HOST
134 Notify(PSTR(
"\r\nAddress not found"), 0x80);
143 #ifdef DEBUG_USB_HOST
144 Notify(PSTR(
"\r\nsetAddr: "), 0x80);
145 D_PrintHex<uint8_t > (rcode, 0x80);
151 Notify(PSTR(
"\r\nAddr: "), 0x80);
152 D_PrintHex<uint8_t > (
bAddress, 0x80);
159 #ifdef DEBUG_USB_HOST
160 Notify(PSTR(
"\r\nAddress not found"), 0x80);
169 goto FailSetDevTblEntry;
175 goto FailSetConfDescr;
177 #ifdef DEBUG_USB_HOST
180 Notify(PSTR(
"\r\nDualshock 3 Controller Connected"), 0x80);
182 Notify(PSTR(
"\r\nNavigation Controller Connected"), 0x80);
184 Notify(PSTR(
"\r\nMotion Controller Connected"), 0x80);
188 #ifdef DEBUG_USB_HOST
189 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);
196 #ifdef DEBUG_USB_HOST
197 Notify(PSTR(
"\r\nBluetooth Address was set to: "), 0x80);
198 for (int8_t i = 5; i > 0; i--) {
199 D_PrintHex<uint8_t > (
my_bdaddr[i], 0x80);
202 D_PrintHex<uint8_t > (
my_bdaddr[0], 0x80);
214 for (uint8_t i = 0; i < num_of_conf; i++) {
223 goto FailGetConfDescr;
229 goto FailUnknownDevice;
234 goto FailSetDevTblEntry;
239 goto FailSetConfDescr;
241 hci_num_reset_loops = 100;
247 #ifdef DEBUG_USB_HOST
248 Notify(PSTR(
"\r\nBluetooth Dongle Initialized"), 0x80);
255 #ifdef DEBUG_USB_HOST
261 #ifdef DEBUG_USB_HOST
267 #ifdef DEBUG_USB_HOST
273 #ifdef DEBUG_USB_HOST
279 #ifdef DEBUG_USB_HOST
285 #ifdef DEBUG_USB_HOST
286 Notify(PSTR(
"\r\nBTD Init Failed, error code: "), 0x80);
293 void BTD::clearAllVariables() {
303 btService[i]->
Reset();
345 if (pollInterval < pep->bInterval)
352 Notify(PSTR(
"\r\nEndpoint descriptor:"), 0x80);
353 Notify(PSTR(
"\r\nLength:\t\t"), 0x80);
354 D_PrintHex<uint8_t > (ep_ptr->
bLength, 0x80);
355 Notify(PSTR(
"\r\nType:\t\t"), 0x80);
357 Notify(PSTR(
"\r\nAddress:\t"), 0x80);
359 Notify(PSTR(
"\r\nAttributes:\t"), 0x80);
361 Notify(PSTR(
"\r\nMaxPktSize:\t"), 0x80);
363 Notify(PSTR(
"\r\nPoll Intrv:\t"), 0x80);
364 D_PrintHex<uint8_t > (ep_ptr->
bInterval, 0x80);
386 void BTD::HCI_event_task() {
390 if (!rcode || rcode ==
hrNAK)
397 if ((hcibuf[3] == 0x01) && (hcibuf[4] == 0x10)) {
400 }
else if ((hcibuf[3] == 0x09) && (hcibuf[4] == 0x10)) {
401 for (uint8_t i = 0; i < 6; i++)
410 #ifdef DEBUG_USB_HOST
411 Notify(PSTR(
"\r\nHCI Command Failed: "), 0x80);
412 D_PrintHex<uint8_t > (hcibuf[2], 0x80);
420 #ifdef DEBUG_USB_HOST
422 Notify(PSTR(
"\r\nCouldn't find Wiimote"), 0x80);
424 Notify(PSTR(
"\r\nCouldn't find HID device"), 0x80);
438 Notify(PSTR(
"\r\nNumber of responses: "), 0x80);
441 for (uint8_t i = 0; i < hcibuf[2]; i++) {
442 uint8_t offset = 8 * hcibuf[2] + 3 * i;
443 uint8_t classOfDevice[3];
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] & 0xC0)) {
460 #ifdef DEBUG_USB_HOST
461 if (classOfDevice[0] & 0x80)
462 Notify(PSTR(
"\r\nMouse found"), 0x80);
463 if (classOfDevice[0] & 0x40)
464 Notify(PSTR(
"\r\nKeyboard found"), 0x80);
467 for (uint8_t j = 0; j < 6; j++)
474 Notify(PSTR(
"\r\nClass of device: "), 0x80);
475 D_PrintHex<uint8_t > (classOfDevice[2], 0x80);
477 D_PrintHex<uint8_t > (classOfDevice[1], 0x80);
479 D_PrintHex<uint8_t > (classOfDevice[0], 0x80);
490 Notify(PSTR(
"\r\nConnection established"), 0x80);
492 hci_handle = hcibuf[3] | ((hcibuf[4] & 0x0F) << 8);
496 #ifdef DEBUG_USB_HOST
497 Notify(PSTR(
"\r\nConnection Failed: "), 0x80);
498 D_PrintHex<uint8_t > (hcibuf[2], 0x80);
512 for (uint8_t i = 0; i < min(
sizeof (
remote_name),
sizeof (hcibuf) - 9); i++)
519 for (uint8_t i = 0; i < 6; i++)
522 if ((hcibuf[9] & 0x05) && (hcibuf[8] & 0xC0)) {
523 #ifdef DEBUG_USB_HOST
524 if (hcibuf[8] & 0x80)
525 Notify(PSTR(
"\r\nMouse is connecting"), 0x80);
526 if (hcibuf[8] & 0x40)
527 Notify(PSTR(
"\r\nKeyboard is connecting"), 0x80);
533 Notify(PSTR(
"\r\nClass of device: "), 0x80);
534 D_PrintHex<uint8_t > (hcibuf[10], 0x80);
536 D_PrintHex<uint8_t > (hcibuf[9], 0x80);
538 D_PrintHex<uint8_t > (hcibuf[8], 0x80);
545 #ifdef DEBUG_USB_HOST
546 Notify(PSTR(
"\r\nPairing with wiimote"), 0x80);
549 }
else if (
btdPin != NULL) {
550 #ifdef DEBUG_USB_HOST
551 Notify(PSTR(
"\r\nBluetooth pin is set too: "), 0x80);
556 #ifdef DEBUG_USB_HOST
557 Notify(PSTR(
"\r\nNo pin was set"), 0x80);
564 #ifdef DEBUG_USB_HOST
565 Notify(PSTR(
"\r\nReceived Key Request"), 0x80);
572 #ifdef DEBUG_USB_HOST
573 Notify(PSTR(
"\r\nPairing successful with Wiimote"), 0x80);
577 #ifdef DEBUG_USB_HOST
578 Notify(PSTR(
"\r\nPairing successful with HID device"), 0x80);
598 if (hcibuf[0] != 0x00) {
599 Notify(PSTR(
"\r\nUnmanaged HCI Event: "), 0x80);
600 D_PrintHex<uint8_t > (hcibuf[0], 0x80);
608 Notify(PSTR(
"\r\nHCI event error: "), 0x80);
609 D_PrintHex<uint8_t > (rcode, 0x80);
616 void BTD::HCI_task() {
620 if (hci_counter > hci_num_reset_loops) {
631 #ifdef DEBUG_USB_HOST
632 Notify(PSTR(
"\r\nHCI Reset complete"), 0x80);
636 }
else if (hci_counter > hci_num_reset_loops) {
637 hci_num_reset_loops *= 10;
638 if (hci_num_reset_loops > 2000)
639 hci_num_reset_loops = 2000;
640 #ifdef DEBUG_USB_HOST
641 Notify(PSTR(
"\r\nNo response to HCI Reset"), 0x80);
650 #ifdef DEBUG_USB_HOST
651 Notify(PSTR(
"\r\nWrite class of device"), 0x80);
660 #ifdef DEBUG_USB_HOST
661 Notify(PSTR(
"\r\nLocal Bluetooth Address: "), 0x80);
662 for (int8_t i = 5; i > 0; i--) {
663 D_PrintHex<uint8_t > (
my_bdaddr[i], 0x80);
666 D_PrintHex<uint8_t > (my_bdaddr[0], 0x80);
685 #ifdef DEBUG_USB_HOST
686 Notify(PSTR(
"\r\nThe name is set to: "), 0x80);
695 #ifdef DEBUG_USB_HOST
697 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);
699 Notify(PSTR(
"\r\nPlease enable discovery of your device"), 0x80);
710 #ifdef DEBUG_USB_HOST
712 Notify(PSTR(
"\r\nWiimote found"), 0x80);
714 Notify(PSTR(
"\r\nHID device found"), 0x80);
716 Notify(PSTR(
"\r\nNow just create the instance like so:"), 0x80);
718 Notify(PSTR(
"\r\nWII Wii(&Btd);"), 0x80);
720 Notify(PSTR(
"\r\nBTHID hid(&Btd);"), 0x80);
722 Notify(PSTR(
"\r\nAnd then press any button on the "), 0x80);
724 Notify(PSTR(
"Wiimote"), 0x80);
726 Notify(PSTR(
"device"), 0x80);
738 #ifdef DEBUG_USB_HOST
740 Notify(PSTR(
"\r\nConnecting to Wiimote"), 0x80);
742 Notify(PSTR(
"\r\nConnecting to HID device"), 0x80);
752 #ifdef DEBUG_USB_HOST
754 Notify(PSTR(
"\r\nConnected to Wiimote"), 0x80);
756 Notify(PSTR(
"\r\nConnected to HID device"), 0x80);
761 #ifdef DEBUG_USB_HOST
762 Notify(PSTR(
"\r\nTrying to connect one more time..."), 0x80);
771 #ifdef DEBUG_USB_HOST
772 Notify(PSTR(
"\r\nWait For Incoming Connection Request"), 0x80);
783 #ifdef DEBUG_USB_HOST
784 Notify(PSTR(
"\r\nIncoming Connection Request"), 0x80);
794 #ifdef DEBUG_USB_HOST
795 Notify(PSTR(
"\r\nRemote Name: "), 0x80);
796 for (uint8_t i = 0; i < 30; i++) {
802 if (strncmp((
const char*)
remote_name,
"Nintendo", 8) == 0) {
804 #ifdef DEBUG_USB_HOST
805 Notify(PSTR(
"\r\nWiimote is connecting"), 0x80);
807 if (strncmp((
const char*)
remote_name,
"Nintendo RVL-CNT-01-TR", 22) == 0) {
808 #ifdef DEBUG_USB_HOST
809 Notify(PSTR(
" with Motion Plus Inside"), 0x80);
812 }
else if (strncmp((
const char*)
remote_name,
"Nintendo RVL-CNT-01-UC", 22) == 0) {
813 #ifdef DEBUG_USB_HOST
814 Notify(PSTR(
" - Wii U Pro Controller"), 0x80);
834 #ifdef DEBUG_USB_HOST
835 Notify(PSTR(
"\r\nConnected to Device: "), 0x80);
836 for (int8_t i = 5; i > 0; i--) {
840 D_PrintHex<uint8_t > (disc_bdaddr[0], 0x80);
854 if (hci_counter > 1000) {
862 #ifdef DEBUG_USB_HOST
863 Notify(PSTR(
"\r\nHCI Disconnected from Device"), 0x80);
889 void BTD::ACL_event_task() {
895 btService[i]->
ACLData(l2capinbuf);
898 else if (rcode !=
hrNAK) {
899 Notify(PSTR(
"\r\nACL data in error: "), 0x80);
900 D_PrintHex<uint8_t > (rcode, 0x80);
914 pUsb->
ctrlReq(
bAddress,
epInfo[
BTD_CONTROL_PIPE ].epAddr,
bmREQ_HCI_OUT, 0x00, 0x00, 0x00, 0x00, nbytes, nbytes, data, NULL);
920 hcibuf[1] = 0x03 << 2;
929 hcibuf[1] = 0x03 << 2;
941 hcibuf[1] = 0x03 << 2;
950 hcibuf[1] = 0x04 << 2;
958 hcibuf[1] = 0x04 << 2;
967 hcibuf[1] = 0x01 << 2;
983 hcibuf[1] = 0x01 << 2;
1001 hcibuf[1] = 0x03 << 2;
1002 hcibuf[2] = strlen(name) + 1;
1004 for (i = 0; i < strlen(name); i++)
1005 hcibuf[i + 3] = name[i];
1006 hcibuf[i + 3] = 0x00;
1014 hcibuf[1] = 0x01 << 2;
1027 hcibuf[1] = 0x01 << 2;
1040 hcibuf[1] = 0x01 << 2;
1042 hcibuf[3] = bdaddr[0];
1043 hcibuf[4] = bdaddr[1];
1044 hcibuf[5] = bdaddr[2];
1045 hcibuf[6] = bdaddr[3];
1046 hcibuf[7] = bdaddr[4];
1047 hcibuf[8] = bdaddr[5];
1061 hcibuf[1] = 0x01 << 2;
1072 #ifdef DEBUG_USB_HOST
1073 Notify(PSTR(
"\r\nParing with Wii U Pro Controller"), 0x80);
1075 for (uint8_t i = 0; i < 6; i++)
1078 for (uint8_t i = 0; i < 6; i++)
1081 for (uint8_t i = 16; i < 26; i++)
1084 hcibuf[9] = strlen(
btdPin);
1086 for (i = 0; i < strlen(
btdPin); i++)
1087 hcibuf[i + 10] =
btdPin[i];
1089 hcibuf[i + 10] = 0x00;
1097 hcibuf[1] = 0x01 << 2;
1111 hcibuf[1] = 0x01 << 2;
1125 hcibuf[1] = 0x01 << 2;
1128 hcibuf[4] = (uint8_t)((
hci_handle >> 8) & 0x0F);
1136 hcibuf[1] = 0x01 << 2;
1138 hcibuf[3] = (uint8_t)(handle & 0xFF);
1139 hcibuf[4] = (uint8_t)((handle >> 8) & 0x0F);
1147 hcibuf[1] = 0x03 << 2;
1181 void BTD::L2CAP_Command(uint16_t handle, uint8_t* data, uint8_t nbytes, uint8_t channelLow, uint8_t channelHigh) {
1182 uint8_t buf[8 + nbytes];
1183 buf[0] = (uint8_t)(handle & 0xff);
1184 buf[1] = (uint8_t)(((handle >> 8) & 0x0f) | 0x20);
1185 buf[2] = (uint8_t)((4 + nbytes) & 0xff);
1186 buf[3] = (uint8_t)((4 + nbytes) >> 8);
1187 buf[4] = (uint8_t)(nbytes & 0xff);
1188 buf[5] = (uint8_t)(nbytes >> 8);
1189 buf[6] = channelLow;
1190 buf[7] = channelHigh;
1192 for (uint16_t i = 0; i < nbytes; i++)
1193 buf[8 + i] = data[i];
1198 #ifdef DEBUG_USB_HOST
1199 Notify(PSTR(
"\r\nError sending L2CAP message: 0x"), 0x80);
1200 D_PrintHex<uint8_t > (rcode, 0x80);
1201 Notify(PSTR(
" - Channel ID: "), 0x80);
1202 D_PrintHex<uint8_t > (channelHigh, 0x80);
1204 D_PrintHex<uint8_t > (channelLow, 0x80);
1211 l2capoutbuf[1] = rxid;
1212 l2capoutbuf[2] = 0x04;
1213 l2capoutbuf[3] = 0x00;
1214 l2capoutbuf[4] = (uint8_t)(psm & 0xff);
1215 l2capoutbuf[5] = (uint8_t)(psm >> 8);
1216 l2capoutbuf[6] = scid[0];
1217 l2capoutbuf[7] = scid[1];
1224 l2capoutbuf[1] = rxid;
1225 l2capoutbuf[2] = 0x08;
1226 l2capoutbuf[3] = 0x00;
1227 l2capoutbuf[4] = dcid[0];
1228 l2capoutbuf[5] = dcid[1];
1229 l2capoutbuf[6] = scid[0];
1230 l2capoutbuf[7] = scid[1];
1231 l2capoutbuf[8] = result;
1232 l2capoutbuf[9] = 0x00;
1233 l2capoutbuf[10] = 0x00;
1234 l2capoutbuf[11] = 0x00;
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] = 0x00;
1247 l2capoutbuf[7] = 0x00;
1248 l2capoutbuf[8] = 0x01;
1249 l2capoutbuf[9] = 0x02;
1250 l2capoutbuf[10] = 0xFF;
1251 l2capoutbuf[11] = 0xFF;
1258 l2capoutbuf[1] = rxid;
1259 l2capoutbuf[2] = 0x0A;
1260 l2capoutbuf[3] = 0x00;
1261 l2capoutbuf[4] = scid[0];
1262 l2capoutbuf[5] = scid[1];
1263 l2capoutbuf[6] = 0x00;
1264 l2capoutbuf[7] = 0x00;
1265 l2capoutbuf[8] = 0x00;
1266 l2capoutbuf[9] = 0x00;
1267 l2capoutbuf[10] = 0x01;
1268 l2capoutbuf[11] = 0x02;
1269 l2capoutbuf[12] = 0xA0;
1270 l2capoutbuf[13] = 0x02;
1277 l2capoutbuf[1] = rxid;
1278 l2capoutbuf[2] = 0x04;
1279 l2capoutbuf[3] = 0x00;
1280 l2capoutbuf[4] = dcid[0];
1281 l2capoutbuf[5] = dcid[1];
1282 l2capoutbuf[6] = scid[0];
1283 l2capoutbuf[7] = scid[1];
1290 l2capoutbuf[1] = rxid;
1291 l2capoutbuf[2] = 0x04;
1292 l2capoutbuf[3] = 0x00;
1293 l2capoutbuf[4] = dcid[0];
1294 l2capoutbuf[5] = dcid[1];
1295 l2capoutbuf[6] = scid[0];
1296 l2capoutbuf[7] = scid[1];
1303 l2capoutbuf[1] = rxid;
1304 l2capoutbuf[2] = 0x08;
1305 l2capoutbuf[3] = 0x00;
1306 l2capoutbuf[4] = infoTypeLow;
1307 l2capoutbuf[5] = infoTypeHigh;
1308 l2capoutbuf[6] = 0x00;
1309 l2capoutbuf[7] = 0x00;
1310 l2capoutbuf[8] = 0x00;
1311 l2capoutbuf[9] = 0x00;
1312 l2capoutbuf[10] = 0x00;
1313 l2capoutbuf[11] = 0x00;
1319 void BTD::setBdaddr(uint8_t* bdaddr) {
1325 for (uint8_t i = 0; i < 6; i++)
1326 buf[i + 2] = bdaddr[5 - i];
1329 pUsb->
ctrlReq(
bAddress,
epInfo[
BTD_CONTROL_PIPE].epAddr,
bmREQ_HID_OUT,
HID_REQUEST_SET_REPORT, 0xF5, 0x03, 0x00, 8, 8, buf, NULL);
1332 void BTD::setMoveBdaddr(uint8_t* bdaddr) {
1341 for (uint8_t i = 0; i < 6; i++)
1342 buf[i + 1] = bdaddr[i];
1345 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
#define hci_read_bdaddr_complete
static const uint8_t BTD_EVENT_PIPE
void hci_write_scan_disable()
#define HCI_SET_NAME_STATE
virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)
#define HCI_FLAG_CONN_COMPLETE
#define EV_LINK_KEY_REQUEST
#define hci_incoming_connect_request
#define EV_DATA_BUFFER_OVERFLOW
#define HCI_DISCONNECT_STATE
#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_DISCONN_COMPLETE
#define HCI_FLAG_CONNECT_EVENT
#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 uint8_t Release()
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 hci_remote_name_complete
#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 hci_read_version_complete
#define IOGEAR_GBU521_PID
virtual uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)
#define HCI_LOCAL_VERSION_STATE
virtual 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 HID_REQUEST_SET_REPORT
#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
virtual void ACLData(uint8_t *ACLData)
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
#define hci_connect_event
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
void hci_write_class_of_device()
#define HCI_CONNECTED_DEVICE_STATE
void hci_pin_code_negative_request_reply()
#define EV_CHANGE_CONNECTION_LINK
#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
AddressPool & GetAddressPool()
#define HCI_CHECK_DEVICE_SERVICE
void hci_link_key_request_negative_reply()
#define hci_connect_complete
#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(...)
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_disconnect_complete
#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)