Exemplo n.º 1
0
 /// <summary>
 /// 获取版本信息
 /// </summary>
 /// <param name="ver"></param>
 /// <returns></returns>
 public static string GetVersion(tVer ver)
 {
     return(((int)ver.u8Main).ToString() +
            "." + ((int)ver.u8Sub).ToString() +
            "." + ((int)ver.u8Rev).ToString() +
            "." + ((int)ver.u8Build).ToString());
 }
 /// <summary>
 /// mesh的获取自描述报告的处理
 /// </summary>
 private void GetSelfReportAnalysis(tGetSelfReportResult result)
 {
     if (!NetworkWSInfo.ContainsKey(result.mac.ToHexString()))
     {
         tVer GetVer = new tVer();
         GetVer.u8Main  = result.verMcuFw.u8Main;
         GetVer.u8Sub   = result.verMcuFw.u8Sub;
         GetVer.u8Rev   = result.verMcuFw.u8Rev;
         GetVer.u8Build = result.verMcuFw.u8Build;
         NetworkWSInfo[result.mac.ToHexString()] = GetVer;
     }
     else
     {
         NetworkWSInfo[result.mac.ToHexString()].u8Main  = result.verMcuFw.u8Main;
         NetworkWSInfo[result.mac.ToHexString()].u8Sub   = result.verMcuFw.u8Sub;
         NetworkWSInfo[result.mac.ToHexString()].u8Rev   = result.verMcuFw.u8Rev;
         NetworkWSInfo[result.mac.ToHexString()].u8Build = result.verMcuFw.u8Build;
     }
 }
        /// <summary>
        /// mesh的自描述报告的处理
        /// </summary>
        private void SelfReportAnalysis(tMeshSelfReportParam param)
        {
            tVer NewVer = new tVer();

            NewVer.u8Main  = param.verMcuFw.u8Main;
            NewVer.u8Sub   = param.verMcuFw.u8Sub;
            NewVer.u8Rev   = param.verMcuFw.u8Rev;
            NewVer.u8Build = param.verMcuFw.u8Build;
            NetworkWSInfo[param.mac.ToHexString()] = NewVer;
            tMeshSelfReportResult date = new tMeshSelfReportResult();

            date.mac.Assign(param.mac);
            date.u8RC = 0;
            if (param.u8RC == 0)
            {
                //ReplyWSDescribe(date);
            }
            CommStackLog.RecordInf(enLogLayer.eAdapter, "WS(" + param.mac.ToHexString() + "):V" + NetworkWSInfo[param.mac.ToHexString()].u8Main.ToString() + "."
                                   + NetworkWSInfo[param.mac.ToHexString()].u8Sub.ToString() + "."
                                   + NetworkWSInfo[param.mac.ToHexString()].u8Rev.ToString() + "."
                                   + NetworkWSInfo[param.mac.ToHexString()].u8Build.ToString());
        }