- server: added RCBEventHandler event types REPORT_CREATED and OVERFLOW

pull/345/head
Michael Zillgith 3 years ago
parent ee948a0c08
commit bb7c2421cd

@ -1993,7 +1993,15 @@ namespace IEC61850
/// <summary>
/// Purge buffer procedure executed
/// </summary>
PURGEBUF = 7
PURGEBUF = 7,
/// <summary>
/// Report buffer overflow
/// </summary>
OVERFLOW = 8,
/// <summary>
/// A new report was created and inserted into the buffer
/// </summary>
REPORT_CREATED = 9
}
public delegate void RCBEventHandler(object parameter, ReportControlBlock rcb, ClientConnection con, RCBEventType eventType, string parameterName, MmsDataAccessError serviceError);

@ -1547,7 +1547,9 @@ typedef enum {
RCB_EVENT_ENABLE, /* << RCB enabled */
RCB_EVENT_DISABLE, /* << RCB disabled */
RCB_EVENT_GI, /* << GI report triggered */
RCB_EVENT_PURGEBUF /* << Purge buffer procedure executed */
RCB_EVENT_PURGEBUF, /* << Purge buffer procedure executed */
RCB_EVENT_OVERFLOW, /* << Report buffer overflow */
RCB_EVENT_REPORT_CREATED /* << a new report was created and inserted into the buffer */
} IedServer_RCBEventType;
/**

@ -166,7 +166,6 @@ ReportControl_unlockNotify(ReportControl* self)
#endif
}
static void
purgeBuf(ReportControl* rc)
{
@ -183,7 +182,6 @@ purgeBuf(ReportControl* rc)
reportBuffer->reportsCount = 0;
}
static void
deleteDataSetValuesShadowBuffer(ReportControl* self)
{
@ -3072,6 +3070,18 @@ exit_function:
Semaphore_post(buffer->lock);
#endif
if (reportControl->server) {
MmsMapping* mmsMapping = reportControl->server->mmsMapping;
if (mmsMapping->rcbEventHandler) {
if (overflow) {
mmsMapping->rcbEventHandler(mmsMapping->rcbEventHandlerParameter, reportControl->rcb, NULL, RCB_EVENT_OVERFLOW, NULL, DATA_ACCESS_ERROR_SUCCESS);
}
mmsMapping->rcbEventHandler(mmsMapping->rcbEventHandlerParameter, reportControl->rcb, NULL, RCB_EVENT_REPORT_CREATED, NULL, DATA_ACCESS_ERROR_SUCCESS);
}
}
return;
} /* enqueuReport() */

Loading…
Cancel
Save