mz-automation / libiec61850

Official repository for libIEC61850, the open-source library for the IEC 61850 protocols
http://libiec61850.com/libiec61850
GNU General Public License v3.0
830 stars 446 forks source link

How to use SetConnectionIndicationHandler #385

Open SpaghettiCodeBoy opened 2 years ago

SpaghettiCodeBoy commented 2 years ago

Hello! I'm currently working on a research project and absolutely love this project. I'm just wondering, how you can use the SetConnectionIndicationHandler() function. The ConnectionIndicationHandler needs the following Parameters: IedServer iedServer, ClientConnection clientConnection, bool connected, object parameter, but how do I get the clientConnection?

Thanks a lot!

mzillgith commented 2 years ago

The ConnectionIndicationHandler is a callback function you have to provide and when called your code will receive these parameters. Like in this example: https://github.com/mz-automation/libiec61850/blob/35ac4794301fb5d1f660d6ff0b4e50acd64632d9/examples/server_example_basic_io/server_example_basic_io.c#L74

SpaghettiCodeBoy commented 1 year ago

Thank you very much for your answer @mzillgith, but I'm working in C#. I tried to setup the SetConnectionHandler Function like the other Event Handlers (of course with changed parameters) but nothing seems to be working.

image