diff --git a/.github/workflows/render-documentation.yml b/.github/workflows/render-documentation.yml
index 9b96a61..e9ac03b 100644
--- a/.github/workflows/render-documentation.yml
+++ b/.github/workflows/render-documentation.yml
@@ -25,5 +25,5 @@ jobs:
with:
source-path: './src'
target-path: './docs/api.md'
- exclude-pattern: '*/open62541/* open62541.h'
+ exclude-pattern: '*/open62541/* open62541.h o1heap.h'
commit: ${{ github.event_name != 'pull_request' }} # Only commit changes if not a PR
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 9496e94..b0afc13 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
.vscode/
.idea/
node_modules
+doxygen-build/
+moxygen.log
diff --git a/docs/api.md b/docs/api.md
index 1e0f360..3f6cb4d 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -2,43 +2,51 @@
Members | Descriptions
--------------------------------|---------------------------------------------
-`namespace ` [`opcua`](#namespaceopcua) |
-`struct ` [`O1HeapDiagnostics`](#struct_o1_heap_diagnostics) | Runtime diagnostic information. This information can be used to facilitate runtime self-testing, as required by certain safety-critical development guidelines. If assertion checks are not disabled, the library will perform automatic runtime self-diagnostics that trigger an assertion failure if a heap corruption is detected. Health checks and validation can be done with o1heapDoInvariantsHold().
+`namespace ` [`opcua`](#namespaceopcua) | opcua is used as enclosing namespace for all parts of the Arduino_open62541 library in order to avoid naming conflicts with already existing frameworks pertaining the Arduino [Opta](#classopcua_1_1_opta).
# namespace `opcua`
+opcua is used as enclosing namespace for all parts of the Arduino_open62541 library in order to avoid naming conflicts with already existing frameworks pertaining the Arduino [Opta](#classopcua_1_1_opta).
+
## Summary
Members | Descriptions
--------------------------------|---------------------------------------------
-`public time_t ` [`cvt_time`](#cvt__time_8h_1ac8a236e4356144a3ee7ebede7d49cfa7)`(char const * time)` |
-`class ` [`opcua::AnalogExpansion`](#classopcua_1_1_analog_expansion) |
-`class ` [`opcua::DigitalExpansion`](#classopcua_1_1_digital_expansion) |
-`class ` [`opcua::DigitalMechExpansion`](#classopcua_1_1_digital_mech_expansion) |
-`class ` [`opcua::DigitalStSolidExpansion`](#classopcua_1_1_digital_st_solid_expansion) |
-`class ` [`opcua::Expansion`](#classopcua_1_1_expansion) |
-`class ` [`opcua::AnalogInput`](#classopcua_1_1_analog_input) |
-`class ` [`opcua::AnalogInputManager`](#classopcua_1_1_analog_input_manager) |
-`class ` [`opcua::AnalogOutput`](#classopcua_1_1_analog_output) |
-`class ` [`opcua::AnalogOutputManager`](#classopcua_1_1_analog_output_manager) |
-`class ` [`opcua::UserButton`](#classopcua_1_1_user_button) |
-`class ` [`opcua::DigitalInput`](#classopcua_1_1_digital_input) |
-`class ` [`opcua::DigitalInputManager`](#classopcua_1_1_digital_input_manager) |
-`class ` [`opcua::Led`](#classopcua_1_1_led) |
-`class ` [`opcua::LedManager`](#classopcua_1_1_led_manager) |
-`class ` [`opcua::PwmOutput`](#classopcua_1_1_pwm_output) |
-`class ` [`opcua::PwmOutputManager`](#classopcua_1_1_pwm_output_manager) |
-`class ` [`opcua::Relay`](#classopcua_1_1_relay) |
-`class ` [`opcua::RelayManager`](#classopcua_1_1_relay_manager) |
-`class ` [`opcua::Opta`](#classopcua_1_1_opta) |
-`class ` [`opcua::OptaExpansionManager`](#classopcua_1_1_opta_expansion_manager) |
-`class ` [`opcua::OptaVariant`](#classopcua_1_1_opta_variant) |
-`class ` [`opcua::NTPUtils`](#classopcua_1_1_n_t_p_utils) |
-`class ` [`opcua::ExpansionType`](#classopcua_1_1_expansion_type) |
+`public time_t ` [`cvt_time`](#namespaceopcua_1ac8a236e4356144a3ee7ebede7d49cfa7)`(char const * time)` | Converts a date/time string as generated by **DATE** into a time_t value.
+`class ` [`opcua::AnalogExpansion`](#classopcua_1_1_analog_expansion) | Provides an OPC UA object node abstraction for an Analog [Expansion](#classopcua_1_1_expansion) board.
+`class ` [`opcua::DigitalExpansion`](#classopcua_1_1_digital_expansion) | Provides an OPC UA object node abstraction for both Digital [Expansion](#classopcua_1_1_expansion) board.
+`class ` [`opcua::DigitalMechExpansion`](#classopcua_1_1_digital_mech_expansion) | Provides an OPC UA object node abstraction for a Digital [Expansion](#classopcua_1_1_expansion) board with mechanical relays.
+`class ` [`opcua::DigitalStSolidExpansion`](#classopcua_1_1_digital_st_solid_expansion) | Provides an OPC UA object node abstraction for a Digital [Expansion](#classopcua_1_1_expansion) board with solid-state relays.
+`class ` [`opcua::Expansion`](#classopcua_1_1_expansion) | Provides a generic base class for various expansion board specificic derived classes.
+`class ` [`opcua::AnalogInput`](#classopcua_1_1_analog_input) | Provides an OPC UA variable node abstraction for an analog input.
+`class ` [`opcua::AnalogInputManager`](#classopcua_1_1_analog_input_manager) | Provides methods for creating and storing [AnalogInput](#classopcua_1_1_analog_input) objects in a collection.
+`class ` [`opcua::AnalogOutput`](#classopcua_1_1_analog_output) | Provides an OPC UA variable node abstraction for an analog output.
+`class ` [`opcua::AnalogOutputManager`](#classopcua_1_1_analog_output_manager) | Provides methods for creating and storing [AnalogOutput](#classopcua_1_1_analog_output) objects in a collection.
+`class ` [`opcua::UserButton`](#classopcua_1_1_user_button) | Provides an OPC UA variable node abstraction for a user button input.
+`class ` [`opcua::DigitalInput`](#classopcua_1_1_digital_input) | Provides an OPC UA variable node abstraction for a digital input.
+`class ` [`opcua::DigitalInputManager`](#classopcua_1_1_digital_input_manager) | Provides methods for creating and storing [DigitalInput](#classopcua_1_1_digital_input) objects in a collection.
+`class ` [`opcua::Led`](#classopcua_1_1_led) | Provides an OPC UA variable node abstraction for controlling a LED.
+`class ` [`opcua::LedManager`](#classopcua_1_1_led_manager) | Provides methods for creating and storing LED objects in a collection.
+`class ` [`opcua::PwmOutput`](#classopcua_1_1_pwm_output) | Provides an OPC UA variable node abstraction for a PWM output.
+`class ` [`opcua::PwmOutputManager`](#classopcua_1_1_pwm_output_manager) | Provides methods for creating and storing [PwmOutput](#classopcua_1_1_pwm_output) objects in a collection.
+`class ` [`opcua::Relay`](#classopcua_1_1_relay) | Provides an OPC UA variable node abstraction for controlling a mechanical or solid-state relay.
+`class ` [`opcua::RelayManager`](#classopcua_1_1_relay_manager) | Provides methods for creating and storing [Relay](#classopcua_1_1_relay) objects in a collection.
+`class ` [`opcua::Opta`](#classopcua_1_1_opta) | Provides functions for exposing various IO capabilities of the Arduino [Opta](#classopcua_1_1_opta) via OPC UA.
+`class ` [`opcua::OptaExpansionManager`](#classopcua_1_1_opta_expansion_manager) | High-level class to create OPC UA representations for Arduino [Opta](#classopcua_1_1_opta) digital and analog expansion boards.
+`class ` [`opcua::OptaVariant`](#classopcua_1_1_opta_variant) | Enables determination of [Opta](#classopcua_1_1_opta) variant (WiFi, RS485, Lite) on which the OPC UA firmware is running on.
+`class ` [`opcua::NTPUtils`](#classopcua_1_1_n_t_p_utils) | Provides a method for obtaining the current time via UDP.
+`class ` [`opcua::ExpansionType`](#classopcua_1_1_expansion_type) | Provides a method for converting Arduino_Opta_Blueprint's ExpansionType_t to a human readable string.
## Members
-#### `public time_t ` [`cvt_time`](#cvt__time_8h_1ac8a236e4356144a3ee7ebede7d49cfa7)`(char const * time)`
+#### `public time_t ` [`cvt_time`](#namespaceopcua_1ac8a236e4356144a3ee7ebede7d49cfa7)`(char const * time)`
+
+Converts a date/time string as generated by **DATE** into a time_t value.
+#### Parameters
+* `time` current time as generated by **DATE**.
+
+#### Returns
+String converted into Unix Time (seconds since Epoch)
# class `opcua::AnalogExpansion`
@@ -47,19 +55,23 @@ class opcua::AnalogExpansion
: public opcua::Expansion
```
+Provides an OPC UA object node abstraction for an Analog [Expansion](#classopcua_1_1_expansion) board.
+
+This class creates an OPC UA object node which is representing an Arduino [Opta](#classopcua_1_1_opta) Analog [Expansion](#classopcua_1_1_expansion) board. Furthermore, this class provides methods for adding OPC UA exposure to all IO entities supported by the Analog [Expansion](#classopcua_1_1_expansion) board.
+
## Summary
Members | Descriptions
--------------------------------|---------------------------------------------
-| [`AnalogExpansion`](#classopcua_1_1_analog_expansion_1a8922c1b320139757c7200ec568d25324) | |
-| [`~AnalogExpansion`](#classopcua_1_1_analog_expansion_1ad9a18c730a6451d543e48a91bf7eeff1) | |
-| [`toSKUString`](#classopcua_1_1_analog_expansion_1a37b9a4657d1e8c0cf2e1d0322adfa27c) | |
-| [`add_analog_input`](#classopcua_1_1_analog_expansion_1a511ae8067b88c476c5a7e47acccede15) | |
-| [`add_analog_output`](#classopcua_1_1_analog_expansion_1aa5ba819a44dfd2f8b651741499ffa5a0) | |
-| [`add_pwm_output`](#classopcua_1_1_analog_expansion_1a3a0997c332767761b4d96cac2e9f0963) | |
-| [`add_led_output`](#classopcua_1_1_analog_expansion_1a748779b79841cfa4329e318450be9be9) | |
-| [`SharedPtr`](#classopcua_1_1_analog_expansion_1a3a99cadc0594891e0ce7ee9acc06d1f3) | |
-| [`create`](#classopcua_1_1_analog_expansion_1a13a953b2d732d52f0c6772957b45abe8) | |
+| [`AnalogExpansion`](#classopcua_1_1_analog_expansion_1a8922c1b320139757c7200ec568d25324) | Constructor of the [opcua::AnalogExpansion](#classopcua_1_1_analog_expansion) class. Note: Objects should not be instantiated directly, but by using [AnalogExpansion::create](#classopcua_1_1_analog_expansion_1a13a953b2d732d52f0c6772957b45abe8). |
+| [`~AnalogExpansion`](#classopcua_1_1_analog_expansion_1ad9a18c730a6451d543e48a91bf7eeff1) | Destructor of the [opcua::AnalogExpansion](#classopcua_1_1_analog_expansion) class. |
+| [`toSKUString`](#classopcua_1_1_analog_expansion_1a37b9a4657d1e8c0cf2e1d0322adfa27c) | Returns the SKU number of the Analog [Expansion](#classopcua_1_1_expansion) board as std::string. |
+| [`add_analog_input`](#classopcua_1_1_analog_expansion_1a831c9c4d6f443ebd8d0924ca7eb00faa) | This function creates a new [opcua::AnalogInput](#classopcua_1_1_analog_input) and adds it to the [opcua::AnalogInputManager](#classopcua_1_1_analog_input_manager) belonging to the [opcua::AnalogExpansion](#classopcua_1_1_analog_expansion) class. |
+| [`add_analog_output`](#classopcua_1_1_analog_expansion_1a06151fa00414888bba4dfcd65f1da081) | This function creates a new [opcua::AnalogOutput](#classopcua_1_1_analog_output) and adds it to the [opcua::AnalogOutputManager](#classopcua_1_1_analog_output_manager) belonging to the [opcua::AnalogExpansion](#classopcua_1_1_analog_expansion) class. |
+| [`add_pwm_output`](#classopcua_1_1_analog_expansion_1a3a0997c332767761b4d96cac2e9f0963) | This function creates a new [opcua::PwmOutput](#classopcua_1_1_pwm_output) and adds it to the [opcua::PwmOutputManager](#classopcua_1_1_pwm_output_manager) belonging to the [opcua::AnalogExpansion](#classopcua_1_1_analog_expansion) class. |
+| [`add_led_output`](#classopcua_1_1_analog_expansion_1a748779b79841cfa4329e318450be9be9) | This function creates a new opcua::LED and adds it to the opcua::LEDManager belonging to the [opcua::AnalogExpansion](#classopcua_1_1_analog_expansion) class. |
+| [`SharedPtr`](#classopcua_1_1_analog_expansion_1a3a99cadc0594891e0ce7ee9acc06d1f3) | SharedPtr is std::shared_ptr of an [AnalogExpansion](#classopcua_1_1_analog_expansion) class. |
+| [`create`](#classopcua_1_1_analog_expansion_1a13a953b2d732d52f0c6772957b45abe8) | Creates a new instance of the [opcua::AnalogExpansion](#classopcua_1_1_analog_expansion) class, creating an OPC UA object node abstraction in the process. |
## Members
@@ -69,6 +81,15 @@ class opcua::AnalogExpansion
AnalogExpansion(UA_Server * server, UA_NodeId const parent_node_id, char * display_name, char * node_name)
```
+Constructor of the [opcua::AnalogExpansion](#classopcua_1_1_analog_expansion) class. Note: Objects should not be instantiated directly, but by using [AnalogExpansion::create](#classopcua_1_1_analog_expansion_1a13a953b2d732d52f0c6772957b45abe8).
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `parent_node_id` OPC UA node id of parent object in OPC UA tree.
+
+* `display_name` Character string providing an easy identifiable name for the object node representing an analog expansion board, i.e. "Arduino Opta Expansion 1: Analog".
+
+* `node_name` The unique node name identifying the Analog [Expansion](#classopcua_1_1_expansion) Board object node within the OPC UA tree.
### `~AnalogExpansion`
@@ -77,6 +98,7 @@ AnalogExpansion(UA_Server * server, UA_NodeId const parent_node_id, char * displ
virtual ~AnalogExpansion() = default
```
+Destructor of the [opcua::AnalogExpansion](#classopcua_1_1_analog_expansion) class.
### `toSKUString`
@@ -85,22 +107,41 @@ virtual ~AnalogExpansion() = default
inline virtual std::string toSKUString() const
```
+Returns the SKU number of the Analog [Expansion](#classopcua_1_1_expansion) board as std::string.
+#### Returns
+SKU number of Analog [Expansion](#classopcua_1_1_expansion) board
-### `add_analog_input`
+### `add_analog_input`
```cpp
-void add_analog_input(UA_Server * server, const char * display_name, AnalogInput::OnReadRequestFunc const on_read_request_func)
+void add_analog_input(UA_Server * server, const char * display_name, AnalogInput::OnReadRequestFunc const on_read_request)
```
+This function creates a new [opcua::AnalogInput](#classopcua_1_1_analog_input) and adds it to the [opcua::AnalogInputManager](#classopcua_1_1_analog_input_manager) belonging to the [opcua::AnalogExpansion](#classopcua_1_1_analog_expansion) class.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `display_name` Character string providing an easy identifiable name for the variable node representing an analog input, i.e. "Analog Input I1".
+
+* `on_read_request` Function pointer which is called during a read-access on the variable node representing the analog input.
-### `add_analog_output`
+### `add_analog_output`
```cpp
-void add_analog_output(UA_Server * server, const char * display_name, AnalogOutput::OnReadRequestFunc const on_read_request, AnalogOutput::OnWriteRequestFunc const on_write_request_func)
+void add_analog_output(UA_Server * server, const char * display_name, AnalogOutput::OnReadRequestFunc const on_read_request, AnalogOutput::OnWriteRequestFunc const on_write_request)
```
+This function creates a new [opcua::AnalogOutput](#classopcua_1_1_analog_output) and adds it to the [opcua::AnalogOutputManager](#classopcua_1_1_analog_output_manager) belonging to the [opcua::AnalogExpansion](#classopcua_1_1_analog_expansion) class.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `display_name` Character string providing an easy identifiable name for the variable node representing an analog output, i.e. "Analog Output O1".
+
+* `on_read_request` Function pointer which is called during a read-access on the variable node representing the analog output.
+
+* `on_write_request` Function pointer which is called during a write-access on the variable node representing the analog output.
### `add_pwm_output`
@@ -109,6 +150,17 @@ void add_analog_output(UA_Server * server, const char * display_name, AnalogOutp
void add_pwm_output(UA_Server * server, const char * display_name, PwmOutput::SetPwmFunc const set_pwm_func, PwmOutput::GetPwmPeriodFunc const get_pwm_period_func, PwmOutput::GetPwmPulseWidthFunc const get_pwm_pulse_width_func)
```
+This function creates a new [opcua::PwmOutput](#classopcua_1_1_pwm_output) and adds it to the [opcua::PwmOutputManager](#classopcua_1_1_pwm_output_manager) belonging to the [opcua::AnalogExpansion](#classopcua_1_1_analog_expansion) class.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `display_name` Character string providing an easy identifiable name for the variable node representing an analog output, i.e. "PWM Output P1".
+
+* `set_pwm_func` Function pointer which is called during a write-access on the variable node representing the PWM output and used for setting the PWM period and pulse width.
+
+* `get_pwm_period_func` Function pointer which is called during a read-access on the variable node representing the PWM output's period.
+
+* `get_pwm_pulse_width_func` Function pointer which is called during a read-access on the variable node representing the PWM output's pulse width.
### `add_led_output`
@@ -117,6 +169,13 @@ void add_pwm_output(UA_Server * server, const char * display_name, PwmOutput::Se
void add_led_output(UA_Server * server, const char * display_name, Led::OnSetLedStateFunc const on_set_led_state)
```
+This function creates a new opcua::LED and adds it to the opcua::LEDManager belonging to the [opcua::AnalogExpansion](#classopcua_1_1_analog_expansion) class.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `display_name` Character string providing an easy identifiable name for the variable node representing a LED, i.e. "LED1".
+
+* `on_set_led_state` Function pointer which is called during a write-access on the variable node representing the LED.
### `SharedPtr`
@@ -125,6 +184,7 @@ void add_led_output(UA_Server * server, const char * display_name, Led::OnSetLed
typedef SharedPtr
```
+SharedPtr is std::shared_ptr of an [AnalogExpansion](#classopcua_1_1_analog_expansion) class.
### `create`
@@ -133,6 +193,16 @@ typedef SharedPtr
static SharedPtr create(UA_Server * server, UA_NodeId const parent_node_id, uint8_t const exp_num)
```
+Creates a new instance of the [opcua::AnalogExpansion](#classopcua_1_1_analog_expansion) class, creating an OPC UA object node abstraction in the process.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `parent_node_id` OPC UA node id of parent object in OPC UA tree.
+
+* `exp_num` A numerical identifier provided by the Arduino_Opta_Blueprint library and identifying the number of the expansion module in the daisy-chain of expansion modules, i.e. exp_num = 2 refers to the second connect expansion module.
+
+#### Returns
+std::shared_ptr holding the newly allocated instance of [opcua::AnalogExpansion](#classopcua_1_1_analog_expansion).
# class `opcua::DigitalExpansion`
@@ -142,16 +212,20 @@ class opcua::DigitalExpansion
: public opcua::Expansion
```
+Provides an OPC UA object node abstraction for both Digital [Expansion](#classopcua_1_1_expansion) board.
+
+This class creates an OPC UA object node which is representing an Arduino [Opta](#classopcua_1_1_opta) Digital [Expansion](#classopcua_1_1_expansion) board. Furthermore, this class provides methods for adding OPC UA exposure to all IO entities supported by the Digital [Expansion](#classopcua_1_1_expansion) board.
+
## Summary
Members | Descriptions
--------------------------------|---------------------------------------------
-| [`DigitalExpansion`](#classopcua_1_1_digital_expansion_1a83aace406ca80bde86e563dcf4ea12fe) | |
-| [`~DigitalExpansion`](#classopcua_1_1_digital_expansion_1ab446f1129440aa88fe7d3fd133fc8bb1) | |
-| [`add_analog_input`](#classopcua_1_1_digital_expansion_1a49daa5502a89ab1656a3027529a651cf) | |
-| [`add_digital_input`](#classopcua_1_1_digital_expansion_1a7c5c6f636eb49335d5554e2be81d6b76) | |
-| [`add_relay_output`](#classopcua_1_1_digital_expansion_1a1ec45c5da3b0d3427a63a9cd30f775d0) | |
-| [`SharedPtr`](#classopcua_1_1_digital_expansion_1a808388135d0335260aed3725a4ca8eb9) | |
+| [`DigitalExpansion`](#classopcua_1_1_digital_expansion_1a83aace406ca80bde86e563dcf4ea12fe) | Constructor of the [opcua::DigitalExpansion](#classopcua_1_1_digital_expansion) class. |
+| [`~DigitalExpansion`](#classopcua_1_1_digital_expansion_1ab446f1129440aa88fe7d3fd133fc8bb1) | Destructor of the [opcua::DigitalExpansion](#classopcua_1_1_digital_expansion) class. |
+| [`add_analog_input`](#classopcua_1_1_digital_expansion_1a12d63f7fe7baa14af8f27cd8f45c7e23) | This function creates a new [opcua::AnalogInput](#classopcua_1_1_analog_input) and adds it to the [opcua::AnalogInputManager](#classopcua_1_1_analog_input_manager) belonging to the [opcua::DigitalExpansion](#classopcua_1_1_digital_expansion) class. |
+| [`add_digital_input`](#classopcua_1_1_digital_expansion_1a534310d78a1ce1a46ec7e92c064a61a0) | This function creates a new [opcua::DigitalInput](#classopcua_1_1_digital_input) and adds it to the [opcua::DigitalInputManager](#classopcua_1_1_digital_input_manager) belonging to the [opcua::DigitalExpansion](#classopcua_1_1_digital_expansion) class. |
+| [`add_relay_output`](#classopcua_1_1_digital_expansion_1a1ec45c5da3b0d3427a63a9cd30f775d0) | This function creates a new [opcua::Relay](#classopcua_1_1_relay) and adds it to the [opcua::RelayManager](#classopcua_1_1_relay_manager) belonging to the [opcua::DigitalExpansion](#classopcua_1_1_digital_expansion) class. |
+| [`SharedPtr`](#classopcua_1_1_digital_expansion_1a808388135d0335260aed3725a4ca8eb9) | SharedPtr is std::shared_ptr of an [DigitalExpansion](#classopcua_1_1_digital_expansion) class. |
## Members
@@ -161,6 +235,17 @@ class opcua::DigitalExpansion
DigitalExpansion(UA_Server * server, UA_NodeId const parent_node_id, char * display_name, char * node_name, char * model_name)
```
+Constructor of the [opcua::DigitalExpansion](#classopcua_1_1_digital_expansion) class.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `parent_node_id` OPC UA node id of parent object in OPC UA tree.
+
+* `display_name` Character string providing an easy identifiable name for the object node representing an analog expansion board, i.e. "Arduino Opta Expansion 1: Analog".
+
+* `node_name` The unique node name identifying the Analog [Expansion](#classopcua_1_1_expansion) Board object node within the OPC UA tree.
+
+* `model_name` This parameter must be filled with the SKU of the actual Digital [Expansion](#classopcua_1_1_expansion) board.
### `~DigitalExpansion`
@@ -169,22 +254,37 @@ DigitalExpansion(UA_Server * server, UA_NodeId const parent_node_id, char * disp
virtual ~DigitalExpansion() = default
```
+Destructor of the [opcua::DigitalExpansion](#classopcua_1_1_digital_expansion) class.
-### `add_analog_input`
+### `add_analog_input`
```cpp
-void add_analog_input(UA_Server * server, const char * display_name, AnalogInput::OnReadRequestFunc const on_read_request_func)
+void add_analog_input(UA_Server * server, const char * display_name, AnalogInput::OnReadRequestFunc const on_read_request)
```
+This function creates a new [opcua::AnalogInput](#classopcua_1_1_analog_input) and adds it to the [opcua::AnalogInputManager](#classopcua_1_1_analog_input_manager) belonging to the [opcua::DigitalExpansion](#classopcua_1_1_digital_expansion) class.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `display_name` Character string providing an easy identifiable name for the variable node representing an analog input, i.e. "Analog Input I1".
+
+* `on_read_request` Function pointer which is called during a read-access on the variable node representing the analog input.
-### `add_digital_input`
+### `add_digital_input`
```cpp
-void add_digital_input(UA_Server * server, const char * display_name, DigitalInput::OnReadRequestFunc const on_read_request_func)
+void add_digital_input(UA_Server * server, const char * display_name, DigitalInput::OnReadRequestFunc const on_read_request)
```
+This function creates a new [opcua::DigitalInput](#classopcua_1_1_digital_input) and adds it to the [opcua::DigitalInputManager](#classopcua_1_1_digital_input_manager) belonging to the [opcua::DigitalExpansion](#classopcua_1_1_digital_expansion) class.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `display_name` Character string providing an easy identifiable name for the variable node representing an analog input, i.e. "Digital Input I1".
+
+* `on_read_request` Function pointer which is called during a read-access on the variable node representing the digital input.
### `add_relay_output`
@@ -193,6 +293,13 @@ void add_digital_input(UA_Server * server, const char * display_name, DigitalInp
void add_relay_output(UA_Server * server, const char * display_name, Relay::OnSetRelayStateFunc const on_set_relay_state)
```
+This function creates a new [opcua::Relay](#classopcua_1_1_relay) and adds it to the [opcua::RelayManager](#classopcua_1_1_relay_manager) belonging to the [opcua::DigitalExpansion](#classopcua_1_1_digital_expansion) class.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `display_name` Character string providing an easy identifiable name for the variable node representing a relay, i.e. "Relay 1".
+
+* `on_set_relay_state` Function pointer which is called during a write-access on the variable node representing a relay.
### `SharedPtr`
@@ -201,6 +308,7 @@ void add_relay_output(UA_Server * server, const char * display_name, Relay::OnSe
typedef SharedPtr
```
+SharedPtr is std::shared_ptr of an [DigitalExpansion](#classopcua_1_1_digital_expansion) class.
# class `opcua::DigitalMechExpansion`
@@ -210,15 +318,19 @@ class opcua::DigitalMechExpansion
: public opcua::DigitalExpansion
```
+Provides an OPC UA object node abstraction for a Digital [Expansion](#classopcua_1_1_expansion) board with mechanical relays.
+
+This class creates an OPC UA object node which is representing an Arduino [Opta](#classopcua_1_1_opta) Digital [Expansion](#classopcua_1_1_expansion) board with mechanical relays.
+
## Summary
Members | Descriptions
--------------------------------|---------------------------------------------
-| [`DigitalMechExpansion`](#classopcua_1_1_digital_mech_expansion_1ad7349ea0108d988330c6b2623ef99696) | |
-| [`~DigitalMechExpansion`](#classopcua_1_1_digital_mech_expansion_1a10367a637954294193c4391c7507a8bc) | |
-| [`toSKUString`](#classopcua_1_1_digital_mech_expansion_1a5d81cd280f0ab93fd5380d070c3d48b6) | |
-| [`SharedPtr`](#classopcua_1_1_digital_mech_expansion_1abc60f0e66b8f12e051497c58b113a16e) | |
-| [`create`](#classopcua_1_1_digital_mech_expansion_1af777877670455dbd9032ca0aa47fcee3) | |
+| [`DigitalMechExpansion`](#classopcua_1_1_digital_mech_expansion_1ad7349ea0108d988330c6b2623ef99696) | Constructor of the [opcua::DigitalMechExpansion](#classopcua_1_1_digital_mech_expansion) class. Note: Objects should not be instantiated directly, but by using [DigitalMechExpansion::create](#classopcua_1_1_digital_mech_expansion_1af777877670455dbd9032ca0aa47fcee3). |
+| [`~DigitalMechExpansion`](#classopcua_1_1_digital_mech_expansion_1a10367a637954294193c4391c7507a8bc) | Destructor of the [opcua::DigitalMechExpansion](#classopcua_1_1_digital_mech_expansion) class. |
+| [`toSKUString`](#classopcua_1_1_digital_mech_expansion_1a5d81cd280f0ab93fd5380d070c3d48b6) | Returns the SKU number of the Digital [Expansion](#classopcua_1_1_expansion) board with mechanical relays as std::string. |
+| [`SharedPtr`](#classopcua_1_1_digital_mech_expansion_1abc60f0e66b8f12e051497c58b113a16e) | SharedPtr is std::shared_ptr of an [DigitalMechExpansion](#classopcua_1_1_digital_mech_expansion) class. |
+| [`create`](#classopcua_1_1_digital_mech_expansion_1af777877670455dbd9032ca0aa47fcee3) | Creates a new instance of the [opcua::DigitalMechExpansion](#classopcua_1_1_digital_mech_expansion) class, creating an OPC UA object node abstraction in the process. |
## Members
@@ -228,6 +340,15 @@ class opcua::DigitalMechExpansion
inline DigitalMechExpansion(UA_Server * server, UA_NodeId const parent_node_id, char * display_name, char * node_name)
```
+Constructor of the [opcua::DigitalMechExpansion](#classopcua_1_1_digital_mech_expansion) class. Note: Objects should not be instantiated directly, but by using [DigitalMechExpansion::create](#classopcua_1_1_digital_mech_expansion_1af777877670455dbd9032ca0aa47fcee3).
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `parent_node_id` OPC UA node id of parent object in OPC UA tree.
+
+* `display_name` Character string providing an easy identifiable name for the object node representing an analog expansion board, i.e. "Arduino Opta Expansion 1: Digital (Mechanical)".
+
+* `node_name` The unique node name identifying the Analog [Expansion](#classopcua_1_1_expansion) Board object node within the OPC UA tree.
### `~DigitalMechExpansion`
@@ -236,6 +357,7 @@ inline DigitalMechExpansion(UA_Server * server, UA_NodeId const parent_node_id,
virtual ~DigitalMechExpansion() = default
```
+Destructor of the [opcua::DigitalMechExpansion](#classopcua_1_1_digital_mech_expansion) class.
### `toSKUString`
@@ -244,6 +366,9 @@ virtual ~DigitalMechExpansion() = default
inline virtual std::string toSKUString() const
```
+Returns the SKU number of the Digital [Expansion](#classopcua_1_1_expansion) board with mechanical relays as std::string.
+#### Returns
+SKU number of Digital [Expansion](#classopcua_1_1_expansion) board / mechanical relays
### `SharedPtr`
@@ -252,6 +377,7 @@ inline virtual std::string toSKUString() const
typedef SharedPtr
```
+SharedPtr is std::shared_ptr of an [DigitalMechExpansion](#classopcua_1_1_digital_mech_expansion) class.
### `create`
@@ -260,6 +386,16 @@ typedef SharedPtr
inline static SharedPtr create(UA_Server * server, UA_NodeId const parent_node_id, uint8_t const exp_num)
```
+Creates a new instance of the [opcua::DigitalMechExpansion](#classopcua_1_1_digital_mech_expansion) class, creating an OPC UA object node abstraction in the process.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `parent_node_id` OPC UA node id of parent object in OPC UA tree.
+
+* `exp_num` A numerical identifier provided by the Arduino_Opta_Blueprint library and identifying the number of the expansion module in the daisy-chain of expansion modules, i.e. exp_num = 2 refers to the second connect expansion module.
+
+#### Returns
+std::shared_ptr holding the newly allocated instance of [opcua::DigitalMechExpansion](#classopcua_1_1_digital_mech_expansion).
# class `opcua::DigitalStSolidExpansion`
@@ -269,15 +405,19 @@ class opcua::DigitalStSolidExpansion
: public opcua::DigitalExpansion
```
+Provides an OPC UA object node abstraction for a Digital [Expansion](#classopcua_1_1_expansion) board with solid-state relays.
+
+This class creates an OPC UA object node which is representing an Arduino [Opta](#classopcua_1_1_opta) Digital [Expansion](#classopcua_1_1_expansion) board with solid-state relays.
+
## Summary
Members | Descriptions
--------------------------------|---------------------------------------------
-| [`DigitalStSolidExpansion`](#classopcua_1_1_digital_st_solid_expansion_1a896bf61b18c63b055343d0b5f408dbb0) | |
-| [`~DigitalStSolidExpansion`](#classopcua_1_1_digital_st_solid_expansion_1afb8021cf2b6041d723c2a3c1888ed5f7) | |
-| [`toSKUString`](#classopcua_1_1_digital_st_solid_expansion_1a67cb3b12dfc74b9747257daf1c481d99) | |
-| [`SharedPtr`](#classopcua_1_1_digital_st_solid_expansion_1a8bb44b6e51c634b1910dafb066f4e448) | |
-| [`create`](#classopcua_1_1_digital_st_solid_expansion_1a6b94afd184c4d435cea8ad32297fc045) | |
+| [`DigitalStSolidExpansion`](#classopcua_1_1_digital_st_solid_expansion_1a896bf61b18c63b055343d0b5f408dbb0) | Constructor of the [opcua::DigitalStSolidExpansion](#classopcua_1_1_digital_st_solid_expansion) class. Note: Objects should not be instantiated directly, but by using [DigitalStSolidExpansion::create](#classopcua_1_1_digital_st_solid_expansion_1a6b94afd184c4d435cea8ad32297fc045). |
+| [`~DigitalStSolidExpansion`](#classopcua_1_1_digital_st_solid_expansion_1afb8021cf2b6041d723c2a3c1888ed5f7) | Destructor of the [opcua::DigitalStSolidExpansion](#classopcua_1_1_digital_st_solid_expansion) class. |
+| [`toSKUString`](#classopcua_1_1_digital_st_solid_expansion_1a67cb3b12dfc74b9747257daf1c481d99) | Returns the SKU number of the Digital [Expansion](#classopcua_1_1_expansion) board with solid-state relays as std::string. |
+| [`SharedPtr`](#classopcua_1_1_digital_st_solid_expansion_1a8bb44b6e51c634b1910dafb066f4e448) | SharedPtr is std::shared_ptr of an [DigitalStSolidExpansion](#classopcua_1_1_digital_st_solid_expansion) class. |
+| [`create`](#classopcua_1_1_digital_st_solid_expansion_1a6b94afd184c4d435cea8ad32297fc045) | Creates a new instance of the [opcua::DigitalStSolidExpansion](#classopcua_1_1_digital_st_solid_expansion) class, creating an OPC UA object node abstraction in the process. |
## Members
@@ -287,6 +427,15 @@ class opcua::DigitalStSolidExpansion
inline DigitalStSolidExpansion(UA_Server * server, UA_NodeId const parent_node_id, char * display_name, char * node_name)
```
+Constructor of the [opcua::DigitalStSolidExpansion](#classopcua_1_1_digital_st_solid_expansion) class. Note: Objects should not be instantiated directly, but by using [DigitalStSolidExpansion::create](#classopcua_1_1_digital_st_solid_expansion_1a6b94afd184c4d435cea8ad32297fc045).
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `parent_node_id` OPC UA node id of parent object in OPC UA tree.
+
+* `display_name` Character string providing an easy identifiable name for the object node representing an analog expansion board, i.e. "Arduino Opta Expansion 1: Digital (Solid State)".
+
+* `node_name` The unique node name identifying the Analog [Expansion](#classopcua_1_1_expansion) Board object node within the OPC UA tree.
### `~DigitalStSolidExpansion`
@@ -295,6 +444,7 @@ inline DigitalStSolidExpansion(UA_Server * server, UA_NodeId const parent_node_i
virtual ~DigitalStSolidExpansion() = default
```
+Destructor of the [opcua::DigitalStSolidExpansion](#classopcua_1_1_digital_st_solid_expansion) class.
### `toSKUString`
@@ -303,6 +453,9 @@ virtual ~DigitalStSolidExpansion() = default
inline virtual std::string toSKUString() const
```
+Returns the SKU number of the Digital [Expansion](#classopcua_1_1_expansion) board with solid-state relays as std::string.
+#### Returns
+SKU number of Digital [Expansion](#classopcua_1_1_expansion) board / solid-state relays
### `SharedPtr`
@@ -311,6 +464,7 @@ inline virtual std::string toSKUString() const
typedef SharedPtr
```
+SharedPtr is std::shared_ptr of an [DigitalStSolidExpansion](#classopcua_1_1_digital_st_solid_expansion) class.
### `create`
@@ -319,18 +473,30 @@ typedef SharedPtr
inline static SharedPtr create(UA_Server * server, UA_NodeId const parent_node_id, uint8_t const exp_num)
```
+Creates a new instance of the [opcua::DigitalStSolidExpansion](#classopcua_1_1_digital_st_solid_expansion) class, creating an OPC UA object node abstraction in the process.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `parent_node_id` OPC UA node id of parent object in OPC UA tree.
+
+* `exp_num` A numerical identifier provided by the Arduino_Opta_Blueprint library and identifying the number of the expansion module in the daisy-chain of expansion modules, i.e. exp_num = 2 refers to the second connect expansion module.
+
+#### Returns
+std::shared_ptr holding the newly allocated instance of [opcua::DigitalStSolidExpansion](#classopcua_1_1_digital_st_solid_expansion).
# class `opcua::Expansion`
+Provides a generic base class for various expansion board specificic derived classes.
+
## Summary
Members | Descriptions
--------------------------------|---------------------------------------------
-| [`Expansion`](#classopcua_1_1_expansion_1a52b0201d688fe43ddf8e662ce4a2ec32) | |
-| [`~Expansion`](#classopcua_1_1_expansion_1a10a1451bd459c4375e7dcc0c1ffabed7) | |
-| [`toSKUString`](#classopcua_1_1_expansion_1ac2087b6c0d2153a8fd760fe5c7e689df) | |
-| [`SharedPtr`](#classopcua_1_1_expansion_1a0e496feb6cd2259a2a9f4cded8f9076a) | |
+| [`Expansion`](#classopcua_1_1_expansion_1a52b0201d688fe43ddf8e662ce4a2ec32) | Constructor of the [opcua::Expansion](#classopcua_1_1_expansion) class. |
+| [`~Expansion`](#classopcua_1_1_expansion_1a10a1451bd459c4375e7dcc0c1ffabed7) | Destructor of the [opcua::Expansion](#classopcua_1_1_expansion) class. |
+| [`toSKUString`](#classopcua_1_1_expansion_1ac2087b6c0d2153a8fd760fe5c7e689df) | Returns the SKU number of a concrete expansion board, must be overridden in derived classes. |
+| [`SharedPtr`](#classopcua_1_1_expansion_1a0e496feb6cd2259a2a9f4cded8f9076a) | SharedPtr is std::shared_ptr of an [Expansion](#classopcua_1_1_expansion) class. |
## Members
@@ -340,6 +506,17 @@ inline static SharedPtr create(UA_Server * server, UA_NodeId const parent_node_i
Expansion(UA_Server * server, UA_NodeId const parent_node_id, char * display_name, char * node_name, char * model_name)
```
+Constructor of the [opcua::Expansion](#classopcua_1_1_expansion) class.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `parent_node_id` OPC UA node id of parent object in OPC UA tree.
+
+* `display_name` Character string providing an easy identifiable name for the object node representing an analog expansion board, i.e. "Arduino Opta Expansion 1: Analog".
+
+* `node_name` The unique node name identifying the Analog [Expansion](#classopcua_1_1_expansion) Board object node within the OPC UA tree.
+
+* `model_name` This parameter must be filled with the SKU of the actual expansion board.
### `~Expansion`
@@ -348,6 +525,7 @@ Expansion(UA_Server * server, UA_NodeId const parent_node_id, char * display_nam
virtual ~Expansion() = default
```
+Destructor of the [opcua::Expansion](#classopcua_1_1_expansion) class.
### `toSKUString`
@@ -356,6 +534,9 @@ virtual ~Expansion() = default
std::string toSKUString() const
```
+Returns the SKU number of a concrete expansion board, must be overridden in derived classes.
+#### Returns
+SKU number of concrete expansion board.
### `SharedPtr`
@@ -364,19 +545,24 @@ std::string toSKUString() const
typedef SharedPtr
```
+SharedPtr is std::shared_ptr of an [Expansion](#classopcua_1_1_expansion) class.
# class `opcua::AnalogInput`
+Provides an OPC UA variable node abstraction for an analog input.
+
+This class creates an OPC UA variable node which is representing an analog input. When reading from the OPC UA variable node a callback is triggered which performs the actual analog readout of an analog input pin.
+
## Summary
Members | Descriptions
--------------------------------|---------------------------------------------
-| [`AnalogInput`](#classopcua_1_1_analog_input_1ae30d8e20ce45b11730cdb43c4f9c16c4) | |
-| [`onReadRequest`](#classopcua_1_1_analog_input_1a3bacb7c68ba84388ad5c2f88012affe0) | |
-| [`SharedPtr`](#classopcua_1_1_analog_input_1abfac39c8c3cfda600c49522bb1b433c0) | |
-| [`OnReadRequestFunc`](#classopcua_1_1_analog_input_1a76301ddd02080ac8f8e1916b33d31116) | |
-| [`create`](#classopcua_1_1_analog_input_1a11a3e1f0bdef544ba77c15c16d5a2689) | |
+| [`AnalogInput`](#classopcua_1_1_analog_input_1ae30d8e20ce45b11730cdb43c4f9c16c4) | Constructor of the [opcua::AnalogInput](#classopcua_1_1_analog_input) class. Note: Objects should not be instantiated directly, but by using [AnalogInput::create](#classopcua_1_1_analog_input_1a11a3e1f0bdef544ba77c15c16d5a2689). |
+| [`onReadRequest`](#classopcua_1_1_analog_input_1a3bacb7c68ba84388ad5c2f88012affe0) | This function is called by the framework when a read-access on the variable node representing the analog input is performed. Note: This function should not be called directly, it will be invoked by the framework. |
+| [`SharedPtr`](#classopcua_1_1_analog_input_1abfac39c8c3cfda600c49522bb1b433c0) | SharedPtr is std::shared_ptr of an [AnalogInput](#classopcua_1_1_analog_input) class. |
+| [`OnReadRequestFunc`](#classopcua_1_1_analog_input_1a76301ddd02080ac8f8e1916b33d31116) | OnReadRequestFunc is definition for a callback which is called during a read-access on the variable node representing the analog input performing the actual analog reading. |
+| [`create`](#classopcua_1_1_analog_input_1a11a3e1f0bdef544ba77c15c16d5a2689) | Creates a new instance of the [opcua::AnalogInput](#classopcua_1_1_analog_input) class, creating an OPC UA variable node abstraction in the process. |
## Members
@@ -386,6 +572,11 @@ typedef SharedPtr
AnalogInput(UA_NodeId const & node_id, OnReadRequestFunc const on_read_request)
```
+Constructor of the [opcua::AnalogInput](#classopcua_1_1_analog_input) class. Note: Objects should not be instantiated directly, but by using [AnalogInput::create](#classopcua_1_1_analog_input_1a11a3e1f0bdef544ba77c15c16d5a2689).
+#### Parameters
+* `node_id` OPC UA node id of the variable node representing the analog input.
+
+* `on_read_request` Function pointer which is called during a read-access on the variable node representing the analog input.
### `onReadRequest`
@@ -394,6 +585,11 @@ AnalogInput(UA_NodeId const & node_id, OnReadRequestFunc const on_read_request)
void onReadRequest(UA_Server * server, UA_NodeId const * node_id)
```
+This function is called by the framework when a read-access on the variable node representing the analog input is performed. Note: This function should not be called directly, it will be invoked by the framework.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `node_id` OPC UA node id of the variable node representing the analog input.
### `SharedPtr`
@@ -402,6 +598,7 @@ void onReadRequest(UA_Server * server, UA_NodeId const * node_id)
typedef SharedPtr
```
+SharedPtr is std::shared_ptr of an [AnalogInput](#classopcua_1_1_analog_input) class.
### `OnReadRequestFunc`
@@ -410,6 +607,7 @@ typedef SharedPtr
typedef OnReadRequestFunc
```
+OnReadRequestFunc is definition for a callback which is called during a read-access on the variable node representing the analog input performing the actual analog reading.
### `create`
@@ -418,18 +616,34 @@ typedef OnReadRequestFunc
static SharedPtr create(UA_Server * server, UA_NodeId const & parent_node_id, const char * display_name, OnReadRequestFunc const on_read_request)
```
+Creates a new instance of the [opcua::AnalogInput](#classopcua_1_1_analog_input) class, creating an OPC UA variable node abstraction in the process.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `parent_node_id` OPC UA node id of parent object in OPC UA tree.
+
+* `display_name` Character string providing an easy identifiable name for the variable node representing an analog input, i.e. "Analog Input I1".
+
+* `on_read_request` Function pointer which is called during a read-access on the variable node representing the analog input.
+
+#### Returns
+std::shared_ptr holding the newly allocated instance of [opcua::AnalogInput](#classopcua_1_1_analog_input).
# class `opcua::AnalogInputManager`
+Provides methods for creating and storing [AnalogInput](#classopcua_1_1_analog_input) objects in a collection.
+
+This class creates an OPC UA object node which is representing all analog inputs of a given OPC UA devices. Analog inputs can be created and added to the OPC UA object node using this class.
+
## Summary
Members | Descriptions
--------------------------------|---------------------------------------------
-| [`AnalogInputManager`](#classopcua_1_1_analog_input_manager_1a4acded183249c128a0577d592434667a) | |
-| [`add_analog_input`](#classopcua_1_1_analog_input_manager_1a3e3f23fcab755f090a4da8181106e54e) | |
-| [`SharedPtr`](#classopcua_1_1_analog_input_manager_1aaf63f82d26fae9a89478d568acdbd390) | |
-| [`create`](#classopcua_1_1_analog_input_manager_1a68d99b738809b67b102ce91fbfbfaf4c) | |
+| [`AnalogInputManager`](#classopcua_1_1_analog_input_manager_1a4acded183249c128a0577d592434667a) | Constructor of the [opcua::AnalogInputManager](#classopcua_1_1_analog_input_manager) class. Note: Objects should not be instantiated directly, but by using [AnalogInputManager::create](#classopcua_1_1_analog_input_manager_1a68d99b738809b67b102ce91fbfbfaf4c). |
+| [`add_analog_input`](#classopcua_1_1_analog_input_manager_1adf465923265cb510b716854460a3439d) | This function creates a new [opcua::AnalogInput](#classopcua_1_1_analog_input) and adds it to the [opcua::AnalogInputManager](#classopcua_1_1_analog_input_manager). |
+| [`SharedPtr`](#classopcua_1_1_analog_input_manager_1aaf63f82d26fae9a89478d568acdbd390) | SharedPtr is std::shared_ptr of an [AnalogInputManager](#classopcua_1_1_analog_input_manager) class. |
+| [`create`](#classopcua_1_1_analog_input_manager_1a68d99b738809b67b102ce91fbfbfaf4c) | Creates a new instance of the [opcua::AnalogInputManager](#classopcua_1_1_analog_input_manager) class, creating an OPC UA object node abstraction in the process. |
## Members
@@ -439,14 +653,24 @@ static SharedPtr create(UA_Server * server, UA_NodeId const & parent_node_id, co
AnalogInputManager(UA_NodeId const & node_id)
```
+Constructor of the [opcua::AnalogInputManager](#classopcua_1_1_analog_input_manager) class. Note: Objects should not be instantiated directly, but by using [AnalogInputManager::create](#classopcua_1_1_analog_input_manager_1a68d99b738809b67b102ce91fbfbfaf4c).
+#### Parameters
+* `node_id` OPC UA node id of the object node representing all analog inputs.
-### `add_analog_input`
+### `add_analog_input`
```cpp
-void add_analog_input(UA_Server * server, const char * display_name, AnalogInput::OnReadRequestFunc const on_read_request_func)
+void add_analog_input(UA_Server * server, const char * display_name, AnalogInput::OnReadRequestFunc const on_read_request)
```
+This function creates a new [opcua::AnalogInput](#classopcua_1_1_analog_input) and adds it to the [opcua::AnalogInputManager](#classopcua_1_1_analog_input_manager).
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `display_name` Character string providing an easy identifiable name for the variable node representing an analog input, i.e. "Analog Input I1".
+
+* `on_read_request` Function pointer which is called during a read-access on the variable node representing the analog input.
### `SharedPtr`
@@ -455,6 +679,7 @@ void add_analog_input(UA_Server * server, const char * display_name, AnalogInput
typedef SharedPtr
```
+SharedPtr is std::shared_ptr of an [AnalogInputManager](#classopcua_1_1_analog_input_manager) class.
### `create`
@@ -463,21 +688,33 @@ typedef SharedPtr
static SharedPtr create(UA_Server * server, UA_NodeId const parent_node_id)
```
+Creates a new instance of the [opcua::AnalogInputManager](#classopcua_1_1_analog_input_manager) class, creating an OPC UA object node abstraction in the process.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `parent_node_id` OPC UA node id of parent object in OPC UA tree.
+
+#### Returns
+std::shared_ptr holding the newly allocated instance of [opcua::AnalogInputManager](#classopcua_1_1_analog_input_manager).
# class `opcua::AnalogOutput`
+Provides an OPC UA variable node abstraction for an analog output.
+
+This class creates an OPC UA variable node which is representing an analog output. When writing to the OPC UA variable node a callback is triggered which performs the setting of the output value of an actual analog output pin. When reading from the OPC UA variable node a different callback is triggered which performs the actual analog readout of an analog output pin.
+
## Summary
Members | Descriptions
--------------------------------|---------------------------------------------
-| [`AnalogOutput`](#classopcua_1_1_analog_output_1a16ac9355b42c1d58d132babc5a207d2e) | |
-| [`onReadRequest`](#classopcua_1_1_analog_output_1a277345f3fe918b57f3c9e10e80a6b29b) | |
-| [`onWriteRequest`](#classopcua_1_1_analog_output_1a072e18e88dd85d16e949434951c9942c) | |
-| [`SharedPtr`](#classopcua_1_1_analog_output_1aa104e63edd1f282690fb7853ac24f3dd) | |
-| [`OnReadRequestFunc`](#classopcua_1_1_analog_output_1a4763f65ceb33a44a12e1a24fb48a2e37) | |
-| [`OnWriteRequestFunc`](#classopcua_1_1_analog_output_1a607044dc4f4a50e50f68a343c6bb4d1f) | |
-| [`create`](#classopcua_1_1_analog_output_1a16351e621798694bb3e09bd84eaf5571) | |
+| [`AnalogOutput`](#classopcua_1_1_analog_output_1a16ac9355b42c1d58d132babc5a207d2e) | Constructor of the [opcua::AnalogOutput](#classopcua_1_1_analog_output) class. Note: Objects should not be instantiated directly, but by using [AnalogOutput::create](#classopcua_1_1_analog_output_1a16351e621798694bb3e09bd84eaf5571). |
+| [`onReadRequest`](#classopcua_1_1_analog_output_1a277345f3fe918b57f3c9e10e80a6b29b) | This function is called by the framework when a read-access on the variable node representing the analog output is performed. Note: This function should not be called directly, it will be invoked by the framework. |
+| [`onWriteRequest`](#classopcua_1_1_analog_output_1a072e18e88dd85d16e949434951c9942c) | This function is called by the framework when a write-access on the variable node representing the analog output is performed. Note: This function should not be called directly, it will be invoked by the framework. |
+| [`SharedPtr`](#classopcua_1_1_analog_output_1aa104e63edd1f282690fb7853ac24f3dd) | SharedPtr is std::shared_ptr of an [AnalogOutput](#classopcua_1_1_analog_output) class. |
+| [`OnReadRequestFunc`](#classopcua_1_1_analog_output_1a4763f65ceb33a44a12e1a24fb48a2e37) | OnReadRequestFunc is definition for a callback which is called during a read-access on the variable node representing the analog output performing the actual analog read-back from the current value of the analog output pin. |
+| [`OnWriteRequestFunc`](#classopcua_1_1_analog_output_1a607044dc4f4a50e50f68a343c6bb4d1f) | OnWriteRequestFunc is definition for a callback which is called during a write-access on the variable node representing the analog output performing the actual writing of the desired output voltage to the analog output pin. |
+| [`create`](#classopcua_1_1_analog_output_1a16351e621798694bb3e09bd84eaf5571) | Creates a new instance of the [opcua::AnalogOutput](#classopcua_1_1_analog_output) class, creating an OPC UA variable node abstraction in the process. |
## Members
@@ -487,6 +724,13 @@ static SharedPtr create(UA_Server * server, UA_NodeId const parent_node_id)
AnalogOutput(UA_NodeId const & node_id, OnReadRequestFunc const on_read_request, OnWriteRequestFunc const on_write_request)
```
+Constructor of the [opcua::AnalogOutput](#classopcua_1_1_analog_output) class. Note: Objects should not be instantiated directly, but by using [AnalogOutput::create](#classopcua_1_1_analog_output_1a16351e621798694bb3e09bd84eaf5571).
+#### Parameters
+* `node_id` OPC UA node id of the variable node representing the analog output.
+
+* `on_read_request` Function pointer which is called during a read-access on the variable node representing the analog output.
+
+* `on_write_request` Function pointer which is called during a write-access on the variable node representing the analog output.
### `onReadRequest`
@@ -495,6 +739,11 @@ AnalogOutput(UA_NodeId const & node_id, OnReadRequestFunc const on_read_request,
void onReadRequest(UA_Server * server, UA_NodeId const * node_id)
```
+This function is called by the framework when a read-access on the variable node representing the analog output is performed. Note: This function should not be called directly, it will be invoked by the framework.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `node_id` OPC UA node id of the variable node representing the analog output.
### `onWriteRequest`
@@ -503,6 +752,13 @@ void onReadRequest(UA_Server * server, UA_NodeId const * node_id)
void onWriteRequest(UA_Server * server, UA_NodeId const * node_id, float const voltage)
```
+This function is called by the framework when a write-access on the variable node representing the analog output is performed. Note: This function should not be called directly, it will be invoked by the framework.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `node_id` OPC UA node id of the variable node representing the analog output.
+
+* `voltage` Desired output voltage value for the analog output.
### `SharedPtr`
@@ -511,6 +767,7 @@ void onWriteRequest(UA_Server * server, UA_NodeId const * node_id, float const v
typedef SharedPtr
```
+SharedPtr is std::shared_ptr of an [AnalogOutput](#classopcua_1_1_analog_output) class.
### `OnReadRequestFunc`
@@ -519,6 +776,7 @@ typedef SharedPtr
typedef OnReadRequestFunc
```
+OnReadRequestFunc is definition for a callback which is called during a read-access on the variable node representing the analog output performing the actual analog read-back from the current value of the analog output pin.
### `OnWriteRequestFunc`
@@ -527,6 +785,7 @@ typedef OnReadRequestFunc
typedef OnWriteRequestFunc
```
+OnWriteRequestFunc is definition for a callback which is called during a write-access on the variable node representing the analog output performing the actual writing of the desired output voltage to the analog output pin.
### `create`
@@ -535,18 +794,36 @@ typedef OnWriteRequestFunc
static SharedPtr create(UA_Server * server, UA_NodeId const & parent_node_id, const char * display_name, OnReadRequestFunc const on_read_request, OnWriteRequestFunc const on_write_request)
```
+Creates a new instance of the [opcua::AnalogOutput](#classopcua_1_1_analog_output) class, creating an OPC UA variable node abstraction in the process.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `parent_node_id` OPC UA node id of parent object in OPC UA tree.
+
+* `display_name` Character string providing an easy identifiable name for the variable node representing an analog output, i.e. "Analog Output O1".
+
+* `on_read_request` Function pointer which is called during a read-access on the variable node representing the analog output.
+
+* `on_write_request` Function pointer which is called during a write-access on the variable node representing the analog output.
+
+#### Returns
+std::shared_ptr holding the newly allocated instance of [opcua::AnalogOutput](#classopcua_1_1_analog_output).
# class `opcua::AnalogOutputManager`
+Provides methods for creating and storing [AnalogOutput](#classopcua_1_1_analog_output) objects in a collection.
+
+This class creates an OPC UA object node which is representing all analog outputs of a given OPC UA devices. Analog outputs can be created and added to the OPC UA object node using this class.
+
## Summary
Members | Descriptions
--------------------------------|---------------------------------------------
-| [`AnalogOutputManager`](#classopcua_1_1_analog_output_manager_1af41a1bda2ad81560a6e9d4c005df0cff) | |
-| [`add_analog_output`](#classopcua_1_1_analog_output_manager_1afd370d4f4c0a3f7fb6df761f0254d7bb) | |
-| [`SharedPtr`](#classopcua_1_1_analog_output_manager_1a019101cbb84c3458e510153db559be63) | |
-| [`create`](#classopcua_1_1_analog_output_manager_1ae70361c7213c9ddb274b607eb0dda289) | |
+| [`AnalogOutputManager`](#classopcua_1_1_analog_output_manager_1af41a1bda2ad81560a6e9d4c005df0cff) | Constructor of the [opcua::AnalogOutputManager](#classopcua_1_1_analog_output_manager) class. Note: Objects should not be instantiated directly, but by using [AnalogOutputManager::create](#classopcua_1_1_analog_output_manager_1ae70361c7213c9ddb274b607eb0dda289). |
+| [`add_analog_output`](#classopcua_1_1_analog_output_manager_1af1cf7248e9a02c420d3d8deb8d21ffe8) | This function creates a new [opcua::AnalogOutput](#classopcua_1_1_analog_output) and adds it to the [opcua::AnalogOutputManager](#classopcua_1_1_analog_output_manager). |
+| [`SharedPtr`](#classopcua_1_1_analog_output_manager_1a019101cbb84c3458e510153db559be63) | SharedPtr is std::shared_ptr of an [AnalogOutputManager](#classopcua_1_1_analog_output_manager) class. |
+| [`create`](#classopcua_1_1_analog_output_manager_1ae70361c7213c9ddb274b607eb0dda289) | Creates a new instance of the [opcua::AnalogOutputManager](#classopcua_1_1_analog_output_manager) class, creating an OPC UA object node abstraction in the process. |
## Members
@@ -556,14 +833,26 @@ static SharedPtr create(UA_Server * server, UA_NodeId const & parent_node_id, co
AnalogOutputManager(UA_NodeId const & node_id)
```
+Constructor of the [opcua::AnalogOutputManager](#classopcua_1_1_analog_output_manager) class. Note: Objects should not be instantiated directly, but by using [AnalogOutputManager::create](#classopcua_1_1_analog_output_manager_1ae70361c7213c9ddb274b607eb0dda289).
+#### Parameters
+* `node_id` OPC UA node id of the object node representing all analog outputs.
-### `add_analog_output`
+### `add_analog_output`
```cpp
-void add_analog_output(UA_Server * server, const char * display_name, AnalogOutput::OnReadRequestFunc const on_read_request, AnalogOutput::OnWriteRequestFunc const on_write_request_func)
+void add_analog_output(UA_Server * server, const char * display_name, AnalogOutput::OnReadRequestFunc const on_read_request, AnalogOutput::OnWriteRequestFunc const on_write_request)
```
+This function creates a new [opcua::AnalogOutput](#classopcua_1_1_analog_output) and adds it to the [opcua::AnalogOutputManager](#classopcua_1_1_analog_output_manager).
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `display_name` Character string providing an easy identifiable name for the variable node representing an analog output, i.e. "Analog Output O1".
+
+* `on_read_request` Function pointer which is called during a read-access on the variable node representing the analog output.
+
+* `on_write_request` Function pointer which is called during a write-access on the variable node representing the analog output.
### `SharedPtr`
@@ -572,6 +861,7 @@ void add_analog_output(UA_Server * server, const char * display_name, AnalogOutp
typedef SharedPtr
```
+SharedPtr is std::shared_ptr of an [AnalogOutputManager](#classopcua_1_1_analog_output_manager) class.
### `create`
@@ -580,18 +870,30 @@ typedef SharedPtr
static SharedPtr create(UA_Server * server, UA_NodeId const parent_node_id)
```
+Creates a new instance of the [opcua::AnalogOutputManager](#classopcua_1_1_analog_output_manager) class, creating an OPC UA object node abstraction in the process.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `parent_node_id` OPC UA node id of parent object in OPC UA tree.
+
+#### Returns
+std::shared_ptr holding the newly allocated instance of [opcua::AnalogOutputManager](#classopcua_1_1_analog_output_manager).
# class `opcua::UserButton`
+Provides an OPC UA variable node abstraction for a user button input.
+
+This class creates an OPC UA variable node which is representing a user button input. When reading from the OPC UA variable node a callback is triggered which performs the actual readout of the current state of the user button.
+
## Summary
Members | Descriptions
--------------------------------|---------------------------------------------
-| [`UserButton`](#classopcua_1_1_user_button_1a8a18ad7cb6edfefc58a8f1fe7cd5b87d) | |
-| [`onReadRequest`](#classopcua_1_1_user_button_1a211f565d05611888ec518de01ed6f120) | |
-| [`SharedPtr`](#classopcua_1_1_user_button_1a5ae06baa98d9a035629c86076d96bfc5) | |
-| [`create`](#classopcua_1_1_user_button_1aaccd71565a95f2c50e33c52077c16171) | |
+| [`UserButton`](#classopcua_1_1_user_button_1a8a18ad7cb6edfefc58a8f1fe7cd5b87d) | Constructor of the [opcua::UserButton](#classopcua_1_1_user_button) class. Note: Objects should not be instantiated directly, but by using [UserButton::create](#classopcua_1_1_user_button_1aaccd71565a95f2c50e33c52077c16171). |
+| [`onReadRequest`](#classopcua_1_1_user_button_1a211f565d05611888ec518de01ed6f120) | This function is called by the framework when a read-access on the variable node representing the user button input is performed. Note: This function should not be called directly, it will be invoked by the framework. |
+| [`SharedPtr`](#classopcua_1_1_user_button_1a5ae06baa98d9a035629c86076d96bfc5) | SharedPtr is std::shared_ptr of an [UserButton](#classopcua_1_1_user_button) class. |
+| [`create`](#classopcua_1_1_user_button_1aaccd71565a95f2c50e33c52077c16171) | Creates a new instance of the [opcua::UserButton](#classopcua_1_1_user_button) class, creating an OPC UA variable node "User Button" abstraction in the process. |
## Members
@@ -601,6 +903,9 @@ static SharedPtr create(UA_Server * server, UA_NodeId const parent_node_id)
UserButton(UA_NodeId const & node_id)
```
+Constructor of the [opcua::UserButton](#classopcua_1_1_user_button) class. Note: Objects should not be instantiated directly, but by using [UserButton::create](#classopcua_1_1_user_button_1aaccd71565a95f2c50e33c52077c16171).
+#### Parameters
+* `node_id` OPC UA node id of the variable node representing the user button.
### `onReadRequest`
@@ -609,6 +914,11 @@ UserButton(UA_NodeId const & node_id)
void onReadRequest(UA_Server * server, UA_NodeId const * node_id)
```
+This function is called by the framework when a read-access on the variable node representing the user button input is performed. Note: This function should not be called directly, it will be invoked by the framework.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `node_id` OPC UA node id of the variable node representing the user button.
### `SharedPtr`
@@ -617,6 +927,7 @@ void onReadRequest(UA_Server * server, UA_NodeId const * node_id)
typedef SharedPtr
```
+SharedPtr is std::shared_ptr of an [UserButton](#classopcua_1_1_user_button) class.
### `create`
@@ -625,19 +936,31 @@ typedef SharedPtr
static SharedPtr create(UA_Server * server, UA_NodeId const & parent_node_id)
```
+Creates a new instance of the [opcua::UserButton](#classopcua_1_1_user_button) class, creating an OPC UA variable node "User Button" abstraction in the process.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `parent_node_id` OPC UA node id of parent object in OPC UA tree.
+
+#### Returns
+std::shared_ptr holding the newly allocated instance of [opcua::UserButton](#classopcua_1_1_user_button).
# class `opcua::DigitalInput`
+Provides an OPC UA variable node abstraction for a digital input.
+
+This class creates an OPC UA variable node which is representing a digital input. When reading from the OPC UA variable node a callback is triggered which performs the actual readout of a digital input pin.
+
## Summary
Members | Descriptions
--------------------------------|---------------------------------------------
-| [`DigitalInput`](#classopcua_1_1_digital_input_1a0da78dff02b4ef7bd8038bab590413da) | |
-| [`onReadRequest`](#classopcua_1_1_digital_input_1a07d7f2c66fd7a856d28852fb72015243) | |
-| [`SharedPtr`](#classopcua_1_1_digital_input_1a5ed8dab221203259b007d15bb332edc8) | |
-| [`OnReadRequestFunc`](#classopcua_1_1_digital_input_1ae45c9b0e3cb2774b2e39431a7feccf41) | |
-| [`create`](#classopcua_1_1_digital_input_1a844932d3127b5adeedd8c7dc5c0f2feb) | |
+| [`DigitalInput`](#classopcua_1_1_digital_input_1a0da78dff02b4ef7bd8038bab590413da) | Constructor of the [opcua::DigitalInput](#classopcua_1_1_digital_input) class. Note: Objects should not be instantiated directly, but by using [DigitalInput::create](#classopcua_1_1_digital_input_1a844932d3127b5adeedd8c7dc5c0f2feb). |
+| [`onReadRequest`](#classopcua_1_1_digital_input_1a07d7f2c66fd7a856d28852fb72015243) | This function is called by the framework when a read-access on the variable node representing the digital input is performed. Note: This function should not be called directly, it will be invoked by the framework. |
+| [`SharedPtr`](#classopcua_1_1_digital_input_1a5ed8dab221203259b007d15bb332edc8) | SharedPtr is std::shared_ptr of a [DigitalInput](#classopcua_1_1_digital_input) class. |
+| [`OnReadRequestFunc`](#classopcua_1_1_digital_input_1ae45c9b0e3cb2774b2e39431a7feccf41) | OnReadRequestFunc is definition for a callback which is called during a read-access on the variable node representing the digital input performing the actual digital reading. |
+| [`create`](#classopcua_1_1_digital_input_1a844932d3127b5adeedd8c7dc5c0f2feb) | Creates a new instance of the [opcua::DigitalInput](#classopcua_1_1_digital_input) class, creating an OPC UA variable node abstraction in the process. |
## Members
@@ -647,6 +970,11 @@ static SharedPtr create(UA_Server * server, UA_NodeId const & parent_node_id)
DigitalInput(UA_NodeId const & node_id, OnReadRequestFunc const on_read_request)
```
+Constructor of the [opcua::DigitalInput](#classopcua_1_1_digital_input) class. Note: Objects should not be instantiated directly, but by using [DigitalInput::create](#classopcua_1_1_digital_input_1a844932d3127b5adeedd8c7dc5c0f2feb).
+#### Parameters
+* `node_id` OPC UA node id of the variable node representing the digital input.
+
+* `on_read_request` Function pointer which is called during a read-access on the variable node representing the digital input.
### `onReadRequest`
@@ -655,6 +983,11 @@ DigitalInput(UA_NodeId const & node_id, OnReadRequestFunc const on_read_request)
void onReadRequest(UA_Server * server, UA_NodeId const * node_id)
```
+This function is called by the framework when a read-access on the variable node representing the digital input is performed. Note: This function should not be called directly, it will be invoked by the framework.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `node_id` OPC UA node id of the variable node representing the digital input.
### `SharedPtr`
@@ -663,6 +996,7 @@ void onReadRequest(UA_Server * server, UA_NodeId const * node_id)
typedef SharedPtr
```
+SharedPtr is std::shared_ptr of a [DigitalInput](#classopcua_1_1_digital_input) class.
### `OnReadRequestFunc`
@@ -671,6 +1005,7 @@ typedef SharedPtr
typedef OnReadRequestFunc
```
+OnReadRequestFunc is definition for a callback which is called during a read-access on the variable node representing the digital input performing the actual digital reading.
### `create`
@@ -679,18 +1014,34 @@ typedef OnReadRequestFunc
static SharedPtr create(UA_Server * server, UA_NodeId const & parent_node_id, const char * display_name, OnReadRequestFunc const on_read_request)
```
+Creates a new instance of the [opcua::DigitalInput](#classopcua_1_1_digital_input) class, creating an OPC UA variable node abstraction in the process.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `parent_node_id` OPC UA node id of parent object in OPC UA tree.
+
+* `display_name` Character string providing an easy identifiable name for the variable node representing an analog input, i.e. "Digital Input I1".
+
+* `on_read_request` Function pointer which is called during a read-access on the variable node representing the digital input.
+
+#### Returns
+std::shared_ptr holding the newly allocated instance of [opcua::DigitalInput](#classopcua_1_1_digital_input).
# class `opcua::DigitalInputManager`
+Provides methods for creating and storing [DigitalInput](#classopcua_1_1_digital_input) objects in a collection.
+
+This class creates an OPC UA object node which is representing all digital inputs of a given OPC UA devices. Digital inputs can be created and added to the OPC UA object node using this class.
+
## Summary
Members | Descriptions
--------------------------------|---------------------------------------------
-| [`DigitalInputManager`](#classopcua_1_1_digital_input_manager_1aa1a41ef9de849beb644a197c5d69c25e) | |
-| [`add_digital_input`](#classopcua_1_1_digital_input_manager_1af8b0c74d437131c49c78999af4a2d3bc) | |
-| [`SharedPtr`](#classopcua_1_1_digital_input_manager_1a65c34fbf328ac93e94931922547e2bbf) | |
-| [`create`](#classopcua_1_1_digital_input_manager_1aa4f8ec8ba017a9c51d5e8ce14f0d5775) | |
+| [`DigitalInputManager`](#classopcua_1_1_digital_input_manager_1aa1a41ef9de849beb644a197c5d69c25e) | Constructor of the [opcua::DigitalInputManager](#classopcua_1_1_digital_input_manager) class. Note: Objects should not be instantiated directly, but by using [DigitalInputManager::create](#classopcua_1_1_digital_input_manager_1aa4f8ec8ba017a9c51d5e8ce14f0d5775). |
+| [`add_digital_input`](#classopcua_1_1_digital_input_manager_1afeae9bf1f9875db96a239a33e177928f) | This function creates a new [opcua::DigitalInput](#classopcua_1_1_digital_input) and adds it to the [opcua::DigitalInputManager](#classopcua_1_1_digital_input_manager). |
+| [`SharedPtr`](#classopcua_1_1_digital_input_manager_1a65c34fbf328ac93e94931922547e2bbf) | SharedPtr is std::shared_ptr of an [DigitalInputManager](#classopcua_1_1_digital_input_manager) class. |
+| [`create`](#classopcua_1_1_digital_input_manager_1aa4f8ec8ba017a9c51d5e8ce14f0d5775) | Creates a new instance of the [opcua::DigitalInputManager](#classopcua_1_1_digital_input_manager) class, creating an OPC UA object node abstraction in the process. |
## Members
@@ -700,14 +1051,24 @@ static SharedPtr create(UA_Server * server, UA_NodeId const & parent_node_id, co
DigitalInputManager(UA_NodeId const & node_id)
```
+Constructor of the [opcua::DigitalInputManager](#classopcua_1_1_digital_input_manager) class. Note: Objects should not be instantiated directly, but by using [DigitalInputManager::create](#classopcua_1_1_digital_input_manager_1aa4f8ec8ba017a9c51d5e8ce14f0d5775).
+#### Parameters
+* `node_id` OPC UA node id of the object node representing all digital inputs.
-### `add_digital_input`
+### `add_digital_input`
```cpp
-void add_digital_input(UA_Server * server, const char * display_name, DigitalInput::OnReadRequestFunc const on_read_request_func)
+void add_digital_input(UA_Server * server, const char * display_name, DigitalInput::OnReadRequestFunc const on_read_request)
```
+This function creates a new [opcua::DigitalInput](#classopcua_1_1_digital_input) and adds it to the [opcua::DigitalInputManager](#classopcua_1_1_digital_input_manager).
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `display_name` Character string providing an easy identifiable name for the variable node representing an analog input, i.e. "Digital Input I1".
+
+* `on_read_request` Function pointer which is called during a read-access on the variable node representing the digital input.
### `SharedPtr`
@@ -716,6 +1077,7 @@ void add_digital_input(UA_Server * server, const char * display_name, DigitalInp
typedef SharedPtr
```
+SharedPtr is std::shared_ptr of an [DigitalInputManager](#classopcua_1_1_digital_input_manager) class.
### `create`
@@ -724,19 +1086,31 @@ typedef SharedPtr
static SharedPtr create(UA_Server * server, UA_NodeId const parent_node_id)
```
+Creates a new instance of the [opcua::DigitalInputManager](#classopcua_1_1_digital_input_manager) class, creating an OPC UA object node abstraction in the process.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `parent_node_id` OPC UA node id of parent object in OPC UA tree.
+
+#### Returns
+std::shared_ptr holding the newly allocated instance of [opcua::DigitalInputManager](#classopcua_1_1_digital_input_manager).
# class `opcua::Led`
+Provides an OPC UA variable node abstraction for controlling a LED.
+
+This class creates an OPC UA variable node which is representing a LED. When writing to the OPC UA variable node a callback is triggered which either turns the LED on or off.
+
## Summary
Members | Descriptions
--------------------------------|---------------------------------------------
-| [`Led`](#classopcua_1_1_led_1a8fc018148c11c526eddb312b6765d647) | |
-| [`onWriteRequest`](#classopcua_1_1_led_1aaf8221b4bc407e27e19d4efdbc2eba4e) | |
-| [`SharedPtr`](#classopcua_1_1_led_1ae98b3b6f5b9fc5efa65f5cb9afd36d26) | |
-| [`OnSetLedStateFunc`](#classopcua_1_1_led_1aaf87efcccae9e4a8bdbf44f59aabb448) | |
-| [`create`](#classopcua_1_1_led_1a629e48c791ae316f9ca0f08038ddcfe1) | |
+| [`Led`](#classopcua_1_1_led_1a8fc018148c11c526eddb312b6765d647) | Constructor of the [opcua::Led](#classopcua_1_1_led) class. Note: Objects should not be instantiated directly, but by using [Led::create](#classopcua_1_1_led_1a629e48c791ae316f9ca0f08038ddcfe1). |
+| [`onWriteRequest`](#classopcua_1_1_led_1aaf8221b4bc407e27e19d4efdbc2eba4e) | This function is called by the framework when a write-access on the variable node representing a LED is performed. Note: This function should not be called directly, it will be invoked by the framework. |
+| [`SharedPtr`](#classopcua_1_1_led_1ae98b3b6f5b9fc5efa65f5cb9afd36d26) | SharedPtr is std::shared_ptr of a [Led](#classopcua_1_1_led) class. |
+| [`OnSetLedStateFunc`](#classopcua_1_1_led_1aaf87efcccae9e4a8bdbf44f59aabb448) | OnSetLedStateFunc is definition for a callback which is called during a write-access on the variable node representing a LED subsequently turned the LED either ON (true) or OFF (false). |
+| [`create`](#classopcua_1_1_led_1a629e48c791ae316f9ca0f08038ddcfe1) | Creates a new instance of the [opcua::Led](#classopcua_1_1_led) class, creating an OPC UA variable node abstraction in the process. |
## Members
@@ -746,6 +1120,11 @@ static SharedPtr create(UA_Server * server, UA_NodeId const parent_node_id)
Led(UA_NodeId const & node_id, OnSetLedStateFunc const on_set_led_state)
```
+Constructor of the [opcua::Led](#classopcua_1_1_led) class. Note: Objects should not be instantiated directly, but by using [Led::create](#classopcua_1_1_led_1a629e48c791ae316f9ca0f08038ddcfe1).
+#### Parameters
+* `node_id` OPC UA node id of the variable node representing the analog output.
+
+* `on_set_led_state` Function pointer which is called during a write-access on the variable node representing the LED.
### `onWriteRequest`
@@ -754,6 +1133,13 @@ Led(UA_NodeId const & node_id, OnSetLedStateFunc const on_set_led_state)
void onWriteRequest(UA_Server * server, UA_NodeId const * node_id, bool const value)
```
+This function is called by the framework when a write-access on the variable node representing a LED is performed. Note: This function should not be called directly, it will be invoked by the framework.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `node_id` OPC UA node id of the variable node representing the LED.
+
+* `value` Desired state of the LED, true -> LED is turned ON, false -> LED is turned off.
### `SharedPtr`
@@ -762,6 +1148,7 @@ void onWriteRequest(UA_Server * server, UA_NodeId const * node_id, bool const va
typedef SharedPtr
```
+SharedPtr is std::shared_ptr of a [Led](#classopcua_1_1_led) class.
### `OnSetLedStateFunc`
@@ -770,6 +1157,7 @@ typedef SharedPtr
typedef OnSetLedStateFunc
```
+OnSetLedStateFunc is definition for a callback which is called during a write-access on the variable node representing a LED subsequently turned the LED either ON (true) or OFF (false).
### `create`
@@ -778,18 +1166,34 @@ typedef OnSetLedStateFunc
static SharedPtr create(UA_Server * server, UA_NodeId const & parent_node_id, const char * display_name, OnSetLedStateFunc const on_set_led_state)
```
+Creates a new instance of the [opcua::Led](#classopcua_1_1_led) class, creating an OPC UA variable node abstraction in the process.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `parent_node_id` OPC UA node id of parent object in OPC UA tree.
+
+* `display_name` Character string providing an easy identifiable name for the variable node representing a LED, i.e. "LED1".
+
+* `on_set_led_state` Function pointer which is called during a write-access on the variable node representing the LED.
+
+#### Returns
+std::shared_ptr holding the newly allocated instance of [opcua::Led](#classopcua_1_1_led).
# class `opcua::LedManager`
+Provides methods for creating and storing LED objects in a collection.
+
+This class creates an OPC UA object node which is representing all LEDs of a given OPC UA devices. LEDs can be created and added to the OPC UA object node using this class.
+
## Summary
Members | Descriptions
--------------------------------|---------------------------------------------
-| [`LedManager`](#classopcua_1_1_led_manager_1a1388f892d85f566acacca95b10b4c62a) | |
-| [`add_led_output`](#classopcua_1_1_led_manager_1ab8b5aaba9ad51d96e4e6d4167973ce9f) | |
-| [`SharedPtr`](#classopcua_1_1_led_manager_1add9494665b55716dcdb70b9ce1e0e1e2) | |
-| [`create`](#classopcua_1_1_led_manager_1a34dfb842af941ecc7505050808885e0f) | |
+| [`LedManager`](#classopcua_1_1_led_manager_1a1388f892d85f566acacca95b10b4c62a) | Constructor of the [opcua::LedManager](#classopcua_1_1_led_manager) class. Note: Objects should not be instantiated directly, but by using [LedManager::create](#classopcua_1_1_led_manager_1a34dfb842af941ecc7505050808885e0f). |
+| [`add_led_output`](#classopcua_1_1_led_manager_1ab8b5aaba9ad51d96e4e6d4167973ce9f) | This function creates a new opcua::LED and adds it to the opcua::LEDManager. |
+| [`SharedPtr`](#classopcua_1_1_led_manager_1add9494665b55716dcdb70b9ce1e0e1e2) | SharedPtr is std::shared_ptr of an [LedManager](#classopcua_1_1_led_manager) class. |
+| [`create`](#classopcua_1_1_led_manager_1a34dfb842af941ecc7505050808885e0f) | Creates a new instance of the [opcua::LedManager](#classopcua_1_1_led_manager) class, creating an OPC UA object node abstraction in the process. |
## Members
@@ -799,6 +1203,9 @@ static SharedPtr create(UA_Server * server, UA_NodeId const & parent_node_id, co
LedManager(UA_NodeId const & node_id)
```
+Constructor of the [opcua::LedManager](#classopcua_1_1_led_manager) class. Note: Objects should not be instantiated directly, but by using [LedManager::create](#classopcua_1_1_led_manager_1a34dfb842af941ecc7505050808885e0f).
+#### Parameters
+* `node_id` OPC UA node id of the object node representing all LEDs.
### `add_led_output`
@@ -807,6 +1214,13 @@ LedManager(UA_NodeId const & node_id)
void add_led_output(UA_Server * server, const char * display_name, Led::OnSetLedStateFunc const on_set_led_state)
```
+This function creates a new opcua::LED and adds it to the opcua::LEDManager.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `display_name` Character string providing an easy identifiable name for the variable node representing a LED, i.e. "LED1".
+
+* `on_set_led_state` Function pointer which is called during a write-access on the variable node representing the LED.
### `SharedPtr`
@@ -815,6 +1229,7 @@ void add_led_output(UA_Server * server, const char * display_name, Led::OnSetLed
typedef SharedPtr
```
+SharedPtr is std::shared_ptr of an [LedManager](#classopcua_1_1_led_manager) class.
### `create`
@@ -823,24 +1238,36 @@ typedef SharedPtr
static SharedPtr create(UA_Server * server, UA_NodeId const parent_node_id)
```
+Creates a new instance of the [opcua::LedManager](#classopcua_1_1_led_manager) class, creating an OPC UA object node abstraction in the process.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `parent_node_id` OPC UA node id of parent object in OPC UA tree.
+
+#### Returns
+std::shared_ptr holding the newly allocated instance of [opcua::LedManager](#classopcua_1_1_led_manager).
# class `opcua::PwmOutput`
+Provides an OPC UA variable node abstraction for a PWM output.
+
+This class creates an OPC UA object node representing a PWM output with two OPC UA variable nodes representing the PWM output's period and pulse width. When writing to any OPC UA variable node a callback is triggered which performs the setting of the desired PWM period and pulse width. When reading from the OPC UA variable nodes different callback are triggered which performs reading back the actual PWM period and pulse width.
+
## Summary
Members | Descriptions
--------------------------------|---------------------------------------------
-| [`PwmOutput`](#classopcua_1_1_pwm_output_1afb7531394d5f6949a1139efc8eb4a2d4) | |
-| [`onReadRequestPwmPeriod`](#classopcua_1_1_pwm_output_1a996ade007bc33c1755cb7a58556d1b72) | |
-| [`onWriteRequestPwmPeriod`](#classopcua_1_1_pwm_output_1ab3361d34f09f0d478253c3eaeaa5d0b8) | |
-| [`onReadRequestPwmPulseWidth`](#classopcua_1_1_pwm_output_1ad94b10965197e6e34421e01826851e5b) | |
-| [`onWriteRequestPwmPulseWidth`](#classopcua_1_1_pwm_output_1a590f6ca875c9858102436e5f3316748d) | |
-| [`SharedPtr`](#classopcua_1_1_pwm_output_1ad871619fdeeccd340fad668e1d59c668) | |
-| [`SetPwmFunc`](#classopcua_1_1_pwm_output_1a979bc7c17dbac4dfb518a65dd92c1c56) | |
-| [`GetPwmPeriodFunc`](#classopcua_1_1_pwm_output_1ae9f4bd8023add25dda7eb038745e494c) | |
-| [`GetPwmPulseWidthFunc`](#classopcua_1_1_pwm_output_1ad9ca89b1b476fac49dd9d32306b819af) | |
-| [`create`](#classopcua_1_1_pwm_output_1a595c247e837f0e9a34e11b2b7b5a26ff) | |
+| [`PwmOutput`](#classopcua_1_1_pwm_output_1afb7531394d5f6949a1139efc8eb4a2d4) | Constructor of the [opcua::PwmOutput](#classopcua_1_1_pwm_output) class. Note: Objects should not be instantiated directly, but by using [PwmOutput::create](#classopcua_1_1_pwm_output_1a595c247e837f0e9a34e11b2b7b5a26ff). |
+| [`onReadRequestPwmPeriod`](#classopcua_1_1_pwm_output_1a996ade007bc33c1755cb7a58556d1b72) | This function is called by the framework when a read-access on the variable node representing the PWM output's period is performed. Note: This function should not be called directly, it will be invoked by the framework. |
+| [`onWriteRequestPwmPeriod`](#classopcua_1_1_pwm_output_1ab3361d34f09f0d478253c3eaeaa5d0b8) | This function is called by the framework when a write-access on the variable node representing the PWM output's period is performed. Note: This function should not be called directly, it will be invoked by the framework. |
+| [`onReadRequestPwmPulseWidth`](#classopcua_1_1_pwm_output_1ad94b10965197e6e34421e01826851e5b) | This function is called by the framework when a read-access on the variable node representing the PWM output's pulse width is performed. Note: This function should not be called directly, it will be invoked by the framework. |
+| [`onWriteRequestPwmPulseWidth`](#classopcua_1_1_pwm_output_1a9a88eb5f43679c66d0be1288158e055c) | This function is called by the framework when a write-access on the variable node representing the PWM output's pulse width is performed. Note: This function should not be called directly, it will be invoked by the framework. |
+| [`SharedPtr`](#classopcua_1_1_pwm_output_1ad871619fdeeccd340fad668e1d59c668) | SharedPtr is std::shared_ptr of a [PwmOutput](#classopcua_1_1_pwm_output) class. |
+| [`SetPwmFunc`](#classopcua_1_1_pwm_output_1a979bc7c17dbac4dfb518a65dd92c1c56) | SetPwmFunc is definition for a callback which is called during a write-access on the variable nodes representing PWM period and PWM pulse width subsequently configuring the PWN output with the desired period and pulse width. |
+| [`GetPwmPeriodFunc`](#classopcua_1_1_pwm_output_1ae9f4bd8023add25dda7eb038745e494c) | GetPwmPeriodFunc is definition for a callback which is called during a read-access on the variable node representing the PWM period and which is used to retrieve the actual PWM period. |
+| [`GetPwmPulseWidthFunc`](#classopcua_1_1_pwm_output_1ad9ca89b1b476fac49dd9d32306b819af) | GetPwmPulseWidthFunc is definition for a callback which is called during a read-access on the variable node representing the PWM pulse width and which is used to retrieve the actual PWM pulse width. |
+| [`create`](#classopcua_1_1_pwm_output_1a595c247e837f0e9a34e11b2b7b5a26ff) | Creates a new instance of the [opcua::PwmOutput](#classopcua_1_1_pwm_output) class, creating an OPC UA variable node abstraction in the process. |
## Members
@@ -850,6 +1277,17 @@ static SharedPtr create(UA_Server * server, UA_NodeId const parent_node_id)
PwmOutput(UA_NodeId const & pwm_period_node_id, UA_NodeId const & pwm_pulse_width_node_id, SetPwmFunc const set_pwm_func, GetPwmPeriodFunc const get_pwm_period_func, GetPwmPulseWidthFunc const get_pwm_pulse_width_func)
```
+Constructor of the [opcua::PwmOutput](#classopcua_1_1_pwm_output) class. Note: Objects should not be instantiated directly, but by using [PwmOutput::create](#classopcua_1_1_pwm_output_1a595c247e837f0e9a34e11b2b7b5a26ff).
+#### Parameters
+* `pwm_period_node_id` OPC UA node id of the variable node representing the PWM output's period.
+
+* `pwm_pulse_width_node_id` OPC UA node id of the variable node representing the PWM output's pulse width.
+
+* `set_pwm_func` Function pointer which is called during a write-access on the variable node representing the PWM output and used for setting the PWM period and pulse width.
+
+* `get_pwm_period_func` Function pointer which is called during a read-access on the variable node representing the PWM output's period.
+
+* `get_pwm_pulse_width_func` Function pointer which is called during a read-access on the variable node representing the PWM output's pulse width.
### `onReadRequestPwmPeriod`
@@ -858,6 +1296,11 @@ PwmOutput(UA_NodeId const & pwm_period_node_id, UA_NodeId const & pwm_pulse_widt
void onReadRequestPwmPeriod(UA_Server * server, UA_NodeId const * node_id)
```
+This function is called by the framework when a read-access on the variable node representing the PWM output's period is performed. Note: This function should not be called directly, it will be invoked by the framework.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `node_id` OPC UA node id of the variable node representing the PWM output's period.
### `onWriteRequestPwmPeriod`
@@ -866,6 +1309,13 @@ void onReadRequestPwmPeriod(UA_Server * server, UA_NodeId const * node_id)
void onWriteRequestPwmPeriod(UA_Server * server, UA_NodeId const * pwm_period_node_id, uint32_t const pwm_period_us)
```
+This function is called by the framework when a write-access on the variable node representing the PWM output's period is performed. Note: This function should not be called directly, it will be invoked by the framework.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `pwm_period_node_id` OPC UA node id of the variable node representing the PWM output's period.
+
+* `pwm_period_us` Desired PWM output period in microseconds.
### `onReadRequestPwmPulseWidth`
@@ -874,14 +1324,26 @@ void onWriteRequestPwmPeriod(UA_Server * server, UA_NodeId const * pwm_period_no
void onReadRequestPwmPulseWidth(UA_Server * server, UA_NodeId const * node_id)
```
+This function is called by the framework when a read-access on the variable node representing the PWM output's pulse width is performed. Note: This function should not be called directly, it will be invoked by the framework.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `node_id` OPC UA node id of the variable node representing the PWM output's pulse width.
-### `onWriteRequestPwmPulseWidth`
+### `onWriteRequestPwmPulseWidth`
```cpp
-void onWriteRequestPwmPulseWidth(UA_Server * server, UA_NodeId const * node_id, uint32_t const pwm_pulse_width_us)
+void onWriteRequestPwmPulseWidth(UA_Server * server, UA_NodeId const * pwm_pulse_width_node_id, uint32_t const pwm_pulse_width_us)
```
+This function is called by the framework when a write-access on the variable node representing the PWM output's pulse width is performed. Note: This function should not be called directly, it will be invoked by the framework.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `pwm_pulse_width_node_id` OPC UA node id of the variable node representing the PWM output's pulse width.
+
+* `pwm_pulse_width_us` Desired PWM output pulse width in microseconds.
### `SharedPtr`
@@ -890,6 +1352,7 @@ void onWriteRequestPwmPulseWidth(UA_Server * server, UA_NodeId const * node_id,
typedef SharedPtr
```
+SharedPtr is std::shared_ptr of a [PwmOutput](#classopcua_1_1_pwm_output) class.
### `SetPwmFunc`
@@ -898,6 +1361,7 @@ typedef SharedPtr
typedef SetPwmFunc
```
+SetPwmFunc is definition for a callback which is called during a write-access on the variable nodes representing PWM period and PWM pulse width subsequently configuring the PWN output with the desired period and pulse width.
### `GetPwmPeriodFunc`
@@ -906,6 +1370,7 @@ typedef SetPwmFunc
typedef GetPwmPeriodFunc
```
+GetPwmPeriodFunc is definition for a callback which is called during a read-access on the variable node representing the PWM period and which is used to retrieve the actual PWM period.
### `GetPwmPulseWidthFunc`
@@ -914,6 +1379,7 @@ typedef GetPwmPeriodFunc
typedef GetPwmPulseWidthFunc
```
+GetPwmPulseWidthFunc is definition for a callback which is called during a read-access on the variable node representing the PWM pulse width and which is used to retrieve the actual PWM pulse width.
### `create`
@@ -922,18 +1388,38 @@ typedef GetPwmPulseWidthFunc
static SharedPtr create(UA_Server * server, UA_NodeId const & parent_node_id, const char * display_name, SetPwmFunc const set_pwm_func, GetPwmPeriodFunc const get_pwm_period_func, GetPwmPulseWidthFunc const get_pwm_pulse_width_func)
```
+Creates a new instance of the [opcua::PwmOutput](#classopcua_1_1_pwm_output) class, creating an OPC UA variable node abstraction in the process.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `parent_node_id` OPC UA node id of parent object in OPC UA tree.
+
+* `display_name` Character string providing an easy identifiable name for the variable node representing an analog output, i.e. "PWM Output P1".
+
+* `set_pwm_func` Function pointer which is called during a write-access on the variable node representing the PWM output and used for setting the PWM period and pulse width.
+
+* `get_pwm_period_func` Function pointer which is called during a read-access on the variable node representing the PWM output's period.
+
+* `get_pwm_pulse_width_func` Function pointer which is called during a read-access on the variable node representing the PWM output's pulse width.
+
+#### Returns
+std::shared_ptr holding the newly allocated instance of [opcua::PwmOutput](#classopcua_1_1_pwm_output).
# class `opcua::PwmOutputManager`
+Provides methods for creating and storing [PwmOutput](#classopcua_1_1_pwm_output) objects in a collection.
+
+This class creates an OPC UA object node which is representing all PWM outputs of a given OPC UA devices. PWM outputs can be created and added to the OPC UA object node using this class.
+
## Summary
Members | Descriptions
--------------------------------|---------------------------------------------
-| [`PwmOutputManager`](#classopcua_1_1_pwm_output_manager_1ae682f02d81ae9cdd8234e670e5140380) | |
-| [`add_pwm_output`](#classopcua_1_1_pwm_output_manager_1aaad206b4639e87595bf60f9154a9e0a4) | |
-| [`SharedPtr`](#classopcua_1_1_pwm_output_manager_1ae595b9016fec91f1e5caa1a74df4bcd5) | |
-| [`create`](#classopcua_1_1_pwm_output_manager_1a032bb88f9e5a54a6d68adc37a685374c) | |
+| [`PwmOutputManager`](#classopcua_1_1_pwm_output_manager_1ae682f02d81ae9cdd8234e670e5140380) | Constructor of the [opcua::PwmOutputManager](#classopcua_1_1_pwm_output_manager) class. Note: Objects should not be instantiated directly, but by using [PwmOutputManager::create](#classopcua_1_1_pwm_output_manager_1a032bb88f9e5a54a6d68adc37a685374c). |
+| [`add_pwm_output`](#classopcua_1_1_pwm_output_manager_1aaad206b4639e87595bf60f9154a9e0a4) | This function creates a new [opcua::PwmOutput](#classopcua_1_1_pwm_output) and adds it to the [opcua::PwmOutputManager](#classopcua_1_1_pwm_output_manager). |
+| [`SharedPtr`](#classopcua_1_1_pwm_output_manager_1ae595b9016fec91f1e5caa1a74df4bcd5) | SharedPtr is std::shared_ptr of an [PwmOutputManager](#classopcua_1_1_pwm_output_manager) class. |
+| [`create`](#classopcua_1_1_pwm_output_manager_1a032bb88f9e5a54a6d68adc37a685374c) | Creates a new instance of the [opcua::PwmOutputManager](#classopcua_1_1_pwm_output_manager) class, creating an OPC UA object node abstraction in the process. |
## Members
@@ -943,6 +1429,9 @@ static SharedPtr create(UA_Server * server, UA_NodeId const & parent_node_id, co
PwmOutputManager(UA_NodeId const & node_id)
```
+Constructor of the [opcua::PwmOutputManager](#classopcua_1_1_pwm_output_manager) class. Note: Objects should not be instantiated directly, but by using [PwmOutputManager::create](#classopcua_1_1_pwm_output_manager_1a032bb88f9e5a54a6d68adc37a685374c).
+#### Parameters
+* `node_id` OPC UA node id of the object node representing all PWM outputs.
### `add_pwm_output`
@@ -951,6 +1440,17 @@ PwmOutputManager(UA_NodeId const & node_id)
void add_pwm_output(UA_Server * server, const char * display_name, PwmOutput::SetPwmFunc const set_pwm_func, PwmOutput::GetPwmPeriodFunc const get_pwm_period_func, PwmOutput::GetPwmPulseWidthFunc const get_pwm_pulse_width_func)
```
+This function creates a new [opcua::PwmOutput](#classopcua_1_1_pwm_output) and adds it to the [opcua::PwmOutputManager](#classopcua_1_1_pwm_output_manager).
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `display_name` Character string providing an easy identifiable name for the variable node representing an analog output, i.e. "PWM Output P1".
+
+* `set_pwm_func` Function pointer which is called during a write-access on the variable node representing the PWM output and used for setting the PWM period and pulse width.
+
+* `get_pwm_period_func` Function pointer which is called during a read-access on the variable node representing the PWM output's period.
+
+* `get_pwm_pulse_width_func` Function pointer which is called during a read-access on the variable node representing the PWM output's pulse width.
### `SharedPtr`
@@ -959,6 +1459,7 @@ void add_pwm_output(UA_Server * server, const char * display_name, PwmOutput::Se
typedef SharedPtr
```
+SharedPtr is std::shared_ptr of an [PwmOutputManager](#classopcua_1_1_pwm_output_manager) class.
### `create`
@@ -967,19 +1468,31 @@ typedef SharedPtr
static SharedPtr create(UA_Server * server, UA_NodeId const parent_node_id)
```
+Creates a new instance of the [opcua::PwmOutputManager](#classopcua_1_1_pwm_output_manager) class, creating an OPC UA object node abstraction in the process.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `parent_node_id` OPC UA node id of parent object in OPC UA tree.
+
+#### Returns
+std::shared_ptr holding the newly allocated instance of [opcua::PwmOutputManager](#classopcua_1_1_pwm_output_manager).
# class `opcua::Relay`
+Provides an OPC UA variable node abstraction for controlling a mechanical or solid-state relay.
+
+This class creates an OPC UA variable node which is representing a mechanical or solid-state relay. When writing to the OPC UA variable node a callback is triggered which either activates or deactivates the relay.
+
## Summary
Members | Descriptions
--------------------------------|---------------------------------------------
-| [`Relay`](#classopcua_1_1_relay_1aee598064d5f606fcd74e8fe473af1232) | |
-| [`onWriteRequest`](#classopcua_1_1_relay_1aaea6db4d009ec591232c10d5ade7f861) | |
-| [`SharedPtr`](#classopcua_1_1_relay_1a28a191bf7c9a5d6b769d7662063f47d7) | |
-| [`OnSetRelayStateFunc`](#classopcua_1_1_relay_1a52b846933e1fb40082c3c76dba8b03ed) | |
-| [`create`](#classopcua_1_1_relay_1ae26e71efaed1d390c3c4f62e831fce0d) | |
+| [`Relay`](#classopcua_1_1_relay_1aee598064d5f606fcd74e8fe473af1232) | Constructor of the [opcua::Relay](#classopcua_1_1_relay) class. Note: Objects should not be instantiated directly, but by using [Relay::create](#classopcua_1_1_relay_1ae26e71efaed1d390c3c4f62e831fce0d). |
+| [`onWriteRequest`](#classopcua_1_1_relay_1aaea6db4d009ec591232c10d5ade7f861) | This function is called by the framework when a write-access on the variable node representing a relay is performed. Note: This function should not be called directly, it will be invoked by the framework. |
+| [`SharedPtr`](#classopcua_1_1_relay_1a28a191bf7c9a5d6b769d7662063f47d7) | SharedPtr is std::shared_ptr of a [Relay](#classopcua_1_1_relay) class. |
+| [`OnSetRelayStateFunc`](#classopcua_1_1_relay_1a52b846933e1fb40082c3c76dba8b03ed) | OnSetRelayStateFunc is definition for a callback which is called during a write-access on the variable node representing a relay subsequently either activating (true -> switch closes) or deactivating a relay (false -> switch opens). |
+| [`create`](#classopcua_1_1_relay_1ae26e71efaed1d390c3c4f62e831fce0d) | Creates a new instance of the [opcua::Relay](#classopcua_1_1_relay) class, creating an OPC UA variable node abstraction in the process. |
## Members
@@ -989,6 +1502,11 @@ static SharedPtr create(UA_Server * server, UA_NodeId const parent_node_id)
Relay(UA_NodeId const & node_id, OnSetRelayStateFunc const on_set_relay_state)
```
+Constructor of the [opcua::Relay](#classopcua_1_1_relay) class. Note: Objects should not be instantiated directly, but by using [Relay::create](#classopcua_1_1_relay_1ae26e71efaed1d390c3c4f62e831fce0d).
+#### Parameters
+* `node_id` OPC UA node id of the variable node representing the relay.
+
+* `on_set_relay_state` Function pointer which is called during a write-access on the variable node representing a relay.
### `onWriteRequest`
@@ -997,6 +1515,13 @@ Relay(UA_NodeId const & node_id, OnSetRelayStateFunc const on_set_relay_state)
void onWriteRequest(UA_Server * server, UA_NodeId const * node_id, bool const value)
```
+This function is called by the framework when a write-access on the variable node representing a relay is performed. Note: This function should not be called directly, it will be invoked by the framework.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `node_id` OPC UA node id of the variable node representing the relay.
+
+* `value` Desired state of the relay, true -> relay is activated (relay switch closes), false -> LED is deactivated (relay switch opens).
### `SharedPtr`
@@ -1005,6 +1530,7 @@ void onWriteRequest(UA_Server * server, UA_NodeId const * node_id, bool const va
typedef SharedPtr
```
+SharedPtr is std::shared_ptr of a [Relay](#classopcua_1_1_relay) class.
### `OnSetRelayStateFunc`
@@ -1013,6 +1539,7 @@ typedef SharedPtr
typedef OnSetRelayStateFunc
```
+OnSetRelayStateFunc is definition for a callback which is called during a write-access on the variable node representing a relay subsequently either activating (true -> switch closes) or deactivating a relay (false -> switch opens).
### `create`
@@ -1021,18 +1548,34 @@ typedef OnSetRelayStateFunc
static SharedPtr create(UA_Server * server, UA_NodeId const & parent_node_id, const char * display_name, OnSetRelayStateFunc const on_set_relay_state)
```
+Creates a new instance of the [opcua::Relay](#classopcua_1_1_relay) class, creating an OPC UA variable node abstraction in the process.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `parent_node_id` OPC UA node id of parent object in OPC UA tree.
+
+* `display_name` Character string providing an easy identifiable name for the variable node representing a relay, i.e. "Relay 1".
+
+* `on_set_relay_state` Function pointer which is called during a write-access on the variable node representing a relay.
+
+#### Returns
+std::shared_ptr holding the newly allocated instance of [opcua::Relay](#classopcua_1_1_relay).
# class `opcua::RelayManager`
+Provides methods for creating and storing [Relay](#classopcua_1_1_relay) objects in a collection.
+
+This class creates an OPC UA object node which is representing all relays of a given OPC UA devices. Relays can be created and added to the OPC UA object node using this class.
+
## Summary
Members | Descriptions
--------------------------------|---------------------------------------------
-| [`RelayManager`](#classopcua_1_1_relay_manager_1a9d4e2106b768a1f1fa0afd4a5056b962) | |
-| [`add_relay_output`](#classopcua_1_1_relay_manager_1ae014ed047413e04ff3e72a924a2569d1) | |
-| [`SharedPtr`](#classopcua_1_1_relay_manager_1a5ed69275e13c134f54d16ba27eabc34c) | |
-| [`create`](#classopcua_1_1_relay_manager_1ae292144fb50a7f4b05e05f2520e41c21) | |
+| [`RelayManager`](#classopcua_1_1_relay_manager_1a9d4e2106b768a1f1fa0afd4a5056b962) | Constructor of the [opcua::RelayManager](#classopcua_1_1_relay_manager) class. Note: Objects should not be instantiated directly, but by using [RelayManager::create](#classopcua_1_1_relay_manager_1ae292144fb50a7f4b05e05f2520e41c21). |
+| [`add_relay_output`](#classopcua_1_1_relay_manager_1ae014ed047413e04ff3e72a924a2569d1) | This function creates a new [opcua::Relay](#classopcua_1_1_relay) and adds it to the [opcua::RelayManager](#classopcua_1_1_relay_manager). |
+| [`SharedPtr`](#classopcua_1_1_relay_manager_1a5ed69275e13c134f54d16ba27eabc34c) | SharedPtr is std::shared_ptr of an [RelayManager](#classopcua_1_1_relay_manager) class. |
+| [`create`](#classopcua_1_1_relay_manager_1ae292144fb50a7f4b05e05f2520e41c21) | Creates a new instance of the [opcua::RelayManager](#classopcua_1_1_relay_manager) class, creating an OPC UA object node abstraction in the process. |
## Members
@@ -1042,6 +1585,9 @@ static SharedPtr create(UA_Server * server, UA_NodeId const & parent_node_id, co
RelayManager(UA_NodeId const & node_id)
```
+Constructor of the [opcua::RelayManager](#classopcua_1_1_relay_manager) class. Note: Objects should not be instantiated directly, but by using [RelayManager::create](#classopcua_1_1_relay_manager_1ae292144fb50a7f4b05e05f2520e41c21).
+#### Parameters
+* `node_id` OPC UA node id of the object node representing all relays.
### `add_relay_output`
@@ -1050,6 +1596,13 @@ RelayManager(UA_NodeId const & node_id)
void add_relay_output(UA_Server * server, const char * display_name, Relay::OnSetRelayStateFunc const on_set_relay_state)
```
+This function creates a new [opcua::Relay](#classopcua_1_1_relay) and adds it to the [opcua::RelayManager](#classopcua_1_1_relay_manager).
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `display_name` Character string providing an easy identifiable name for the variable node representing a relay, i.e. "Relay 1".
+
+* `on_set_relay_state` Function pointer which is called during a write-access on the variable node representing a relay.
### `SharedPtr`
@@ -1058,6 +1611,7 @@ void add_relay_output(UA_Server * server, const char * display_name, Relay::OnSe
typedef SharedPtr
```
+SharedPtr is std::shared_ptr of an [RelayManager](#classopcua_1_1_relay_manager) class.
### `create`
@@ -1066,21 +1620,33 @@ typedef SharedPtr
static SharedPtr create(UA_Server * server, UA_NodeId const parent_node_id)
```
+Creates a new instance of the [opcua::RelayManager](#classopcua_1_1_relay_manager) class, creating an OPC UA object node abstraction in the process.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `parent_node_id` OPC UA node id of parent object in OPC UA tree.
+
+#### Returns
+std::shared_ptr holding the newly allocated instance of [opcua::RelayManager](#classopcua_1_1_relay_manager).
# class `opcua::Opta`
+Provides functions for exposing various IO capabilities of the Arduino [Opta](#classopcua_1_1_opta) via OPC UA.
+
+This class allows the user to expose analog and digital inputs, as well as relay and LED outputs via OPC UA properties.
+
## Summary
Members | Descriptions
--------------------------------|---------------------------------------------
-| [`Opta`](#classopcua_1_1_opta_1a283e8bca4e4044cce2e85d86bb95cd55) | |
-| [`add_analog_input`](#classopcua_1_1_opta_1a6caea0f035f0831d6a57dc3e5f972dcf) | |
-| [`add_digital_input`](#classopcua_1_1_opta_1a844b182bb773dd05310b8f92cdcb8428) | |
-| [`add_relay_output`](#classopcua_1_1_opta_1ae015db2b74d47771632648d97508bc9c) | |
-| [`add_led_output`](#classopcua_1_1_opta_1a0ca04bd872b6c67fc8e0a01ec7b60773) | |
-| [`SharedPtr`](#classopcua_1_1_opta_1a75b2e05ac5b273859709490686dfa165) | |
-| [`create`](#classopcua_1_1_opta_1a01f8da6cd187c6237c903dc6d004828a) | |
+| [`Opta`](#classopcua_1_1_opta_1a283e8bca4e4044cce2e85d86bb95cd55) | Constructor of the [opcua::Opta](#classopcua_1_1_opta) class. |
+| [`add_analog_input`](#classopcua_1_1_opta_1aaf38cbd09a99553fe731aac437ecd299) | Adds an analog input to the [opcua::Opta](#classopcua_1_1_opta) object node and exposes it as an OPC UA variable node. |
+| [`add_digital_input`](#classopcua_1_1_opta_1a6749313fcf2a31e00c0777eb03904767) | Adds a digital input to the [opcua::Opta](#classopcua_1_1_opta) object node and exposes it as an OPC UA variable node. |
+| [`add_relay_output`](#classopcua_1_1_opta_1ae015db2b74d47771632648d97508bc9c) | Adds a relay output to the [opcua::Opta](#classopcua_1_1_opta) object node and exposes it as an OPC UA variable node. |
+| [`add_led_output`](#classopcua_1_1_opta_1a0ca04bd872b6c67fc8e0a01ec7b60773) | Adds a LED output to the [opcua::Opta](#classopcua_1_1_opta) object node and exposes it as an OPC UA variable node. |
+| [`SharedPtr`](#classopcua_1_1_opta_1a75b2e05ac5b273859709490686dfa165) | SharedPtr is std::shared_ptr of an [Opta](#classopcua_1_1_opta) class. |
+| [`create`](#classopcua_1_1_opta_1a01f8da6cd187c6237c903dc6d004828a) | Creates a new instance of the [opcua::Opta](#classopcua_1_1_opta) class, creating an OPC UA object abstraction in the process. |
## Members
@@ -1090,22 +1656,43 @@ static SharedPtr create(UA_Server * server, UA_NodeId const parent_node_id)
Opta(UA_Server * server, UA_NodeId const & node_id, OptaVariant::Type const opta_type)
```
+Constructor of the [opcua::Opta](#classopcua_1_1_opta) class.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `node_id` OPC UA node id uniquely identifying the OPC UA representation of the [opcua::Opta](#classopcua_1_1_opta) class as an OPC UA object node.
+
+* `opta_type` Enumerated type describing which [Opta](#classopcua_1_1_opta) (WiFi, RS485, Lite) variant is being created.
-### `add_analog_input`
+### `add_analog_input`
```cpp
-void add_analog_input(UA_Server * server, const char * display_name, AnalogInput::OnReadRequestFunc const on_read_request_func)
+void add_analog_input(UA_Server * server, const char * display_name, AnalogInput::OnReadRequestFunc const on_read_request)
```
+Adds an analog input to the [opcua::Opta](#classopcua_1_1_opta) object node and exposes it as an OPC UA variable node.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `display_name` Character string providing an easy identifiable name for the variable node.
+
+* `on_read_request` Function pointer which is called during a read-access on the variable node representing the analog input.
-### `add_digital_input`
+### `add_digital_input`
```cpp
-void add_digital_input(UA_Server * server, const char * display_name, DigitalInput::OnReadRequestFunc const on_read_request_func)
+void add_digital_input(UA_Server * server, const char * display_name, DigitalInput::OnReadRequestFunc const on_read_request)
```
+Adds a digital input to the [opcua::Opta](#classopcua_1_1_opta) object node and exposes it as an OPC UA variable node.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `display_name` Character string providing an easy identifiable name for the variable node.
+
+* `on_read_request` Function pointer which is called during a read-access on the variable node representing the digital input.
### `add_relay_output`
@@ -1114,6 +1701,13 @@ void add_digital_input(UA_Server * server, const char * display_name, DigitalInp
void add_relay_output(UA_Server * server, const char * display_name, Relay::OnSetRelayStateFunc const on_set_relay_state)
```
+Adds a relay output to the [opcua::Opta](#classopcua_1_1_opta) object node and exposes it as an OPC UA variable node.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `display_name` Character string providing an easy identifiable name for the variable node.
+
+* `on_set_relay_state` Function pointer which is called during a write-access on the variable node representing the relay output.
### `add_led_output`
@@ -1122,6 +1716,13 @@ void add_relay_output(UA_Server * server, const char * display_name, Relay::OnSe
void add_led_output(UA_Server * server, const char * display_name, Led::OnSetLedStateFunc const on_set_led_state)
```
+Adds a LED output to the [opcua::Opta](#classopcua_1_1_opta) object node and exposes it as an OPC UA variable node.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `display_name` Character string providing an easy identifiable name for the variable node.
+
+* `on_set_led_state` Function pointer which is called during a write-access on the variable node representing the LED output.
### `SharedPtr`
@@ -1130,6 +1731,7 @@ void add_led_output(UA_Server * server, const char * display_name, Led::OnSetLed
typedef SharedPtr
```
+SharedPtr is std::shared_ptr of an [Opta](#classopcua_1_1_opta) class.
### `create`
@@ -1138,20 +1740,32 @@ typedef SharedPtr
static SharedPtr create(UA_Server * server, OptaVariant::Type const opta_type)
```
+Creates a new instance of the [opcua::Opta](#classopcua_1_1_opta) class, creating an OPC UA object abstraction in the process.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+* `opta_type` Enumerated type describing which [Opta](#classopcua_1_1_opta) (WiFi, RS485, Lite) variant is being created.
+
+#### Returns
+std::shared_ptr holding the newly allocated instance of [opcua::Opta](#classopcua_1_1_opta).
# class `opcua::OptaExpansionManager`
+High-level class to create OPC UA representations for Arduino [Opta](#classopcua_1_1_opta) digital and analog expansion boards.
+
+This class allows the user to create OPC UA representations of digital (mechanical and solid-state relays) as well as analog expansion boards connected to the Arduino [Opta](#classopcua_1_1_opta).
+
## Summary
Members | Descriptions
--------------------------------|---------------------------------------------
-| [`OptaExpansionManager`](#classopcua_1_1_opta_expansion_manager_1a50f8f17012161470f0c80efa83f8aba8) | |
-| [`create_digital_mechanical_expansion`](#classopcua_1_1_opta_expansion_manager_1a4ccb3789aab33df7df7d92a1a741bd84) | |
-| [`create_digital_solid_state_expansion`](#classopcua_1_1_opta_expansion_manager_1adf13057818a23b761898b7f263f7811b) | |
-| [`create_analog_expansion`](#classopcua_1_1_opta_expansion_manager_1ab7d5c5d2d1a35f97be82ae45ce36dafd) | |
-| [`SharedPtr`](#classopcua_1_1_opta_expansion_manager_1abd9459852a863117520d564b018779dd) | |
-| [`create`](#classopcua_1_1_opta_expansion_manager_1a1fe5f600c6a428877e5c3fc2529a1db6) | |
+| [`OptaExpansionManager`](#classopcua_1_1_opta_expansion_manager_1a50f8f17012161470f0c80efa83f8aba8) | Constructor of the [opcua::OptaExpansionManager](#classopcua_1_1_opta_expansion_manager) class. |
+| [`create_digital_mechanical_expansion`](#classopcua_1_1_opta_expansion_manager_1a4ccb3789aab33df7df7d92a1a741bd84) | Creates a new instance of the [opcua::DigitalMechExpansion](#classopcua_1_1_digital_mech_expansion) (digital expansion with mechanical relays) class. |
+| [`create_digital_solid_state_expansion`](#classopcua_1_1_opta_expansion_manager_1adf13057818a23b761898b7f263f7811b) | Creates a new instance of the [opcua::DigitalStSolidExpansion](#classopcua_1_1_digital_st_solid_expansion) (digital expansion with solid-state relays) class. |
+| [`create_analog_expansion`](#classopcua_1_1_opta_expansion_manager_1ab7d5c5d2d1a35f97be82ae45ce36dafd) | Creates a new instance of the [opcua::AnalogExpansion](#classopcua_1_1_analog_expansion) class. |
+| [`SharedPtr`](#classopcua_1_1_opta_expansion_manager_1abd9459852a863117520d564b018779dd) | SharedPtr is std::shared_ptr of an [OptaExpansionManager](#classopcua_1_1_opta_expansion_manager) class. |
+| [`create`](#classopcua_1_1_opta_expansion_manager_1a1fe5f600c6a428877e5c3fc2529a1db6) | Creates a new instance of the [opcua::OptaExpansionManager](#classopcua_1_1_opta_expansion_manager) class. |
## Members
@@ -1161,6 +1775,9 @@ static SharedPtr create(UA_Server * server, OptaVariant::Type const opta_type)
inline OptaExpansionManager(UA_Server * server)
```
+Constructor of the [opcua::OptaExpansionManager](#classopcua_1_1_opta_expansion_manager) class.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
### `create_digital_mechanical_expansion`
@@ -1169,6 +1786,12 @@ inline OptaExpansionManager(UA_Server * server)
DigitalMechExpansion::SharedPtr create_digital_mechanical_expansion(uint8_t const exp_num)
```
+Creates a new instance of the [opcua::DigitalMechExpansion](#classopcua_1_1_digital_mech_expansion) (digital expansion with mechanical relays) class.
+#### Parameters
+* `exp_num` A numerical identifier provided by the Arduino_Opta_Blueprint library and identifying the number of the expansion module in the daisy-chain of expansion modules, i.e. exp_num = 2 refers to the second connect expansion module.
+
+#### Returns
+std::shared_ptr holding the newly allocated instance of [opcua::DigitalMechExpansion](#classopcua_1_1_digital_mech_expansion).
### `create_digital_solid_state_expansion`
@@ -1177,6 +1800,12 @@ DigitalMechExpansion::SharedPtr create_digital_mechanical_expansion(uint8_t cons
DigitalStSolidExpansion::SharedPtr create_digital_solid_state_expansion(uint8_t const exp_num)
```
+Creates a new instance of the [opcua::DigitalStSolidExpansion](#classopcua_1_1_digital_st_solid_expansion) (digital expansion with solid-state relays) class.
+#### Parameters
+* `exp_num` A numerical identifier provided by the Arduino_Opta_Blueprint library and identifying the number of the expansion module in the daisy-chain of expansion modules, i.e. exp_num = 2 refers to the second connect expansion module.
+
+#### Returns
+std::shared_ptr holding the newly allocated instance of [opcua::DigitalStSolidExpansion](#classopcua_1_1_digital_st_solid_expansion).
### `create_analog_expansion`
@@ -1185,6 +1814,12 @@ DigitalStSolidExpansion::SharedPtr create_digital_solid_state_expansion(uint8_t
AnalogExpansion::SharedPtr create_analog_expansion(uint8_t const exp_num)
```
+Creates a new instance of the [opcua::AnalogExpansion](#classopcua_1_1_analog_expansion) class.
+#### Parameters
+* `exp_num` A numerical identifier provided by the Arduino_Opta_Blueprint library and identifying the number of the expansion module in the daisy-chain of expansion modules, i.e. exp_num = 2 refers to the second connect expansion module.
+
+#### Returns
+std::shared_ptr holding the newly allocated instance of [opcua::AnalogExpansion](#classopcua_1_1_analog_expansion).
### `SharedPtr`
@@ -1193,6 +1828,7 @@ AnalogExpansion::SharedPtr create_analog_expansion(uint8_t const exp_num)
typedef SharedPtr
```
+SharedPtr is std::shared_ptr of an [OptaExpansionManager](#classopcua_1_1_opta_expansion_manager) class.
### `create`
@@ -1201,20 +1837,30 @@ typedef SharedPtr
inline static SharedPtr create(UA_Server * server)
```
+Creates a new instance of the [opcua::OptaExpansionManager](#classopcua_1_1_opta_expansion_manager) class.
+#### Parameters
+* `server` Pointer to the OPC UA server implementation of the open62541 library.
+
+#### Returns
+std::shared_ptr holding the newly allocated instance of [opcua::OptaExpansionManager](#classopcua_1_1_opta_expansion_manager).
# class `opcua::OptaVariant`
+Enables determination of [Opta](#classopcua_1_1_opta) variant (WiFi, RS485, Lite) on which the OPC UA firmware is running on.
+
+This class allows the user to determine the concrete [Opta](#classopcua_1_1_opta) variant (WiFi, RS485, Lite) on which the OPC UA firmware is running on. This is archived by interrogating information stored by the bootloader.
+
## Summary
Members | Descriptions
--------------------------------|---------------------------------------------
-| [`OptaVariant`](#classopcua_1_1_opta_variant_1acaaa63b7b37af5fab4f3df0080669d76) | |
-| [`OptaVariant`](#classopcua_1_1_opta_variant_1a82a5e186512309818c5a4922e18097b6) | |
-| [`Type`](#classopcua_1_1_opta_variant_1abd647955f6c174916e3c0e25ed240ea8) | |
-| [`get_opta_variant`](#classopcua_1_1_opta_variant_1a0b7ae42903e8beabeaf6962db7504d35) | |
-| [`toString`](#classopcua_1_1_opta_variant_1aa2b41d503d530c8f135f420b54d94068) | |
-| [`toSKUString`](#classopcua_1_1_opta_variant_1aba13996161689f6feb65753daa4e796e) | |
+| [`OptaVariant`](#classopcua_1_1_opta_variant_1acaaa63b7b37af5fab4f3df0080669d76) | The constructor of [OptaVariant](#classopcua_1_1_opta_variant) is deleted because this object shall not be instantiated. |
+| [`OptaVariant`](#classopcua_1_1_opta_variant_1a82a5e186512309818c5a4922e18097b6) | The copy constructor of [OptaVariant](#classopcua_1_1_opta_variant) is deleted because this object shall not be copied. |
+| [`Type`](#classopcua_1_1_opta_variant_1abd647955f6c174916e3c0e25ed240ea8) | Type is an enumeration type to describe the various different Arduino [Opta](#classopcua_1_1_opta) variants. |
+| [`get_opta_variant`](#classopcua_1_1_opta_variant_1a0b7ae42903e8beabeaf6962db7504d35) | Determines the current [Opta](#classopcua_1_1_opta) variant by reading information provided by the bootloader. |
+| [`toString`](#classopcua_1_1_opta_variant_1aa2b41d503d530c8f135f420b54d94068) | Convert enumerated variant type to variant product name. |
+| [`toSKUString`](#classopcua_1_1_opta_variant_1aba13996161689f6feb65753daa4e796e) | Convert enumerated variant type to variant product SKU number. |
## Members
@@ -1224,6 +1870,7 @@ inline static SharedPtr create(UA_Server * server)
OptaVariant() = delete
```
+The constructor of [OptaVariant](#classopcua_1_1_opta_variant) is deleted because this object shall not be instantiated.
### `OptaVariant`
@@ -1232,6 +1879,7 @@ OptaVariant() = delete
OptaVariant( OptaVariant const &) = delete
```
+The copy constructor of [OptaVariant](#classopcua_1_1_opta_variant) is deleted because this object shall not be copied.
### `Type`
@@ -1242,43 +1890,64 @@ enum Type
Values | Descriptions
--------------------------------|---------------------------------------------
-Lite |
-RS485 |
-WiFi |
+Lite | Arduino [Opta](#classopcua_1_1_opta) Lite
+RS485 | Arduino [Opta](#classopcua_1_1_opta) RS485
+WiFi | Arduino [Opta](#classopcua_1_1_opta) WiFi
+Type is an enumeration type to describe the various different Arduino [Opta](#classopcua_1_1_opta) variants.
### `get_opta_variant`
```cpp
-static bool get_opta_variant(Type & type)
+static bool get_opta_variant( Type & type)
```
+Determines the current [Opta](#classopcua_1_1_opta) variant by reading information provided by the bootloader.
+#### Parameters
+* `type` Output parameter containing the current [Opta](#classopcua_1_1_opta) variant.
+
+#### Returns
+True if the [Opta](#classopcua_1_1_opta) variant could be obtained successfully.
### `toString`
```cpp
-static std::string toString(Type const type)
+static std::string toString( Type const type)
```
+Convert enumerated variant type to variant product name.
+#### Parameters
+* `type` Enumerated type describing an [Opta](#classopcua_1_1_opta) variant.
+
+#### Returns
+String describing the [Opta](#classopcua_1_1_opta) variant's product name, i.e. [Type::Lite](#classopcua_1_1_opta_variant_1abd647955f6c174916e3c0e25ed240ea8a2dc5b73e350ccaf3a027e503e0220979) -> "Arduino Opta Lite"
### `toSKUString`
```cpp
-static std::string toSKUString(Type const type)
+static std::string toSKUString( Type const type)
```
+Convert enumerated variant type to variant product SKU number.
+#### Parameters
+* `type` Enumerated type describing an [Opta](#classopcua_1_1_opta) variant.
+
+#### Returns
+String describing the [Opta](#classopcua_1_1_opta) variant's SKU number, i.e. [Type::Lite](#classopcua_1_1_opta_variant_1abd647955f6c174916e3c0e25ed240ea8a2dc5b73e350ccaf3a027e503e0220979) -> "AFX00003"
# class `opcua::NTPUtils`
+Provides a method for obtaining the current time via UDP.
+
## Summary
Members | Descriptions
--------------------------------|---------------------------------------------
-| [`getTime`](#classopcua_1_1_n_t_p_utils_1afb634cf860f54e4cc7d1cc23073af912) | |
+| [`getTime`](#classopcua_1_1_n_t_p_utils_1afb634cf860f54e4cc7d1cc23073af912) | Obtain the current UTC time via NTP. |
## Members
@@ -1288,17 +1957,25 @@ static std::string toSKUString(Type const type)
static unsigned long getTime(UDP & udp)
```
+Obtain the current UTC time via NTP.
+#### Parameters
+* `udp` Reference to UDP network socket.
+
+#### Returns
+current UTC time in seconds since Epoch (Unix Time)
# class `opcua::ExpansionType`
+Provides a method for converting Arduino_Opta_Blueprint's ExpansionType_t to a human readable string.
+
## Summary
Members | Descriptions
--------------------------------|---------------------------------------------
-| [`ExpansionType`](#classopcua_1_1_expansion_type_1a23ebe20fe86bce334acbebca12453f97) | |
-| [`ExpansionType`](#classopcua_1_1_expansion_type_1a93119a7176cebcc818038cc2cb5bd566) | |
-| [`toStr`](#classopcua_1_1_expansion_type_1a34fa70ff71feda985dd570b7e25f2286) | |
+| [`ExpansionType`](#classopcua_1_1_expansion_type_1a23ebe20fe86bce334acbebca12453f97) | The constructor of [ExpansionType](#classopcua_1_1_expansion_type) is deleted because this object shall not be instantiated. |
+| [`ExpansionType`](#classopcua_1_1_expansion_type_1a93119a7176cebcc818038cc2cb5bd566) | The copy constructor of [ExpansionType](#classopcua_1_1_expansion_type) is deleted because this object shall not be copied. |
+| [`toStr`](#classopcua_1_1_expansion_type_1a34fa70ff71feda985dd570b7e25f2286) | Converts Arduino_Opta_Blueprint's ExpansionType_t into a human readable string. |
## Members
@@ -1308,6 +1985,7 @@ static unsigned long getTime(UDP & udp)
ExpansionType() = delete
```
+The constructor of [ExpansionType](#classopcua_1_1_expansion_type) is deleted because this object shall not be instantiated.
### `ExpansionType`
@@ -1316,6 +1994,7 @@ ExpansionType() = delete
ExpansionType( ExpansionType const &) = delete
```
+The copy constructor of [ExpansionType](#classopcua_1_1_expansion_type) is deleted because this object shall not be copied.
### `toStr`
@@ -1324,67 +2003,11 @@ ExpansionType( ExpansionType const &) = delete
inline static std::string toStr(ExpansionType_t const type)
```
-
-
-# struct `O1HeapDiagnostics`
-
-Runtime diagnostic information. This information can be used to facilitate runtime self-testing, as required by certain safety-critical development guidelines. If assertion checks are not disabled, the library will perform automatic runtime self-diagnostics that trigger an assertion failure if a heap corruption is detected. Health checks and validation can be done with o1heapDoInvariantsHold().
-
-## Summary
-
- Members | Descriptions
---------------------------------|---------------------------------------------
-| [`capacity`](#struct_o1_heap_diagnostics_1ad43d9507a941522c830a9695b4c72ebe) | The total amount of memory available for serving allocation requests (heap size). The maximum allocation size is (capacity - O1HEAP_ALIGNMENT). This parameter does not include the overhead used up by O1HeapInstance and arena alignment. This parameter is constant. |
-| [`allocated`](#struct_o1_heap_diagnostics_1a26088df3cfdc97fdb7cb9aa270eb4f01) | The amount of memory that is currently allocated, including the per-fragment overhead and size alignment. For example, if the application requested a fragment of size 1 byte, the value reported here may be 32 bytes. |
-| [`peak_allocated`](#struct_o1_heap_diagnostics_1a2dfd925e33942d0d87dbcd1c27ab74e2) | The maximum value of 'allocated' seen since initialization. This parameter is never decreased. |
-| [`peak_request_size`](#struct_o1_heap_diagnostics_1a08dc28803ca2732f21f273bc8c563916) | The largest amount of memory that the allocator has attempted to allocate (perhaps unsuccessfully) since initialization (not including the rounding and the allocator's own per-fragment overhead, so the total is larger). This parameter is never decreased. The initial value is zero. |
-| [`oom_count`](#struct_o1_heap_diagnostics_1aef5b37fb6497cc3fbdffc08fa6cac88e) | The number of times an allocation request could not be completed due to the lack of memory or excessive fragmentation. OOM stands for "out of memory". This parameter is never decreased. |
-
-## Members
-
-### `capacity`
-
-```cpp
-size_t capacity
-```
-
-The total amount of memory available for serving allocation requests (heap size). The maximum allocation size is (capacity - O1HEAP_ALIGNMENT). This parameter does not include the overhead used up by O1HeapInstance and arena alignment. This parameter is constant.
-
-
-### `allocated`
-
-```cpp
-size_t allocated
-```
-
-The amount of memory that is currently allocated, including the per-fragment overhead and size alignment. For example, if the application requested a fragment of size 1 byte, the value reported here may be 32 bytes.
-
-
-### `peak_allocated`
-
-```cpp
-size_t peak_allocated
-```
-
-The maximum value of 'allocated' seen since initialization. This parameter is never decreased.
-
-
-
-### `peak_request_size`
-
-```cpp
-size_t peak_request_size
-```
-
-The largest amount of memory that the allocator has attempted to allocate (perhaps unsuccessfully) since initialization (not including the rounding and the allocator's own per-fragment overhead, so the total is larger). This parameter is never decreased. The initial value is zero.
-
-
-### `oom_count`
-
-```cpp
-uint64_t oom_count
-```
+Converts Arduino_Opta_Blueprint's ExpansionType_t into a human readable string.
+#### Parameters
+* `type` Numeric identifier identifying the type of connected expansion board.
-The number of times an allocation request could not be completed due to the lack of memory or excessive fragmentation. OOM stands for "out of memory". This parameter is never decreased.
+#### Returns
+Human readable string describing the concrete expansion module.
diff --git a/src/Opta.cpp b/src/Opta.cpp
index 0e7c2aa..068c7d4 100644
--- a/src/Opta.cpp
+++ b/src/Opta.cpp
@@ -146,18 +146,18 @@ void
Opta::add_analog_input(
UA_Server * server,
const char * display_name,
- AnalogInput::OnReadRequestFunc const on_read_request_func)
+ AnalogInput::OnReadRequestFunc const on_read_request)
{
- _analog_input_mgr->add_analog_input(server, display_name, on_read_request_func);
+ _analog_input_mgr->add_analog_input(server, display_name, on_read_request);
}
void
Opta::add_digital_input(
UA_Server * server,
const char * display_name,
- DigitalInput::OnReadRequestFunc const on_read_request_func)
+ DigitalInput::OnReadRequestFunc const on_read_request)
{
- _digital_input_mgr->add_digital_input(server, display_name, on_read_request_func);
+ _digital_input_mgr->add_digital_input(server, display_name, on_read_request);
}
void
diff --git a/src/Opta.h b/src/Opta.h
index 21cb80e..caa68ef 100644
--- a/src/Opta.h
+++ b/src/Opta.h
@@ -29,6 +29,11 @@
* NAMESPACE
**************************************************************************************/
+/**
+ * opcua is used as enclosing namespace for all parts of the Arduino_open62541 library
+ * in order to avoid naming conflicts with already existing frameworks pertaining the
+ * Arduino Opta.
+ */
namespace opcua
{
@@ -36,42 +41,88 @@ namespace opcua
* CLASS DECLARATION
**************************************************************************************/
+/**
+ * @class Opta
+ * @brief Provides functions for exposing various IO capabilities of the Arduino Opta via OPC UA.
+ *
+ * This class allows the user to expose analog and digital inputs, as well as relay and LED outputs
+ * via OPC UA properties.
+ */
class Opta
{
public:
+ /**
+ * SharedPtr is std::shared_ptr of an Opta class.
+ */
typedef std::shared_ptr SharedPtr;
+ /**
+ * Creates a new instance of the opcua::Opta class, creating an OPC UA object abstraction in the process.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param opta_type Enumerated type describing which Opta (WiFi, RS485, Lite) variant is being created.
+ * @return std::shared_ptr holding the newly allocated instance of opcua::Opta.
+ */
static SharedPtr
create(
UA_Server * server,
OptaVariant::Type const opta_type);
+ /**
+ * Constructor of the opcua::Opta class.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param node_id OPC UA node id uniquely identifying the OPC UA representation of the opcua::Opta class as an OPC UA object node.
+ * @param opta_type Enumerated type describing which Opta (WiFi, RS485, Lite) variant is being created.
+ */
Opta(
UA_Server * server,
UA_NodeId const & node_id,
OptaVariant::Type const opta_type);
+ /**
+ * Adds an analog input to the opcua::Opta object node and exposes it as an OPC UA variable node.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param display_name Character string providing an easy identifiable name for the variable node.
+ * @param on_read_request Function pointer which is called during a read-access on the variable node representing the analog input.
+ */
void
add_analog_input(
UA_Server * server,
const char * display_name,
- AnalogInput::OnReadRequestFunc const on_read_request_func);
-
+ AnalogInput::OnReadRequestFunc const on_read_request);
+
+ /**
+ * Adds a digital input to the opcua::Opta object node and exposes it as an OPC UA variable node.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param display_name Character string providing an easy identifiable name for the variable node.
+ * @param on_read_request Function pointer which is called during a read-access on the variable node representing the digital input.
+ */
void
add_digital_input(
UA_Server * server,
const char * display_name,
- DigitalInput::OnReadRequestFunc const on_read_request_func);
-
+ DigitalInput::OnReadRequestFunc const on_read_request);
+
+ /**
+ * Adds a relay output to the opcua::Opta object node and exposes it as an OPC UA variable node.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param display_name Character string providing an easy identifiable name for the variable node.
+ * @param on_set_relay_state Function pointer which is called during a write-access on the variable node representing the relay output.
+ */
void
add_relay_output(
UA_Server * server,
const char * display_name,
Relay::OnSetRelayStateFunc const on_set_relay_state);
+ /**
+ * Adds a LED output to the opcua::Opta object node and exposes it as an OPC UA variable node.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param display_name Character string providing an easy identifiable name for the variable node.
+ * @param on_set_led_state Function pointer which is called during a write-access on the variable node representing the LED output.
+ */
void
add_led_output(
UA_Server * server,
diff --git a/src/OptaExpansionManager.h b/src/OptaExpansionManager.h
index b9f3fd0..2ef7b60 100644
--- a/src/OptaExpansionManager.h
+++ b/src/OptaExpansionManager.h
@@ -32,12 +32,27 @@ namespace opcua
* CLASS DECLARATION
**************************************************************************************/
+/**
+ * @class OptaExpansionManager
+ * @brief High-level class to create OPC UA representations for Arduino Opta digital and analog expansion boards.
+ *
+ * This class allows the user to create OPC UA representations of digital (mechanical and solid-state relays) as
+ * well as analog expansion boards connected to the Arduino Opta.
+ */
class OptaExpansionManager
{
public:
+ /**
+ * SharedPtr is std::shared_ptr of an OptaExpansionManager class.
+ */
typedef std::shared_ptr SharedPtr;
+ /**
+ * Creates a new instance of the opcua::OptaExpansionManager class.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @return std::shared_ptr holding the newly allocated instance of opcua::OptaExpansionManager.
+ */
static SharedPtr
create(
UA_Server * server) {
@@ -45,15 +60,43 @@ class OptaExpansionManager
}
+ /**
+ * Constructor of the opcua::OptaExpansionManager class.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ */
OptaExpansionManager(
UA_Server * server)
: _server{server}
{ }
- DigitalMechExpansion::SharedPtr create_digital_mechanical_expansion(uint8_t const exp_num);
- DigitalStSolidExpansion::SharedPtr create_digital_solid_state_expansion(uint8_t const exp_num);
- AnalogExpansion::SharedPtr create_analog_expansion(uint8_t const exp_num);
+ /**
+ * Creates a new instance of the opcua::DigitalMechExpansion (digital expansion with mechanical relays) class.
+ * @param exp_num A numerical identifier provided by the Arduino_Opta_Blueprint library and identifying the number of the expansion module in the daisy-chain of expansion modules, i.e. exp_num = 2 refers to the second connect expansion module.
+ * @return std::shared_ptr holding the newly allocated instance of opcua::DigitalMechExpansion.
+ */
+ DigitalMechExpansion::SharedPtr
+ create_digital_mechanical_expansion(
+ uint8_t const exp_num);
+
+ /**
+ * Creates a new instance of the opcua::DigitalStSolidExpansion (digital expansion with solid-state relays) class.
+ * @param exp_num A numerical identifier provided by the Arduino_Opta_Blueprint library and identifying the number of the expansion module in the daisy-chain of expansion modules, i.e. exp_num = 2 refers to the second connect expansion module.
+ * @return std::shared_ptr holding the newly allocated instance of opcua::DigitalStSolidExpansion.
+ */
+ DigitalStSolidExpansion::SharedPtr
+ create_digital_solid_state_expansion(
+ uint8_t const exp_num);
+
+ /**
+ * Creates a new instance of the opcua::AnalogExpansion class.
+ * @param exp_num A numerical identifier provided by the Arduino_Opta_Blueprint library and identifying the number of the expansion module in the daisy-chain of expansion modules, i.e. exp_num = 2 refers to the second connect expansion module.
+ * @return std::shared_ptr holding the newly allocated instance of opcua::AnalogExpansion.
+ */
+ AnalogExpansion::SharedPtr
+ create_analog_expansion(
+ uint8_t const exp_num);
+
private:
UA_Server * _server;
diff --git a/src/OptaVariant.h b/src/OptaVariant.h
index b70a2a4..04bde8e 100644
--- a/src/OptaVariant.h
+++ b/src/OptaVariant.h
@@ -26,23 +26,63 @@ namespace opcua
* CLASS DECLARATION
**************************************************************************************/
+/**
+ * @class OptaVariant
+ * @brief Enables determination of Opta variant (WiFi, RS485, Lite) on which the OPC UA firmware is running on.
+ *
+ * This class allows the user to determine the concrete Opta variant (WiFi, RS485, Lite) on which the OPC UA
+ * firmware is running on. This is archived by interrogating information stored by the bootloader.
+ */
class OptaVariant
{
public:
+ /**
+ * The constructor of OptaVariant is deleted because this object shall not be instantiated.
+ */
OptaVariant() = delete;
+ /**
+ * The copy constructor of OptaVariant is deleted because this object shall not be copied.
+ */
OptaVariant(OptaVariant const &) = delete;
- enum class Type { Lite, RS485, WiFi };
+ /**
+ * Type is an enumeration type to describe the various different Arduino Opta variants.
+ */
+ enum class Type
+ {
+ /** Arduino Opta Lite */
+ Lite,
+ /** Arduino Opta RS485 */
+ RS485,
+ /** Arduino Opta WiFi */
+ WiFi
+ };
+ /**
+ * Determines the current Opta variant by reading information provided by the bootloader.
+ * @param type Output parameter containing the current Opta variant.
+ * @return True if the Opta variant could be obtained successfully.
+ */
static bool
get_opta_variant(
Type & type);
+ /**
+ * Convert enumerated variant type to variant product name.
+ * @param type Enumerated type describing an Opta variant.
+ * @return String describing the Opta variant's product name, i.e. Type::Lite -> "Arduino Opta Lite"
+ */
static std::string
toString(
Type const type);
+
+ /**
+ * Convert enumerated variant type to variant product SKU number.
+ * @param type Enumerated type describing an Opta variant.
+ * @return String describing the Opta variant's SKU number, i.e. Type::Lite -> "AFX00003"
+ */
static std::string
toSKUString(
Type const type);
diff --git a/src/expansion/AnalogExpansion.cpp b/src/expansion/AnalogExpansion.cpp
index febdb08..16daea8 100644
--- a/src/expansion/AnalogExpansion.cpp
+++ b/src/expansion/AnalogExpansion.cpp
@@ -69,9 +69,9 @@ void
AnalogExpansion::add_analog_input(
UA_Server * server,
const char * display_name,
- AnalogInput::OnReadRequestFunc const on_read_request_func)
+ AnalogInput::OnReadRequestFunc const on_read_request)
{
- _analog_input_mgr->add_analog_input(server, display_name, on_read_request_func);
+ _analog_input_mgr->add_analog_input(server, display_name, on_read_request);
}
void
@@ -79,9 +79,9 @@ AnalogExpansion::add_analog_output(
UA_Server * server,
const char * display_name,
AnalogOutput::OnReadRequestFunc const on_read_request,
- AnalogOutput::OnWriteRequestFunc const on_write_request_func)
+ AnalogOutput::OnWriteRequestFunc const on_write_request)
{
- _analog_output_mgr->add_analog_output(server, display_name, on_read_request, on_write_request_func);
+ _analog_output_mgr->add_analog_output(server, display_name, on_read_request, on_write_request);
}
void
diff --git a/src/expansion/AnalogExpansion.h b/src/expansion/AnalogExpansion.h
index 66fd547..5ce3a1f 100644
--- a/src/expansion/AnalogExpansion.h
+++ b/src/expansion/AnalogExpansion.h
@@ -33,12 +33,30 @@ namespace opcua
* CLASS DECLARATION
**************************************************************************************/
+/**
+ * @class AnalogExpansion
+ * @brief Provides an OPC UA object node abstraction for an Analog Expansion board.
+ *
+ * This class creates an OPC UA object node which is representing an Arduino Opta
+ * Analog Expansion board. Furthermore, this class provides methods for adding
+ * OPC UA exposure to all IO entities supported by the Analog Expansion board.
+ */
class AnalogExpansion : public Expansion
{
public:
+ /**
+ * SharedPtr is std::shared_ptr of an AnalogExpansion class.
+ */
typedef std::shared_ptr SharedPtr;
+ /**
+ * Creates a new instance of the opcua::AnalogExpansion class, creating an OPC UA object node abstraction in the process.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param parent_node_id OPC UA node id of parent object in OPC UA tree.
+ * @param exp_num A numerical identifier provided by the Arduino_Opta_Blueprint library and identifying the number of the expansion module in the daisy-chain of expansion modules, i.e. exp_num = 2 refers to the second connect expansion module.
+ * @return std::shared_ptr holding the newly allocated instance of opcua::AnalogExpansion.
+ */
static SharedPtr
create(
UA_Server *server,
@@ -46,33 +64,70 @@ class AnalogExpansion : public Expansion
uint8_t const exp_num);
+ /**
+ * Constructor of the opcua::AnalogExpansion class.
+ * Note: Objects should not be instantiated directly, but by using AnalogExpansion::create.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param parent_node_id OPC UA node id of parent object in OPC UA tree.
+ * @param display_name Character string providing an easy identifiable name for the object node representing an analog expansion board, i.e. "Arduino Opta Expansion 1: Analog".
+ * @param node_name The unique node name identifying the Analog Expansion Board object node within the OPC UA tree.
+ */
AnalogExpansion(
UA_Server * server,
UA_NodeId const parent_node_id,
char * display_name,
char * node_name);
+ /**
+ * Destructor of the opcua::AnalogExpansion class.
+ */
virtual ~AnalogExpansion() = default;
+ /**
+ * Returns the SKU number of the Analog Expansion board as std::string.
+ * @return SKU number of Analog Expansion board
+ */
virtual std::string
toSKUString() const override final
{
return std::string("AFX00007");
}
+
+ /**
+ * This function creates a new opcua::AnalogInput and adds it to the opcua::AnalogInputManager belonging to the opcua::AnalogExpansion class.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param display_name Character string providing an easy identifiable name for the variable node representing an analog input, i.e. "Analog Input I1".
+ * @param on_read_request Function pointer which is called during a read-access on the variable node representing the analog input.
+ */
void
add_analog_input(
UA_Server * server,
const char * display_name,
- AnalogInput::OnReadRequestFunc const on_read_request_func);
-
+ AnalogInput::OnReadRequestFunc const on_read_request);
+
+ /**
+ * This function creates a new opcua::AnalogOutput and adds it to the opcua::AnalogOutputManager belonging to the opcua::AnalogExpansion class.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param display_name Character string providing an easy identifiable name for the variable node representing an analog output, i.e. "Analog Output O1".
+ * @param on_read_request Function pointer which is called during a read-access on the variable node representing the analog output.
+ * @param on_write_request Function pointer which is called during a write-access on the variable node representing the analog output.
+ */
void
add_analog_output(
UA_Server * server,
const char * display_name,
AnalogOutput::OnReadRequestFunc const on_read_request,
- AnalogOutput::OnWriteRequestFunc const on_write_request_func);
-
+ AnalogOutput::OnWriteRequestFunc const on_write_request);
+
+ /**
+ * This function creates a new opcua::PwmOutput and adds it to the opcua::PwmOutputManager belonging to the opcua::AnalogExpansion class.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param display_name Character string providing an easy identifiable name for the variable node representing an analog output, i.e. "PWM Output P1".
+ * @param set_pwm_func Function pointer which is called during a write-access on the variable node representing the PWM output and used for setting the PWM period and pulse width.
+ * @param get_pwm_period_func Function pointer which is called during a read-access on the variable node representing the PWM output's period.
+ * @param get_pwm_pulse_width_func Function pointer which is called during a read-access on the variable node representing the PWM output's pulse width.
+ */
void
add_pwm_output(
UA_Server * server,
@@ -81,6 +136,12 @@ class AnalogExpansion : public Expansion
PwmOutput::GetPwmPeriodFunc const get_pwm_period_func,
PwmOutput::GetPwmPulseWidthFunc const get_pwm_pulse_width_func);
+ /**
+ * This function creates a new opcua::LED and adds it to the opcua::LEDManager belonging to the opcua::AnalogExpansion class.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param display_name Character string providing an easy identifiable name for the variable node representing a LED, i.e. "LED1".
+ * @param on_set_led_state Function pointer which is called during a write-access on the variable node representing the LED.
+ */
void
add_led_output(
UA_Server * server,
diff --git a/src/expansion/DigitalExpansion.cpp b/src/expansion/DigitalExpansion.cpp
index 72ee10a..90c11d7 100644
--- a/src/expansion/DigitalExpansion.cpp
+++ b/src/expansion/DigitalExpansion.cpp
@@ -53,18 +53,18 @@ void
DigitalExpansion::add_analog_input(
UA_Server * server,
const char * display_name,
- AnalogInput::OnReadRequestFunc const on_read_request_func)
+ AnalogInput::OnReadRequestFunc const on_read_request)
{
- _analog_input_mgr->add_analog_input(server, display_name, on_read_request_func);
+ _analog_input_mgr->add_analog_input(server, display_name, on_read_request);
}
void
DigitalExpansion::add_digital_input(
UA_Server * server,
const char * display_name,
- DigitalInput::OnReadRequestFunc const on_read_request_func)
+ DigitalInput::OnReadRequestFunc const on_read_request)
{
- _digital_input_mgr->add_digital_input(server, display_name, on_read_request_func);
+ _digital_input_mgr->add_digital_input(server, display_name, on_read_request);
}
void
diff --git a/src/expansion/DigitalExpansion.h b/src/expansion/DigitalExpansion.h
index 2adbe69..1e24e65 100644
--- a/src/expansion/DigitalExpansion.h
+++ b/src/expansion/DigitalExpansion.h
@@ -32,32 +32,73 @@ namespace opcua
* CLASS DECLARATION
**************************************************************************************/
+/**
+ * @class DigitalExpansion
+ * @brief Provides an OPC UA object node abstraction for both Digital Expansion board.
+ *
+ * This class creates an OPC UA object node which is representing an Arduino Opta
+ * Digital Expansion board. Furthermore, this class provides methods for adding
+ * OPC UA exposure to all IO entities supported by the Digital Expansion board.
+ */
class DigitalExpansion : public Expansion
{
public:
+ /**
+ * SharedPtr is std::shared_ptr of an DigitalExpansion class.
+ */
typedef std::shared_ptr SharedPtr;
+ /**
+ * Constructor of the opcua::DigitalExpansion class.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param parent_node_id OPC UA node id of parent object in OPC UA tree.
+ * @param display_name Character string providing an easy identifiable name for the object node representing an analog expansion board, i.e. "Arduino Opta Expansion 1: Analog".
+ * @param node_name The unique node name identifying the Analog Expansion Board object node within the OPC UA tree.
+ * @param model_name This parameter must be filled with the SKU of the actual Digital Expansion board.
+ */
DigitalExpansion(
UA_Server * server,
UA_NodeId const parent_node_id,
char * display_name,
char * node_name,
char * model_name);
+ /**
+ * Destructor of the opcua::DigitalExpansion class.
+ */
virtual ~DigitalExpansion() = default;
+
+/**
+ * This function creates a new opcua::AnalogInput and adds it to the opcua::AnalogInputManager belonging to the opcua::DigitalExpansion class.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param display_name Character string providing an easy identifiable name for the variable node representing an analog input, i.e. "Analog Input I1".
+ * @param on_read_request Function pointer which is called during a read-access on the variable node representing the analog input.
+ */
void
add_analog_input(
UA_Server * server,
const char * display_name,
- AnalogInput::OnReadRequestFunc const on_read_request_func);
-
+ AnalogInput::OnReadRequestFunc const on_read_request);
+
+ /**
+ * This function creates a new opcua::DigitalInput and adds it to the opcua::DigitalInputManager belonging to the opcua::DigitalExpansion class.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param display_name Character string providing an easy identifiable name for the variable node representing an analog input, i.e. "Digital Input I1".
+ * @param on_read_request Function pointer which is called during a read-access on the variable node representing the digital input.
+ */
void
add_digital_input(
UA_Server * server,
const char * display_name,
- DigitalInput::OnReadRequestFunc const on_read_request_func);
-
+ DigitalInput::OnReadRequestFunc const on_read_request);
+
+ /**
+ * This function creates a new opcua::Relay and adds it to the opcua::RelayManager belonging to the opcua::DigitalExpansion class.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param display_name Character string providing an easy identifiable name for the variable node representing a relay, i.e. "Relay 1".
+ * @param on_set_relay_state Function pointer which is called during a write-access on the variable node representing a relay.
+ */
void
add_relay_output(
UA_Server * server,
diff --git a/src/expansion/DigitalMechExpansion.h b/src/expansion/DigitalMechExpansion.h
index c200ef1..2670c42 100644
--- a/src/expansion/DigitalMechExpansion.h
+++ b/src/expansion/DigitalMechExpansion.h
@@ -26,12 +26,29 @@ namespace opcua
* CLASS DECLARATION
**************************************************************************************/
+/**
+ * @class DigitalMechExpansion
+ * @brief Provides an OPC UA object node abstraction for a Digital Expansion board with mechanical relays.
+ *
+ * This class creates an OPC UA object node which is representing an Arduino Opta
+ * Digital Expansion board with mechanical relays.
+ */
class DigitalMechExpansion : public DigitalExpansion
{
public:
+ /**
+ * SharedPtr is std::shared_ptr of an DigitalMechExpansion class.
+ */
typedef std::shared_ptr SharedPtr;
+ /**
+ * Creates a new instance of the opcua::DigitalMechExpansion class, creating an OPC UA object node abstraction in the process.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param parent_node_id OPC UA node id of parent object in OPC UA tree.
+ * @param exp_num A numerical identifier provided by the Arduino_Opta_Blueprint library and identifying the number of the expansion module in the daisy-chain of expansion modules, i.e. exp_num = 2 refers to the second connect expansion module.
+ * @return std::shared_ptr holding the newly allocated instance of opcua::DigitalMechExpansion.
+ */
static SharedPtr
create(
UA_Server *server,
@@ -49,6 +66,14 @@ class DigitalMechExpansion : public DigitalExpansion
}
+ /**
+ * Constructor of the opcua::DigitalMechExpansion class.
+ * Note: Objects should not be instantiated directly, but by using DigitalMechExpansion::create.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param parent_node_id OPC UA node id of parent object in OPC UA tree.
+ * @param display_name Character string providing an easy identifiable name for the object node representing an analog expansion board, i.e. "Arduino Opta Expansion 1: Digital (Mechanical)".
+ * @param node_name The unique node name identifying the Analog Expansion Board object node within the OPC UA tree.
+ */
DigitalMechExpansion(
UA_Server * server,
UA_NodeId const parent_node_id,
@@ -56,9 +81,16 @@ class DigitalMechExpansion : public DigitalExpansion
char * node_name)
: DigitalExpansion(server, parent_node_id, display_name, node_name, (char *)toSKUString().c_str())
{}
+ /**
+ * Destructor of the opcua::DigitalMechExpansion class.
+ */
virtual ~DigitalMechExpansion() = default;
+ /**
+ * Returns the SKU number of the Digital Expansion board with mechanical relays as std::string.
+ * @return SKU number of Digital Expansion board / mechanical relays
+ */
virtual std::string
toSKUString() const override final
{
diff --git a/src/expansion/DigitalStSolidExpansion.h b/src/expansion/DigitalStSolidExpansion.h
index 1f50a95..1343425 100644
--- a/src/expansion/DigitalStSolidExpansion.h
+++ b/src/expansion/DigitalStSolidExpansion.h
@@ -26,12 +26,29 @@ namespace opcua
* CLASS DECLARATION
**************************************************************************************/
+/**
+ * @class DigitalStSolidExpansion
+ * @brief Provides an OPC UA object node abstraction for a Digital Expansion board with solid-state relays.
+ *
+ * This class creates an OPC UA object node which is representing an Arduino Opta
+ * Digital Expansion board with solid-state relays.
+ */
class DigitalStSolidExpansion : public DigitalExpansion
{
public:
+ /**
+ * SharedPtr is std::shared_ptr of an DigitalStSolidExpansion class.
+ */
typedef std::shared_ptr SharedPtr;
+ /**
+ * Creates a new instance of the opcua::DigitalStSolidExpansion class, creating an OPC UA object node abstraction in the process.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param parent_node_id OPC UA node id of parent object in OPC UA tree.
+ * @param exp_num A numerical identifier provided by the Arduino_Opta_Blueprint library and identifying the number of the expansion module in the daisy-chain of expansion modules, i.e. exp_num = 2 refers to the second connect expansion module.
+ * @return std::shared_ptr holding the newly allocated instance of opcua::DigitalStSolidExpansion.
+ */
static SharedPtr
create(
UA_Server *server,
@@ -49,6 +66,14 @@ class DigitalStSolidExpansion : public DigitalExpansion
}
+ /**
+ * Constructor of the opcua::DigitalStSolidExpansion class.
+ * Note: Objects should not be instantiated directly, but by using DigitalStSolidExpansion::create.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param parent_node_id OPC UA node id of parent object in OPC UA tree.
+ * @param display_name Character string providing an easy identifiable name for the object node representing an analog expansion board, i.e. "Arduino Opta Expansion 1: Digital (Solid State)".
+ * @param node_name The unique node name identifying the Analog Expansion Board object node within the OPC UA tree.
+ */
DigitalStSolidExpansion(
UA_Server * server,
UA_NodeId const parent_node_id,
@@ -56,9 +81,16 @@ class DigitalStSolidExpansion : public DigitalExpansion
char * node_name)
: DigitalExpansion{server, parent_node_id, display_name, node_name, (char *)toSKUString().c_str()}
{}
+ /**
+ * Destructor of the opcua::DigitalStSolidExpansion class.
+ */
virtual ~DigitalStSolidExpansion() = default;
+ /**
+ * Returns the SKU number of the Digital Expansion board with solid-state relays as std::string.
+ * @return SKU number of Digital Expansion board / solid-state relays
+ */
virtual std::string
toSKUString() const override final
{
diff --git a/src/expansion/Expansion.h b/src/expansion/Expansion.h
index edffe50..233328b 100644
--- a/src/expansion/Expansion.h
+++ b/src/expansion/Expansion.h
@@ -28,26 +28,55 @@ namespace opcua
* CLASS DECLARATION
**************************************************************************************/
+/**
+ * @class Expansion
+ * @brief Provides a generic base class for various expansion board specificic derived classes.
+ */
class Expansion
{
public:
+ /**
+ * SharedPtr is std::shared_ptr of an Expansion class.
+ */
typedef std::shared_ptr SharedPtr;
+ /**
+ * Constructor of the opcua::Expansion class.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param parent_node_id OPC UA node id of parent object in OPC UA tree.
+ * @param display_name Character string providing an easy identifiable name for the object node representing an analog expansion board, i.e. "Arduino Opta Expansion 1: Analog".
+ * @param node_name The unique node name identifying the Analog Expansion Board object node within the OPC UA tree.
+ * @param model_name This parameter must be filled with the SKU of the actual expansion board.
+ */
Expansion(
UA_Server * server,
UA_NodeId const parent_node_id,
char * display_name,
char * node_name,
char * model_name);
+ /**
+ * Destructor of the opcua::Expansion class.
+ */
virtual ~Expansion() = default;
+
+ /**
+ * Returns the SKU number of a concrete expansion board, must be overridden in derived classes.
+ * @return SKU number of concrete expansion board.
+ */
virtual std::string
toSKUString() const = 0;
protected:
+ /**
+ * _server is a pointer to the OPC UA server implementation of the open62541 library.
+ */
UA_Server * _server;
+ /**
+ * node_id OPC UA node id of the object node representing an expansion.
+ */
UA_NodeId _node_id;
};
diff --git a/src/io/analog/AnalogInput.h b/src/io/analog/AnalogInput.h
index 8113b19..6770ce9 100644
--- a/src/io/analog/AnalogInput.h
+++ b/src/io/analog/AnalogInput.h
@@ -31,13 +31,37 @@ namespace opcua
* CLASS DECLARATION
**************************************************************************************/
+/**
+ * @class AnalogInput
+ * @brief Provides an OPC UA variable node abstraction for an analog input.
+ *
+ * This class creates an OPC UA variable node which is representing an analog input. When
+ * reading from the OPC UA variable node a callback is triggered which performs the
+ * actual analog readout of an analog input pin.
+ */
class AnalogInput
{
public:
+ /**
+ * SharedPtr is std::shared_ptr of an AnalogInput class.
+ */
typedef std::shared_ptr SharedPtr;
+ /**
+ * OnReadRequestFunc is definition for a callback which is called
+ * during a read-access on the variable node representing the analog
+ * input performing the actual analog reading.
+ */
typedef std::function OnReadRequestFunc;
+ /**
+ * Creates a new instance of the opcua::AnalogInput class, creating an OPC UA variable node abstraction in the process.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param parent_node_id OPC UA node id of parent object in OPC UA tree.
+ * @param display_name Character string providing an easy identifiable name for the variable node representing an analog input, i.e. "Analog Input I1".
+ * @param on_read_request Function pointer which is called during a read-access on the variable node representing the analog input.
+ * @return std::shared_ptr holding the newly allocated instance of opcua::AnalogInput.
+ */
static SharedPtr
create(
UA_Server * server,
@@ -46,11 +70,23 @@ class AnalogInput
OnReadRequestFunc const on_read_request);
+ /**
+ * Constructor of the opcua::AnalogInput class.
+ * Note: Objects should not be instantiated directly, but by using AnalogInput::create.
+ * @param node_id OPC UA node id of the variable node representing the analog input.
+ * @param on_read_request Function pointer which is called during a read-access on the variable node representing the analog input.
+ */
AnalogInput(
UA_NodeId const & node_id,
OnReadRequestFunc const on_read_request);
+ /**
+ * This function is called by the framework when a read-access on the variable node representing the analog input is performed.
+ * Note: This function should not be called directly, it will be invoked by the framework.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param node_id OPC UA node id of the variable node representing the analog input.
+ */
void onReadRequest(
UA_Server * server,
UA_NodeId const * node_id);
diff --git a/src/io/analog/AnalogInputManager.cpp b/src/io/analog/AnalogInputManager.cpp
index f8fb38f..cba2cb8 100644
--- a/src/io/analog/AnalogInputManager.cpp
+++ b/src/io/analog/AnalogInputManager.cpp
@@ -73,9 +73,9 @@ void
AnalogInputManager::add_analog_input(
UA_Server * server,
const char * display_name,
- AnalogInput::OnReadRequestFunc const on_read_request_func)
+ AnalogInput::OnReadRequestFunc const on_read_request)
{
- auto const analog_input = AnalogInput::create(server, _node_id, display_name, on_read_request_func);
+ auto const analog_input = AnalogInput::create(server, _node_id, display_name, on_read_request);
if (!analog_input) {
UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "%s: AnalogInput::create(...) failed: returned nullptr", __PRETTY_FUNCTION__);
return;
diff --git a/src/io/analog/AnalogInputManager.h b/src/io/analog/AnalogInputManager.h
index 78ad2e1..c95cd24 100644
--- a/src/io/analog/AnalogInputManager.h
+++ b/src/io/analog/AnalogInputManager.h
@@ -31,26 +31,55 @@ namespace opcua
* CLASS DECLARATION
**************************************************************************************/
+/**
+ * @class AnalogInputManager
+ * @brief Provides methods for creating and storing AnalogInput objects in a collection.
+ *
+ * This class creates an OPC UA object node which is representing all analog
+ * inputs of a given OPC UA devices. Analog inputs can be created and added
+ * to the OPC UA object node using this class.
+ */
class AnalogInputManager
{
public:
+ /**
+ * SharedPtr is std::shared_ptr of an AnalogInputManager class.
+ */
typedef std::shared_ptr SharedPtr;
+ /**
+ * Creates a new instance of the opcua::AnalogInputManager class, creating an OPC UA object node abstraction in the process.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param parent_node_id OPC UA node id of parent object in OPC UA tree.
+ * @return std::shared_ptr holding the newly allocated instance of opcua::AnalogInputManager.
+ */
static SharedPtr
create(
UA_Server * server,
UA_NodeId const parent_node_id);
+ /**
+ * Constructor of the opcua::AnalogInputManager class.
+ * Note: Objects should not be instantiated directly, but by using AnalogInputManager::create.
+ * @param node_id OPC UA node id of the object node representing all analog inputs.
+ */
AnalogInputManager(
UA_NodeId const & node_id);
+
+ /**
+ * This function creates a new opcua::AnalogInput and adds it to the opcua::AnalogInputManager.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param display_name Character string providing an easy identifiable name for the variable node representing an analog input, i.e. "Analog Input I1".
+ * @param on_read_request Function pointer which is called during a read-access on the variable node representing the analog input.
+ */
void
add_analog_input(
UA_Server * server,
const char * display_name,
- AnalogInput::OnReadRequestFunc const on_read_request_func);
+ AnalogInput::OnReadRequestFunc const on_read_request);
private:
diff --git a/src/io/analog/AnalogOutput.h b/src/io/analog/AnalogOutput.h
index 0b1332e..61349d2 100644
--- a/src/io/analog/AnalogOutput.h
+++ b/src/io/analog/AnalogOutput.h
@@ -31,14 +31,48 @@ namespace opcua
* CLASS DECLARATION
**************************************************************************************/
+/**
+ * @class AnalogOutput
+ * @brief Provides an OPC UA variable node abstraction for an analog output.
+ *
+ * This class creates an OPC UA variable node which is representing an analog output.
+ * When writing to the OPC UA variable node a callback is triggered which performs
+ * the setting of the output value of an actual analog output pin. When reading from the
+ * OPC UA variable node a different callback is triggered which performs the actual analog
+ * readout of an analog output pin.
+ */
class AnalogOutput
{
public:
+ /**
+ * SharedPtr is std::shared_ptr of an AnalogOutput class.
+ */
typedef std::shared_ptr SharedPtr;
+ /**
+ * OnReadRequestFunc is definition for a callback which is called
+ * during a read-access on the variable node representing the analog
+ * output performing the actual analog read-back from the current
+ * value of the analog output pin.
+ */
typedef std::function OnReadRequestFunc;
+ /**
+ * OnWriteRequestFunc is definition for a callback which is called
+ * during a write-access on the variable node representing the analog
+ * output performing the actual writing of the desired output voltage
+ * to the analog output pin.
+ */
typedef std::function OnWriteRequestFunc;
+ /**
+ * Creates a new instance of the opcua::AnalogOutput class, creating an OPC UA variable node abstraction in the process.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param parent_node_id OPC UA node id of parent object in OPC UA tree.
+ * @param display_name Character string providing an easy identifiable name for the variable node representing an analog output, i.e. "Analog Output O1".
+ * @param on_read_request Function pointer which is called during a read-access on the variable node representing the analog output.
+ * @param on_write_request Function pointer which is called during a write-access on the variable node representing the analog output.
+ * @return std::shared_ptr holding the newly allocated instance of opcua::AnalogOutput.
+ */
static SharedPtr
create(
UA_Server * server,
@@ -48,17 +82,37 @@ class AnalogOutput
OnWriteRequestFunc const on_write_request);
+ /**
+ * Constructor of the opcua::AnalogOutput class.
+ * Note: Objects should not be instantiated directly, but by using AnalogOutput::create.
+ * @param node_id OPC UA node id of the variable node representing the analog output.
+ * @param on_read_request Function pointer which is called during a read-access on the variable node representing the analog output.
+ * @param on_write_request Function pointer which is called during a write-access on the variable node representing the analog output.
+ */
AnalogOutput(
UA_NodeId const & node_id,
OnReadRequestFunc const on_read_request,
OnWriteRequestFunc const on_write_request);
+ /**
+ * This function is called by the framework when a read-access on the variable node representing the analog output is performed.
+ * Note: This function should not be called directly, it will be invoked by the framework.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param node_id OPC UA node id of the variable node representing the analog output.
+ */
void
onReadRequest(
UA_Server * server,
UA_NodeId const * node_id);
+ /**
+ * This function is called by the framework when a write-access on the variable node representing the analog output is performed.
+ * Note: This function should not be called directly, it will be invoked by the framework.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param node_id OPC UA node id of the variable node representing the analog output.
+ * @param voltage Desired output voltage value for the analog output.
+ */
void
onWriteRequest(
UA_Server * server,
diff --git a/src/io/analog/AnalogOutputManager.cpp b/src/io/analog/AnalogOutputManager.cpp
index ea31431..e6fcdd1 100644
--- a/src/io/analog/AnalogOutputManager.cpp
+++ b/src/io/analog/AnalogOutputManager.cpp
@@ -74,9 +74,9 @@ AnalogOutputManager::add_analog_output(
UA_Server * server,
const char * display_name,
AnalogOutput::OnReadRequestFunc const on_read_request,
- AnalogOutput::OnWriteRequestFunc const on_write_request_func)
+ AnalogOutput::OnWriteRequestFunc const on_write_request)
{
- auto const analog_output = AnalogOutput::create(server, _node_id, display_name, on_read_request, on_write_request_func);
+ auto const analog_output = AnalogOutput::create(server, _node_id, display_name, on_read_request, on_write_request);
if (!analog_output) {
UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "%s: AnalogOutput::create(...) failed: returned nullptr", __PRETTY_FUNCTION__);
return;
diff --git a/src/io/analog/AnalogOutputManager.h b/src/io/analog/AnalogOutputManager.h
index f025fed..9208b47 100644
--- a/src/io/analog/AnalogOutputManager.h
+++ b/src/io/analog/AnalogOutputManager.h
@@ -31,28 +31,57 @@ namespace opcua
* CLASS DECLARATION
**************************************************************************************/
+/**
+ * @class AnalogOutputManager
+ * @brief Provides methods for creating and storing AnalogOutput objects in a collection.
+ *
+ * This class creates an OPC UA object node which is representing all analog
+ * outputs of a given OPC UA devices. Analog outputs can be created and added
+ * to the OPC UA object node using this class.
+ */
class AnalogOutputManager
{
public:
+ /**
+ * SharedPtr is std::shared_ptr of an AnalogOutputManager class.
+ */
typedef std::shared_ptr SharedPtr;
+ /**
+ * Creates a new instance of the opcua::AnalogOutputManager class, creating an OPC UA object node abstraction in the process.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param parent_node_id OPC UA node id of parent object in OPC UA tree.
+ * @return std::shared_ptr holding the newly allocated instance of opcua::AnalogOutputManager.
+ */
static SharedPtr
create(
UA_Server * server,
UA_NodeId const parent_node_id);
+ /**
+ * Constructor of the opcua::AnalogOutputManager class.
+ * Note: Objects should not be instantiated directly, but by using AnalogOutputManager::create.
+ * @param node_id OPC UA node id of the object node representing all analog outputs.
+ */
AnalogOutputManager(
UA_NodeId const & node_id);
+ /**
+ * This function creates a new opcua::AnalogOutput and adds it to the opcua::AnalogOutputManager.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param display_name Character string providing an easy identifiable name for the variable node representing an analog output, i.e. "Analog Output O1".
+ * @param on_read_request Function pointer which is called during a read-access on the variable node representing the analog output.
+ * @param on_write_request Function pointer which is called during a write-access on the variable node representing the analog output.
+ */
void
add_analog_output(
UA_Server * server,
const char * display_name,
AnalogOutput::OnReadRequestFunc const on_read_request,
- AnalogOutput::OnWriteRequestFunc const on_write_request_func);
+ AnalogOutput::OnWriteRequestFunc const on_write_request);
private:
diff --git a/src/io/button/UserButton.h b/src/io/button/UserButton.h
index a462484..67539d0 100644
--- a/src/io/button/UserButton.h
+++ b/src/io/button/UserButton.h
@@ -30,22 +30,50 @@ namespace opcua
* CLASS DECLARATION
**************************************************************************************/
+/**
+ * @class UserButton
+ * @brief Provides an OPC UA variable node abstraction for a user button input.
+ *
+ * This class creates an OPC UA variable node which is representing a user button input.
+ * When reading from the OPC UA variable node a callback is triggered which performs the
+ * actual readout of the current state of the user button.
+ */
class UserButton
{
public:
+ /**
+ * SharedPtr is std::shared_ptr of an UserButton class.
+ */
typedef std::shared_ptr SharedPtr;
+ /**
+ * Creates a new instance of the opcua::UserButton class, creating an OPC UA variable node "User Button" abstraction in the process.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param parent_node_id OPC UA node id of parent object in OPC UA tree.
+ * @return std::shared_ptr holding the newly allocated instance of opcua::UserButton.
+ */
static SharedPtr
create(
UA_Server * server,
UA_NodeId const & parent_node_id);
+ /**
+ * Constructor of the opcua::UserButton class.
+ * Note: Objects should not be instantiated directly, but by using UserButton::create.
+ * @param node_id OPC UA node id of the variable node representing the user button.
+ */
UserButton(
UA_NodeId const & node_id);
+ /**
+ * This function is called by the framework when a read-access on the variable node representing the user button input is performed.
+ * Note: This function should not be called directly, it will be invoked by the framework.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param node_id OPC UA node id of the variable node representing the user button.
+ */
void
onReadRequest(
UA_Server * server,
diff --git a/src/io/digital/DigitalInput.h b/src/io/digital/DigitalInput.h
index 269b321..ee8e752 100644
--- a/src/io/digital/DigitalInput.h
+++ b/src/io/digital/DigitalInput.h
@@ -31,13 +31,37 @@ namespace opcua
* CLASS DECLARATION
**************************************************************************************/
+/**
+ * @class DigitalInput
+ * @brief Provides an OPC UA variable node abstraction for a digital input.
+ *
+ * This class creates an OPC UA variable node which is representing a digital input. When
+ * reading from the OPC UA variable node a callback is triggered which performs the
+ * actual readout of a digital input pin.
+ */
class DigitalInput
{
public:
+ /**
+ * SharedPtr is std::shared_ptr of a DigitalInput class.
+ */
typedef std::shared_ptr SharedPtr;
+ /**
+ * OnReadRequestFunc is definition for a callback which is called
+ * during a read-access on the variable node representing the digital
+ * input performing the actual digital reading.
+ */
typedef std::function OnReadRequestFunc;
+ /**
+ * Creates a new instance of the opcua::DigitalInput class, creating an OPC UA variable node abstraction in the process.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param parent_node_id OPC UA node id of parent object in OPC UA tree.
+ * @param display_name Character string providing an easy identifiable name for the variable node representing an analog input, i.e. "Digital Input I1".
+ * @param on_read_request Function pointer which is called during a read-access on the variable node representing the digital input.
+ * @return std::shared_ptr holding the newly allocated instance of opcua::DigitalInput.
+ */
static SharedPtr
create(
UA_Server * server,
@@ -46,11 +70,23 @@ class DigitalInput
OnReadRequestFunc const on_read_request);
+ /**
+ * Constructor of the opcua::DigitalInput class.
+ * Note: Objects should not be instantiated directly, but by using DigitalInput::create.
+ * @param node_id OPC UA node id of the variable node representing the digital input.
+ * @param on_read_request Function pointer which is called during a read-access on the variable node representing the digital input.
+ */
DigitalInput(
UA_NodeId const & node_id,
OnReadRequestFunc const on_read_request);
+ /**
+ * This function is called by the framework when a read-access on the variable node representing the digital input is performed.
+ * Note: This function should not be called directly, it will be invoked by the framework.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param node_id OPC UA node id of the variable node representing the digital input.
+ */
void
onReadRequest(
UA_Server * server,
diff --git a/src/io/digital/DigitalInputManager.cpp b/src/io/digital/DigitalInputManager.cpp
index 3db18d1..f15d5bd 100644
--- a/src/io/digital/DigitalInputManager.cpp
+++ b/src/io/digital/DigitalInputManager.cpp
@@ -73,9 +73,9 @@ void
DigitalInputManager::add_digital_input(
UA_Server * server,
const char * display_name,
- DigitalInput::OnReadRequestFunc const on_read_request_func)
+ DigitalInput::OnReadRequestFunc const on_read_request)
{
- auto const digital_input = DigitalInput::create(server, _node_id, display_name, on_read_request_func);
+ auto const digital_input = DigitalInput::create(server, _node_id, display_name, on_read_request);
if (!digital_input){
UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "%s: DigitalInput::create(...) failed: returned nullptr", __PRETTY_FUNCTION__);
return;
diff --git a/src/io/digital/DigitalInputManager.h b/src/io/digital/DigitalInputManager.h
index 893eeb4..714c93d 100644
--- a/src/io/digital/DigitalInputManager.h
+++ b/src/io/digital/DigitalInputManager.h
@@ -31,27 +31,55 @@ namespace opcua
* CLASS DECLARATION
**************************************************************************************/
+/**
+ * @class DigitalInputManager
+ * @brief Provides methods for creating and storing DigitalInput objects in a collection.
+ *
+ * This class creates an OPC UA object node which is representing all digital
+ * inputs of a given OPC UA devices. Digital inputs can be created and added
+ * to the OPC UA object node using this class.
+ */
class DigitalInputManager
{
public:
+ /**
+ * SharedPtr is std::shared_ptr of an DigitalInputManager class.
+ */
typedef std::shared_ptr SharedPtr;
+ /**
+ * Creates a new instance of the opcua::DigitalInputManager class, creating an OPC UA object node abstraction in the process.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param parent_node_id OPC UA node id of parent object in OPC UA tree.
+ * @return std::shared_ptr holding the newly allocated instance of opcua::DigitalInputManager.
+ */
static SharedPtr
create(
UA_Server * server,
UA_NodeId const parent_node_id);
+ /**
+ * Constructor of the opcua::DigitalInputManager class.
+ * Note: Objects should not be instantiated directly, but by using DigitalInputManager::create.
+ * @param node_id OPC UA node id of the object node representing all digital inputs.
+ */
DigitalInputManager(
UA_NodeId const & node_id);
+ /**
+ * This function creates a new opcua::DigitalInput and adds it to the opcua::DigitalInputManager.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param display_name Character string providing an easy identifiable name for the variable node representing an analog input, i.e. "Digital Input I1".
+ * @param on_read_request Function pointer which is called during a read-access on the variable node representing the digital input.
+ */
void
add_digital_input(
UA_Server * server,
const char * display_name,
- DigitalInput::OnReadRequestFunc const on_read_request_func);
+ DigitalInput::OnReadRequestFunc const on_read_request);
private:
diff --git a/src/io/led/Led.h b/src/io/led/Led.h
index dfb0126..22386aa 100644
--- a/src/io/led/Led.h
+++ b/src/io/led/Led.h
@@ -29,13 +29,36 @@ namespace opcua
* CLASS DECLARATION
**************************************************************************************/
+/**
+ * @class Led
+ * @brief Provides an OPC UA variable node abstraction for controlling a LED.
+ *
+ * This class creates an OPC UA variable node which is representing a LED. When writing
+ * to the OPC UA variable node a callback is triggered which either turns the LED on or off.
+ */
class Led
{
public:
+ /**
+ * SharedPtr is std::shared_ptr of a Led class.
+ */
typedef std::shared_ptr SharedPtr;
+ /**
+ * OnSetLedStateFunc is definition for a callback which is called
+ * during a write-access on the variable node representing a LED
+ * subsequently turned the LED either ON (true) or OFF (false).
+ */
typedef std::function OnSetLedStateFunc;
+ /**
+ * Creates a new instance of the opcua::Led class, creating an OPC UA variable node abstraction in the process.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param parent_node_id OPC UA node id of parent object in OPC UA tree.
+ * @param display_name Character string providing an easy identifiable name for the variable node representing a LED, i.e. "LED1".
+ * @param on_set_led_state Function pointer which is called during a write-access on the variable node representing the LED.
+ * @return std::shared_ptr holding the newly allocated instance of opcua::Led.
+ */
static SharedPtr
create(
UA_Server *server,
@@ -44,11 +67,24 @@ class Led
OnSetLedStateFunc const on_set_led_state);
+ /**
+ * Constructor of the opcua::Led class.
+ * Note: Objects should not be instantiated directly, but by using Led::create.
+ * @param node_id OPC UA node id of the variable node representing the analog output.
+ * @param on_set_led_state Function pointer which is called during a write-access on the variable node representing the LED.
+ */
Led(
UA_NodeId const &node_id,
OnSetLedStateFunc const on_set_led_state);
+ /**
+ * This function is called by the framework when a write-access on the variable node representing a LED is performed.
+ * Note: This function should not be called directly, it will be invoked by the framework.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param node_id OPC UA node id of the variable node representing the LED.
+ * @param value Desired state of the LED, true -> LED is turned ON, false -> LED is turned off.
+ */
void
onWriteRequest(
UA_Server * server,
diff --git a/src/io/led/LedManager.h b/src/io/led/LedManager.h
index ad91493..2867d25 100644
--- a/src/io/led/LedManager.h
+++ b/src/io/led/LedManager.h
@@ -31,20 +31,49 @@ namespace opcua
* CLASS DECLARATION
**************************************************************************************/
+/**
+ * @class LedManager
+ * @brief Provides methods for creating and storing LED objects in a collection.
+ *
+ * This class creates an OPC UA object node which is representing all LEDs
+ * of a given OPC UA devices. LEDs can be created and added to the OPC UA
+ * object node using this class.
+ */
class LedManager
{
public:
+ /**
+ * SharedPtr is std::shared_ptr of an LedManager class.
+ */
typedef std::shared_ptr SharedPtr;
+
+ /**
+ * Creates a new instance of the opcua::LedManager class, creating an OPC UA object node abstraction in the process.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param parent_node_id OPC UA node id of parent object in OPC UA tree.
+ * @return std::shared_ptr holding the newly allocated instance of opcua::LedManager.
+ */
static SharedPtr
create(
UA_Server * server,
UA_NodeId const parent_node_id);
+ /**
+ * Constructor of the opcua::LedManager class.
+ * Note: Objects should not be instantiated directly, but by using LedManager::create.
+ * @param node_id OPC UA node id of the object node representing all LEDs.
+ */
LedManager(UA_NodeId const & node_id);
+ /**
+ * This function creates a new opcua::LED and adds it to the opcua::LEDManager.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param display_name Character string providing an easy identifiable name for the variable node representing a LED, i.e. "LED1".
+ * @param on_set_led_state Function pointer which is called during a write-access on the variable node representing the LED.
+ */
void
add_led_output(
UA_Server * server,
diff --git a/src/io/pwm/PwmOutput.cpp b/src/io/pwm/PwmOutput.cpp
index 7060439..096eefe 100644
--- a/src/io/pwm/PwmOutput.cpp
+++ b/src/io/pwm/PwmOutput.cpp
@@ -286,7 +286,7 @@ PwmOutput::onReadRequestPwmPulseWidth(
void
PwmOutput::onWriteRequestPwmPulseWidth(
UA_Server * server,
- UA_NodeId const * node_id,
+ UA_NodeId const * pwm_pulse_width_node_id,
uint32_t const pwm_pulse_width_us)
{
_pwm_pulse_width_us = pwm_pulse_width_us;
diff --git a/src/io/pwm/PwmOutput.h b/src/io/pwm/PwmOutput.h
index b17b4e4..e9f2a84 100644
--- a/src/io/pwm/PwmOutput.h
+++ b/src/io/pwm/PwmOutput.h
@@ -31,15 +31,55 @@ namespace opcua
* CLASS DECLARATION
**************************************************************************************/
+/**
+ * @class PwmOutput
+ * @brief Provides an OPC UA variable node abstraction for a PWM output.
+ *
+ * This class creates an OPC UA object node representing a PWM output with two
+ * OPC UA variable nodes representing the PWM output's period and pulse width.
+ * When writing to any OPC UA variable node a callback is triggered which performs
+ * the setting of the desired PWM period and pulse width. When reading from the
+ * OPC UA variable nodes different callback are triggered which performs reading
+ * back the actual PWM period and pulse width.
+ */
class PwmOutput
{
public:
+ /**
+ * SharedPtr is std::shared_ptr of a PwmOutput class.
+ */
typedef std::shared_ptr SharedPtr;
+ /**
+ * SetPwmFunc is definition for a callback which is called
+ * during a write-access on the variable nodes representing
+ * PWM period and PWM pulse width subsequently configuring
+ * the PWN output with the desired period and pulse width.
+ */
typedef std::function SetPwmFunc;
+ /**
+ * GetPwmPeriodFunc is definition for a callback which is called
+ * during a read-access on the variable node representing the PWM
+ * period and which is used to retrieve the actual PWM period.
+ */
typedef std::function GetPwmPeriodFunc;
+ /**
+ * GetPwmPulseWidthFunc is definition for a callback which is called
+ * during a read-access on the variable node representing the PWM
+ * pulse width and which is used to retrieve the actual PWM pulse width.
+ */
typedef std::function GetPwmPulseWidthFunc;
+ /**
+ * Creates a new instance of the opcua::PwmOutput class, creating an OPC UA variable node abstraction in the process.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param parent_node_id OPC UA node id of parent object in OPC UA tree.
+ * @param display_name Character string providing an easy identifiable name for the variable node representing an analog output, i.e. "PWM Output P1".
+ * @param set_pwm_func Function pointer which is called during a write-access on the variable node representing the PWM output and used for setting the PWM period and pulse width.
+ * @param get_pwm_period_func Function pointer which is called during a read-access on the variable node representing the PWM output's period.
+ * @param get_pwm_pulse_width_func Function pointer which is called during a read-access on the variable node representing the PWM output's pulse width.
+ * @return std::shared_ptr holding the newly allocated instance of opcua::PwmOutput.
+ */
static SharedPtr
create(
UA_Server * server,
@@ -50,6 +90,15 @@ class PwmOutput
GetPwmPulseWidthFunc const get_pwm_pulse_width_func);
+ /**
+ * Constructor of the opcua::PwmOutput class.
+ * Note: Objects should not be instantiated directly, but by using PwmOutput::create.
+ * @param pwm_period_node_id OPC UA node id of the variable node representing the PWM output's period.
+ * @param pwm_pulse_width_node_id OPC UA node id of the variable node representing the PWM output's pulse width.
+ * @param set_pwm_func Function pointer which is called during a write-access on the variable node representing the PWM output and used for setting the PWM period and pulse width.
+ * @param get_pwm_period_func Function pointer which is called during a read-access on the variable node representing the PWM output's period.
+ * @param get_pwm_pulse_width_func Function pointer which is called during a read-access on the variable node representing the PWM output's pulse width.
+ */
PwmOutput(
UA_NodeId const & pwm_period_node_id,
UA_NodeId const & pwm_pulse_width_node_id,
@@ -58,26 +107,52 @@ class PwmOutput
GetPwmPulseWidthFunc const get_pwm_pulse_width_func);
+ /**
+ * This function is called by the framework when a read-access on the variable node representing the PWM output's period is performed.
+ * Note: This function should not be called directly, it will be invoked by the framework.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param node_id OPC UA node id of the variable node representing the PWM output's period.
+ */
void
onReadRequestPwmPeriod(
UA_Server * server,
UA_NodeId const * node_id);
+ /**
+ * This function is called by the framework when a write-access on the variable node representing the PWM output's period is performed.
+ * Note: This function should not be called directly, it will be invoked by the framework.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param pwm_period_node_id OPC UA node id of the variable node representing the PWM output's period.
+ * @param pwm_period_us Desired PWM output period in microseconds.
+ */
void
onWriteRequestPwmPeriod(
UA_Server * server,
UA_NodeId const * pwm_period_node_id,
uint32_t const pwm_period_us);
+ /**
+ * This function is called by the framework when a read-access on the variable node representing the PWM output's pulse width is performed.
+ * Note: This function should not be called directly, it will be invoked by the framework.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param node_id OPC UA node id of the variable node representing the PWM output's pulse width.
+ */
void
onReadRequestPwmPulseWidth(
UA_Server * server,
UA_NodeId const * node_id);
+ /**
+ * This function is called by the framework when a write-access on the variable node representing the PWM output's pulse width is performed.
+ * Note: This function should not be called directly, it will be invoked by the framework.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param pwm_pulse_width_node_id OPC UA node id of the variable node representing the PWM output's pulse width.
+ * @param pwm_pulse_width_us Desired PWM output pulse width in microseconds.
+ */
void
onWriteRequestPwmPulseWidth(
UA_Server * server,
- UA_NodeId const * node_id,
+ UA_NodeId const * pwm_pulse_width_node_id,
uint32_t const pwm_pulse_width_us);
diff --git a/src/io/pwm/PwmOutputManager.h b/src/io/pwm/PwmOutputManager.h
index 7ff5fd3..d3c2ad2 100644
--- a/src/io/pwm/PwmOutputManager.h
+++ b/src/io/pwm/PwmOutputManager.h
@@ -31,21 +31,52 @@ namespace opcua
* CLASS DECLARATION
**************************************************************************************/
+/**
+ * @class PwmOutputManager
+ * @brief Provides methods for creating and storing PwmOutput objects in a collection.
+ *
+ * This class creates an OPC UA object node which is representing all PWM
+ * outputs of a given OPC UA devices. PWM outputs can be created and added
+ * to the OPC UA object node using this class.
+ */
class PwmOutputManager
{
public:
+ /**
+ * SharedPtr is std::shared_ptr of an PwmOutputManager class.
+ */
typedef std::shared_ptr SharedPtr;
+ /**
+ * Creates a new instance of the opcua::PwmOutputManager class, creating an OPC UA object node abstraction in the process.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param parent_node_id OPC UA node id of parent object in OPC UA tree.
+ * @return std::shared_ptr holding the newly allocated instance of opcua::PwmOutputManager.
+ */
static SharedPtr
create(
UA_Server * server,
UA_NodeId const parent_node_id);
- PwmOutputManager(UA_NodeId const & node_id);
+ /**
+ * Constructor of the opcua::PwmOutputManager class.
+ * Note: Objects should not be instantiated directly, but by using PwmOutputManager::create.
+ * @param node_id OPC UA node id of the object node representing all PWM outputs.
+ */
+ PwmOutputManager(
+ UA_NodeId const & node_id);
+ /**
+ * This function creates a new opcua::PwmOutput and adds it to the opcua::PwmOutputManager.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param display_name Character string providing an easy identifiable name for the variable node representing an analog output, i.e. "PWM Output P1".
+ * @param set_pwm_func Function pointer which is called during a write-access on the variable node representing the PWM output and used for setting the PWM period and pulse width.
+ * @param get_pwm_period_func Function pointer which is called during a read-access on the variable node representing the PWM output's period.
+ * @param get_pwm_pulse_width_func Function pointer which is called during a read-access on the variable node representing the PWM output's pulse width.
+ */
void
add_pwm_output(
UA_Server * server,
diff --git a/src/io/relay/Relay.h b/src/io/relay/Relay.h
index bd3f631..36d9fe3 100644
--- a/src/io/relay/Relay.h
+++ b/src/io/relay/Relay.h
@@ -29,13 +29,38 @@ namespace opcua
* CLASS DECLARATION
**************************************************************************************/
+/**
+ * @class Relay
+ * @brief Provides an OPC UA variable node abstraction for controlling a mechanical or solid-state relay.
+ *
+ * This class creates an OPC UA variable node which is representing a mechanical or solid-state
+ * relay. When writing to the OPC UA variable node a callback is triggered which either activates
+ * or deactivates the relay.
+ */
class Relay
{
public:
+ /**
+ * SharedPtr is std::shared_ptr of a Relay class.
+ */
typedef std::shared_ptr SharedPtr;
+ /**
+ * OnSetRelayStateFunc is definition for a callback which is called
+ * during a write-access on the variable node representing a relay
+ * subsequently either activating (true -> switch closes) or deactivating
+ * a relay (false -> switch opens).
+ */
typedef std::function OnSetRelayStateFunc;
+ /**
+ * Creates a new instance of the opcua::Relay class, creating an OPC UA variable node abstraction in the process.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param parent_node_id OPC UA node id of parent object in OPC UA tree.
+ * @param display_name Character string providing an easy identifiable name for the variable node representing a relay, i.e. "Relay 1".
+ * @param on_set_relay_state Function pointer which is called during a write-access on the variable node representing a relay.
+ * @return std::shared_ptr holding the newly allocated instance of opcua::Relay.
+ */
static SharedPtr
create(
UA_Server *server,
@@ -44,11 +69,24 @@ class Relay
OnSetRelayStateFunc const on_set_relay_state);
+ /**
+ * Constructor of the opcua::Relay class.
+ * Note: Objects should not be instantiated directly, but by using Relay::create.
+ * @param node_id OPC UA node id of the variable node representing the relay.
+ * @param on_set_relay_state Function pointer which is called during a write-access on the variable node representing a relay.
+ */
Relay(
UA_NodeId const &node_id,
OnSetRelayStateFunc const on_set_relay_state);
+ /**
+ * This function is called by the framework when a write-access on the variable node representing a relay is performed.
+ * Note: This function should not be called directly, it will be invoked by the framework.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param node_id OPC UA node id of the variable node representing the relay.
+ * @param value Desired state of the relay, true -> relay is activated (relay switch closes), false -> LED is deactivated (relay switch opens).
+ */
void
onWriteRequest(
UA_Server * server,
diff --git a/src/io/relay/RelayManager.h b/src/io/relay/RelayManager.h
index a77a0d7..97ac8c3 100644
--- a/src/io/relay/RelayManager.h
+++ b/src/io/relay/RelayManager.h
@@ -31,22 +31,50 @@ namespace opcua
* CLASS DECLARATION
**************************************************************************************/
+/**
+ * @class RelayManager
+ * @brief Provides methods for creating and storing Relay objects in a collection.
+ *
+ * This class creates an OPC UA object node which is representing all relays
+ * of a given OPC UA devices. Relays can be created and added to the OPC UA
+ * object node using this class.
+ */
class RelayManager
{
public:
+ /**
+ * SharedPtr is std::shared_ptr of an RelayManager class.
+ */
typedef std::shared_ptr SharedPtr;
+ /**
+ * Creates a new instance of the opcua::RelayManager class, creating an OPC UA object node abstraction in the process.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param parent_node_id OPC UA node id of parent object in OPC UA tree.
+ * @return std::shared_ptr holding the newly allocated instance of opcua::RelayManager.
+ */
static SharedPtr
create(
UA_Server * server,
UA_NodeId const parent_node_id);
+ /**
+ * Constructor of the opcua::RelayManager class.
+ * Note: Objects should not be instantiated directly, but by using RelayManager::create.
+ * @param node_id OPC UA node id of the object node representing all relays.
+ */
RelayManager(
UA_NodeId const & node_id);
+ /**
+ * This function creates a new opcua::Relay and adds it to the opcua::RelayManager.
+ * @param server Pointer to the OPC UA server implementation of the open62541 library.
+ * @param display_name Character string providing an easy identifiable name for the variable node representing a relay, i.e. "Relay 1".
+ * @param on_set_relay_state Function pointer which is called during a write-access on the variable node representing a relay.
+ */
void
add_relay_output(
UA_Server * server,
diff --git a/src/util/time/NTPUtils.h b/src/util/time/NTPUtils.h
index b11a216..4101098 100644
--- a/src/util/time/NTPUtils.h
+++ b/src/util/time/NTPUtils.h
@@ -32,10 +32,19 @@ namespace opcua
* CLASS DECLARATION
**************************************************************************************/
+/**
+ * @class NTPUtils
+ * @brief Provides a method for obtaining the current time via UDP.
+ */
class NTPUtils
{
public:
+ /**
+ * Obtain the current UTC time via NTP.
+ * @param udp Reference to UDP network socket.
+ * @return current UTC time in seconds since Epoch (Unix Time)
+ */
static unsigned long getTime(UDP &udp);
private:
diff --git a/src/util/time/cvt_time.h b/src/util/time/cvt_time.h
index 231d182..7771819 100644
--- a/src/util/time/cvt_time.h
+++ b/src/util/time/cvt_time.h
@@ -26,6 +26,11 @@ namespace opcua
* FUNCTION DECLARATION
**************************************************************************************/
+/**
+ * Converts a date/time string as generated by __DATE__ into a time_t value.
+ * @param time current time as generated by __DATE__.
+ * @return String converted into Unix Time (seconds since Epoch)
+ */
time_t cvt_time(char const * time);
/**************************************************************************************
diff --git a/src/util/toStr/ExpansionType.h b/src/util/toStr/ExpansionType.h
index 2bf5910..365e326 100644
--- a/src/util/toStr/ExpansionType.h
+++ b/src/util/toStr/ExpansionType.h
@@ -28,12 +28,27 @@ namespace opcua
* CLASS DECLARATION
**************************************************************************************/
+/**
+ * @class ExpansionType
+ * @brief Provides a method for converting Arduino_Opta_Blueprint's ExpansionType_t to a human readable string.
+ */
class ExpansionType
{
public:
+ /**
+ * The constructor of ExpansionType is deleted because this object shall not be instantiated.
+ */
ExpansionType() = delete;
+ /**
+ * The copy constructor of ExpansionType is deleted because this object shall not be copied.
+ */
ExpansionType(ExpansionType const &) = delete;
+ /**
+ * Converts Arduino_Opta_Blueprint's ExpansionType_t into a human readable string.
+ * @param type Numeric identifier identifying the type of connected expansion board.
+ * @return Human readable string describing the concrete expansion module.
+ */
static std::string toStr(ExpansionType_t const type)
{
if(type == EXPANSION_NOT_VALID)