Using simpleIOGenericIO GGIO1.NamPlt.vendor (#14)

pull/302/head
Chun-Sheng, Li 5 years ago committed by GitHub
parent 8968786527
commit 9573fcc16f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -88,10 +88,12 @@ int main(int argc, char** argv) {
/* write a variable to the server */
value = MmsValue_newVisibleString("libiec61850_itri");
IedConnection_writeObject(con, &error, "simpleIOGenericIO/GGIO1.SPCSO1.ctlModel", IEC61850_FC_DC, value);
IedConnection_writeObject(con, &error, "simpleIOGenericIO/GGIO1.NamPlt.vendor", IEC61850_FC_DC, value);
if (error != IED_ERROR_OK)
if (error != IED_ERROR_OK) {
printf("Error code=%d", error);
printf("failed to write simpleIOGenericIO/GGIO1.NamPlt.vendor!\n");
}
MmsValue_delete(value);

@ -67,22 +67,6 @@ controlHandlerForBinaryOutput(ControlAction action, void* parameter, MmsValue* v
return CONTROL_RESULT_OK;
}
static MmsDataAccessError
writeAccessHandler (DataAttribute* dataAttribute, MmsValue* value, ClientConnection connection, void* parameter)
{
ControlModel ctlModelVal = (ControlModel) MmsValue_toInt32(value);
/* we only allow status-only and direct-operate */
if ((ctlModelVal == CONTROL_MODEL_STATUS_ONLY) || (ctlModelVal == CONTROL_MODEL_DIRECT_NORMAL)) {
IedServer_updateCtlModel(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO1, ctlModelVal);
printf("Changed GGIO1.SPCSI.ctlModel to %i\n", ctlModelVal);
return DATA_ACCESS_ERROR_SUCCESS;
}
else {
return DATA_ACCESS_ERROR_OBJECT_VALUE_INVALID;
}
}
static void
connectionHandler (IedServer self, ClientConnection connection, bool connected, void* parameter)
{
@ -187,13 +171,6 @@ main(int argc, char** argv)
IedServer_setWriteAccessPolicy(iedServer, IEC61850_FC_DC, ACCESS_POLICY_ALLOW);
/*
* For SPCSO1 we want the user be able to change the control model by online service -
* so we install a write access handler to change the control model when the client
* writes to the "ctlModel" attribute.
*/
IedServer_handleWriteAccess(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO1_ctlModel, writeAccessHandler, NULL);
/* MMS server will be instructed to start listening to client connections. */
IedServer_start(iedServer, port_number);

Loading…
Cancel
Save