Specifications

INTELLIGENT PLATFORM MANAGEMENT INTERFACE
PP 41x/03x 7-19
7.6.3 Reading Sensors
The IPMI specification supports many commands to manage and interrogate sensors. The
following program fragment illustrates how the current reading of a sensor can be obtained.
/* network function codes */
#define NFC_SENSOR_EVENT_RQ 0x04
/* commands */
#define CMD_GET_SENS_RD 0x2D /* Get sensor reading */
/* Completion codes */
#define COMPLETION_OK 0 /* Completion code OK */
/* error codes */
#define E_OK 0 /* OK */
#define E_COMPLETION 0x400 /* wrong completion code */
/* forward declarations */
void vBmcSmicSmsMessageWrite (const unsigned char *pbMessage,
unsigned char bLength);
void vBmcSmicSmsMessageRead (unsigned char *pbMessage,
unsigned char *bMessageLength);
/* response data structure provided to wGetSensorReadingCmd() */
struct SENSOR_READING
{
unsigned char bData;
unsigned char bStatus;
};
/******************************************************************************
*
* wGetSensorReadingCmd
*
* This function gets current sensor reading.
*
* RETURNS: E_OK if it is OK, or error code
*
*/
unsigned short int wGetSensorReadingCmd
(
unsigned char bSensorId,
struct SENSOR_READING *psSensorReading
)
{
unsigned char bLength;