Subversion Repositories f9daq

Rev

Rev 154 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
151 f9daq 1
#ifndef WIENER_SNMP_H
2
#define WIENER_SNMP_H
3
 
4
#ifdef _MSC_VER
5
#define EXPORT extern "C" _declspec(dllexport)
6
#else
7
#define EXPORT extern "C"
8
#endif
9
 
10
#define WIN32_LEAN_AND_MEAN
11
 
154 f9daq 12
//SAMO #include <net-snmp/net-snmp-config.h>
13
#include "net-snmp-config.h" // SAMO
14
//SAMO #define NET_SNMP_SNMPV3_H                   // we don't need SNMPV3 (one include file is missing)
151 f9daq 15
#include <net-snmp/net-snmp-includes.h>
16
 
17
typedef void *HSNMP;   // SNMP handle (like FILE)
18
 
19
// DLL functions
20
EXPORT void   snmpSetStdErrLog(void);
21
EXPORT void   snmpSetFileLog(const char * const fileName);
22
EXPORT unsigned int snmpGetVersion(void);
23
EXPORT char  *snmpGetVersionString(void);
24
 
25
EXPORT int    snmpInit(void);
26
EXPORT void   snmpCleanup(void);
27
EXPORT void   snmpSetReadCommunityName(const char * const readCommunityName);
28
EXPORT void   snmpSetWriteCommunityName(const char * const writeCommunityName);
29
 
30
EXPORT HSNMP  snmpOpen(const char * const ipAddress);
31
EXPORT void   snmpClose(HSNMP session);
32
EXPORT char  *snmpGetLastError(void);
33
 
34
// System Functions
35
EXPORT char *getSysDescr(HSNMP session);
36
EXPORT int  getMainSwitch(HSNMP session);
37
EXPORT int  setMainSwitch(HSNMP session, int value);
38
EXPORT int  getMainStatus(HSNMP session);
39
EXPORT int  getVmeReset(HSNMP session);
40
EXPORT int  setVmeReset(HSNMP session);
41
EXPORT int  getIpStaticAddress(HSNMP session);
42
EXPORT int  setIpStaticAddress(HSNMP session, int value);
43
EXPORT char *getPsSerialNumber(HSNMP session);
44
 
45
// Output Counts
46
EXPORT int  getOutputNumber(HSNMP session);
47
EXPORT int  getOutputGroups(HSNMP session);
48
 
49
//Output Channel Information
50
//std::string  getOutputName(HSNMP session, int channel);
51
EXPORT int     getOutputGroup(HSNMP session, int channel);
52
EXPORT int     getOutputStatus(HSNMP session, int channel);
53
EXPORT int     getChannelStatus(HSNMP m_sessmp, int channel);
54
EXPORT double  getOutputSenseMeasurement(HSNMP session, int channel);
55
EXPORT double  getOutputTerminalMeasurement(HSNMP session, int channel);
56
EXPORT double  getCurrentMeasurement(HSNMP session, int channel);
57
EXPORT int     getTemperatureMeasurement(HSNMP session, int channel);
58
EXPORT int     setChannelSwitch(HSNMP session, int channel, int value);
59
EXPORT int     setOutputSwitch(HSNMP session, int channel, int value);
60
EXPORT int     getChannelSwitch(HSNMP session, int channel);
61
EXPORT int     getOutputSwitch(HSNMP session, int channel);
62
EXPORT int     setHighVoltageGroupsSwitch(HSNMP session, int value);
63
EXPORT int     getHighVoltageGroupsSwitch(HSNMP session);
64
EXPORT int     setLowVoltageGroupsSwitch(HSNMP session, int value);
65
EXPORT int     getLowVoltageGroupsSwitch(HSNMP session);
66
EXPORT double  getOutputVoltage(HSNMP session, int channel);
67
EXPORT double  setOutputVoltage(HSNMP session, int channel, double value);
68
EXPORT double  getOutputCurrent(HSNMP session, int channel);
69
EXPORT double  setOutputCurrent(HSNMP session, int channel, double value);
70
EXPORT double  getOutputRiseRate(HSNMP session, int channel);
71
EXPORT double  setOutputRiseRate(HSNMP session, int channel, double value);
72
EXPORT double  getOutputFallRate(HSNMP session, int channel);
73
EXPORT double  setOutputFallRate(HSNMP session, int channel, double value);
74
EXPORT double  getOutputCurrentRiseRate(HSNMP session, int channel);
75
EXPORT double  setOutputCurrentRiseRate(HSNMP session, int channel, double value);
76
EXPORT double  getOutputCurrentFallRate(HSNMP session, int channel);
77
EXPORT double  setOutputCurrentFallRate(HSNMP session, int channel, double value);
78
EXPORT int     getOutputSupervisionBehavior(HSNMP session, int channel);
79
EXPORT int     setOutputSupervisionBehavior(HSNMP session, int channel, int value);
80
EXPORT double  getOutputSupervisionMinSenseVoltage(HSNMP session, int channel);
81
EXPORT double  setOutputSupervisionMinSenseVoltage(HSNMP session, int channel, double value);
82
EXPORT double  getOutputSupervisionMaxSenseVoltage(HSNMP session, int channel);
83
EXPORT double  setOutputSupervisionMaxSenseVoltage(HSNMP session, int channel, double value);
84
EXPORT double  getOutputSupervisionMaxTerminalVoltage(HSNMP session, int channel);
85
EXPORT double  setOutputSupervisionMaxTerminalVoltage(HSNMP session, int channel, double value);
86
EXPORT double  getOutputSupervisionMaxCurrent(HSNMP session, int channel);
87
EXPORT double  setOutputSupervisionMaxCurrent(HSNMP session, int channel, double value);
88
EXPORT int     setOutputSupervisionMaxTemperature(HSNMP session, int channel, int value);
89
EXPORT double  getOutputConfigMaxSenseVoltage(HSNMP session, int channel);
90
EXPORT double  getOutputConfigMaxTerminalVoltage(HSNMP session, int channel);
91
EXPORT double  getOutputConfigMaxCurrent(HSNMP session, int channel);
92
EXPORT double  getOutputSupervisionMaxPower(HSNMP session, int channel);
93
EXPORT int     getOutputTripTimeMaxCurrent(HSNMP session, int channel);
94
EXPORT int     setOutputTripTimeMaxCurrent(HSNMP session, int channel, int delay);
95
 
