12345678910111213141516171819202122232425262728293031323334 |
- #ifndef HELPER_FUNCTIONS_H
- #define HELPER_FUNCTIONS_H
- #include <open62541/server.h>
- #include <libconfig.h>
- /* Sets an OPC UA variable
- */
- UA_StatusCode setVariable(UA_Server* server, void *value, const UA_DataType *dataType, UA_NodeId variableNodeid);
- /* Sets and OPC UA range variable with min and max value
- */
- UA_StatusCode setEURangeVariable(UA_Server* server, UA_Double low, UA_Double high, UA_NodeId euRangeVariableNodeid);
- // UA State-machine handling
- bool inState(UA_Server* server, UA_NodeId currentStateIdNodeId, UA_NodeId stateNodeId);
- UA_StatusCode setCurrentState(UA_Server *server, UA_NodeId currentStateVariableNodeId, UA_NodeId currentStateVariableIdNodeId, UA_NodeId newStateNodeId);
- // Configuration file handling
- bool getIntFromConfig(const config_t* cfg, const char* name, int *res);
- bool getBoolFromConfig(const config_t* cfg, const char* name, bool *res);
- bool getStringFromConfig(const config_t* cfg, const char* name, char **res);
- bool getStringListFromConfig(const config_t* cfg, const char* name, char **res, int *listLength);
- bool getDoubleFromConfig(const config_t* cfg, const char* name, double *res);
- #endif /* HELPER_FUNCTIONS_H */
|