51 const auto request = detail::createReadRequest(timestamps, nodesToRead);
52 return read(connection, asWrapper<ReadRequest>(request));
60template <
typename CompletionToken>
62 return detail::sendRequestAsync<ReadRequest, ReadResponse>(
63 connection, request, std::forward<CompletionToken>(token)
68template <
typename CompletionToken>
73 CompletionToken&& token
75 const auto request = detail::createReadRequest(timestamps, nodesToRead);
77 connection, asWrapper<ReadRequest>(request), std::forward<CompletionToken>(token)
98template <
typename CompletionToken>
104 CompletionToken&& token
106 auto item = detail::createReadValueId(
id, attributeId);
107 const auto request = detail::createReadRequest(timestamps, item);
110 asWrapper<ReadRequest>(request),
111 detail::TransformToken(
112 detail::wrapSingleResult<DataValue, UA_ReadResponse>,
113 std::forward<CompletionToken>(token)
148 const auto request = detail::createWriteRequest(nodesToWrite);
149 return write(connection, asWrapper<WriteRequest>(request));
157template <
typename CompletionToken>
159 return detail::sendRequestAsync<WriteRequest, WriteResponse>(
160 connection, request, std::forward<CompletionToken>(token)
165template <
typename CompletionToken>
167 const auto request = detail::createWriteRequest(nodesToWrite);
169 connection, asWrapper<WriteRequest>(request), std::forward<CompletionToken>(token)
190template <
typename CompletionToken>
196 CompletionToken&& token
198 auto item = detail::createWriteValue(
id, attributeId, value);
199 const auto request = detail::createWriteRequest(item);
202 asWrapper<WriteRequest>(request),
203 detail::TransformToken(
204 detail::getSingleStatus<UA_WriteResponse>, std::forward<CompletionToken>(token)
217template <AttributeId Attribute,
typename T>
218auto readAttributeImpl(T& connection,
const NodeId&
id)
noexcept {
219 using Handler =
typename detail::AttributeHandler<Attribute>;
220 return readAttribute(connection,
id, Attribute, TimestampsToReturn::Neither)
221 .andThen(Handler::fromDataValue);
224template <AttributeId Attribute,
typename CompletionToken>
225auto readAttributeAsyncImpl(Client& connection,
const NodeId&
id, CompletionToken&& token) {
226 using Handler =
typename detail::AttributeHandler<Attribute>;
231 TimestampsToReturn::Neither,
232 detail::TransformToken(
233 [](Result<DataValue>& result) {
234 return std::move(result).andThen(Handler::fromDataValue);
236 std::forward<CompletionToken>(token)
241template <AttributeId Attribute,
typename T,
typename U>
242StatusCode writeAttributeImpl(T& connection,
const NodeId&
id, U&& value)
noexcept {
243 using Handler = detail::AttributeHandler<Attribute>;
244 return writeAttribute(connection,
id, Attribute, Handler::toDataValue(std::forward<U>(value)));
247template <AttributeId Attribute,
typename T,
typename U,
typename CompletionToken>
248auto writeAttributeAsyncImpl(T& connection,
const NodeId&
id, U&& value, CompletionToken&& token) {
249 using Handler = detail::AttributeHandler<Attribute>;
254 Handler::toDataValue(std::forward<U>(value)),
255 std::forward<CompletionToken>(token)
278template <
typename CompletionToken>
284 TimestampsToReturn::Both,
285 std::forward<CompletionToken>(token)
307template <
typename CompletionToken>
UA_DataValue wrapper class.
The template class Result encapsulates a StatusCode and optionally a value.
View to a contiguous sequence of objects, similar to std::span in C++20.
UA_StatusCode wrapper class.
UA_ReadRequest wrapper class.
UA_ReadResponse wrapper class.
UA_WriteRequest wrapper class.
UA_WriteResponse wrapper class.
auto readDataValueAsync(Client &connection, const NodeId &id, CompletionToken &&token)
Read the AttributeId::Value attribute of a node as a DataValue object.
Result< DataValue > readDataValue(T &connection, const NodeId &id) noexcept
Read the AttributeId::Value attribute of a node as a DataValue object.
ReadResponse read(Client &connection, const ReadRequest &request) noexcept
Read one or more attributes of one or more nodes (client only).
Result< DataValue > readAttribute(T &connection, const NodeId &id, AttributeId attributeId, TimestampsToReturn timestamps) noexcept
Read node attribute.
auto readAttributeAsync(Client &connection, const NodeId &id, AttributeId attributeId, TimestampsToReturn timestamps, CompletionToken &&token)
Read node attribute.
auto readAsync(Client &connection, const ReadRequest &request, CompletionToken &&token)
Read one or more attributes of one or more nodes (client only).
TimestampsToReturn
Timestamps to return.
StatusCode writeAttribute(T &connection, const NodeId &id, AttributeId attributeId, const DataValue &value) noexcept
Write node attribute.
auto writeAsync(Client &connection, const WriteRequest &request, CompletionToken &&token)
Write one or more attributes of one or more nodes (client only).
auto writeDataValueAsync(Client &connection, const NodeId &id, const DataValue &value, CompletionToken &&token)
Write the AttributeId::Value attribute of a node as a DataValue object.
auto writeAttributeAsync(Client &connection, const NodeId &id, AttributeId attributeId, const DataValue &value, CompletionToken &&token)
Write node attribute.
StatusCode writeDataValue(T &connection, const NodeId &id, const DataValue &value) noexcept
Write the AttributeId::Value attribute of a node as a DataValue object.
WriteResponse write(Client &connection, const WriteRequest &request) noexcept
Write one or more attributes of one or more nodes (client only).
OPC UA services as free functions.
AttributeId
Attribute identifiers.