- IEC 618580 server: Added function IedServer_setServerIdentity to set values for MMS identity service

pull/228/head
Michael Zillgith 6 years ago
parent ae07c77d39
commit 09b23aaa74

@ -164,6 +164,9 @@
/* allow user to control read access by callback */
#define CONFIG_IEC61850_SUPPORT_USER_READ_ACCESS_CONTROL 1
/* allow application to set server identity (for MMS identity service) at runtime */
#define CONFIG_IEC61850_SUPPORT_SERVER_IDENTITY 1
/* Force memory alignment - required for some platforms (required more memory for buffered reporting) */
#define CONFIG_IEC61850_FORCE_MEMORY_ALIGNMENT 1

@ -154,6 +154,9 @@
/* allow user to control read access by callback */
#cmakedefine01 CONFIG_IEC61850_SUPPORT_USER_READ_ACCESS_CONTROL
/* allow application to set server identity (for MMS identity service) at runtime */
#define CONFIG_IEC61850_SUPPORT_SERVER_IDENTITY 1
/* Force memory alignment - required for some platforms (required more memory for buffered reporting) */
#define CONFIG_IEC61850_FORCE_MEMORY_ALIGNMENT 1

@ -114,6 +114,9 @@ main(int argc, char** argv)
/* configuration object is no longer required */
IedServerConfig_destroy(config);
/* set the identity values for MMS identify service */
IedServer_setServerIdentity(iedServer, "MZ", "basic io", "1.4.2");
/* Install handler for operate command */
IedServer_setControlHandler(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO1,
(ControlHandler) controlHandlerForBinaryOutput,

@ -347,6 +347,19 @@ IedServer_destroy(IedServer self);
LIB61850_API void
IedServer_setLocalIpAddress(IedServer self, const char* localIpAddress);
/**
* \brief Set the identify for the MMS identify service
*
* CONFIG_IEC61850_SUPPORT_SERVER_IDENTITY required
*
* \param self the IedServer instance
* \param vendor the IED vendor name
* \param model the IED model name
* \param revision the IED revision/version number
*/
LIB61850_API void
IedServer_setServerIdentity(IedServer self, const char* vendor, const char* model, const char* revision);
/**
* \brief Set the virtual filestore basepath for the MMS file services
*

@ -61,6 +61,12 @@ struct sIedServer
Thread serverThread;
#endif
#if (CONFIG_IEC61850_SUPPORT_SERVER_IDENTITY == 1)
char* vendorName;
char* modelName;
char* revision;
#endif
uint8_t edition;
bool running;

@ -548,6 +548,18 @@ IedServer_destroy(IedServer self)
Semaphore_destroy(self->clientConnectionsLock);
#endif
#if (CONFIG_IEC61850_SUPPORT_SERVER_IDENTITY == 1)
if (self->vendorName)
GLOBAL_FREEMEM(self->vendorName);
if (self->modelName)
GLOBAL_FREEMEM(self->modelName);
if (self->revision)
GLOBAL_FREEMEM(self->revision);
#endif /* (CONFIG_IEC61850_SUPPORT_SERVER_IDENTITY == 1) */
GLOBAL_FREEMEM(self);
}
@ -1530,6 +1542,28 @@ IedServer_setLogStorage(IedServer self, const char* logRef, LogStorage logStorag
#endif
}
void
IedServer_setServerIdentity(IedServer self, const char* vendor, const char* model, const char* revision)
{
#if (CONFIG_IEC61850_SUPPORT_SERVER_IDENTITY == 1)
if (self->vendorName)
GLOBAL_FREEMEM(self->vendorName);
if (self->modelName)
GLOBAL_FREEMEM(self->modelName);
if (self->revision)
GLOBAL_FREEMEM(self->revision);
self->vendorName = StringUtils_copyString(vendor);
self->modelName = StringUtils_copyString(model);
self->revision = StringUtils_copyString(revision);
MmsServer_setServerIdentity(self->mmsServer, self->vendorName, self->modelName, self->revision);
#endif
}
ClientConnection
private_IedServer_getClientConnectionByHandle(IedServer self, void* serverConnectionHandle)
{

Loading…
Cancel
Save