|
29 | 29 | * NAMESPACE |
30 | 30 | **************************************************************************************/ |
31 | 31 |
|
| 32 | +/** |
| 33 | + * opcua is used as enclosing namespace for all parts of the Arduino_open62541 library |
| 34 | + * in order to avoid naming conflicts with already existing frameworks pertaining the |
| 35 | + * Arduino Opta. |
| 36 | + */ |
32 | 37 | namespace opcua |
33 | 38 | { |
34 | 39 |
|
35 | 40 | /************************************************************************************** |
36 | 41 | * CLASS DECLARATION |
37 | 42 | **************************************************************************************/ |
38 | 43 |
|
| 44 | +/** |
| 45 | + * @class Opta |
| 46 | + * @brief Provides functions for exposing various IO capabilities of the Arduino Opta via OPC UA. |
| 47 | + * |
| 48 | + * This class allows the user to expose analog and digital inputs, as well as relay and LED outputs |
| 49 | + * via OPC UA properties. |
| 50 | + */ |
39 | 51 | class Opta |
40 | 52 | { |
41 | 53 | public: |
| 54 | + /** |
| 55 | + * SharedPtr is std::shared_ptr of an Opta class. |
| 56 | + */ |
42 | 57 | typedef std::shared_ptr<Opta> SharedPtr; |
43 | 58 |
|
44 | 59 |
|
| 60 | + /** |
| 61 | + * Creates a new instance of the opcua::Opta class, creating an OPC UA object abstraction in the process. |
| 62 | + * @param server Pointer to the OPC UA server implementation of the open62541 library. |
| 63 | + * @param opta_type Enumerated type describing which Opta (WiFi, RS485, Lite) variant is being created. |
| 64 | + * @return std::shared_ptr holding the newly allocated instance of opcua::Opta. |
| 65 | + */ |
45 | 66 | static SharedPtr |
46 | 67 | create( |
47 | 68 | UA_Server * server, |
48 | 69 | OptaVariant::Type const opta_type); |
49 | 70 |
|
50 | 71 |
|
| 72 | + /** |
| 73 | + * Constructor of the opcua::Opta class. |
| 74 | + * @param server Pointer to the OPC UA server implementation of the open62541 library. |
| 75 | + * @param node_id OPC UA node id uniquely identifying the OPC UA representation of the opcua::Opta class as an OPC UA object node. |
| 76 | + * @param opta_type Enumerated type describing which Opta (WiFi, RS485, Lite) variant is being created. |
| 77 | + */ |
51 | 78 | Opta( |
52 | 79 | UA_Server * server, |
53 | 80 | UA_NodeId const & node_id, |
54 | 81 | OptaVariant::Type const opta_type); |
55 | 82 |
|
56 | 83 |
|
| 84 | + /** |
| 85 | + * Adds an analog input to the opcua::Opta object node and exposes it as an OPC UA variable node. |
| 86 | + * @param server Pointer to the OPC UA server implementation of the open62541 library. |
| 87 | + * @param display_name Character string providing an easy identifiable name for the variable node. |
| 88 | + * @param on_read_request Function pointer which is called during a read-access on the variable node representing the analog input. |
| 89 | + */ |
57 | 90 | void |
58 | 91 | add_analog_input( |
59 | 92 | UA_Server * server, |
60 | 93 | const char * display_name, |
61 | | - AnalogInput::OnReadRequestFunc const on_read_request_func); |
62 | | - |
| 94 | + AnalogInput::OnReadRequestFunc const on_read_request); |
| 95 | + |
| 96 | + /** |
| 97 | + * Adds a digital input to the opcua::Opta object node and exposes it as an OPC UA variable node. |
| 98 | + * @param server Pointer to the OPC UA server implementation of the open62541 library. |
| 99 | + * @param display_name Character string providing an easy identifiable name for the variable node. |
| 100 | + * @param on_read_request Function pointer which is called during a read-access on the variable node representing the digital input. |
| 101 | + */ |
63 | 102 | void |
64 | 103 | add_digital_input( |
65 | 104 | UA_Server * server, |
66 | 105 | const char * display_name, |
67 | | - DigitalInput::OnReadRequestFunc const on_read_request_func); |
68 | | - |
| 106 | + DigitalInput::OnReadRequestFunc const on_read_request); |
| 107 | + |
| 108 | + /** |
| 109 | + * Adds a relay output to the opcua::Opta object node and exposes it as an OPC UA variable node. |
| 110 | + * @param server Pointer to the OPC UA server implementation of the open62541 library. |
| 111 | + * @param display_name Character string providing an easy identifiable name for the variable node. |
| 112 | + * @param on_set_relay_state Function pointer which is called during a write-access on the variable node representing the relay output. |
| 113 | + */ |
69 | 114 | void |
70 | 115 | add_relay_output( |
71 | 116 | UA_Server * server, |
72 | 117 | const char * display_name, |
73 | 118 | Relay::OnSetRelayStateFunc const on_set_relay_state); |
74 | 119 |
|
| 120 | + /** |
| 121 | + * Adds a LED output to the opcua::Opta object node and exposes it as an OPC UA variable node. |
| 122 | + * @param server Pointer to the OPC UA server implementation of the open62541 library. |
| 123 | + * @param display_name Character string providing an easy identifiable name for the variable node. |
| 124 | + * @param on_set_led_state Function pointer which is called during a write-access on the variable node representing the LED output. |
| 125 | + */ |
75 | 126 | void |
76 | 127 | add_led_output( |
77 | 128 | UA_Server * server, |
|
0 commit comments