Exemplo n.º 1
0
        private void OnSetTime(string msg)
        {
            string qn = Value.Parse(msg, "QN");
            this.SendReplyPacket(qn);

            string time = Value.Parse(msg, "SystemTime");
            DateTime dt = DeviceTime.Parse(time);

            this.agent.OnTimeChanged(dt);

            if (this.CanHandleSetTime)
            {
                SystemTime st = new SystemTime();

                st.wYear = (ushort)dt.Year;
                st.wMonth = (ushort)dt.Month;
                st.wDay = (ushort)dt.Day;
                st.whour = (ushort)dt.Hour;
                st.wMinute = (ushort)dt.Minute;
                st.wSecond = (ushort)dt.Second;
                st.wMilliseconds = 0;

                SetLocalTime(st);
            }
            this.SendResultPacket(qn);
        }
Exemplo n.º 2
0
 public static extern void SetLocalTime(SystemTime st);