From 0b869cf12d914773d78fb5ee5234f208661d9280 Mon Sep 17 00:00:00 2001 From: Matthew Parlane Date: Sat, 18 May 2013 22:26:00 +1200 Subject: [PATCH] Add mac support for balance board. --- .../Core/Core/Src/HW/WiimoteReal/IOdarwin.mm | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Source/Core/Core/Src/HW/WiimoteReal/IOdarwin.mm b/Source/Core/Core/Src/HW/WiimoteReal/IOdarwin.mm index cec18ed63a..9f9192423c 100644 --- a/Source/Core/Core/Src/HW/WiimoteReal/IOdarwin.mm +++ b/Source/Core/Core/Src/HW/WiimoteReal/IOdarwin.mm @@ -116,22 +116,21 @@ WiimoteScanner::~WiimoteScanner() void WiimoteScanner::Update() {} -std::vector WiimoteScanner::FindWiimotes() +void WiimoteScanner::FindWiimotes(std::vector & found_wiimotes, Wiimote* & found_board) { // TODO: find the device in the constructor and save it for later - - std::vector wiimotes; IOBluetoothHostController *bth; IOBluetoothDeviceInquiry *bti; SearchBT *sbt; NSEnumerator *en; + found_board = NULL; bth = [[IOBluetoothHostController alloc] init]; if ([bth addressAsString] == nil) { WARN_LOG(WIIMOTE, "No bluetooth host controller"); [bth release]; - return wiimotes; + return; } sbt = [[SearchBT alloc] init]; @@ -162,14 +161,22 @@ std::vector WiimoteScanner::FindWiimotes() Wiimote *wm = new Wiimote(); wm->btd = dev; - wiimotes.push_back(wm); + + if(IsBalanceBoardName(name)) + { + found_board = wm; + NOTICE_LOG(WIIMOTE, "Found balance board (%s).", bdaddr_str); + } + else + { + found_wiimotes.push_back(wm); + NOTICE_LOG(WIIMOTE, "Found wiimote (%s).", bdaddr_str); + } } [bth release]; [bti release]; [sbt release]; - - return wiimotes; } bool WiimoteScanner::IsReady() const