예제 #1
0
파일: DeviceInfo.cs 프로젝트: ridsl22/AURA
        /// <summary>
        /// Records the receipt and contents of the CEMHello message from the connected device.
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        ///
        public void NoteCEMHelloMsg(Msg_CEMHello msg)
        {
            if (msg == null)
            {
                throw new ArgumentNullException("msg");
            }

            // NOTE: The CEMHello message will be sent in the following circumstances:
            // 1) At CEM startup (automatic).
            // 2) On loss of RCM communication (automatic).
            // 3) On resumption of normal RCM communication (automatic).
            // 4) In response to a CEMHello sent by the PC.
            // 5) At the start and end of a GPS module reset cycle (15 sec TSM power cycle).
            //
            // Because of the automatic cases, we always want to copy data from the message, because
            // the CEM or RCM versions may have changed (the former in the case of a CEM firmware
            // update; the latter in the case of normal startup or a TSM disconnect, reconnect, or
            // failure.

            //MainWindow.Log.WriteToLog(LogConfigAURA.ADUConnect, "CONNECT: Got CEMHello msg.");

            GotCEMHello     = true;
            DeviceIsPresent = true;

            CEMVersion    = msg.CEMVersion;
            ConfigVersion = msg.ConfigVersion;
            MachineName   = msg.MachineName;
            CEMInfoFlags  = msg.Flags;

            // General note concerning Address and RCMVersion: it's possible that the DNT subsystem
            // is working fine (required for the CEM to get the DNT MAC address) but the RCM subsystem
            // isn't, or that this msg was sent after DNT "radio ready" but before the RCM "get status"
            // has completed. In these cases we can have an Address but no RCMVersion. This "state" isn't
            // covered by the "Got" predicates. We don't really need to add a predicate for it, though
            // - we can deduce this by seeing a meaningful address but RCMVersion is null. It *is*
            // important information, however: if an RCM board fails (serial communication or power),
            // we'd see the MAC address but no RCM version information.

            Address   = msg.Address;
            NetworkId = msg.NetworkId;

            RCMVersion = msg.RCMVersion.IsValid ? msg.RCMVersion : null;

            RaiseCompleteActionIfComplete();
        }
예제 #2
0
파일: AURA_Core.cs 프로젝트: ridsl22/AURA
        private void HandleCEMHello(Msg_CEMHello msg)
        {
            //menuManager.DeviceInfo.CEM = msg.CEMVersion.Major.ToString("00") + "."
            //					+ msg.CEMVersion.Minor.ToString("00") + "."
            //					+ msg.CEMVersion.Revision.ToString("00");
            //menuManager.DeviceInfo.RCM = msg.RCMVersion.Major.ToString("00") + "."
            //					+ msg.RCMVersion.Minor.ToString("00") + "."
            //					+ msg.RCMVersion.Revision.ToString("00");
            ////deviceInfoModel.Name = msg.MachineName.Substring(0, 2) + " " + msg.MachineName.Substring(3);
            //menuManager.DeviceInfo.MAC = msg.Address == AURADef.InvalidMACAddress ? "" : msg.Address.ToString("x6");//
            //menuManager.DeviceInfo.GroupID = msg.NetworkId;
            //cemConfig.DNTNetworkId = msg.NetworkId;
            ConfigVersion = msg.ConfigVersion;
            //devInfo_ = msg.ConfigVersion;
            //cemConfig.Flags = (CEMConfigFlag)msg.Flags;

            //menuManager.CreateDeviceInfoValuesList();

            //SendMgmtMsg(new Msg_UIMHello());
            devInfo_.NoteCEMHelloMsg(msg);
            SendMgmtMsg(new Msg_UIGetCEMConfigADU());
            SendMgmtMsg(new Msg_UIGetUIMConfig());
        }