abRequest [1] = CMD_GET_SENS_RD;
/* command */
abRequest [2] = bSensorId;
vBmcSmicSmsMessageWrite (abRequest, 3);
vBmcSmicSmsMessageRead (abResponse, &bLength);
if (abResponse [2] != COMPLETION_OK)
wStatus = E_COMPLETION;
else
{
psSensorReading->bData
= abResponse [3];
psSensorReading->bStatus = abResponse [4];
}
return wStatus;
}
The following example shows how to read the CPU temperature sensor and voltage sensors:
/* read CPU temperature, sensor ID = 01h */
wStatus = wGetSensorReadingCmd (0x01, &sSensorReading);
if wStatus==E_OK)
printf(”CPU temperature is %dC\n”, sSensorReading.bData);
/* read +12V Power Supply Voltage, sensor ID = 10h */
wStatus = wGetSensorReadingCmd (0x10, &sReading);
if (wStatus == E_OK)
printf (“Power 12V = %fV\n”, sReading.bData * 0.0708);
/* read +5V Power Supply Voltage, sensor ID = 11h */
wStatus = wGetSensorReadingCmd (0x11, &sReading);
if (wStatus == E_OK)
printf (“Power 5V = %fV\n”, sReading.bData * 0.0244);
/* read +3.3V Power Supply Voltage, sensor ID = 12h */
wStatus = wGetSensorReadingCmd (0x12, &sReading);
if (wStatus == E_OK)
printf (“Power 3.3V = %fV\n”, sReading.bData * 0.0244);
/* read -12V Power Supply Voltage, sensor ID = 13h */
wStatus = wGetSensorReadingCmd (0x13, &sReading);
if (wStatus == E_OK)
printf (“Power Supply -12V = %fV\n”, sReading.bData / (-12.8));
7-20
PP 110/01x
Intelligent Platform Manager Interface
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com