Fixed type in waitingForConnection variable and set it to false when pairing

This commit is contained in:
Kristian Sloth Lauszus 2017-02-07 15:27:00 +01:00
parent 343ae2c1d1
commit 242ce6c92b
3 changed files with 9 additions and 8 deletions

View file

@ -254,7 +254,7 @@ uint8_t BTD::Init(uint8_t parent, uint8_t port, bool lowspeed) {
hci_num_reset_loops = 100; // only loop 100 times before trying to send the hci reset command hci_num_reset_loops = 100; // only loop 100 times before trying to send the hci reset command
hci_counter = 0; hci_counter = 0;
hci_state = HCI_INIT_STATE; hci_state = HCI_INIT_STATE;
watingForConnection = false; waitingForConnection = false;
bPollEnable = true; bPollEnable = true;
#ifdef DEBUG_USB_HOST #ifdef DEBUG_USB_HOST
@ -802,14 +802,14 @@ void BTD::HCI_task() {
Notify(PSTR("\r\nWait For Incoming Connection Request"), 0x80); Notify(PSTR("\r\nWait For Incoming Connection Request"), 0x80);
#endif #endif
hci_write_scan_enable(); hci_write_scan_enable();
watingForConnection = true; waitingForConnection = true;
hci_state = HCI_CONNECT_IN_STATE; hci_state = HCI_CONNECT_IN_STATE;
} }
break; break;
case HCI_CONNECT_IN_STATE: case HCI_CONNECT_IN_STATE:
if(hci_check_flag(HCI_FLAG_INCOMING_REQUEST)) { if(hci_check_flag(HCI_FLAG_INCOMING_REQUEST)) {
watingForConnection = false; waitingForConnection = false;
#ifdef DEBUG_USB_HOST #ifdef DEBUG_USB_HOST
Notify(PSTR("\r\nIncoming Connection Request"), 0x80); Notify(PSTR("\r\nIncoming Connection Request"), 0x80);
#endif #endif

9
BTD.h
View file

@ -432,7 +432,7 @@ public:
/**@}*/ /**@}*/
/** Use this to see if it is waiting for a incoming connection. */ /** Use this to see if it is waiting for a incoming connection. */
bool watingForConnection; bool waitingForConnection;
/** This is used by the service to know when to store the device information. */ /** This is used by the service to know when to store the device information. */
bool l2capConnectionClaimed; bool l2capConnectionClaimed;
/** This is used by the SPP library to claim the current SDP incoming request. */ /** This is used by the SPP library to claim the current SDP incoming request. */
@ -476,14 +476,15 @@ public:
/** True if it's a Wii U Pro Controller. */ /** True if it's a Wii U Pro Controller. */
bool wiiUProController; bool wiiUProController;
/** Call this function to pair with a Wiimote */ /** Call this function to pair with a HID device */
void pairWithHID() { void pairWithHID() {
waitingForConnection = false;
pairWithHIDDevice = true; pairWithHIDDevice = true;
hci_state = HCI_CHECK_DEVICE_SERVICE; hci_state = HCI_CHECK_DEVICE_SERVICE;
}; };
/** Used to only send the ACL data to the Wiimote. */ /** Used to only send the ACL data to the HID device. */
bool connectToHIDDevice; bool connectToHIDDevice;
/** True if a Wiimote is connecting. */ /** True if a HID device is connecting. */
bool incomingHIDDevice; bool incomingHIDDevice;
/** True when it should pair with a device like a mouse or keyboard. */ /** True when it should pair with a device like a mouse or keyboard. */
bool pairWithHIDDevice; bool pairWithHIDDevice;

View file

@ -75,7 +75,7 @@ PS3MoveConnected KEYWORD2
PS3NavigationConnected KEYWORD2 PS3NavigationConnected KEYWORD2
isReady KEYWORD2 isReady KEYWORD2
watingForConnection KEYWORD2 waitingForConnection KEYWORD2
isTouching KEYWORD2 isTouching KEYWORD2
getX KEYWORD2 getX KEYWORD2