diff options
author | Wei Shuai <cpuwolf@gmail.com> | 2018-02-06 22:30:46 +0800 |
---|---|---|
committer | Wei Shuai <cpuwolf@gmail.com> | 2018-02-06 22:30:46 +0800 |
commit | 84a143aa1b9654e4133cb19016c3a95fbfb57bf2 (patch) | |
tree | abcbade4c378a9c2e08c5f09dee5666681dc7f4e /tracker-wii | |
parent | 2b71b2984d5d71157cb9c999b6121a7269d89dcb (diff) |
tracker/wii: bluetooth auto pair speed optimization
Diffstat (limited to 'tracker-wii')
-rw-r--r-- | tracker-wii/wii_camera.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tracker-wii/wii_camera.cpp b/tracker-wii/wii_camera.cpp index 0ce7859b..99a1414c 100644 --- a/tracker-wii/wii_camera.cpp +++ b/tracker-wii/wii_camera.cpp @@ -157,6 +157,9 @@ wii_camera_status WIICamera::_pair() if (btdevinfo.fRemembered) { //BluetoothRemoveDevice(&btdevinfo.Address); } + if (btdevinfo.fConnected) { + break; + } WCHAR pwd[6]; pwd[0] = btinfo.address.rgBytes[0]; pwd[1] = btinfo.address.rgBytes[1]; @@ -170,6 +173,7 @@ wii_camera_status WIICamera::_pair() GUID guids[32]; if (ERROR_SUCCESS != BluetoothEnumerateInstalledServices(hbtlist[i], &btdevinfo, &servicecount, guids)) { continue; } if (ERROR_SUCCESS != BluetoothSetServiceState(hbtlist[i], &btdevinfo, &HumanInterfaceDeviceServiceClass_UUID, BLUETOOTH_SERVICE_ENABLE)) { continue; } + break; } while (BluetoothFindNextDevice(hbtdevfd, &btdevinfo)); BluetoothFindDeviceClose(hbtdevfd); } |