48 uint8_t buf[constBufSize];
57 Notify(PSTR(
"\r\nBTD ConfigureDevice"), 0x80);
62 Notify(PSTR(
"\r\nAddress in use"), 0x80);
70 Notify(PSTR(
"\r\nAddress not found"), 0x80);
77 Notify(PSTR(
"\r\nepinfo is null"), 0x80);
96 Notify(PSTR(
"\r\nOut of address space"), 0x80);
110 #ifdef DEBUG_USB_HOST
119 uint8_t
BTD::Init(uint8_t parent, uint8_t port,
bool lowspeed) {
126 Notify(PSTR(
"\r\nBTD Init"), 0x80);
131 #ifdef DEBUG_USB_HOST
132 Notify(PSTR(
"\r\nAddress not found"), 0x80);
141 #ifdef DEBUG_USB_HOST
142 Notify(PSTR(
"\r\nsetAddr: "), 0x80);
143 D_PrintHex<uint8_t > (rcode, 0x80);
149 Notify(PSTR(
"\r\nAddr: "), 0x80);
150 D_PrintHex<uint8_t > (
bAddress, 0x80);
157 #ifdef DEBUG_USB_HOST
158 Notify(PSTR(
"\r\nAddress not found"), 0x80);
167 goto FailSetDevTblEntry;
173 goto FailSetConfDescr;
175 #ifdef DEBUG_USB_HOST
178 Notify(PSTR(
"\r\nDualshock 3 Controller Connected"), 0x80);
180 Notify(PSTR(
"\r\nNavigation Controller Connected"), 0x80);
182 Notify(PSTR(
"\r\nMotion Controller Connected"), 0x80);
186 #ifdef DEBUG_USB_HOST
187 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);
194 #ifdef DEBUG_USB_HOST
195 Notify(PSTR(
"\r\nBluetooth Address was set to: "), 0x80);
196 for (int8_t i = 5; i > 0; i--) {
197 D_PrintHex<uint8_t > (
my_bdaddr[i], 0x80);
200 D_PrintHex<uint8_t > (
my_bdaddr[0], 0x80);
212 for (uint8_t i = 0; i < num_of_conf; i++) {
221 goto FailGetConfDescr;
227 goto FailUnknownDevice;
232 goto FailSetDevTblEntry;
237 goto FailSetConfDescr;
239 hci_num_reset_loops = 100;
245 #ifdef DEBUG_USB_HOST
246 Notify(PSTR(
"\r\nBluetooth Dongle Initialized"), 0x80);
253 #ifdef DEBUG_USB_HOST
259 #ifdef DEBUG_USB_HOST
265 #ifdef DEBUG_USB_HOST
271 #ifdef DEBUG_USB_HOST
277 #ifdef DEBUG_USB_HOST
283 #ifdef DEBUG_USB_HOST
284 Notify(PSTR(
"\r\nBTD Init Failed, error code: "), 0x80);
291 void BTD::clearAllVariables() {
301 btService[i]->
Reset();
341 if (pollInterval < pep->bInterval)
348 Notify(PSTR(
"\r\nEndpoint descriptor:"), 0x80);
349 Notify(PSTR(
"\r\nLength:\t\t"), 0x80);
350 D_PrintHex<uint8_t > (ep_ptr->
bLength, 0x80);
351 Notify(PSTR(
"\r\nType:\t\t"), 0x80);
353 Notify(PSTR(
"\r\nAddress:\t"), 0x80);
355 Notify(PSTR(
"\r\nAttributes:\t"), 0x80);
357 Notify(PSTR(
"\r\nMaxPktSize:\t"), 0x80);
359 Notify(PSTR(
"\r\nPoll Intrv:\t"), 0x80);
360 D_PrintHex<uint8_t > (ep_ptr->
bInterval, 0x80);
382 void BTD::HCI_event_task() {
386 if (!rcode || rcode ==
hrNAK)
393 if ((hcibuf[3] == 0x01) && (hcibuf[4] == 0x10)) {
396 }
else if ((hcibuf[3] == 0x09) && (hcibuf[4] == 0x10)) {
397 for (uint8_t i = 0; i < 6; i++)
406 #ifdef DEBUG_USB_HOST
407 Notify(PSTR(
"\r\nHCI Command Failed: "), 0x80);
408 D_PrintHex<uint8_t > (hcibuf[2], 0x80);
410 D_PrintHex<uint8_t > (hcibuf[4], 0x80);
412 D_PrintHex<uint8_t > (hcibuf[5], 0x80);
420 #ifdef DEBUG_USB_HOST
421 Notify(PSTR(
"\r\nCouldn't find Wiimote"), 0x80);
433 Notify(PSTR(
"\r\nNumber of responses: "), 0x80);
436 for (uint8_t i = 0; i < hcibuf[2]; i++) {
437 if ((hcibuf[4 + 8 * hcibuf[2] + 3 * i] == 0x04 && hcibuf[5 + 8 * hcibuf[2] + 3 * i] == 0x25 && hcibuf[6 + 8 * hcibuf[2] + 3 * i] == 0x00) || (hcibuf[4 + 8 * hcibuf[2] + 3 * i] == 0x08 && hcibuf[5 + 8 * hcibuf[2] + 3 * i] == 0x05 && hcibuf[6 + 8 * hcibuf[2] + 3 * i] == 0x00)) {
438 if (hcibuf[4 + 8 * hcibuf[2] + 3 * i] == 0x08)
453 Notify(PSTR(
"\r\nClass of device: "), 0x80);
454 D_PrintHex<uint8_t > (hcibuf[6 + 8 * hcibuf[2] + 3 * i], 0x80);
456 D_PrintHex<uint8_t > (hcibuf[5 + 8 * hcibuf[2] + 3 * i], 0x80);
458 D_PrintHex<uint8_t > (hcibuf[4 + 8 * hcibuf[2] + 3 * i], 0x80);
468 hci_handle = hcibuf[3] | ((hcibuf[4] & 0x0F) << 8);
471 #ifdef DEBUG_USB_HOST
473 Notify(PSTR(
"\r\nConnection Failed"), 0x80);
488 for (uint8_t i = 0; i < min(
sizeof (
remote_name),
sizeof (hcibuf) - 9); i++)
502 Notify(PSTR(
"\r\nClass of device: "), 0x80);
503 D_PrintHex<uint8_t > (hcibuf[10], 0x80);
505 D_PrintHex<uint8_t > (hcibuf[9], 0x80);
507 D_PrintHex<uint8_t > (hcibuf[8], 0x80);
514 #ifdef DEBUG_USB_HOST
515 Notify(PSTR(
"\r\nPairing with wiimote"), 0x80);
518 }
else if (
btdPin != NULL) {
519 #ifdef DEBUG_USB_HOST
520 Notify(PSTR(
"\r\nBluetooth pin is set too: "), 0x80);
525 #ifdef DEBUG_USB_HOST
526 Notify(PSTR(
"\r\nNo pin was set"), 0x80);
533 #ifdef DEBUG_USB_HOST
534 Notify(PSTR(
"\r\nReceived Key Request"), 0x80);
541 #ifdef DEBUG_USB_HOST
542 Notify(PSTR(
"\r\nPairing successful"), 0x80);
562 if (hcibuf[0] != 0x00) {
563 Notify(PSTR(
"\r\nUnmanaged HCI Event: "), 0x80);
564 D_PrintHex<uint8_t > (hcibuf[0], 0x80);
572 Notify(PSTR(
"\r\nHCI event error: "), 0x80);
573 D_PrintHex<uint8_t > (rcode, 0x80);
580 void BTD::HCI_task() {
584 if (hci_counter > hci_num_reset_loops) {
595 #ifdef DEBUG_USB_HOST
596 Notify(PSTR(
"\r\nHCI Reset complete"), 0x80);
600 }
else if (hci_counter > hci_num_reset_loops) {
601 hci_num_reset_loops *= 10;
602 if (hci_num_reset_loops > 2000)
603 hci_num_reset_loops = 2000;
604 #ifdef DEBUG_USB_HOST
605 Notify(PSTR(
"\r\nNo response to HCI Reset"), 0x80);
614 #ifdef DEBUG_USB_HOST
615 Notify(PSTR(
"\r\nWrite class of device"), 0x80);
624 #ifdef DEBUG_USB_HOST
625 Notify(PSTR(
"\r\nLocal Bluetooth Address: "), 0x80);
626 for (int8_t i = 5; i > 0; i--) {
627 D_PrintHex<uint8_t > (
my_bdaddr[i], 0x80);
630 D_PrintHex<uint8_t > (my_bdaddr[0], 0x80);
649 #ifdef DEBUG_USB_HOST
650 Notify(PSTR(
"\r\nThe name is set to: "), 0x80);
659 #ifdef DEBUG_USB_HOST
660 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);
671 #ifdef DEBUG_USB_HOST
672 Notify(PSTR(
"\r\nWiimote found"), 0x80);
673 Notify(PSTR(
"\r\nNow just create the instance like so:"), 0x80);
674 Notify(PSTR(
"\r\nWII Wii(&Btd);"), 0x80);
675 Notify(PSTR(
"\r\nAnd then press any button on the Wiimote"), 0x80);
687 #ifdef DEBUG_USB_HOST
688 Notify(PSTR(
"\r\nConnecting to Wiimote"), 0x80);
698 #ifdef DEBUG_USB_HOST
699 Notify(PSTR(
"\r\nConnected to Wiimote"), 0x80);
704 #ifdef DEBUG_USB_HOST
705 Notify(PSTR(
"\r\nTrying to connect one more time..."), 0x80);
714 #ifdef DEBUG_USB_HOST
715 Notify(PSTR(
"\r\nWait For Incoming Connection Request"), 0x80);
726 #ifdef DEBUG_USB_HOST
727 Notify(PSTR(
"\r\nIncoming Connection Request"), 0x80);
737 #ifdef DEBUG_USB_HOST
738 Notify(PSTR(
"\r\nRemote Name: "), 0x80);
739 for (uint8_t i = 0; i < 30; i++) {
745 if (strncmp((
const char*)
remote_name,
"Nintendo", 8) == 0) {
747 #ifdef DEBUG_USB_HOST
748 Notify(PSTR(
"\r\nWiimote is connecting"), 0x80);
750 if (strncmp((
const char*)
remote_name,
"Nintendo RVL-CNT-01-TR", 22) == 0) {
751 #ifdef DEBUG_USB_HOST
752 Notify(PSTR(
" with Motion Plus Inside"), 0x80);
755 }
else if (strncmp((
const char*)
remote_name,
"Nintendo RVL-CNT-01-UC", 22) == 0) {
756 #ifdef DEBUG_USB_HOST
757 Notify(PSTR(
" - Wii U Pro Controller"), 0x80);
777 #ifdef DEBUG_USB_HOST
778 Notify(PSTR(
"\r\nConnected to Device: "), 0x80);
779 for (int8_t i = 5; i > 0; i--) {
783 D_PrintHex<uint8_t > (disc_bdaddr[0], 0x80);
797 if (hci_counter > 1000) {
805 #ifdef DEBUG_USB_HOST
806 Notify(PSTR(
"\r\nHCI Disconnected from Device"), 0x80);
828 void BTD::ACL_event_task() {
834 btService[i]->
ACLData(l2capinbuf);
837 else if (rcode !=
hrNAK) {
838 Notify(PSTR(
"\r\nACL data in error: "), 0x80);
839 D_PrintHex<uint8_t > (rcode, 0x80);
853 pUsb->
ctrlReq(
bAddress,
epInfo[
BTD_CONTROL_PIPE ].epAddr,
bmREQ_HCI_OUT, 0x00, 0x00, 0x00, 0x00, nbytes, nbytes, data, NULL);
859 hcibuf[1] = 0x03 << 2;
868 hcibuf[1] = 0x03 << 2;
880 hcibuf[1] = 0x03 << 2;
889 hcibuf[1] = 0x04 << 2;
897 hcibuf[1] = 0x04 << 2;
906 hcibuf[1] = 0x01 << 2;
922 hcibuf[1] = 0x01 << 2;
940 hcibuf[1] = 0x03 << 2;
941 hcibuf[2] = strlen(name) + 1;
943 for (i = 0; i < strlen(name); i++)
944 hcibuf[i + 3] = name[i];
945 hcibuf[i + 3] = 0x00;
953 hcibuf[1] = 0x01 << 2;
966 hcibuf[1] = 0x01 << 2;
975 hcibuf[1] = 0x01 << 2;
996 hcibuf[1] = 0x01 << 2;
1007 #ifdef DEBUG_USB_HOST
1008 Notify(PSTR(
"\r\nParing with Wii U Pro Controller"), 0x80);
1010 for (uint8_t i = 0; i < 6; i++)
1013 for (uint8_t i = 0; i < 6; i++)
1016 for (uint8_t i = 16; i < 26; i++)
1019 hcibuf[9] = strlen(
btdPin);
1021 for (i = 0; i < strlen(
btdPin); i++)
1022 hcibuf[i + 10] =
btdPin[i];
1024 hcibuf[i + 10] = 0x00;
1032 hcibuf[1] = 0x01 << 2;
1046 hcibuf[1] = 0x01 << 2;
1060 hcibuf[1] = 0x01 << 2;
1063 hcibuf[4] = (uint8_t)((
hci_handle >> 8) & 0x0F);
1071 hcibuf[1] = 0x01 << 2;
1073 hcibuf[3] = (uint8_t)(handle & 0xFF);
1074 hcibuf[4] = (uint8_t)((handle >> 8) & 0x0F);
1082 hcibuf[1] = 0x03 << 2;
1116 void BTD::L2CAP_Command(uint16_t handle, uint8_t* data, uint8_t nbytes, uint8_t channelLow, uint8_t channelHigh) {
1117 uint8_t buf[8 + nbytes];
1118 buf[0] = (uint8_t)(handle & 0xff);
1119 buf[1] = (uint8_t)(((handle >> 8) & 0x0f) | 0x20);
1120 buf[2] = (uint8_t)((4 + nbytes) & 0xff);
1121 buf[3] = (uint8_t)((4 + nbytes) >> 8);
1122 buf[4] = (uint8_t)(nbytes & 0xff);
1123 buf[5] = (uint8_t)(nbytes >> 8);
1124 buf[6] = channelLow;
1125 buf[7] = channelHigh;
1127 for (uint16_t i = 0; i < nbytes; i++)
1128 buf[8 + i] = data[i];
1133 #ifdef DEBUG_USB_HOST
1134 Notify(PSTR(
"\r\nError sending L2CAP message: 0x"), 0x80);
1135 D_PrintHex<uint8_t > (rcode, 0x80);
1136 Notify(PSTR(
" - Channel ID: "), 0x80);
1137 D_PrintHex<uint8_t > (channelHigh, 0x80);
1139 D_PrintHex<uint8_t > (channelLow, 0x80);
1146 l2capoutbuf[1] = rxid;
1147 l2capoutbuf[2] = 0x04;
1148 l2capoutbuf[3] = 0x00;
1149 l2capoutbuf[4] = (uint8_t)(psm & 0xff);
1150 l2capoutbuf[5] = (uint8_t)(psm >> 8);
1151 l2capoutbuf[6] = scid[0];
1152 l2capoutbuf[7] = scid[1];
1159 l2capoutbuf[1] = rxid;
1160 l2capoutbuf[2] = 0x08;
1161 l2capoutbuf[3] = 0x00;
1162 l2capoutbuf[4] = dcid[0];
1163 l2capoutbuf[5] = dcid[1];
1164 l2capoutbuf[6] = scid[0];
1165 l2capoutbuf[7] = scid[1];
1166 l2capoutbuf[8] = result;
1167 l2capoutbuf[9] = 0x00;
1168 l2capoutbuf[10] = 0x00;
1169 l2capoutbuf[11] = 0x00;
1176 l2capoutbuf[1] = rxid;
1177 l2capoutbuf[2] = 0x08;
1178 l2capoutbuf[3] = 0x00;
1179 l2capoutbuf[4] = dcid[0];
1180 l2capoutbuf[5] = dcid[1];
1181 l2capoutbuf[6] = 0x00;
1182 l2capoutbuf[7] = 0x00;
1183 l2capoutbuf[8] = 0x01;
1184 l2capoutbuf[9] = 0x02;
1185 l2capoutbuf[10] = 0xFF;
1186 l2capoutbuf[11] = 0xFF;
1193 l2capoutbuf[1] = rxid;
1194 l2capoutbuf[2] = 0x0A;
1195 l2capoutbuf[3] = 0x00;
1196 l2capoutbuf[4] = scid[0];
1197 l2capoutbuf[5] = scid[1];
1198 l2capoutbuf[6] = 0x00;
1199 l2capoutbuf[7] = 0x00;
1200 l2capoutbuf[8] = 0x00;
1201 l2capoutbuf[9] = 0x00;
1202 l2capoutbuf[10] = 0x01;
1203 l2capoutbuf[11] = 0x02;
1204 l2capoutbuf[12] = 0xA0;
1205 l2capoutbuf[13] = 0x02;
1212 l2capoutbuf[1] = rxid;
1213 l2capoutbuf[2] = 0x04;
1214 l2capoutbuf[3] = 0x00;
1215 l2capoutbuf[4] = dcid[0];
1216 l2capoutbuf[5] = dcid[1];
1217 l2capoutbuf[6] = scid[0];
1218 l2capoutbuf[7] = scid[1];
1225 l2capoutbuf[1] = rxid;
1226 l2capoutbuf[2] = 0x04;
1227 l2capoutbuf[3] = 0x00;
1228 l2capoutbuf[4] = dcid[0];
1229 l2capoutbuf[5] = dcid[1];
1230 l2capoutbuf[6] = scid[0];
1231 l2capoutbuf[7] = scid[1];
1238 l2capoutbuf[1] = rxid;
1239 l2capoutbuf[2] = 0x08;
1240 l2capoutbuf[3] = 0x00;
1241 l2capoutbuf[4] = infoTypeLow;
1242 l2capoutbuf[5] = infoTypeHigh;
1243 l2capoutbuf[6] = 0x00;
1244 l2capoutbuf[7] = 0x00;
1245 l2capoutbuf[8] = 0x00;
1246 l2capoutbuf[9] = 0x00;
1247 l2capoutbuf[10] = 0x00;
1248 l2capoutbuf[11] = 0x00;
1254 void BTD::setBdaddr(uint8_t* bdaddr) {
1260 for (uint8_t i = 0; i < 6; i++)
1261 buf[i + 2] = bdaddr[5 - i];
1264 pUsb->
ctrlReq(
bAddress,
epInfo[
BTD_CONTROL_PIPE].epAddr,
bmREQ_HID_OUT,
HID_REQUEST_SET_REPORT, 0xF5, 0x03, 0x00, 8, 8, buf, NULL);
1267 void BTD::setMoveBdaddr(uint8_t* bdaddr) {
1276 for (uint8_t i = 0; i < 6; i++)
1277 buf[i + 1] = bdaddr[i];
1280 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
#define HCI_CHECK_WII_SERVICE
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
#define HCI_CONNECTED_WII_STATE
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
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
#define HCI_CONNECT_WII_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()
void hci_pin_code_negative_request_reply()
#define EV_CHANGE_CONNECTION_LINK
#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL
AddressPool & GetAddressPool()
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()
#define HCI_FLAG_WII_FOUND
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
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)