summaryrefslogtreecommitdiffhomepage
path: root/tracker-wii/wii_camera.cpp
diff options
context:
space:
mode:
authorWei Shuai <cpuwolf@gmail.com>2018-02-07 20:57:57 +0800
committerWei Shuai <cpuwolf@gmail.com>2018-02-07 20:57:57 +0800
commit35bca40ccb844803d11505947903584f33216182 (patch)
treed19cd3b62eabf7cb7c57ca257cb4aa21ad33e860 /tracker-wii/wii_camera.cpp
parent993e6b18966af927563398e04c516a6fcafd8123 (diff)
tracker/wii: optimize auto BT pair
1. reconnect wiiyourself 2. reduce wiimote power by reduce LEDs
Diffstat (limited to 'tracker-wii/wii_camera.cpp')
-rw-r--r--tracker-wii/wii_camera.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/tracker-wii/wii_camera.cpp b/tracker-wii/wii_camera.cpp
index 91d61b34..163dad17 100644
--- a/tracker-wii/wii_camera.cpp
+++ b/tracker-wii/wii_camera.cpp
@@ -198,6 +198,14 @@ wii_camera_status WIICamera::_get_frame(cv::Mat& frame)
if (!m_pDev->IsConnected()) {
qDebug() << "wii wait";
ret = _pair();
+ switch(ret){
+ case wii_cam_wait_for_sync:
+ m_pDev->Disconnect();
+ goto goodbye;
+ case wii_cam_wait_for_connect:
+ m_pDev->Disconnect();
+ break;
+ }
if (!m_pDev->Connect(wiimote::FIRST_AVAILABLE)) {
Beep(500, 30); Sleep(1000);
goto goodbye;
@@ -248,7 +256,7 @@ bool WIICamera::_get_points(struct wii_info& wii)
wii.Points[index].bvis = dot.bVisible;
}
}
- m_pDev->SetLEDs(3 - point_count);
+ m_pDev->SetLEDs(0);
return ret;
}