mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Merge branch 'master' into xxxajk
This commit is contained in:
commit
db39f5f347
2 changed files with 10 additions and 3 deletions
10
BTD.cpp
10
BTD.cpp
|
@ -25,18 +25,24 @@ const uint8_t BTD::BTD_DATAIN_PIPE = 2;
|
||||||
const uint8_t BTD::BTD_DATAOUT_PIPE = 3;
|
const uint8_t BTD::BTD_DATAOUT_PIPE = 3;
|
||||||
|
|
||||||
BTD::BTD(USB *p) :
|
BTD::BTD(USB *p) :
|
||||||
|
connectToWii(false),
|
||||||
|
pairWithWii(false),
|
||||||
pUsb(p), // Pointer to USB class instance - mandatory
|
pUsb(p), // Pointer to USB class instance - mandatory
|
||||||
bAddress(0), // Device address - mandatory
|
bAddress(0), // Device address - mandatory
|
||||||
bNumEP(1), // If config descriptor needs to be parsed
|
bNumEP(1), // If config descriptor needs to be parsed
|
||||||
qNextPollTime(0), // Reset NextPollTime
|
qNextPollTime(0), // Reset NextPollTime
|
||||||
|
pollInterval(0),
|
||||||
bPollEnable(false) // Don't start polling before dongle is connected
|
bPollEnable(false) // Don't start polling before dongle is connected
|
||||||
{
|
{
|
||||||
for (uint8_t i = 0; i < BTD_MAX_ENDPOINTS; i++) {
|
uint8_t i;
|
||||||
|
for (i = 0; i < BTD_MAX_ENDPOINTS; i++) {
|
||||||
epInfo[i].epAddr = 0;
|
epInfo[i].epAddr = 0;
|
||||||
epInfo[i].maxPktSize = (i) ? 0 : 8;
|
epInfo[i].maxPktSize = (i) ? 0 : 8;
|
||||||
epInfo[i].epAttribs = 0;
|
epInfo[i].epAttribs = 0;
|
||||||
epInfo[i].bmNakPower = (i) ? USB_NAK_NOWAIT : USB_NAK_MAX_POWER;
|
epInfo[i].bmNakPower = (i) ? USB_NAK_NOWAIT : USB_NAK_MAX_POWER;
|
||||||
}
|
}
|
||||||
|
for (i = 0; i < BTD_NUMSERVICES; i++)
|
||||||
|
btService[i] = NULL;
|
||||||
|
|
||||||
if (pUsb) // register in USB subsystem
|
if (pUsb) // register in USB subsystem
|
||||||
pUsb->RegisterDeviceClass(this); //set devConfig[] entry
|
pUsb->RegisterDeviceClass(this); //set devConfig[] entry
|
||||||
|
@ -1235,4 +1241,4 @@ void BTD::setMoveBdaddr(uint8_t* bdaddr) {
|
||||||
|
|
||||||
// bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0x05), Report Type (Feature 0x03), interface (0x00), datalength, datalength, data)
|
// bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0x05), Report Type (Feature 0x03), interface (0x00), datalength, datalength, data)
|
||||||
pUsb->ctrlReq(bAddress, epInfo[BTD_CONTROL_PIPE].epAddr, bmREQ_HID_OUT, HID_REQUEST_SET_REPORT, 0x05, 0x03, 0x00, 11, 11, buf, NULL);
|
pUsb->ctrlReq(bAddress, epInfo[BTD_CONTROL_PIPE].epAddr, bmREQ_HID_OUT, HID_REQUEST_SET_REPORT, 0x05, 0x03, 0x00, 11, 11, buf, NULL);
|
||||||
}
|
}
|
||||||
|
|
3
SPP.cpp
3
SPP.cpp
|
@ -64,6 +64,7 @@ void SPP::Reset() {
|
||||||
connected = false;
|
connected = false;
|
||||||
RFCOMMConnected = false;
|
RFCOMMConnected = false;
|
||||||
SDPConnected = false;
|
SDPConnected = false;
|
||||||
|
waitForLastCommand = false;
|
||||||
l2cap_sdp_state = L2CAP_SDP_WAIT;
|
l2cap_sdp_state = L2CAP_SDP_WAIT;
|
||||||
l2cap_rfcomm_state = L2CAP_RFCOMM_WAIT;
|
l2cap_rfcomm_state = L2CAP_RFCOMM_WAIT;
|
||||||
l2cap_event_flag = 0;
|
l2cap_event_flag = 0;
|
||||||
|
@ -808,4 +809,4 @@ int SPP::read(void) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue