Ejemplo n.º 1
0
        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));
                    }
                }
            }
        }
Ejemplo n.º 2
0
 void m_spokes_PutOn(object sender, WearingStateArgs e)
 {
     DebugPrint(MethodInfo.GetCurrentMethod().Name, "Headset put on");
     if (!e.m_isInitialStateEvent)
     {
         DoCancelLockIfCheckBoxSet(takenOffcheckBox);
     }
 }
Ejemplo n.º 3
0
 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());
     }
 }
Ejemplo n.º 4
0
 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);
 }
Ejemplo n.º 5
0
 void m_spokes_PutOn(object sender, WearingStateArgs e)
 {
     UpdateWearingStateToConnection(e);
 }
Ejemplo n.º 6
0
 void m_spokes_TakenOff(object sender, WearingStateArgs e)
 {
     UpdateWearingStateToConnection(e);
 }
Ejemplo n.º 7
0
 void m_spokes_PutOn(object sender, WearingStateArgs e)
 {
     DebugPrint(MethodInfo.GetCurrentMethod().Name, "@@@ Headset " + (e.m_isInitialStateEvent ? "INITIALLY " : "") + "Put On");
 }
Ejemplo n.º 8
0
 void m_spokes_PutOn(object sender, WearingStateArgs e)
 {
     OnPltEvent(new PltEventArgs(PltEventType.PutOn));
 }
Ejemplo n.º 9
0
 void m_spokes_TakenOff(object sender, WearingStateArgs e)
 {
     OnPltEvent(new PltEventArgs(PltEventType.TakenOff));
 }
Ejemplo n.º 10
0
 static void spokes_PutOn(object sender, WearingStateArgs e)
 {
     Console.WriteLine("Headset is worn" + (e.m_isInitialStateEvent?" (initial state)":""));
 }