From 94563cb9f62805000d03f316710737bb6539ec87 Mon Sep 17 00:00:00 2001 From: Michael Zillgith Date: Sat, 22 Jan 2022 19:41:02 +0100 Subject: [PATCH] - additional methods for ReportControlBlock --- src/iec61850/inc/iec61850_dynamic_model.h | 32 +++++++++++++++++++++++ src/iec61850/server/model/dynamic_model.c | 18 +++++++++++++ 2 files changed, 50 insertions(+) diff --git a/src/iec61850/inc/iec61850_dynamic_model.h b/src/iec61850/inc/iec61850_dynamic_model.h index cd8a421f..8a94940a 100644 --- a/src/iec61850/inc/iec61850_dynamic_model.h +++ b/src/iec61850/inc/iec61850_dynamic_model.h @@ -211,6 +211,38 @@ ReportControlBlock_create(const char* name, LogicalNode* parent, const char* rpt LIB61850_API void ReportControlBlock_setPreconfiguredClient(ReportControlBlock* self, uint8_t clientType, const uint8_t* clientAddress); +/** + * \brief Get the name of the RCB instance + * + * NOTE: the returned string is only valid during the lifetime of the ReportControlBlock instance! + * + * \param self the RCB instance + * + * \return the RCB instance name + */ +LIB61850_API const char* +ReportControlBlock_getName(ReportControlBlock* self); + +/** + * \brief Is the RCB buffered or unbuffered? + * + * \param self the RCB instance + * + * \return true, in case of a buffered RCB, false otherwise + */ +LIB61850_API bool +ReportControlBlock_isBuffered(ReportControlBlock* self); + +/** + * \brief Get the parent (LogicalNode) of the RCB instance + * + * \param self the RCB instance + * + * \return the parent (LogicalNode) of the RCB instance + */ +LIB61850_API LogicalNode* +ReportControlBlock_getParent(ReportControlBlock* self); + /** * \brief create a new log control block (LCB) * diff --git a/src/iec61850/server/model/dynamic_model.c b/src/iec61850/server/model/dynamic_model.c index 043bdc29..69406330 100644 --- a/src/iec61850/server/model/dynamic_model.c +++ b/src/iec61850/server/model/dynamic_model.c @@ -383,6 +383,24 @@ ReportControlBlock_setPreconfiguredClient(ReportControlBlock* self, uint8_t clie } } +const char* +ReportControlBlock_getName(ReportControlBlock* self) +{ + return self->name; +} + +LogicalNode* +ReportControlBlock_getParent(ReportControlBlock* self) +{ + return self->parent; +} + +bool +ReportControlBlock_isBuffered(ReportControlBlock* self) +{ + return self->buffered; +} + #if (CONFIG_IEC61850_SETTING_GROUPS == 1) static void LogicalNode_addSettingGroupControlBlock(LogicalNode* self, SettingGroupControlBlock* sgcb)