Wiimotes() { m_WiimoteConnected = false; m_WiimoteDataAdaptor = new SpaceSensorDataAdaptor(this); m_SelectedRowForRecord = null; m_ContinueConnectingAttempts = true; m_Wiimote1 = new Wiimote(); m_Wiimote2 = new Wiimote(); Initialize(); }
public override void checkWiimoteState(Wiimote wiimote1, Wiimote wiimote2) { try { Thread.Sleep(Configuration.getConfiguration().WaitTimeCheckConnection); string checkWiimoteStateMessage = CHECK_WIIMOTE_STATE_METHOD_NAME + ";"; string returnString = m_CommandPipe.sendMessage(checkWiimoteStateMessage); if (returnString.Length < 4) return; string[] returnValues = returnString.Split(','); wiimote1.WiimoteCurrentState = (WiimoteState)Convert.ToInt32(returnValues[0]); wiimote1.BatteryLevel = Convert.ToInt32(returnValues[1]); wiimote2.WiimoteCurrentState = (WiimoteState)Convert.ToInt32(returnValues[2]); wiimote2.BatteryLevel = Convert.ToInt32(returnValues[3]); } catch (PipeCommunicationException ex) { throw new WiimoteCommunicationException(ex); } }
public abstract void checkWiimoteState(Wiimote wiimote1, Wiimote wiimote2);