Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Write data value #191

Merged
merged 8 commits into from
Jan 9, 2025
Merged

Write data value #191

merged 8 commits into from
Jan 9, 2025

Conversation

andrewwkoerner
Copy link
Contributor

Description

Allow support for writing ua::DataValue to a server.

Testing details

Tested and confirmed OPC-UA Server example writes to a variable node with a ua::DataValue in example code.
Viewed data with a separate OPC-UA client.

Confirmed pre-commit output.

akoerner@xyz open62541 % just pre-commit
pre-commit run --all-files
check for case conflicts.................................................Passed
check json...........................................(no files to check)Skipped
check for merge conflicts................................................Passed
check for broken symlinks............................(no files to check)Skipped
check toml...............................................................Passed
check xml............................................(no files to check)Skipped
check yaml...............................................................Passed
detect destroyed symlinks................................................Passed
detect private key.......................................................Passed
fix end of files.........................................................Passed
fix utf-8 byte order marker..............................................Passed
forbid new submodules................................(no files to check)Skipped
mixed line ending........................................................Passed
trim trailing whitespace.................................................Passed
markdownlint-cli2........................................................Passed
codespell................................................................Passed
Validate GitHub Actions..............................(no files to check)Skipped
Validate GitHub Workflows................................................Passed
taplo-format.............................................................Passed
taplo-lint...............................................................Passed
prettier.................................................................Passed
fmt......................................................................Passed
clippy --all-features....................................................Passed
clippy --no-default-features.............................................Passed
cargo-doc................................................................Passed

@sgoll
Copy link
Contributor

sgoll commented Jan 9, 2025

@andrewwkoerner Thank you! I made some minor adjustments of related aspects of the existing code, but this looks good to go.

Comment on lines -252 to +254
// We don't return and thus don't have to fetch timestamps.
.with_timestamps_to_return(&ua::TimestampsToReturn::NEITHER)
// TODO: Add method argument for this? We return timestamps in `DataValue` and they
// should not end up always being `None` by default.
.with_timestamps_to_return(&ua::TimestampsToReturn::BOTH)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Motivation for this related change: In #151 we added timestamp attributes to DataValue without taking into account that we have to retrieve them here first.

We may revisit the default action of always returning (retrieving) both timestamps in the future.

@sgoll sgoll merged commit 456b3ac into HMIProject:main Jan 9, 2025
23 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants