Ejemplo n.º 1
0
int main() {

	updateSensorRecordFromSSRAESC(testrec_bootprogress);
	updateSensorRecordFromSSRAESC(testrec_sensor1);
	updateSensorRecordFromSSRAESC(testrec_sensor2);


	return 0;
}
Ejemplo n.º 2
0
// TODO: Saves the sensor information to a file in /tmp.  This
// will need to change to calling the correct method 
// once it exists in the stack.  
ipmi_ret_t ipmi_sen_set_sensor(ipmi_netfn_t netfn, ipmi_cmd_t cmd, 
                             ipmi_request_t request, ipmi_response_t response, 
                             ipmi_data_len_t data_len, ipmi_context_t context)
{
    FILE *fp;
    char string[16];
    sensor_data_t *reqptr = (sensor_data_t*)request;
    ipmi_ret_t rc = IPMI_CC_OK;
    unsigned short rlen;

    rlen = (unsigned short) *data_len;

    sprintf(string, "%s%02x", "/tmp/sen", reqptr->sennum);

    printf("IPMI SET_SENSOR [%s]\n",string);

    if ((fp = fopen(string, "wb")) != NULL) {
        fwrite(reqptr,rlen,1,fp);
        fclose(fp);
    } else {
        fprintf(stderr, "Error trying to write to sensor file %s\n",string);
        ipmi_ret_t rc = IPMI_CC_INVALID;        
    }

    updateSensorRecordFromSSRAESC(reqptr);

    *data_len=0;


    return rc;
}
Ejemplo n.º 3
0
ipmi_ret_t ipmi_sen_set_sensor(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
                             ipmi_request_t request, ipmi_response_t response,
                             ipmi_data_len_t data_len, ipmi_context_t context)
{
    sensor_data_t *reqptr = (sensor_data_t*)request;
    ipmi_ret_t rc = IPMI_CC_OK;

    printf("IPMI SET_SENSOR [0x%02x]\n",reqptr->sennum);

    updateSensorRecordFromSSRAESC(reqptr);

    *data_len=0;

    return rc;
}