libIEC61850
Open-source IEC 61850 MMS server and client library
Main Page
Modules
Data Structures
Files
Downloads
Contact
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Groups
Pages
mms
iso_mms
common
mms_value.h
Go to the documentation of this file.
1
/*
2
* mms_value.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_VALUE_H_
25
#define MMS_VALUE_H_
26
32
#include "mms_common.h"
33
#include "
mms_types.h
"
34
#include <stdbool.h>
35
36
/*************************************************************************************
37
* Array functions
38
*************************************************************************************/
39
48
MmsValue*
49
MmsValue_createArray
(MmsTypeSpecification* elementType,
int
size);
50
58
uint32_t
59
MmsValue_getArraySize
(MmsValue*
self
);
60
69
MmsValue*
70
MmsValue_getElement
(MmsValue* array,
int
index);
71
79
MmsValue*
80
MmsValue_createEmtpyArray
(
int
size);
81
82
void
83
MmsValue_setArrayElement
(MmsValue* array,
int
index, MmsValue* elementValue);
84
85
MmsValue*
86
MmsValue_getStructElementByIndex
(MmsValue* structure,
int
index);
87
88
/*************************************************************************************
89
* Basic type functions
90
*************************************************************************************/
91
99
int64_t
100
MmsValue_toInt64
(MmsValue*
self
);
101
109
int32_t
110
MmsValue_toInt32
(MmsValue* value);
111
119
uint32_t
120
MmsValue_toUint32
(MmsValue* value);
121
129
double
130
MmsValue_toDouble
(MmsValue*
self
);
131
139
float
140
MmsValue_toFloat
(MmsValue*
self
);
141
149
uint32_t
150
MmsValue_toUnixTimestamp
(MmsValue*
self
);
151
157
void
158
MmsValue_setFloat
(MmsValue*
self
,
float
newFloatValue);
159
165
void
166
MmsValue_setDouble
(MmsValue*
self
,
double
newFloatValue);
167
173
void
174
MmsValue_setInt32
(MmsValue*
self
, int32_t integer);
175
182
void
183
MmsValue_setBoolean
(MmsValue* value,
bool
boolValue);
184
185
char
*
186
MmsValue_toString
(MmsValue*
self
);
187
188
void
189
MmsValue_setVisibleString
(MmsValue*
self
,
char
*
string
);
190
191
void
192
MmsValue_setBitStringBit
(MmsValue*
self
,
int
bitPos,
bool
value);
193
194
bool
195
MmsValue_getBitStringBit
(MmsValue*
self
,
int
bitPos);
196
197
void
198
MmsValue_deleteAllBitStringBits
(MmsValue*
self
);
199
200
void
201
MmsValue_setAllBitStringBits
(MmsValue*
self
);
202
203
MmsValue*
204
MmsValue_setUtcTime
(MmsValue*
self
, uint32_t timeval);
205
206
bool
207
MmsValue_update
(MmsValue*
self
, MmsValue*);
208
209
/*************************************************************************************
210
* Constructors and destructors
211
*************************************************************************************/
212
213
214
MmsValue*
215
MmsValue_newDataAccessError
(uint32_t code);
216
217
MmsValue*
218
MmsValue_newIntegerFromBerInteger
(Asn1PrimitiveValue* berInteger);
219
220
MmsValue*
221
MmsValue_newUnsignedFromBerInteger
(Asn1PrimitiveValue* berInteger);
222
223
MmsValue*
224
MmsValue_newInteger
(
int
size);
225
226
MmsValue*
227
MmsValue_newUnsigned
(
int
size);
228
229
MmsValue*
230
MmsValue_newBoolean
(
bool
boolean
);
231
232
MmsValue*
233
MmsValue_newBitString
(
int
bitSize);
234
235
MmsValue*
236
MmsValue_newOctetString
(
int
size,
int
maxSize);
237
238
MmsValue*
239
MmsValue_newStructure
(MmsTypeSpecification* typeSpec);
240
241
MmsValue*
242
MmsValue_newDefaultValue
(MmsTypeSpecification* typeSpec);
243
244
MmsValue*
245
MmsValue_newIntegerFromInt16
(int16_t integer);
246
247
MmsValue*
248
MmsValue_newIntegerFromInt32
(int32_t integer);
249
250
MmsValue*
251
MmsValue_newIntegerFromInt64
(int64_t integer);
252
253
MmsValue*
254
MmsValue_newUnsignedFromUint32
(uint32_t integer);
255
256
MmsValue*
257
MmsValue_newFloat
(
float
variable);
258
259
MmsValue*
260
MmsValue_newDouble
(
double
variable);
261
262
MmsValue*
263
MmsValue_clone
(MmsValue* value);
264
265
void
266
MmsValue_delete
(MmsValue* value);
267
268
MmsValue*
269
MmsValue_newVisibleString
(
char
*
string
);
270
271
MmsValue*
272
MmsValue_newBinaryTime
(
bool
timeOfDay);
273
274
MmsValue*
275
MmsValue_newVisibleStringFromByteArray
(uint8_t* byteArray,
int
size);
276
277
MmsValue*
278
MmsValue_newMmsString
(
char
*
string
);
279
280
void
281
MmsValue_setMmsString
(MmsValue* value,
char
*
string
);
282
283
MmsValue*
284
MmsValue_newUtcTime
(uint32_t timeval);
285
286
void
287
MmsValue_setDeletable
(MmsValue* value);
288
289
int
290
MmsValue_isDeletable
(MmsValue* value);
291
292
MmsType
293
MmsValue_getType
(MmsValue* value);
294
297
#endif
/* MMS_VALUE_H_ */
Generated on Tue May 14 2013 23:20:13 for libIEC61850 by
1.8.3.1