96
//Sensor Information functions
97
EXPORT int  getSensorNumber(HSNMP session);
98
EXPORT int  getSensorTemp(HSNMP session, int sensor);
99
EXPORT int  getSensorWarningTemperature(HSNMP session, int sensor);
100
EXPORT int  setSensorWarningTemperature(HSNMP session, int sensor, int value);
101
EXPORT int  getSensorFailureTemperature(HSNMP session, int sensor);
102
EXPORT int  setSensorFailureTemperature(HSNMP session, int sensor, int value);
103
 
104
//SNMP Community Name Functions
105
//std::string  getSnmpCommunityName(HSNMP session, int index);
106
//std::string  setSnmpCommunityName(HSNMP session, int index , int value);
107
 
108
//Power Supply Detail Functions
109
//std::string  getPsFirmwareVersion(HSNMP session);
110
//std::string  getPsSerialNumber(HSNMP session);
111
EXPORT int    getPsOperatingTime(HSNMP session);
112
EXPORT double getPsAuxVoltage(HSNMP session, int auxIndex);
113
EXPORT double getPsAuxCurrent(HSNMP session, int auxIndex);
114
//std::string  getPsDirectAccess(HSNMP session);
115
//std::string  setPsDirectAccess(HSNMP session);
116
 
117
//Fan Tray Functions
118
//std::string  getFanFirmwareVersion(HSNMP session);
119
//std::string  getFanSerialNumber(HSNMP session);
120
EXPORT int  getFanOperatingTime(HSNMP session);
121
EXPORT int  getFanAirTemperature(HSNMP session);
122
EXPORT int  getFanSwitchOffDelay(HSNMP session);
123
EXPORT int  setFanSwitchOffDelay(HSNMP session, int value);
124
EXPORT int  getFanNominalSpeed(HSNMP session);
125
EXPORT int  setFanNominalSpeed(HSNMP session, int value);
126
EXPORT int  getFanNumberOfFans(HSNMP session);
127
EXPORT int  getFanSpeed(HSNMP session, int fan);
128
 
129
// Module functions
130
EXPORT char  *getModuleDescription(HSNMP session, int slot);
131
EXPORT double getModuleSupply24(HSNMP session, int slot);
132
EXPORT double getModuleSupply5(HSNMP session, int slot);
133
EXPORT double getModuleAuxTemperature(HSNMP session, int slot, int index);
134
EXPORT double getModuleHardwareLimitVoltage(HSNMP session, int slot);
135
EXPORT double getModuleHardwareLimitCurrent(HSNMP session, int slot);
136
EXPORT double getModuleRampSpeedVoltage(HSNMP session, int slot);
137
EXPORT double setModuleRampSpeedVoltage(HSNMP session, int slot, double value);
138
EXPORT double getModuleRampSpeedCurrent(HSNMP session, int slot);
139
EXPORT double setModuleRampSpeedCurrent(HSNMP session, int slot, double value);
140
EXPORT int    getModuleStatus(HSNMP session, int slot);
141
EXPORT int    getModuleEventStatus(HSNMP session, int slot);
142
EXPORT int    setModuleDoClear(HSNMP session, int slot);
143
 
