- client: IedConnection_setRCBValues send GI last when RptEna=true included

pull/6/head
Michael Zillgith 10 years ago
parent 78b9e4796a
commit 33fcf156d4

@ -11,7 +11,7 @@ project(libiec61850)
set(LIB_VERSION_MAJOR "0")
set(LIB_VERSION_MINOR "9")
set(LIB_VERSION_PATCH "0")
set(LIB_VERSION_PATCH "1")
# feature checks
include(CheckLibraryExists)

@ -156,7 +156,7 @@
/* default results for MMS identify service */
#define CONFIG_DEFAULT_MMS_VENDOR_NAME "libiec61850.com"
#define CONFIG_DEFAULT_MMS_MODEL_NAME "LIBIEC61850"
#define CONFIG_DEFAULT_MMS_REVISION "0.9.0"
#define CONFIG_DEFAULT_MMS_REVISION "0.9.1"
/* MMS virtual file store base path - where file services are looking for files */
#define CONFIG_VIRTUAL_FILESTORE_BASEPATH "./vmd-filestore/"

@ -116,13 +116,14 @@ int main(int argc, char** argv) {
ClientReportControlBlock_setResv(rcb, true);
ClientReportControlBlock_setDataSetReference(rcb, "simpleIOGenericIO/LLN0$Events"); /* NOTE the "$" instead of "." ! */
ClientReportControlBlock_setRptEna(rcb, true);
ClientReportControlBlock_setGI(rcb, true);
/* Configure the report receiver */
IedConnection_installReportHandler(con, "simpleIOGenericIO/LLN0.RP.EventsRCB", ClientReportControlBlock_getRptId(rcb), reportCallbackFunction,
(void*) dataSetDirectory);
/* Write RCB parameters and enable report */
IedConnection_setRCBValues(con, &error, rcb, RCB_ELEMENT_RESV | RCB_ELEMENT_DATSET | RCB_ELEMENT_RPT_ENA, true);
IedConnection_setRCBValues(con, &error, rcb, RCB_ELEMENT_RESV | RCB_ELEMENT_DATSET | RCB_ELEMENT_RPT_ENA | RCB_ELEMENT_GI, true);
if (error != IED_ERROR_OK) {
printf("setRCBValues service error!\n");

@ -15,7 +15,7 @@
#include "platform_endian.h"
#define LIBIEC61850_VERSION "0.9.0"
#define LIBIEC61850_VERSION "0.9.1"
#ifndef CONFIG_DEFAULT_MMS_VENDOR_NAME
#define CONFIG_DEFAULT_MMS_VENDOR_NAME "libiec61850.com"

@ -37,7 +37,7 @@ isBufferedRcb(const char* objectReference)
const char* separator = strchr(objectReference, '.');
if (separator == NULL)
return false; //TODO report an error
return false;
if (*(separator + 1) == 'B')
return true;
@ -50,6 +50,8 @@ ClientReportControlBlock_create(const char* objectReference)
{
ClientReportControlBlock self = (ClientReportControlBlock) GLOBAL_CALLOC(1, sizeof(struct sClientReportControlBlock));
//TODO check validity of object reference?!
self->objectReference = copyString(objectReference);
self->isBuffered = isBufferedRcb(objectReference);
@ -499,6 +501,7 @@ IedConnection_setRCBValues(IedConnection self, IedClientError* error, ClientRepo
MmsError mmsError = MMS_ERROR_NONE;
bool isBuffered = ClientReportControlBlock_isBuffered(rcb);
bool sendGILast = false; /* GI should be sent last when RptEna=TRUE is included */
char domainId[65];
char itemId[129];
@ -591,10 +594,18 @@ IedConnection_setRCBValues(IedConnection self, IedClientError* error, ClientRepo
}
if (parametersMask & RCB_ELEMENT_GI) {
strcpy(itemId + itemIdLen, "$GI");
LinkedList_add(itemIds, copyString(itemId));
LinkedList_add(values, rcb->gi);
if (parametersMask & RCB_ELEMENT_RPT_ENA) {
if (MmsValue_getBoolean(rcb->rptEna))
sendGILast = true;
}
if (sendGILast == false) {
strcpy(itemId + itemIdLen, "$GI");
LinkedList_add(itemIds, copyString(itemId));
LinkedList_add(values, rcb->gi);
}
}
if (parametersMask & RCB_ELEMENT_PURGE_BUF) {
@ -624,6 +635,13 @@ IedConnection_setRCBValues(IedConnection self, IedClientError* error, ClientRepo
LinkedList_add(values, rcb->rptEna);
}
if (sendGILast) {
strcpy(itemId + itemIdLen, "$GI");
LinkedList_add(itemIds, copyString(itemId));
LinkedList_add(values, rcb->gi);
}
if (singleRequest) {
LinkedList accessResults = NULL;
@ -672,10 +690,10 @@ IedConnection_setRCBValues(IedConnection self, IedClientError* error, ClientRepo
goto exit_function;
}
error_invalid_parameter:
error_invalid_parameter:
*error = IED_ERROR_USER_PROVIDED_INVALID_ARGUMENT;
exit_function:
exit_function:
LinkedList_destroy(itemIds);
LinkedList_destroyStatic(values);
}

Loading…
Cancel
Save