static int onlp_fan_info_get_locked__(onlp_oid_t oid, onlp_fan_info_t* fip) { int rv; VALIDATE(oid); /* Get the information struct from the platform */ rv = onlp_fani_info_get(oid, fip); if(rv >= 0) { #if ONLP_CONFIG_INCLUDE_PLATFORM_OVERRIDES == 1 /* * Optional override from the config file. * This is usually just for testing. */ int id = ONLP_OID_ID_GET(oid); cJSON* entry = NULL; cjson_util_lookup(onlp_json_get(0), &entry, "overrides.fan.%d", id); onlp_fani_info_from_json__(entry, fip, 0); #endif if(fip->percentage && fip->rpm == 0) { /* Approximate RPM based on a 10,000 RPM Maximum */ fip->rpm = fip->percentage * 100; } } return rv; }
static int onlp_thermal_info_get_locked__(onlp_oid_t oid, onlp_thermal_info_t* info) { int rv; VALIDATE(oid); rv = onlp_thermali_info_get(oid, info); if(rv >= 0) { #if ONLP_CONFIG_INCLUDE_PLATFORM_OVERRIDES == 1 int id = ONLP_OID_ID_GET(oid); cJSON* entry = NULL; cjson_util_lookup(onlp_json_get(0), &entry, "overrides.thermal.%d", id); onlp_thermali_info_from_json__(entry, info, 0); #endif } return rv; }