mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Exit if inquiry finished
This commit is contained in:
parent
9f20111d53
commit
091650d0a1
2 changed files with 13 additions and 2 deletions
12
BTD.cpp
12
BTD.cpp
|
@ -354,7 +354,17 @@ void BTD::HCI_event_task() {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EV_INQUIRY_COMPLETE: // We don't use this for anything
|
case EV_INQUIRY_COMPLETE:
|
||||||
|
if(inquiry_counter >= 5) {
|
||||||
|
inquiry_counter = 0;
|
||||||
|
#ifdef DEBUG
|
||||||
|
Notify(PSTR("\r\nCouldn't find Wiimote"));
|
||||||
|
#endif
|
||||||
|
connectToWii = false;
|
||||||
|
pairWithWii = false;
|
||||||
|
hci_state = HCI_SCANNING_STATE;
|
||||||
|
}
|
||||||
|
inquiry_counter++;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EV_INQUIRY_RESULT:
|
case EV_INQUIRY_RESULT:
|
||||||
|
|
3
BTD.h
3
BTD.h
|
@ -243,7 +243,8 @@ private:
|
||||||
uint8_t hci_state; //current state of bluetooth hci connection
|
uint8_t hci_state; //current state of bluetooth hci connection
|
||||||
uint16_t hci_counter; // counter used for bluetooth hci reset loops
|
uint16_t hci_counter; // counter used for bluetooth hci reset loops
|
||||||
uint8_t hci_num_reset_loops; // this value indicate how many times it should read before trying to reset
|
uint8_t hci_num_reset_loops; // this value indicate how many times it should read before trying to reset
|
||||||
uint16_t hci_event_flag; // hci flags of received bluetooth events
|
uint16_t hci_event_flag; // hci flags of received bluetooth events
|
||||||
|
uint8_t inquiry_counter;
|
||||||
|
|
||||||
uint8_t hcibuf[BULK_MAXPKTSIZE];//General purpose buffer for hci data
|
uint8_t hcibuf[BULK_MAXPKTSIZE];//General purpose buffer for hci data
|
||||||
uint8_t l2capinbuf[BULK_MAXPKTSIZE];//General purpose buffer for l2cap in data
|
uint8_t l2capinbuf[BULK_MAXPKTSIZE];//General purpose buffer for l2cap in data
|
||||||
|
|
Loading…
Reference in a new issue