feat(cli): read --attribute reads one node attribute (e.g. Historizing, AccessLevel) (#921)
This commit is contained in:
@@ -76,6 +76,14 @@ internal sealed class DefaultSessionAdapter : ISessionAdapter
|
||||
return ValidateReadResult(response.ResponseHeader, response.Results, nodeId);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<DataValue> ReadAttributeAsync(NodeId nodeId, uint attributeId, CancellationToken ct)
|
||||
{
|
||||
ArrayOf<ReadValueId> nodes = [new ReadValueId { NodeId = nodeId, AttributeId = attributeId }];
|
||||
var response = await _session.ReadAsync(null, 0, TimestampsToReturn.Both, nodes, ct);
|
||||
return ValidateReadResult(response.ResponseHeader, response.Results, nodeId);
|
||||
}
|
||||
|
||||
internal static DataValue ValidateReadResult(ResponseHeader? header, ArrayOf<DataValue> results, NodeId nodeId)
|
||||
{
|
||||
var serviceStatus = header?.ServiceResult.Code ?? StatusCodes.BadUnexpectedError;
|
||||
|
||||
Reference in New Issue
Block a user