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
857 stars 459 forks source link

help with python #177

Open keyvdir opened 4 years ago

keyvdir commented 4 years ago

Hello, i successfully made client and server connection with pyiec61850 by following the C examples. One thing that i failed is making the connectionHandler in python language. Because i want to inform my server if there's client connected to the server or not. Can you please help me?

From C

static void
connectionHandler (IedServer self, ClientConnection connection, bool connected, void* parameter)
{
    char* clientAddress = ClientConnection_getPeerAddress(connection);
    if (connected)
        printf("New client connection from %s\n", clientAddress);
    else
        printf("Client connection from %s closed\n", clientAddress);
}

and IedServer_setConnectionIndicationHandler(iedServer, (IedConnectionIndicationHandler) connectionHandler, NULL);

How can i use those codes in python? There's no information about IedConnectionIndicationHandler in iec61850.py. Thank you

darkjhesus commented 4 years ago

Could you share the python library, I have problems trying to compile in python 3.6. When I impot the module I get the next error: ImportError: DLL load failed: No se puede encontrar el módulo especificado

Could you help me?