コード例 #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));
                    }
                }
            }
        }
コード例 #2
0
 void m_spokes_PutOn(object sender, WearingStateArgs e)
 {
     DebugPrint(MethodInfo.GetCurrentMethod().Name, "Headset put on");
     if (!e.m_isInitialStateEvent)
     {
         DoCancelLockIfCheckBoxSet(takenOffcheckBox);
     }
 }
コード例 #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());
     }
 }
コード例 #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);
 }
コード例 #5
0
 void m_spokes_PutOn(object sender, WearingStateArgs e)
 {
     UpdateWearingStateToConnection(e);
 }
コード例 #6
0
 void m_spokes_TakenOff(object sender, WearingStateArgs e)
 {
     UpdateWearingStateToConnection(e);
 }
コード例 #7
0
 void m_spokes_PutOn(object sender, WearingStateArgs e)
 {
     DebugPrint(MethodInfo.GetCurrentMethod().Name, "@@@ Headset " + (e.m_isInitialStateEvent ? "INITIALLY " : "") + "Put On");
 }
コード例 #8
0
ファイル: PLTLayer.cs プロジェクト: trphilander/Samples
 void m_spokes_PutOn(object sender, WearingStateArgs e)
 {
     OnPltEvent(new PltEventArgs(PltEventType.PutOn));
 }
コード例 #9
0
ファイル: PLTLayer.cs プロジェクト: trphilander/Samples
 void m_spokes_TakenOff(object sender, WearingStateArgs e)
 {
     OnPltEvent(new PltEventArgs(PltEventType.TakenOff));
 }
コード例 #10
0
 static void spokes_PutOn(object sender, WearingStateArgs e)
 {
     Console.WriteLine("Headset is worn" + (e.m_isInitialStateEvent?" (initial state)":""));
 }