private void UpdateWearingStateToConnection(WearingStateArgs e) { lock (m_lastwornstateLock) { m_lastwornstate.m_worn = e.m_worn; m_lastwornstate.m_isInitialStateEvent = e.m_isInitialStateEvent; } if (m_activeConnection != null) // todo only do this if subscribed to relevant service? { PLTServiceSubscription subscr = m_activeConnection.getSubscription(PLTService.WEARING_STATE_SVC); if (subscr != null) { lock (m_lastwornstateLock) { subscr.LastData = m_lastwornstate; } // if it is an on change subscription, beam to connected app now // otherwise will happen in the PLTConnection's periodic timer if (subscr.m_mode == PLTMode.On_Change) { m_callbackhandler.infoUpdated(m_activeConnection, new PLTInfo(PLTService.WEARING_STATE_SVC, subscr.LastData)); } } } }
void m_spokes_PutOn(object sender, WearingStateArgs e) { DebugPrint(MethodInfo.GetCurrentMethod().Name, "Headset put on"); if (!e.m_isInitialStateEvent) { DoCancelLockIfCheckBoxSet(takenOffcheckBox); } }
void m_spokes_TakenOff(object sender, WearingStateArgs e) { DebugPrint(MethodInfo.GetCurrentMethod().Name, "Headset taken off"); if (!e.m_isInitialStateEvent) { DoLockIfCheckBoxSet(takenOffcheckBox, "Headset was taken off", GetSecondsDelay()); } }
static void spokes_PutOn(object sender, WearingStateArgs e) { Console.WriteLine("Headset put on, sending message to Client App via socket..."); if (socket == null) { Console.WriteLine("INFO: No client connected."); return; } socket.sendMsg("PutOn," + e.m_worn + "," + e.m_isInitialStateEvent); }
void m_spokes_PutOn(object sender, WearingStateArgs e) { UpdateWearingStateToConnection(e); }
void m_spokes_TakenOff(object sender, WearingStateArgs e) { UpdateWearingStateToConnection(e); }
void m_spokes_PutOn(object sender, WearingStateArgs e) { DebugPrint(MethodInfo.GetCurrentMethod().Name, "@@@ Headset " + (e.m_isInitialStateEvent ? "INITIALLY " : "") + "Put On"); }
void m_spokes_PutOn(object sender, WearingStateArgs e) { OnPltEvent(new PltEventArgs(PltEventType.PutOn)); }
void m_spokes_TakenOff(object sender, WearingStateArgs e) { OnPltEvent(new PltEventArgs(PltEventType.TakenOff)); }
static void spokes_PutOn(object sender, WearingStateArgs e) { Console.WriteLine("Headset is worn" + (e.m_isInitialStateEvent?" (initial state)":"")); }