read temperature via S.M.A.R.T and display
This commit is contained in:
@ -46,6 +46,11 @@ uint32_t Drive::getPowerCycles(void)
|
||||
return u32PowerCycles;
|
||||
}
|
||||
|
||||
uint32_t Drive::getTemperature(void)
|
||||
{
|
||||
return u32Temperature;
|
||||
}
|
||||
|
||||
string Drive::sCapacityToText()
|
||||
{
|
||||
char acBuffer[16];
|
||||
@ -91,6 +96,11 @@ string Drive::sPowerCyclesToText()
|
||||
return to_string(getPowerCycles());
|
||||
}
|
||||
|
||||
string Drive::sTemperatureToText()
|
||||
{
|
||||
return to_string(getTemperature())+" C";;
|
||||
}
|
||||
|
||||
void Drive::setTaskPercentage(double d32TaskPercentage)
|
||||
{
|
||||
if(d32TaskPercentage <= 100)
|
||||
@ -122,7 +132,8 @@ void Drive::setDriveSMARTData( string modelFamily,
|
||||
uint64_t capacity,
|
||||
uint32_t errorCount,
|
||||
uint32_t powerOnHours,
|
||||
uint32_t powerCycle)
|
||||
uint32_t powerCycle,
|
||||
uint32_t temperature)
|
||||
{
|
||||
this->sModelFamily = modelFamily;
|
||||
sModelName = modelName;
|
||||
@ -131,6 +142,7 @@ void Drive::setDriveSMARTData( string modelFamily,
|
||||
u32ErrorCount = errorCount;
|
||||
u32PowerOnHours = powerOnHours;
|
||||
u32PowerCycles = powerCycle;
|
||||
u32Temperature = temperature;
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user