コード例 #1
0
        /**
         * Writes unique values.
         */
        private static void WriteUniqueValues(StreamWriter writer, CXmlDataBlock datablock)
        {
            // Unique values
            writer.Write(PrettyTitle(KTitleUniqueValues));

            // Available memory
            writer.Write(PrettyString(XmlConsts.Kxml_available_memory, datablock.FreeMemory()));

            if (datablock.RegStorage() != null && datablock.RegStorage().ProgramCounter() != null)
            {
                writer.Write(PrettyString(XmlConsts.Kxml_program_counter, "0x" + datablock.RegStorage().ProgramCounter().Value.ToString("X8")));
                writer.Write(PrettyString(XmlConsts.Kxml_program_counter_symbol, datablock.RegStorage().ProgramCounter().Symbol));
            }

            writer.Write(PrettyString(XmlConsts.Kxml_misc_info, datablock.GetMiscInfo()));

            // Reporter not written.
            // Resetreason not written.

            writer.Write(PrettyString(XmlConsts.Kxml_uptime, datablock.Uptime()));
            writer.Write(PrettyString(XmlConsts.Kxml_siminfo, datablock.Imsi()));
            writer.Write(PrettyString(XmlConsts.Kxml_locinfo, datablock.LocInfo()));
            writer.Write(PrettyString(XmlConsts.Kxml_cellid, datablock.NetworkCell()));
            writer.Write(PrettyString(XmlConsts.Kxml_psninfo, datablock.SerialNumber()));

            if (datablock.UID() != null)
            {
                writer.Write(PrettyString(XmlConsts.Kxml_uid, "0x" + datablock.UID().Value.ToString("X8")));
            }

            writer.Write(PrettyString(XmlConsts.Kxml_diskinfo, datablock.DiskInfo()));
            writer.Write(PrettyString(XmlConsts.Kxml_phone_number, datablock.PhoneNumber()));

            writer.Write(PrettyString(XmlConsts.Kxml_report_ok, datablock.ReportOK()));
            writer.Write(PrettyString(XmlConsts.Kxml_report_fail, datablock.ReportFail()));
            writer.Write(PrettyString(XmlConsts.Kxml_report_param_name1, datablock.ReportParamName1()));
            writer.Write(PrettyString(XmlConsts.Kxml_report_param_value1, datablock.ReportParamValue1()));
            writer.Write(PrettyString(XmlConsts.Kxml_report_param_name2, datablock.ReportParamName2()));
            writer.Write(PrettyString(XmlConsts.Kxml_report_param_value2, datablock.ReportParamValue2()));
            writer.Write(PrettyString(XmlConsts.Kxml_report_param_name3, datablock.ReportParamName3()));
            writer.Write(PrettyString(XmlConsts.Kxml_report_param_value3, datablock.ReportParamValue3()));
            writer.Write(PrettyString(XmlConsts.Kxml_report_comments, datablock.ReportComments()));
        }
コード例 #2
0
        private static void WriteUniqueValues(XmlWriter aOutput, CXmlDataBlock datablock)
        {
            // Unique values
            aOutput.WriteStartElement(XmlConsts.Kxml_unique_values);

            // Hw version is not added because it doesn't exist.

            WriteDetail(aOutput, XmlConsts.Kxml_available_memory, datablock.FreeMemory());

            if (datablock.RegStorage() != null && datablock.RegStorage().ProgramCounter() != null)
            {
                WriteDetail(aOutput, XmlConsts.Kxml_program_counter, datablock.RegStorage().ProgramCounter().Value);
                WriteDetail(aOutput, XmlConsts.Kxml_program_counter_symbol, datablock.RegStorage().ProgramCounter().Symbol);
            }

            WriteDetail(aOutput, XmlConsts.Kxml_misc_info, datablock.GetMiscInfo());

            // Reporter not written.
            // Resetreason not written.

            WriteDetail(aOutput, XmlConsts.Kxml_uptime, datablock.Uptime());
            WriteDetail(aOutput, XmlConsts.Kxml_siminfo, datablock.Imsi());
            WriteDetail(aOutput, XmlConsts.Kxml_locinfo, datablock.LocInfo());
            WriteDetail(aOutput, XmlConsts.Kxml_cellid, datablock.NetworkCell());
            WriteDetail(aOutput, XmlConsts.Kxml_psninfo, datablock.SerialNumber());
            WriteDetail(aOutput, XmlConsts.Kxml_uid, datablock.UID());
            WriteDetail(aOutput, XmlConsts.Kxml_diskinfo, datablock.DiskInfo());
            WriteDetail(aOutput, XmlConsts.Kxml_phone_number, datablock.PhoneNumber());

            WriteDetail(aOutput, XmlConsts.Kxml_report_ok, datablock.ReportOK());
            WriteDetail(aOutput, XmlConsts.Kxml_report_fail, datablock.ReportFail());
            WriteDetail(aOutput, XmlConsts.Kxml_report_param_name1, datablock.ReportParamName1());
            WriteDetail(aOutput, XmlConsts.Kxml_report_param_value1, datablock.ReportParamValue1());
            WriteDetail(aOutput, XmlConsts.Kxml_report_param_name2, datablock.ReportParamName2());
            WriteDetail(aOutput, XmlConsts.Kxml_report_param_value2, datablock.ReportParamValue2());
            WriteDetail(aOutput, XmlConsts.Kxml_report_param_name3, datablock.ReportParamName3());
            WriteDetail(aOutput, XmlConsts.Kxml_report_param_value3, datablock.ReportParamValue3());
            WriteDetail(aOutput, XmlConsts.Kxml_report_comments, datablock.ReportComments());

            aOutput.WriteEndElement(); // unique values
        }