From 35bca40ccb844803d11505947903584f33216182 Mon Sep 17 00:00:00 2001 From: Wei Shuai Date: Wed, 7 Feb 2018 20:57:57 +0800 Subject: tracker/wii: optimize auto BT pair 1. reconnect wiiyourself 2. reduce wiimote power by reduce LEDs --- tracker-wii/wii_camera.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'tracker-wii/wii_camera.cpp') 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; } -- cgit v1.2.3