libiec61850  1.6.0
iec61850_dynamic_model.h
Go to the documentation of this file.
1 /*
2  * dynamic_model.h
3  *
4  * Copyright 2014 Michael Zillgith
5  *
6  * This file is part of libIEC61850.
7  *
8  * libIEC61850 is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * libIEC61850 is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with libIEC61850. If not, see <http://www.gnu.org/licenses/>.
20  *
21  * See COPYING file for the complete license text.
22  */
23 
24 #ifndef DYNAMIC_MODEL_H_
25 #define DYNAMIC_MODEL_H_
26 
27 #include "iec61850_model.h"
28 #include "iec61850_cdc.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 
57 LIB61850_API IedModel*
58 IedModel_create(const char* name);
59 
71 LIB61850_API void
72 IedModel_setIedNameForDynamicModel(IedModel* self, const char* name);
73 
83 LIB61850_API void
84 IedModel_destroy(IedModel* model);
85 
94 LIB61850_API LogicalDevice*
95 LogicalDevice_create(const char* name, IedModel* parent);
96 
106 LIB61850_API LogicalDevice*
107 LogicalDevice_createEx(const char* inst, IedModel* parent, const char* ldName);
108 
117 LIB61850_API LogicalNode*
118 LogicalNode_create(const char* name, LogicalDevice* parent);
119 
134 LIB61850_API DataObject*
135 DataObject_create(const char* name, ModelNode* parent, int arrayElements);
136 
152 LIB61850_API DataAttribute*
153 DataAttribute_create(const char* name, ModelNode* parent, DataAttributeType type, FunctionalConstraint fc,
154  uint8_t triggerOptions, int arrayElements, uint32_t sAddr);
155 
163 LIB61850_API DataAttributeType
164 DataAttribute_getType(DataAttribute* self);
165 
173 LIB61850_API FunctionalConstraint
174 DataAttribute_getFC(DataAttribute* self);
175 
183 LIB61850_API uint8_t
184 DataAttribute_getTrgOps(DataAttribute* self);
185 
192 LIB61850_API void
193 DataAttribute_setValue(DataAttribute* self, MmsValue* value);
194 
214 LIB61850_API ReportControlBlock*
215 ReportControlBlock_create(const char* name, LogicalNode* parent, const char* rptId, bool isBuffered, const char*
216  dataSetName, uint32_t confRef, uint8_t trgOps, uint8_t options, uint32_t bufTm, uint32_t intgPd);
217 
227 LIB61850_API void
228 ReportControlBlock_setPreconfiguredClient(ReportControlBlock* self, uint8_t clientType, const uint8_t* clientAddress);
229 
239 LIB61850_API const char*
240 ReportControlBlock_getName(ReportControlBlock* self);
241 
249 LIB61850_API bool
250 ReportControlBlock_isBuffered(ReportControlBlock* self);
251 
259 LIB61850_API LogicalNode*
260 ReportControlBlock_getParent(ReportControlBlock* self);
261 
269 LIB61850_API char*
270 ReportControlBlock_getRptID(ReportControlBlock* self);
271 
279 LIB61850_API bool
280 ReportControlBlock_getRptEna(ReportControlBlock* self);
281 
289 LIB61850_API char*
290 ReportControlBlock_getDataSet(ReportControlBlock* self);
291 
299 LIB61850_API uint32_t
300 ReportControlBlock_getConfRev(ReportControlBlock* self);
301 
319 LIB61850_API uint32_t
320 ReportControlBlock_getOptFlds(ReportControlBlock* self);
321 
332 LIB61850_API uint32_t
333 ReportControlBlock_getBufTm(ReportControlBlock* self);
334 
335 LIB61850_API uint16_t
336 ReportControlBlock_getSqNum(ReportControlBlock* self);
337 
352 LIB61850_API uint32_t
353 ReportControlBlock_getTrgOps(ReportControlBlock* self);
354 
355 LIB61850_API uint32_t
356 ReportControlBlock_getIntgPd(ReportControlBlock* self);
357 
358 LIB61850_API bool
359 ReportControlBlock_getGI(ReportControlBlock* self);
360 
361 LIB61850_API bool
362 ReportControlBlock_getPurgeBuf(ReportControlBlock* self);
363 
364 LIB61850_API MmsValue*
365 ReportControlBlock_getEntryId(ReportControlBlock* self);
366 
367 LIB61850_API uint64_t
368 ReportControlBlock_getTimeofEntry(ReportControlBlock* self);
369 
370 LIB61850_API int16_t
371 ReportControlBlock_getResvTms(ReportControlBlock* self);
372 
373 LIB61850_API bool
374 ReportControlBlock_getResv(ReportControlBlock* self);
375 
376 LIB61850_API MmsValue*
377 ReportControlBlock_getOwner(ReportControlBlock* self);
378 
396 LIB61850_API LogControlBlock*
397 LogControlBlock_create(const char* name, LogicalNode* parent, const char* dataSetName, const char* logRef, uint8_t trgOps,
398  uint32_t intgPd, bool logEna, bool reasonCode);
399 
400 LIB61850_API const char*
401 LogControlBlock_getName(LogControlBlock* self);
402 
403 LIB61850_API LogicalNode*
404 LogControlBlock_getParent(LogControlBlock* self);
405 
414 LIB61850_API Log*
415 Log_create(const char* name, LogicalNode* parent);
416 
428 LIB61850_API SettingGroupControlBlock*
429 SettingGroupControlBlock_create(LogicalNode* parent, uint8_t actSG, uint8_t numOfSGs);
430 
447 LIB61850_API GSEControlBlock*
448 GSEControlBlock_create(const char* name, LogicalNode* parent, const char* appId, const char* dataSet, uint32_t confRev,
449  bool fixedOffs, int minTime, int maxTime);
450 
467 LIB61850_API SVControlBlock*
468 SVControlBlock_create(const char* name, LogicalNode* parent, const char* svID, const char* dataSet, uint32_t confRev, uint8_t smpMod,
469  uint16_t smpRate, uint8_t optFlds, bool isUnicast);
470 
471 LIB61850_API void
472 SVControlBlock_addPhyComAddress(SVControlBlock* self, PhyComAddress* phyComAddress);
473 
474 LIB61850_API void
475 GSEControlBlock_addPhyComAddress(GSEControlBlock* self, PhyComAddress* phyComAddress);
476 
489 LIB61850_API PhyComAddress*
490 PhyComAddress_create(uint8_t vlanPriority, uint16_t vlanId, uint16_t appId, uint8_t dstAddress[]);
491 
500 LIB61850_API DataSet*
501 DataSet_create(const char* name, LogicalNode* parent);
502 
510 LIB61850_API const char*
511 DataSet_getName(DataSet* self);
512 
520 LIB61850_API int
521 DataSet_getSize(DataSet* self);
522 
523 LIB61850_API DataSetEntry*
524 DataSet_getFirstEntry(DataSet* self);
525 
526 LIB61850_API DataSetEntry*
528 
549 LIB61850_API DataSetEntry*
550 DataSetEntry_create(DataSet* dataSet, const char* variable, int index, const char* component);
551 
556 #ifdef __cplusplus
557 }
558 #endif
559 
560 #endif /* DYNAMIC_MODEL_H_ */
DataAttributeType
Definition: iec61850_model.h:91
LIB61850_API LogicalNode * ReportControlBlock_getParent(ReportControlBlock *self)
Get the parent (LogicalNode) of the RCB instance.
LIB61850_API bool ReportControlBlock_isBuffered(ReportControlBlock *self)
Is the RCB buffered or unbuffered?
LIB61850_API LogicalNode * LogicalNode_create(const char *name, LogicalDevice *parent)
Create a new logical mode and add it to a logical device.
LIB61850_API LogicalNode * LogControlBlock_getParent(LogControlBlock *self)
LIB61850_API int DataSet_getSize(DataSet *self)
returns the number of elements (entries) of the data set
LIB61850_API uint32_t ReportControlBlock_getConfRev(ReportControlBlock *self)
Get the confRev value.
LIB61850_API ReportControlBlock * ReportControlBlock_create(const char *name, LogicalNode *parent, const char *rptId, bool isBuffered, const char *dataSetName, uint32_t confRef, uint8_t trgOps, uint8_t options, uint32_t bufTm, uint32_t intgPd)
create a new report control block (RCB)
LIB61850_API DataAttributeType DataAttribute_getType(DataAttribute *self)
Get the data type of the data attribute.
LIB61850_API FunctionalConstraint DataAttribute_getFC(DataAttribute *self)
Get the functional constraint (FC) of the data attribute.
LIB61850_API uint32_t ReportControlBlock_getTrgOps(ReportControlBlock *self)
Get the currently set trigger options.
LIB61850_API LogControlBlock * LogControlBlock_create(const char *name, LogicalNode *parent, const char *dataSetName, const char *logRef, uint8_t trgOps, uint32_t intgPd, bool logEna, bool reasonCode)
create a new log control block (LCB)
LIB61850_API DataObject * DataObject_create(const char *name, ModelNode *parent, int arrayElements)
create a new data object or array data object and add it to a parent model node
LIB61850_API LogicalDevice * LogicalDevice_create(const char *name, IedModel *parent)
Create a new logical device and add it to the IED model.
LIB61850_API void DataAttribute_setValue(DataAttribute *self, MmsValue *value)
Set the value of the data attribute (can be used to set default values before server is created)
LIB61850_API MmsValue * ReportControlBlock_getOwner(ReportControlBlock *self)
LIB61850_API uint32_t ReportControlBlock_getIntgPd(ReportControlBlock *self)
LIB61850_API char * ReportControlBlock_getDataSet(ReportControlBlock *self)
Get the name of the currenlty set data set.
LIB61850_API PhyComAddress * PhyComAddress_create(uint8_t vlanPriority, uint16_t vlanId, uint16_t appId, uint8_t dstAddress[])
create a PhyComAddress object
LIB61850_API const char * LogControlBlock_getName(LogControlBlock *self)
LIB61850_API bool ReportControlBlock_getResv(ReportControlBlock *self)
LIB61850_API void ReportControlBlock_setPreconfiguredClient(ReportControlBlock *self, uint8_t clientType, const uint8_t *clientAddress)
Set a pre-configured client for the RCB.
LIB61850_API DataSetEntry * DataSetEntry_getNext(DataSetEntry *self)
LIB61850_API char * ReportControlBlock_getRptID(ReportControlBlock *self)
Get the name of the currently set report ID.
LIB61850_API Log * Log_create(const char *name, LogicalNode *parent)
create a log (used by the IEC 61850 log service)
LIB61850_API DataSet * DataSet_create(const char *name, LogicalNode *parent)
create a new data set
LIB61850_API void SVControlBlock_addPhyComAddress(SVControlBlock *self, PhyComAddress *phyComAddress)
LIB61850_API uint16_t ReportControlBlock_getSqNum(ReportControlBlock *self)
LIB61850_API int16_t ReportControlBlock_getResvTms(ReportControlBlock *self)
LIB61850_API DataAttribute * DataAttribute_create(const char *name, ModelNode *parent, DataAttributeType type, FunctionalConstraint fc, uint8_t triggerOptions, int arrayElements, uint32_t sAddr)
create a new data attribute and add it to a parent model node
LIB61850_API bool ReportControlBlock_getGI(ReportControlBlock *self)
LIB61850_API void IedModel_setIedNameForDynamicModel(IedModel *self, const char *name)
Set the name of the IED (use only for dynamic model!)
LIB61850_API SettingGroupControlBlock * SettingGroupControlBlock_create(LogicalNode *parent, uint8_t actSG, uint8_t numOfSGs)
create a setting group control block (SGCB)
LIB61850_API LogicalDevice * LogicalDevice_createEx(const char *inst, IedModel *parent, const char *ldName)
Create a new logical device and add it to the IED model.
LIB61850_API GSEControlBlock * GSEControlBlock_create(const char *name, LogicalNode *parent, const char *appId, const char *dataSet, uint32_t confRev, bool fixedOffs, int minTime, int maxTime)
create a new GSE/GOOSE control block (GoCB)
LIB61850_API void IedModel_destroy(IedModel *model)
destroy a dynamically created data model
LIB61850_API bool ReportControlBlock_getRptEna(ReportControlBlock *self)
Check if RCB instance is enabled.
LIB61850_API DataSetEntry * DataSet_getFirstEntry(DataSet *self)
LIB61850_API uint32_t ReportControlBlock_getBufTm(ReportControlBlock *self)
Get the BufTm value (buffer time)
LIB61850_API DataSetEntry * DataSetEntry_create(DataSet *dataSet, const char *variable, int index, const char *component)
create a new data set entry (FCDA)
LIB61850_API MmsValue * ReportControlBlock_getEntryId(ReportControlBlock *self)
LIB61850_API const char * DataSet_getName(DataSet *self)
Get the name of the data set.
LIB61850_API uint32_t ReportControlBlock_getOptFlds(ReportControlBlock *self)
Get the currently set OptFlds value.
LIB61850_API uint64_t ReportControlBlock_getTimeofEntry(ReportControlBlock *self)
LIB61850_API IedModel * IedModel_create(const char *name)
create a new IedModel instance
LIB61850_API uint8_t DataAttribute_getTrgOps(DataAttribute *self)
Get the trigger options of the data attribute.
LIB61850_API const char * ReportControlBlock_getName(ReportControlBlock *self)
Get the name of the RCB instance.
LIB61850_API SVControlBlock * SVControlBlock_create(const char *name, LogicalNode *parent, const char *svID, const char *dataSet, uint32_t confRev, uint8_t smpMod, uint16_t smpRate, uint8_t optFlds, bool isUnicast)
create a new Multicast/Unicast Sampled Value (SV) control block (SvCB)
LIB61850_API void GSEControlBlock_addPhyComAddress(GSEControlBlock *self, PhyComAddress *phyComAddress)
LIB61850_API bool ReportControlBlock_getPurgeBuf(ReportControlBlock *self)
FunctionalConstraint
Definition: iec61850_common.h:260
struct sMmsValue MmsValue
Definition: mms_value.h:68
Definition: iec61850_model.h:204
Definition: iec61850_common.h:51