diff --git a/userspace/snmpd/wrsOSStatusGroup.c b/userspace/snmpd/wrsOSStatusGroup.c index 1ec13ea5e957308fbbb524fd34fa0e5a99a88e9d..a566b16dd9b3f12a54e4b880ec7b3759a986f3cb 100644 --- a/userspace/snmpd/wrsOSStatusGroup.c +++ b/userspace/snmpd/wrsOSStatusGroup.c @@ -149,10 +149,10 @@ time_t wrsOSStatus_data_fill(void) /*********************************************************************\ |*********************** wrsTemperatureWarning ***********************| \*********************************************************************/ - if (!wrsTemperature_s.temp_fpga_thold - && !wrsTemperature_s.temp_pll_thold - && !wrsTemperature_s.temp_psl_thold - && !wrsTemperature_s.temp_psr_thold) { + if (!wrsTemperature_s.wrsTempThresholdFPGA + && !wrsTemperature_s.wrsTempThresholdPLL + && !wrsTemperature_s.wrsTempThresholdPSL + && !wrsTemperature_s.wrsTempThresholdPSR) { /* no threshold are set */ wrsOSStatus_s.wrsTemperatureWarning = WRS_TEMPERATURE_WARNING_THOLD_NOT_SET; @@ -163,10 +163,10 @@ time_t wrsOSStatus_data_fill(void) * 2 is ok (WRS_TEMPERATURE_WARNING_OK), 3 is temperature too * high (WRS_TEMPERATURE_WARNING_TOO_HIGH) */ wrsOSStatus_s.wrsTemperatureWarning = 2 + - ((wrsTemperature_s.temp_fpga > wrsTemperature_s.temp_fpga_thold) - || (wrsTemperature_s.temp_pll > wrsTemperature_s.temp_pll_thold) - || (wrsTemperature_s.temp_psl > wrsTemperature_s.temp_psl_thold) - || (wrsTemperature_s.temp_psr > wrsTemperature_s.temp_psr_thold)); + ((wrsTemperature_s.wrsTempFPGA > wrsTemperature_s.wrsTempThresholdFPGA) + || (wrsTemperature_s.wrsTempPLL > wrsTemperature_s.wrsTempThresholdPLL) + || (wrsTemperature_s.wrsTempPSL > wrsTemperature_s.wrsTempThresholdPSL) + || (wrsTemperature_s.wrsTempPSR > wrsTemperature_s.wrsTempThresholdPSR)); } /*********************************************************************\ diff --git a/userspace/snmpd/wrsTemperatureGroup.c b/userspace/snmpd/wrsTemperatureGroup.c index d7a3f9cdb4cd4dcc766f4956b3d3d7977dca7731..f1b10c290901ceb380f938ba7bb7a2913dadf903 100644 --- a/userspace/snmpd/wrsTemperatureGroup.c +++ b/userspace/snmpd/wrsTemperatureGroup.c @@ -4,14 +4,14 @@ #include <libwr/config.h> static struct pickinfo wrsTemperature_pickinfo[] = { - FIELD(wrsTemperature_s, ASN_INTEGER, temp_fpga), - FIELD(wrsTemperature_s, ASN_INTEGER, temp_pll), - FIELD(wrsTemperature_s, ASN_INTEGER, temp_psl), - FIELD(wrsTemperature_s, ASN_INTEGER, temp_psr), - FIELD(wrsTemperature_s, ASN_INTEGER, temp_fpga_thold), - FIELD(wrsTemperature_s, ASN_INTEGER, temp_pll_thold), - FIELD(wrsTemperature_s, ASN_INTEGER, temp_psl_thold), - FIELD(wrsTemperature_s, ASN_INTEGER, temp_psr_thold), + FIELD(wrsTemperature_s, ASN_INTEGER, wrsTempFPGA), + FIELD(wrsTemperature_s, ASN_INTEGER, wrsTempPLL), + FIELD(wrsTemperature_s, ASN_INTEGER, wrsTempPSL), + FIELD(wrsTemperature_s, ASN_INTEGER, wrsTempPSR), + FIELD(wrsTemperature_s, ASN_INTEGER, wrsTempThresholdFPGA), + FIELD(wrsTemperature_s, ASN_INTEGER, wrsTempThresholdPLL), + FIELD(wrsTemperature_s, ASN_INTEGER, wrsTempThresholdPSL), + FIELD(wrsTemperature_s, ASN_INTEGER, wrsTempThresholdPSR), }; struct wrsTemperature_s wrsTemperature_s; @@ -22,16 +22,16 @@ static void get_thresholds(void) /* check wether config fields exist, atoi has to have valid string */ config_item = libwr_cfg_get("SNMP_TEMP_THOLD_FPGA"); if (config_item) - wrsTemperature_s.temp_fpga_thold = atoi(config_item); + wrsTemperature_s.wrsTempThresholdFPGA = atoi(config_item); config_item = libwr_cfg_get("SNMP_TEMP_THOLD_PLL"); if (config_item) - wrsTemperature_s.temp_pll_thold = atoi(config_item); + wrsTemperature_s.wrsTempThresholdPLL = atoi(config_item); config_item = libwr_cfg_get("SNMP_TEMP_THOLD_PSL"); if (config_item) - wrsTemperature_s.temp_psl_thold = atoi(config_item); + wrsTemperature_s.wrsTempThresholdPSL = atoi(config_item); config_item = libwr_cfg_get("SNMP_TEMP_THOLD_PSR"); if (config_item) - wrsTemperature_s.temp_psr_thold = atoi(config_item); + wrsTemperature_s.wrsTempThresholdPSR = atoi(config_item); } time_t wrsTemperature_data_fill(void) @@ -65,10 +65,10 @@ time_t wrsTemperature_data_fill(void) while (1) { ii = wrs_shm_seqbegin(hal_head); - wrsTemperature_s.temp_fpga = hal_shmem->temp.fpga >> 8; - wrsTemperature_s.temp_pll = hal_shmem->temp.pll >> 8; - wrsTemperature_s.temp_psl = hal_shmem->temp.psl >> 8; - wrsTemperature_s.temp_psr = hal_shmem->temp.psr >> 8; + wrsTemperature_s.wrsTempFPGA = hal_shmem->temp.fpga >> 8; + wrsTemperature_s.wrsTempPLL = hal_shmem->temp.pll >> 8; + wrsTemperature_s.wrsTempPSL = hal_shmem->temp.psl >> 8; + wrsTemperature_s.wrsTempPSR = hal_shmem->temp.psr >> 8; retries++; if (retries > 100) { diff --git a/userspace/snmpd/wrsTemperatureGroup.h b/userspace/snmpd/wrsTemperatureGroup.h index f84a1f75043af7447407ec98b3521d567f647216..cc3c94d015c7e4c2278be30284b1f78988fd9191 100644 --- a/userspace/snmpd/wrsTemperatureGroup.h +++ b/userspace/snmpd/wrsTemperatureGroup.h @@ -5,14 +5,14 @@ #define WRSTEMPERATURE_OID WRS_OID, 7, 1, 3 struct wrsTemperature_s { - int temp_fpga; /* FPGA temperature */ - int temp_pll; /* PLL temperature */ - int temp_psl; /* PSL temperature */ - int temp_psr; /* PSR temperature */ - int temp_fpga_thold; /* Threshold value for FPGA temperature */ - int temp_pll_thold; /* Threshold value for PLL temperature */ - int temp_psl_thold; /* Threshold value for PSL temperature */ - int temp_psr_thold; /* Threshold value for PSR temperature */ + int wrsTempFPGA; /* FPGA temperature */ + int wrsTempPLL; /* PLL temperature */ + int wrsTempPSL; /* PSL temperature */ + int wrsTempPSR; /* PSR temperature */ + int wrsTempThresholdFPGA; /* Threshold value for FPGA temperature */ + int wrsTempThresholdPLL; /* Threshold value for PLL temperature */ + int wrsTempThresholdPSL; /* Threshold value for PSL temperature */ + int wrsTempThresholdPSR; /* Threshold value for PSR temperature */ }; extern struct wrsTemperature_s wrsTemperature_s;