helper_functions.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef HELPER_FUNCTIONS_H
  2. #define HELPER_FUNCTIONS_H
  3. #include <open62541/server.h>
  4. #include <libconfig.h>
  5. /* Sets an OPC UA variable
  6. */
  7. UA_StatusCode setVariable(UA_Server* server, void *value, const UA_DataType *dataType, UA_NodeId variableNodeid);
  8. /* Sets and OPC UA range variable with min and max value
  9. */
  10. UA_StatusCode setEURangeVariable(UA_Server* server, UA_Double low, UA_Double high, UA_NodeId euRangeVariableNodeid);
  11. // UA State-machine handling
  12. bool inState(UA_Server* server, UA_NodeId currentStateIdNodeId, UA_NodeId stateNodeId);
  13. UA_StatusCode setCurrentState(UA_Server *server, UA_NodeId currentStateVariableNodeId, UA_NodeId currentStateVariableIdNodeId, UA_NodeId newStateNodeId);
  14. // Configuration file handling
  15. bool getIntFromConfig(const config_t* cfg, const char* name, int *res);
  16. bool getBoolFromConfig(const config_t* cfg, const char* name, bool *res);
  17. bool getStringFromConfig(const config_t* cfg, const char* name, char **res);
  18. bool getStringListFromConfig(const config_t* cfg, const char* name, char **res, int *listLength);
  19. bool getDoubleFromConfig(const config_t* cfg, const char* name, double *res);
  20. #endif /* HELPER_FUNCTIONS_H */