Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

subscription: add SetMonitoringMode functionality #712

Merged
merged 1 commit into from
Apr 22, 2024

Conversation

jackchenjc
Copy link
Contributor

@jackchenjc jackchenjc commented Feb 6, 2024

closes #711

Add SetMonitoringMode functionality and fix the potential issue that leaves the mutex locked.

Simply add the following code to examples/subscribe/subscribe.go can test this new feature

resp, err := sub.SetMonitoringMode(ctx, ua.MonitoringModeSampling, res.Results[0].MonitoredItemID)
if err != nil || resp.Results[0] != ua.StatusOK {
	log.Fatal(err)
}

@jackchenjc
Copy link
Contributor Author

Not sure if we should update item.req.MonitoringMode while getting ua.StatusOK.

subscription.go Outdated Show resolved Hide resolved
Copy link
Member

@kung-foo kung-foo left a comment

Choose a reason for hiding this comment

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

Ah, https://github.com/gopcua/opcua/blob/v0.5.3/README.md?plain=1#L206 needs an update as well. Otherwise LGTM

closes gopcua#711

Add SetMonitoringMode functionality and fix the potential issue that leaves the mutex locked.

Signed-off-by: Jack Chen <[email protected]>
@kung-foo kung-foo merged commit d707564 into gopcua:main Apr 22, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

subscription: add SetMonitoringMode functionality
2 participants