libiec61850  1.2.0
mms_device_model.h
Go to the documentation of this file.
1 /*
2  * mms_model.h
3  *
4  * Copyright 2013 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 MMS_DEVICE_MODEL_H_
25 #define MMS_DEVICE_MODEL_H_
26 
27 #include "libiec61850_common_api.h"
28 
29 #include "mms_type_spec.h"
30 #include "mms_common.h"
32 #include "logging_api.h"
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 typedef struct {
39  char* deviceName;
40 
41  /* MMS VMD scope variables support */
43  MmsVariableSpecification** namedVariables;
44 
45  /* MMS VMD scope named variables list support */
46  LinkedList /*<MmsNamedVariableList>*/ namedVariableLists;
47 
48  /* MMS domain support */
50  MmsDomain** domains;
51 } MmsDevice;
52 
53 
54 struct sMmsJournal {
55  char* name;
56  LogStorage logStorage;
57 };
58 
59 typedef struct sMmsJournal* MmsJournal;
60 
61 /*
62  * Server side data structure to hold information of an MMS domain (Logical Device)
63  */
64 struct sMmsDomain {
65  char* domainName;
67  MmsVariableSpecification** namedVariables;
68  LinkedList /*<MmsNamedVariableList>*/ namedVariableLists;
69  LinkedList /* <MmsJournal> */ journals;
70 };
71 
87 MmsDomain*
88 MmsDomain_create(char* domainName);
89 
90 char*
91 MmsDomain_getName(MmsDomain* self);
92 
93 void
94 MmsDomain_addJournal(MmsDomain* self, const char* name);
95 
96 MmsJournal
97 MmsDomain_getJournal(MmsDomain* self, const char* name);
98 
104 void
105 MmsDomain_destroy(MmsDomain* self);
106 
119 bool
120 MmsDomain_addNamedVariableList(MmsDomain* self, MmsNamedVariableList variableList);
121 
131 void
132 MmsDomain_deleteNamedVariableList(MmsDomain* self, char* variableListName);
133 
134 MmsNamedVariableList
135 MmsDomain_getNamedVariableList(MmsDomain* self, const char* variableListName);
136 
137 LinkedList
138 MmsDomain_getNamedVariableLists(MmsDomain* self);
139 
140 LinkedList
141 MmsDomain_getNamedVariableListValues(MmsDomain* self, char* variableListName);
142 
143 LinkedList
144 MmsDomain_createNamedVariableListValues(MmsDomain* self, char* variableListName);
145 
154 MmsVariableSpecification*
155 MmsDomain_getNamedVariable(MmsDomain* self, char* nameId);
156 
168 MmsDevice*
169 MmsDevice_create(char* deviceName);
170 
174 void
176 
184 MmsDomain*
185 MmsDevice_getDomain(MmsDevice* self, const char* domainId);
186 
195 MmsVariableSpecification*
196 MmsDevice_getNamedVariable(MmsDevice* self, char* variableName);
197 
198 LinkedList
200 
201 MmsNamedVariableList
202 MmsDevice_getNamedVariableListWithName(MmsDevice* self, const char* variableListName);
203 
204 MmsJournal
205 MmsJournal_create(const char* name);
206 
207 void
208 MmsJournal_destroy(MmsJournal self);
209 
212 #ifdef __cplusplus
213 }
214 #endif
215 
216 #endif /* MMS_DEVICE_MODEL_H_ */
MmsNamedVariableList MmsDomain_getNamedVariableList(MmsDomain *self, const char *variableListName)
char * MmsDomain_getName(MmsDomain *self)
char * deviceName
Definition: mms_device_model.h:39
MmsVariableSpecification ** namedVariables
Definition: mms_device_model.h:67
MmsVariableSpecification * MmsDomain_getNamedVariable(MmsDomain *self, char *nameId)
Get the MmsTypeSpecification instance of a MMS named variable.
int domainCount
Definition: mms_device_model.h:49
bool MmsDomain_addNamedVariableList(MmsDomain *self, MmsNamedVariableList variableList)
Add a new MMS Named Variable List (Data set) to a MmsDomain instance.
void MmsJournal_destroy(MmsJournal self)
void MmsDomain_addJournal(MmsDomain *self, const char *name)
void MmsDomain_destroy(MmsDomain *self)
Definition: mms_device_model.h:54
MmsJournal MmsJournal_create(const char *name)
MmsDomain ** domains
Definition: mms_device_model.h:50
LinkedList journals
Definition: mms_device_model.h:69
LinkedList namedVariableLists
Definition: mms_device_model.h:46
char * name
Definition: mms_device_model.h:55
LinkedList MmsDomain_getNamedVariableListValues(MmsDomain *self, char *variableListName)
void MmsDevice_destroy(MmsDevice *self)
Delete the MmsDevice instance.
MmsDomain * MmsDevice_getDomain(MmsDevice *self, const char *domainId)
Get the MmsDomain object with the specified MMS domain name.
MmsDevice * MmsDevice_create(char *deviceName)
Create a new MmsDevice instance.
MmsDomain * MmsDomain_create(char *domainName)
Create a new MmsDomain instance.
int namedVariablesCount
Definition: mms_device_model.h:66
MmsVariableSpecification ** namedVariables
Definition: mms_device_model.h:43
int namedVariablesCount
Definition: mms_device_model.h:42
Definition: mms_device_model.h:64
void MmsDomain_deleteNamedVariableList(MmsDomain *self, char *variableListName)
Delete a MMS Named Variable List from this MmsDomain instance.
MmsVariableSpecification * MmsDevice_getNamedVariable(MmsDevice *self, char *variableName)
Get the MmsTypeSpecification instance of a MMS named variable of VMD scope.
LinkedList MmsDomain_createNamedVariableListValues(MmsDomain *self, char *variableListName)
LinkedList MmsDevice_getNamedVariableLists(MmsDevice *self)
MmsNamedVariableList MmsDevice_getNamedVariableListWithName(MmsDevice *self, const char *variableListName)
LogStorage logStorage
Definition: mms_device_model.h:56
Definition: mms_device_model.h:38
LinkedList namedVariableLists
Definition: mms_device_model.h:68
LinkedList MmsDomain_getNamedVariableLists(MmsDomain *self)
MmsJournal MmsDomain_getJournal(MmsDomain *self, const char *name)
char * domainName
Definition: mms_device_model.h:65