Sun Microsystems Netra CP2500 Programming Manual page 54

For the solaris operating system
Table of Contents

Advertisement

Sample envmond Application Program (Continued)
CODE EXAMPLE 2-1
}
if (get_child_by_name(platformh, sensor, &childh) != PICL_SUCCESS) {
}
get_sensor_thresholds(childh);
/* Read current sensor temperature */
if (picl_get_propval_by_name(childh, CURRENT_TEMPERATURE,
} else
set_sensor_threshold(childh, HI_WARNING_THRESHOLD, temp+5);
picl_shutdown();
return (0);
}
40
Netra CP2500 Board Programming Guide • March 2007
return (1);
fprintf(stderr, "Failed to get %s sensor.", sensor);
picl_shutdown();
return (1);
&temp, sizeof (temp)) != PICL_SUCCESS) {
fprintf(stderr, "Failed to read current temperature\n");
fprintf(stdout, "Current temperature = %d\n", temp);

Advertisement

Table of Contents
loading

Table of Contents