Using writer handler

pull/302/head
Peter 5 years ago
parent 9573fcc16f
commit ba3b448ab4

@ -25,6 +25,14 @@ sigint_handler(int signalId)
running = 0; running = 0;
} }
static bool
writeAccessHandler (DataAttribute* dataAttribute, MmsValue* value, ClientConnection connection)
{
printf("New visible string value for OutVarSet_setMag_f = %s\n",
MmsValue_toString(value));
return true;
}
static ControlHandlerResult static ControlHandlerResult
controlHandlerForBinaryOutput(ControlAction action, void* parameter, MmsValue* value, bool test) controlHandlerForBinaryOutput(ControlAction action, void* parameter, MmsValue* value, bool test)
{ {
@ -167,6 +175,10 @@ main(int argc, char** argv)
// Create Server Connection // Create Server Connection
iedServer = IedServer_createWithTlsSupport(&iedModel, tlsConfig); iedServer = IedServer_createWithTlsSupport(&iedModel, tlsConfig);
// Install writer handler
IedServer_handleWriteAccess(iedServer, IEDMODEL_GenericIO_GGIO1_NamPlt_vendor,
writeAccessHandler);
IedServer_setAuthenticator(iedServer, clientAuthenticator, NULL); IedServer_setAuthenticator(iedServer, clientAuthenticator, NULL);
IedServer_setWriteAccessPolicy(iedServer, IEC61850_FC_DC, ACCESS_POLICY_ALLOW); IedServer_setWriteAccessPolicy(iedServer, IEC61850_FC_DC, ACCESS_POLICY_ALLOW);

Loading…
Cancel
Save