libiec61850  1.5.3
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 
55 LIB61850_API IedModel*
56 IedModel_create(const char* name);
57 
69 LIB61850_API void
70 IedModel_setIedNameForDynamicModel(IedModel* self, const char* name);
71 
81 LIB61850_API void
82 IedModel_destroy(IedModel* model);
83 
92 LIB61850_API LogicalDevice*
93 LogicalDevice_create(const char* name, IedModel* parent);
94 
95 
104 LIB61850_API LogicalNode*
105 LogicalNode_create(const char* name, LogicalDevice* parent);
106 
118 LIB61850_API DataObject*
119 DataObject_create(const char* name, ModelNode* parent, int arrayElements);
120 
136 LIB61850_API DataAttribute*
137 DataAttribute_create(const char* name, ModelNode* parent, DataAttributeType type, FunctionalConstraint fc,
138  uint8_t triggerOptions, int arrayElements, uint32_t sAddr);
139 
147 LIB61850_API DataAttributeType
148 DataAttribute_getType(DataAttribute* self);
149 
157 LIB61850_API FunctionalConstraint
158 DataAttribute_getFC(DataAttribute* self);
159 
167 LIB61850_API uint8_t
168 DataAttribute_getTrgOps(DataAttribute* self);
169 
176 LIB61850_API void
177 DataAttribute_setValue(DataAttribute* self, MmsValue* value);
178 
198 LIB61850_API ReportControlBlock*
199 ReportControlBlock_create(const char* name, LogicalNode* parent, const char* rptId, bool isBuffered, const char*
200  dataSetName, uint32_t confRef, uint8_t trgOps, uint8_t options, uint32_t bufTm, uint32_t intgPd);
201 
211 LIB61850_API void
212 ReportControlBlock_setPreconfiguredClient(ReportControlBlock* self, uint8_t clientType, const uint8_t* clientAddress);
213 
223 LIB61850_API const char*
224 ReportControlBlock_getName(ReportControlBlock* self);
225 
233 LIB61850_API bool
234 ReportControlBlock_isBuffered(ReportControlBlock* self);
235 
243 LIB61850_API LogicalNode*
244 ReportControlBlock_getParent(ReportControlBlock* self);
245 
253 LIB61850_API char*
254 ReportControlBlock_getRptID(ReportControlBlock* self);
255 
263 LIB61850_API bool
264 ReportControlBlock_getRptEna(ReportControlBlock* self);
265 
273 LIB61850_API char*
274 ReportControlBlock_getDataSet(ReportControlBlock* self);
275 
283 LIB61850_API uint32_t
284 ReportControlBlock_getConfRev(ReportControlBlock* self);
285 
303 LIB61850_API uint32_t
304 ReportControlBlock_getOptFlds(ReportControlBlock* self);
305 
316 LIB61850_API uint32_t
317 ReportControlBlock_getBufTm(ReportControlBlock* self);
318 
319 LIB61850_API uint16_t
320 ReportControlBlock_getSqNum(ReportControlBlock* self);
321 
336 LIB61850_API uint32_t
337 ReportControlBlock_getTrgOps(ReportControlBlock* self);
338 
339 LIB61850_API uint32_t
340 ReportControlBlock_getIntgPd(ReportControlBlock* self);
341 
342 LIB61850_API bool
343 ReportControlBlock_getGI(ReportControlBlock* self);
344 
345 LIB61850_API bool
346 ReportControlBlock_getPurgeBuf(ReportControlBlock* self);
347 
348 LIB61850_API MmsValue*
349 ReportControlBlock_getEntryId(ReportControlBlock* self);
350 
351 LIB61850_API uint64_t
352 ReportControlBlock_getTimeofEntry(ReportControlBlock* self);
353 
354 LIB61850_API int16_t
355 ReportControlBlock_getResvTms(ReportControlBlock* self);
356 
357 LIB61850_API bool
358 ReportControlBlock_getResv(ReportControlBlock* self);
359 
360 LIB61850_API MmsValue*
361 ReportControlBlock_getOwner(ReportControlBlock* self);
362 
380 LIB61850_API LogControlBlock*
381 LogControlBlock_create(const char* name, LogicalNode* parent, const char* dataSetName, const char* logRef, uint8_t trgOps,
382  uint32_t intgPd, bool logEna, bool reasonCode);
383 
392 LIB61850_API Log*
393 Log_create(const char* name, LogicalNode* parent);
394 
406 LIB61850_API SettingGroupControlBlock*
407 SettingGroupControlBlock_create(LogicalNode* parent, uint8_t actSG, uint8_t numOfSGs);
408 
425 LIB61850_API GSEControlBlock*
426 GSEControlBlock_create(const char* name, LogicalNode* parent, const char* appId, const char* dataSet, uint32_t confRev,
427  bool fixedOffs, int minTime, int maxTime);
428 
445 LIB61850_API SVControlBlock*
446 SVControlBlock_create(const char* name, LogicalNode* parent, const char* svID, const char* dataSet, uint32_t confRev, uint8_t smpMod,
447  uint16_t smpRate, uint8_t optFlds, bool isUnicast);
448 
449 LIB61850_API void
450 SVControlBlock_addPhyComAddress(SVControlBlock* self, PhyComAddress* phyComAddress);
451 
452 LIB61850_API void
453 GSEControlBlock_addPhyComAddress(GSEControlBlock* self, PhyComAddress* phyComAddress);
454 
467 LIB61850_API PhyComAddress*
468 PhyComAddress_create(uint8_t vlanPriority, uint16_t vlanId, uint16_t appId, uint8_t dstAddress[]);
469 
478 LIB61850_API DataSet*
479 DataSet_create(const char* name, LogicalNode* parent);
480 
488 LIB61850_API const char*
489 DataSet_getName(DataSet* self);
490 
498 LIB61850_API int
499 DataSet_getSize(DataSet* self);
500 
501 LIB61850_API DataSetEntry*
502 DataSet_getFirstEntry(DataSet* self);
503 
504 LIB61850_API DataSetEntry*
506 
527 LIB61850_API DataSetEntry*
528 DataSetEntry_create(DataSet* dataSet, const char* variable, int index, const char* component);
529 
534 #ifdef __cplusplus
535 }
536 #endif
537 
538 #endif /* DYNAMIC_MODEL_H_ */
DataAttributeType
Definition: iec61850_model.h:89
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 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 and add it to a parent model node
LIB61850_API LogicalDevice * LogicalDevice_create(const char *name, IedModel *parent)
Create a new logical device model 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 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 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:264
struct sMmsValue MmsValue
Definition: mms_value.h:68
Definition: iec61850_model.h:237
Definition: iec61850_common.h:51