144
/**
145
 * @enum MaximumCrateValues
146
 */
147
typedef enum MaximumCrateValues {
148
        MaxModuleAuxSupplies = 2,     ///< The maximum number of module auxiliary supply measurements
149
        MaxModuleAuxTemperatures = 4, ///< The maximum number of module temperature sensors (iseg HV only)
150
        MaxCommunities = 4,           ///< The maximum number of SNMP community names
151
        MaxFans = 6,
152
        MaxPsAuxSupplies = 8,
153
        MaxSlotsPerCrate = 10,        ///< The number of slots per crate
154
        MaxSensors = 12,              ///< The maximum
155
        MaxChannelsPerSlot = 100,     ///< The maximum number of channels per slot
156
        MaxChannelsPerCrate = 1000    ///< The maximum number of channels per crate
157
} MaximumCrateValues;
158
 
159
/**
160
 * @struct SnmpDoubleBuffer
161
 * This struct is used to pass double parameters to setMultiple... functions
162
 * and for the result value of getMultiple.../setMultiple... functions.
163
 */
164
typedef struct SnmpDoubleBuffer {
165
        int size;                         ///< The number of values used in value[]
166
        double value[MaxChannelsPerSlot]; ///< An array of max. 100 double values
167
} SnmpDoubleBuffer;
168
 
169
/**
170
 * @struct SnmpIntegerBuffer
171
 * This struct is used to pass integer parameters to setMultiple... functions
172
 * and for the result value of getMultiple.../setMultiple... functions.
173
*/
174
typedef struct SnmpIntegerBuffer {
175
        int size;                      ///< The number of values used in value[]
176
        int value[MaxChannelsPerSlot]; ///< An array of max. 100 int values
177
} SnmpIntegerBuffer;
178
 
179
// Functions for multiple data transfer in one SNMP packet
180
EXPORT SnmpIntegerBuffer *getMultipleChannelStatuses(HSNMP session, int start, int size);
181
EXPORT SnmpIntegerBuffer *getMultipleOutputStatuses(HSNMP session, int start, int size);
182
EXPORT SnmpIntegerBuffer *getMultipleOutputSwitches(HSNMP session, int start, int size);
183
EXPORT SnmpIntegerBuffer *setMultipleOutputSwitches(HSNMP session, int start, SnmpIntegerBuffer *values);
184
EXPORT SnmpDoubleBuffer *getMultipleOutputVoltages(HSNMP session, int start, int size);
185
EXPORT SnmpDoubleBuffer *setMultipleOutputVoltages(HSNMP session, int start, SnmpDoubleBuffer *values);
186
EXPORT SnmpDoubleBuffer *getMultipleMeasurementTerminalVoltages(HSNMP session, int start, int size);
187
EXPORT SnmpDoubleBuffer *getMultipleOutputMeasurementTerminalVoltages(HSNMP session, int start, int size);
188
EXPORT SnmpDoubleBuffer *getMultipleOutputConfigMaxTerminalVoltages(HSNMP session, int start, int size);
189
EXPORT SnmpDoubleBuffer *getMultipleOutputCurrents(HSNMP session, int start, int size);
190
EXPORT SnmpDoubleBuffer *setMultipleOutputCurrents(HSNMP session, int start, SnmpDoubleBuffer *values);
191
EXPORT SnmpDoubleBuffer *getMultipleMeasurementCurrents(HSNMP session, int start, int size);
192
EXPORT SnmpDoubleBuffer *getMultipleOutputMeasurementCurrents(HSNMP session, int start, int size);
193
EXPORT SnmpDoubleBuffer *getMultipleOutputConfigMaxCurrents(HSNMP session, int start, int size);
194
EXPORT SnmpIntegerBuffer *getMultipleOutputTripTimeMaxCurrents(HSNMP session, int start, int size);
195
EXPORT SnmpIntegerBuffer *setMultipleOutputTripTimeMaxCurrents(HSNMP session, int start, SnmpIntegerBuffer *values);
196
EXPORT SnmpIntegerBuffer *getMultipleOutputSupervisionBehaviors(HSNMP session, int start, int size);
197
EXPORT SnmpIntegerBuffer *setMultipleOutputSupervisionBehaviors(HSNMP session, int start, SnmpIntegerBuffer *values);
198
 
199
#endif