|
|
|
@ -43,19 +43,33 @@ reportCallbackFunction(void* parameter, ClientReport report)
|
|
|
|
|
printf(" report contains timestamp (%u): %s", (unsigned int) unixTime, timeBuf);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int i;
|
|
|
|
|
for (i = 0; i < LinkedList_size(dataSetDirectory); i++) {
|
|
|
|
|
ReasonForInclusion reason = ClientReport_getReasonForInclusion(report, i);
|
|
|
|
|
if (dataSetDirectory) {
|
|
|
|
|
int i;
|
|
|
|
|
for (i = 0; i < LinkedList_size(dataSetDirectory); i++) {
|
|
|
|
|
ReasonForInclusion reason = ClientReport_getReasonForInclusion(report, i);
|
|
|
|
|
|
|
|
|
|
if (reason != IEC61850_REASON_NOT_INCLUDED) {
|
|
|
|
|
if (reason != IEC61850_REASON_NOT_INCLUDED) {
|
|
|
|
|
|
|
|
|
|
LinkedList entry = LinkedList_get(dataSetDirectory, i);
|
|
|
|
|
char valBuffer[500];
|
|
|
|
|
sprintf(valBuffer, "no value");
|
|
|
|
|
|
|
|
|
|
char* entryName = (char*) entry->data;
|
|
|
|
|
if (dataSetValues) {
|
|
|
|
|
MmsValue* value = MmsValue_getElement(dataSetValues, i);
|
|
|
|
|
|
|
|
|
|
printf(" %s (included for reason %i)\n", entryName, reason);
|
|
|
|
|
if (value) {
|
|
|
|
|
MmsValue_printToBuffer(value, valBuffer, 500);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LinkedList entry = LinkedList_get(dataSetDirectory, i);
|
|
|
|
|
|
|
|
|
|
char* entryName = (char*) entry->data;
|
|
|
|
|
|
|
|
|
|
printf(" %s (included for reason %i): %s\n", entryName, reason, valBuffer);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
@ -89,23 +103,23 @@ main(int argc, char** argv)
|
|
|
|
|
LinkedList dataSetDirectory = NULL;
|
|
|
|
|
|
|
|
|
|
/* read data set directory */
|
|
|
|
|
dataSetDirectory = IedConnection_getDataSetDirectory(con, &error, "simpleIOGenericIO/LLN0.Events", NULL);
|
|
|
|
|
dataSetDirectory = IedConnection_getDataSetDirectory(con, &error, "testmodelSENSORS/LLN0.DataSetST_Attr", NULL);
|
|
|
|
|
|
|
|
|
|
if (error != IED_ERROR_OK) {
|
|
|
|
|
printf("Reading data set directory failed!\n");
|
|
|
|
|
goto exit_error;
|
|
|
|
|
// goto exit_error;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* read data set */
|
|
|
|
|
clientDataSet = IedConnection_readDataSetValues(con, &error, "simpleIOGenericIO/LLN0.Events", NULL);
|
|
|
|
|
clientDataSet = IedConnection_readDataSetValues(con, &error, "testmodelSENSORS/LLN0.DataSetST_Attr", NULL);
|
|
|
|
|
|
|
|
|
|
if (clientDataSet == NULL) {
|
|
|
|
|
printf("failed to read dataset\n");
|
|
|
|
|
goto exit_error;
|
|
|
|
|
// goto exit_error;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Read RCB values */
|
|
|
|
|
rcb = IedConnection_getRCBValues(con, &error, "simpleIOGenericIO/LLN0.RP.EventsRCB01", NULL);
|
|
|
|
|
rcb = IedConnection_getRCBValues(con, &error, "testmodelSENSORS/LLN0.RP.events01", NULL);
|
|
|
|
|
|
|
|
|
|
if (error != IED_ERROR_OK) {
|
|
|
|
|
printf("getRCBValues service error!\n");
|
|
|
|
@ -115,12 +129,12 @@ main(int argc, char** argv)
|
|
|
|
|
/* prepare the parameters of the RCP */
|
|
|
|
|
ClientReportControlBlock_setResv(rcb, true);
|
|
|
|
|
ClientReportControlBlock_setTrgOps(rcb, TRG_OPT_DATA_CHANGED | TRG_OPT_QUALITY_CHANGED | TRG_OPT_GI);
|
|
|
|
|
ClientReportControlBlock_setDataSetReference(rcb, "simpleIOGenericIO/LLN0$Events"); /* NOTE the "$" instead of "." ! */
|
|
|
|
|
ClientReportControlBlock_setDataSetReference(rcb, "testmodelSENSORS/LLN0$DataSetST_Attr"); /* 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,
|
|
|
|
|
IedConnection_installReportHandler(con, "testmodelSENSORS/LLN0.events01", ClientReportControlBlock_getRptId(rcb), reportCallbackFunction,
|
|
|
|
|
(void*) dataSetDirectory);
|
|
|
|
|
|
|
|
|
|
/* Write RCB parameters and enable report */
|
|
|
|
|