private void organizeSmartValue_NVMe(SMARTLog_NVMe smartLog, ref List <string[]> rowCollection) { rowCollection.Add(new string[4] { "0", "Critical Warning", smartLog.critical_warning.content, smartLog.critical_warning.raw }); rowCollection.Add(new string[4] { "1-2", "Composite Temperature", smartLog.temperature.content, smartLog.temperature.raw }); rowCollection.Add(new string[4] { "3", "Available Spare", smartLog.avail_spare.content, smartLog.avail_spare.raw }); rowCollection.Add(new string[4] { "4", "Available Spare Threshold", smartLog.spare_thresh.content, smartLog.spare_thresh.raw }); rowCollection.Add(new string[4] { "5", "Percentage Use", smartLog.percent_used.content, smartLog.percent_used.raw }); rowCollection.Add(new string[4] { "6", "Endurance Group Critical Warning Summary", smartLog.endu_grp_crit_warn_sumry.content, smartLog.endu_grp_crit_warn_sumry.raw }); rowCollection.Add(new string[4] { "7-31", "Reserved", smartLog.rsvd7.content, smartLog.rsvd7.raw }); rowCollection.Add(new string[4] { "32-47", "Data Units Read", smartLog.data_units_read.content, smartLog.data_units_read.raw }); rowCollection.Add(new string[4] { "48-63", "Data Units Written", smartLog.data_units_written.content, smartLog.data_units_written.raw }); rowCollection.Add(new string[4] { "64-79", "Host Read Commands", smartLog.host_reads.content, smartLog.host_reads.raw }); rowCollection.Add(new string[4] { "80-95", "Host Write Commands", smartLog.host_writes.content, smartLog.host_writes.raw }); rowCollection.Add(new string[4] { "96-111", "Controller Busy Time", smartLog.ctrl_busy_time.content, smartLog.ctrl_busy_time.raw }); rowCollection.Add(new string[4] { "112-127", "Power Cycles", smartLog.power_cycles.content, smartLog.power_cycles.raw }); rowCollection.Add(new string[4] { "128-143", "Power On Hours", smartLog.power_on_hours.content, smartLog.power_on_hours.raw }); rowCollection.Add(new string[4] { "144-159", "Unsafe Shutdowns", smartLog.unsafe_shutdowns.content, smartLog.unsafe_shutdowns.raw }); rowCollection.Add(new string[4] { "160-175", "Media and Data integrity Errors", smartLog.media_errors.content, smartLog.media_errors.raw }); rowCollection.Add(new string[4] { "176-191", "Number of Error information Log Entries", smartLog.num_err_log_entries.content, smartLog.num_err_log_entries.raw }); rowCollection.Add(new string[4] { "192-195", "Warning Composite Temperature Time", smartLog.warning_temp_time.content, smartLog.warning_temp_time.raw }); rowCollection.Add(new string[4] { "196-199", "Critical Composite Temperature Time", smartLog.critical_comp_time.content, smartLog.critical_comp_time.raw }); }
private void parseSmartInformation_NVMe(byte[] SMARTinfo, ref List <string[]> rowCollection) { SMARTLog_NVMe smartLog_nvme = new SMARTLog_NVMe(); separatSmartValue_NVMe(SMARTinfo, ref smartLog_nvme); organizeSmartValue_NVMe(smartLog_nvme, ref rowCollection); }
private void separatSmartValue_NVMe(byte[] buf_smart, ref SMARTLog_NVMe smartLog) { smartLog.critical_warning.content = (buf_smart[0]).ToString(); smartLog.temperature.content = ((buf_smart[2] << 8) + buf_smart[1] - 273).ToString(); smartLog.avail_spare.content = (buf_smart[3]).ToString(); smartLog.spare_thresh.content = (buf_smart[4]).ToString(); smartLog.percent_used.content = (buf_smart[5]).ToString(); smartLog.endu_grp_crit_warn_sumry.content = Convert.ToString(buf_smart[6], 2).PadLeft(8, '0'); smartLog.rsvd7.content = getTableData_NVMe(buf_smart, 7, 31, false); smartLog.data_units_read.content = getTableData_NVMe(buf_smart, 32, 47, false); smartLog.data_units_written.content = getTableData_NVMe(buf_smart, 48, 63, false); smartLog.host_reads.content = getTableData_NVMe(buf_smart, 64, 79, false); smartLog.host_writes.content = getTableData_NVMe(buf_smart, 80, 95, false); smartLog.ctrl_busy_time.content = getTableData_NVMe(buf_smart, 96, 111, false); smartLog.power_cycles.content = getTableData_NVMe(buf_smart, 112, 127, false); smartLog.power_on_hours.content = getTableData_NVMe(buf_smart, 128, 143, false); smartLog.unsafe_shutdowns.content = getTableData_NVMe(buf_smart, 144, 159, false); smartLog.media_errors.content = getTableData_NVMe(buf_smart, 160, 175, false); smartLog.num_err_log_entries.content = getTableData_NVMe(buf_smart, 176, 191, false); smartLog.warning_temp_time.content = getTableData_NVMe(buf_smart, 192, 195, false); smartLog.critical_comp_time.content = getTableData_NVMe(buf_smart, 196, 199, false); smartLog.critical_warning.raw = (buf_smart[0]).ToString("X8"); smartLog.temperature.raw = ((buf_smart[2] << 8) + buf_smart[1]).ToString("X8"); smartLog.avail_spare.raw = (buf_smart[3]).ToString("X8"); smartLog.spare_thresh.raw = (buf_smart[4]).ToString("X8"); smartLog.percent_used.raw = (buf_smart[5]).ToString("X8"); smartLog.endu_grp_crit_warn_sumry.raw = (buf_smart[6]).ToString("X8"); smartLog.rsvd7.raw = getTableData_NVMe(buf_smart, 7, 31, true); smartLog.data_units_read.raw = getTableData_NVMe(buf_smart, 32, 47, true); smartLog.data_units_written.raw = getTableData_NVMe(buf_smart, 48, 63, true); smartLog.host_reads.raw = getTableData_NVMe(buf_smart, 64, 79, true); smartLog.host_writes.raw = getTableData_NVMe(buf_smart, 80, 95, true); smartLog.ctrl_busy_time.raw = getTableData_NVMe(buf_smart, 96, 111, true); smartLog.power_cycles.raw = getTableData_NVMe(buf_smart, 112, 127, true); smartLog.power_on_hours.raw = getTableData_NVMe(buf_smart, 128, 143, true); smartLog.unsafe_shutdowns.raw = getTableData_NVMe(buf_smart, 144, 159, true); smartLog.media_errors.raw = getTableData_NVMe(buf_smart, 160, 175, true); smartLog.num_err_log_entries.raw = getTableData_NVMe(buf_smart, 176, 191, true); smartLog.warning_temp_time.raw = getTableData_NVMe(buf_smart, 192, 195, true); smartLog.critical_comp_time.raw = getTableData_NVMe(buf_smart, 196, 199, true); }