28 #ifndef __ONLP_THERMAL_H__ 29 #define __ONLP_THERMAL_H__ 32 #include <onlp/onlp.h> 38 ONLP_THERMAL_CAPS_GET_TEMPERATURE = (1 << 0),
39 ONLP_THERMAL_CAPS_GET_WARNING_THRESHOLD = (1 << 1),
40 ONLP_THERMAL_CAPS_GET_ERROR_THRESHOLD = (1 << 2),
41 ONLP_THERMAL_CAPS_GET_SHUTDOWN_THRESHOLD = (1 << 3),
46 ONLP_THERMAL_THRESHOLD_WARNING_DEFAULT = 45000,
47 ONLP_THERMAL_THRESHOLD_ERROR_DEFAULT = 55000,
48 ONLP_THERMAL_THRESHOLD_SHUTDOWN_DEFAULT = 60000,
55 #define ONLP_THERMAL_CAPS_ALL 0xF 60 #define ONLP_THERMAL_CAPS_GET_ANY_THRESHOLD \ 61 ( ONLP_THERMAL_CAPS_GET_WARNING_THRESHOLD | \ 62 ONLP_THERMAL_CAPS_GET_ERROR_THRESHOLD | \ 63 ONLP_THERMAL_CAPS_GET_SHUTDOWN_THRESHOLD ) 68 #define ONLP_THERMAL_THRESHOLD_INIT_DEFAULTS \ 69 { ONLP_THERMAL_THRESHOLD_WARNING_DEFAULT, \ 70 ONLP_THERMAL_THRESHOLD_ERROR_DEFAULT, \ 71 ONLP_THERMAL_THRESHOLD_SHUTDOWN_DEFAULT } 105 #define ONLP_THERMAL_INFO_CAP_IS_SET(_pinfo, _name) \ 106 ((_pinfo)->caps & ONLP_THERMAL_CAPS_##_name) 189 #define ONLP_THERMAL_CAPS_VALID(_e) \ 190 (onlp_thermal_caps_valid((_e))) 210 #define ONLP_THERMAL_THRESHOLD_VALID(_e) \ 211 (onlp_thermal_threshold_valid((_e))) onlp Configuration Header
int onlp_thermal_sw_init(void)
Software initialization of the thermal module.
onlp_thermal_caps_e
Definition: thermal.h:37
int onlp_thermal_caps_value(const char *str, onlp_thermal_caps_t *e, int substr)
int warning
Definition: thermal.h:90
aim_map_si_t onlp_thermal_caps_map[]
struct onlp_thermal_info_s::@1 thresholds
uint32_t onlp_oid_t
Definition: oids.h:52
int onlp_thermal_sw_denit(void)
Deinitialize the thermal software module.
int error
Definition: thermal.h:93
uint32_t caps
Definition: thermal.h:82
const char * onlp_thermal_threshold_desc(onlp_thermal_threshold_t e)
const char * onlp_thermal_threshold_name(onlp_thermal_threshold_t e)
int onlp_thermal_threshold_valid(onlp_thermal_threshold_t e)
int onlp_thermal_info_get(onlp_oid_t oid, onlp_thermal_info_t *rv)
Retrieve information about the given thermal id.
onlp_thermal_threshold_e
Definition: thermal.h:45
int onlp_thermal_info_to_json(onlp_thermal_info_t *info, cJSON **rv, uint32_t flags)
Convert a thermal info structure to json.
int shutdown
Definition: thermal.h:96
onlp_oid_hdr_t hdr
Definition: thermal.h:79
const char * onlp_thermal_caps_name(onlp_thermal_caps_t e)
int onlp_thermal_hdr_get(onlp_oid_t oid, onlp_oid_hdr_t *rv)
Retrieve the thermal's oid header.
int onlp_thermal_caps_valid(onlp_thermal_caps_t e)
int onlp_thermal_hw_init(uint32_t flags)
Hardware initialization of the thermal module.
aim_map_si_t onlp_thermal_threshold_desc_map[]
struct onlp_thermal_info_s onlp_thermal_info_t
enum onlp_thermal_caps_e onlp_thermal_caps_t
int onlp_thermal_info_to_user_json(onlp_thermal_info_t *info, cJSON **rv, uint32_t flags)
Convert a thermal info structure to user json.
enum onlp_thermal_threshold_e onlp_thermal_threshold_t
const char * onlp_thermal_caps_desc(onlp_thermal_caps_t e)
int mcelsius
Definition: thermal.h:85
int onlp_thermal_threshold_value(const char *str, onlp_thermal_threshold_t *e, int substr)
aim_map_si_t onlp_thermal_threshold_map[]
int onlp_thermal_info_from_json(cJSON *cj, onlp_thermal_info_t *info)
Convert a JSON object to a thermal info structure.
aim_map_si_t onlp_thermal_caps_desc_map[]