FreeOpcUa / python-opcua

LGPL Pure Python OPC-UA Client and Server
http://freeopcua.github.io/
GNU Lesser General Public License v3.0
1.37k stars 661 forks source link

Receiving custom event types #595

Open ephraim opened 6 years ago

ephraim commented 6 years ago

I have edited the client-events.py to subscribe to my event source an my event type but when I receive the event, I can see the right EventType ID but I'm missing the properties of the custom event type, I can just see the BaseEventType properties.

Do I need to prepare anything before that the custom event type is known? In UaExpert I need to activate the custom eventtype so the properties are shown ... I think this "part" is missing in the script but I don't find the right way to register the custom event type.

zerox1212 commented 6 years ago

This is not implemented as far as I know. Someone needs to read the OPC UA spec and see how the client is supposed to decode custom events from the server.

Maybe it's possible to handle in a similar way to extension objects using import_and_register_structures().

oroulet commented 6 years ago

The low level code is in place so you can provide your own filter code and you will get whatever you want. But as far as I remember when subscribing to events, you can pass an event node which will be used to create the filter, thus you should get all properties you want