Commit 3f93266e authored by Adam Wujek's avatar Adam Wujek 💬

userspace/snmpd: (no tech change) rename fields in the wrsTemperature_s

Rename fields in the struct wrsTemperature_s to reflect SNMP objects'
names.

temp_fpga -> wrsTempFPGA
temp_pll -> wrsTempPLL
temp_psl -> wrsTempPSL
temp_psr -> wrsTempPSR
temp_fpga_thold -> wrsTempThresholdFPGA
temp_pll_thold -> wrsTempThresholdPLL
temp_psl_thold -> wrsTempThresholdPSL
temp_psr_thold -> wrsTempThresholdPSR
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent a7c0497b
......@@ -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));
}
/*********************************************************************\
......
......@@ -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) {
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment