OPCFoundation / UA-.NETStandard

OPC Unified Architecture .NET Standard
Other
1.97k stars 950 forks source link

HistoryRead bit in EventNotifier attribute not set in Server object in NETStandard SDK #2081

Open semahag6 opened 1 year ago

semahag6 commented 1 year ago

Type of issue

Current Behavior

We're implementing an OPC UA Server using the NETStandard SDK. Event history is implemented and we set the HistoryRead bit on the EventNotifier attribute on our "own" objects. ServerCapability AccessHistoryEventsCapability is set to true.

From a connected UA client I can detect that the HistoryRead bit is set on our own objects but not on the Server object.

Does anyone know what must be done to set this bit on the Server object?

Expected Behavior

I think setting ServerCapability AccessHistoryEventsCapability to true should result in the HistoryRead bit being set on the EventNotifier attribute on the Server object

Steps To Reproduce

No response

Environment

- OS:
- Environment:
- Runtime:
- Nuget Version:
- Component:
- Server:
- Client:

Anything else?

No response

romanett commented 2 months ago

You need to override in the DiagnosticsNodeManager: https://github.com/OPCFoundation/UA-.NETStandard/blob/6dcee7ebf1f790d34c94883ff7572852086494f2/Libraries/Opc.Ua.Server/Diagnostics/DiagnosticsNodeManager.cs#L509

https://github.com/OPCFoundation/UA-.NETStandard/blob/6dcee7ebf1f790d34c94883ff7572852086494f2/Libraries/Opc.Ua.Server/Diagnostics/DiagnosticsNodeManager.cs#L1065

There seems to be a call missing to GetDefaultHistoryCapabilities. It would be apreciated to add this call in a PR and maybe make it a virtual method so you can override it in your sever.