Sun Microsystems Netra CP2500 Programming Manual page 53

For the solaris operating system
Table of Contents

Advertisement

Sample envmond Application Program (Continued)
CODE EXAMPLE 2-1
if (picl_get_propval_by_name(nodeh, LO_SHUTDOWN_THRESHOLD,
} else
if (picl_get_propval_by_name(nodeh, LO_WARNING_THRESHOLD,
} else
}
void
set_sensor_thresholds(picl_nodehdl_t nodeh, char *threshold, int8_t value)
{
int8_t
if (picl_set_propval_by_name(nodeh, threshold, &new_value,
}
int
main(void)
{
int
int8_t
char
picl_nodehdl_t
picl_nodehdl_t
picl_nodehdl_t
if (picl_initialize() != PICL_SUCCESS) {
}
if (picl_get_root(&rooth) != PICL_SUCCESS) {
}
if (get_child_by_name(rooth, "platform", &platformh) != PICL_SUCCESS) {
&threshold, sizeof (threshold)) != PICL_SUCCESS) {
fprintf(stderr, "Failed to read low shutdown threshold.");
fprintf(stdout, "Low shutdown threshold = %d\n", threshold);
&threshold, sizeof (threshold)) != PICL_SUCCESS) {
fprintf(stderr, "Failed to read low warning threshold.");
fprintf(stderr, "Low warning threshold = %d\n", threshold);
new_value = value;
sizeof (new_value)) != PICL_SUCCESS)
fprintf(stderr, "Failed to set *s\n", threshold);
warning_temp;
temp;
*sensor = "CPU-sensor";
rooth;
platformh;
childh;
fprintf(stderr, "Failed to initialise picl\n");
return (1);
fprintf(stderr, "Failed to get root node\n");
picl_shutdown();
return (1);
fprintf(stderr, "Failed to get platform node\n");
picl_shutdown();
Chapter 2 Environmental Monitoring
39

Advertisement

Table of Contents
loading

Table of Contents