24 #ifndef IEC61850_COMMON_H_
25 #define IEC61850_COMMON_H_
32 #include "libiec61850_common_api.h"
42 #define IEC_61850_EDITION_1 0
45 #define IEC_61850_EDITION_2 1
48 #define IEC_61850_EDITION_2_1 2
55 uint8_t dstAddress[6];
112 #define TRG_OPT_DATA_CHANGED 1
115 #define TRG_OPT_QUALITY_CHANGED 2
118 #define TRG_OPT_DATA_UPDATE 4
121 #define TRG_OPT_INTEGRITY 8
124 #define TRG_OPT_GI 16
127 #define TRG_OPT_TRANSIENT 128
139 #define RPT_OPT_SEQ_NUM 1
142 #define RPT_OPT_TIME_STAMP 2
145 #define RPT_OPT_REASON_FOR_INCLUSION 4
148 #define RPT_OPT_DATA_SET 8
151 #define RPT_OPT_DATA_REFERENCE 16
154 #define RPT_OPT_BUFFER_OVERFLOW 32
157 #define RPT_OPT_ENTRY_ID 64
160 #define RPT_OPT_CONF_REV 128
170 #define CONTROL_ORCAT_NOT_SUPPORTED 0
173 #define CONTROL_ORCAT_BAY_CONTROL 1
176 #define CONTROL_ORCAT_STATION_CONTROL 2
179 #define CONTROL_ORCAT_REMOTE_CONTROL 3
182 #define CONTROL_ORCAT_AUTOMATIC_BAY 4
185 #define CONTROL_ORCAT_AUTOMATIC_STATION 5
188 #define CONTROL_ORCAT_AUTOMATIC_REMOTE 6
191 #define CONTROL_ORCAT_MAINTENANCE 7
194 #define CONTROL_ORCAT_PROCESS 8
260 typedef enum eFunctionalConstraint {
329 #define QUALITY_VALIDITY_GOOD 0
330 #define QUALITY_VALIDITY_INVALID 2
331 #define QUALITY_VALIDITY_RESERVED 1
332 #define QUALITY_VALIDITY_QUESTIONABLE 3
334 #define QUALITY_DETAIL_OVERFLOW 4
335 #define QUALITY_DETAIL_OUT_OF_RANGE 8
336 #define QUALITY_DETAIL_BAD_REFERENCE 16
337 #define QUALITY_DETAIL_OSCILLATORY 32
338 #define QUALITY_DETAIL_FAILURE 64
339 #define QUALITY_DETAIL_OLD_DATA 128
340 #define QUALITY_DETAIL_INCONSISTENT 256
341 #define QUALITY_DETAIL_INACCURATE 512
343 #define QUALITY_SOURCE_SUBSTITUTED 1024
345 #define QUALITY_TEST 2048
347 #define QUALITY_OPERATOR_BLOCKED 4096
349 #define QUALITY_DERIVED 8192
433 LIB61850_API uint32_t
436 LIB61850_API msSinceEpoch
439 LIB61850_API nsSinceEpoch
466 LIB61850_API uint32_t
ControlAddCause
Definition: iec61850_common.h:205
@ ADD_CAUSE_ABORTION_BY_COMMUNICATION_LOSS
Definition: iec61850_common.h:229
@ ADD_CAUSE_BLOCKED_BY_INTERLOCKING
Definition: iec61850_common.h:216
@ ADD_CAUSE_UNKNOWN
Definition: iec61850_common.h:206
@ ADD_CAUSE_OBJECT_ALREADY_SELECTED
Definition: iec61850_common.h:225
@ ADD_CAUSE_SELECT_FAILED
Definition: iec61850_common.h:209
@ ADD_CAUSE_ABORTION_BY_CANCEL
Definition: iec61850_common.h:221
@ ADD_CAUSE_BLOCKED_BY_PROCESS
Definition: iec61850_common.h:215
@ ADD_CAUSE_COMMAND_ALREADY_IN_EXECUTION
Definition: iec61850_common.h:218
@ ADD_CAUSE_ABORTION_BY_TRIP
Definition: iec61850_common.h:223
@ ADD_CAUSE_OBJECT_NOT_SELECTED
Definition: iec61850_common.h:224
@ ADD_CAUSE_BLOCKED_BY_SYNCHROCHECK
Definition: iec61850_common.h:217
@ ADD_CAUSE_BLOCKED_BY_SWITCHING_HIERARCHY
Definition: iec61850_common.h:208
@ ADD_CAUSE_INVALID_POSITION
Definition: iec61850_common.h:210
@ ADD_CAUSE_STEP_LIMIT
Definition: iec61850_common.h:213
@ ADD_CAUSE_NO_ACCESS_AUTHORITY
Definition: iec61850_common.h:226
@ ADD_CAUSE_PARAMETER_CHANGE_IN_EXECUTION
Definition: iec61850_common.h:212
@ ADD_CAUSE_ENDED_WITH_OVERSHOOT
Definition: iec61850_common.h:227
@ ADD_CAUSE_ABORTION_BY_COMMAND
Definition: iec61850_common.h:230
@ ADD_CAUSE_TIME_LIMIT_OVER
Definition: iec61850_common.h:222
@ ADD_CAUSE_BLOCKED_BY_HEALTH
Definition: iec61850_common.h:219
@ ADD_CAUSE_LOCKED_BY_OTHER_CLIENT
Definition: iec61850_common.h:233
@ ADD_CAUSE_1_OF_N_CONTROL
Definition: iec61850_common.h:220
@ ADD_CAUSE_ABORTION_DUE_TO_DEVIATION
Definition: iec61850_common.h:228
@ ADD_CAUSE_NOT_SUPPORTED
Definition: iec61850_common.h:207
@ ADD_CAUSE_BLOCKED_BY_MODE
Definition: iec61850_common.h:214
@ ADD_CAUSE_NONE
Definition: iec61850_common.h:231
@ ADD_CAUSE_INCONSISTENT_PARAMETERS
Definition: iec61850_common.h:232
@ ADD_CAUSE_POSITION_REACHED
Definition: iec61850_common.h:211
ControlLastApplError
Definition: iec61850_common.h:244
@ CONTROL_ERROR_TIMEOUT_TEST
Definition: iec61850_common.h:247
@ CONTROL_ERROR_NO_ERROR
Definition: iec61850_common.h:245
@ CONTROL_ERROR_OPERATOR_TEST
Definition: iec61850_common.h:248
@ CONTROL_ERROR_UNKNOWN
Definition: iec61850_common.h:246
LIB61850_API Dbpos Dbpos_fromMmsValue(const MmsValue *mmsValue)
convert MMS bit string to Dbpos enumeration type
Dbpos
Definition: iec61850_common.h:380
LIB61850_API MmsValue * Dbpos_toMmsValue(MmsValue *mmsValue, Dbpos dbpos)
conver Dbpos to MMS bit string
@ DBPOS_BAD_STATE
Definition: iec61850_common.h:384
@ DBPOS_ON
Definition: iec61850_common.h:383
@ DBPOS_OFF
Definition: iec61850_common.h:382
@ DBPOS_INTERMEDIATE_STATE
Definition: iec61850_common.h:381
LIB61850_API char * FunctionalConstraint_toString(FunctionalConstraint fc)
convert a function constraint to a static string
LIB61850_API FunctionalConstraint FunctionalConstraint_fromString(const char *fcString)
parse a string treated as a functional constraint representation
FunctionalConstraint
Definition: iec61850_common.h:260
@ IEC61850_FC_BL
Definition: iec61850_common.h:282
@ IEC61850_FC_SE
Definition: iec61850_common.h:276
@ IEC61850_FC_US
Definition: iec61850_common.h:288
@ IEC61850_FC_SP
Definition: iec61850_common.h:266
@ IEC61850_FC_MX
Definition: iec61850_common.h:264
@ IEC61850_FC_LG
Definition: iec61850_common.h:296
@ IEC61850_FC_SV
Definition: iec61850_common.h:268
@ IEC61850_FC_BR
Definition: iec61850_common.h:294
@ IEC61850_FC_OR
Definition: iec61850_common.h:280
@ IEC61850_FC_SR
Definition: iec61850_common.h:278
@ IEC61850_FC_EX
Definition: iec61850_common.h:284
@ IEC61850_FC_ALL
Definition: iec61850_common.h:301
@ IEC61850_FC_SG
Definition: iec61850_common.h:274
@ IEC61850_FC_DC
Definition: iec61850_common.h:272
@ IEC61850_FC_MS
Definition: iec61850_common.h:290
@ IEC61850_FC_GO
Definition: iec61850_common.h:298
@ IEC61850_FC_NONE
Definition: iec61850_common.h:302
@ IEC61850_FC_CO
Definition: iec61850_common.h:286
@ IEC61850_FC_CF
Definition: iec61850_common.h:270
@ IEC61850_FC_ST
Definition: iec61850_common.h:262
@ IEC61850_FC_RP
Definition: iec61850_common.h:292
struct sMmsValue MmsValue
Definition: mms_value.h:68
uint16_t Validity
Definition: iec61850_common.h:327
LIB61850_API Quality Quality_fromMmsValue(const MmsValue *mmsValue)
LIB61850_API void Quality_setValidity(Quality *self, Validity validity)
uint16_t Quality
Definition: iec61850_common.h:326
LIB61850_API bool Quality_isFlagSet(Quality *self, int flag)
LIB61850_API void Quality_setFlag(Quality *self, int flag)
LIB61850_API void Quality_unsetFlag(Quality *self, int flag)
LIB61850_API Validity Quality_getValidity(Quality *self)
LIB61850_API MmsValue * Quality_toMmsValue(Quality *self, MmsValue *mmsValue)
LIB61850_API msSinceEpoch Timestamp_getTimeInMs(Timestamp *self)
LIB61850_API void Timestamp_setFractionOfSecondPart(Timestamp *self, uint32_t fractionOfSecond)
LIB61850_API void Timestamp_setSubsecondPrecision(Timestamp *self, int subsecondPrecision)
Set the subsecond precision value of the time stamp.
LIB61850_API void Timestamp_setClockFailure(Timestamp *self, bool value)
LIB61850_API Timestamp * Timestamp_create(void)
LIB61850_API void Timestamp_setByMmsUtcTime(Timestamp *self, const MmsValue *mmsValue)
LIB61850_API nsSinceEpoch Timestamp_getTimeInNs(Timestamp *self)
LIB61850_API int Timestamp_getSubsecondPrecision(Timestamp *self)
LIB61850_API void Timestamp_destroy(Timestamp *self)
LIB61850_API void Timestamp_setClockNotSynchronized(Timestamp *self, bool value)
LIB61850_API void Timestamp_setTimeInMilliseconds(Timestamp *self, msSinceEpoch msTime)
Set the time in milliseconds.
LIB61850_API Timestamp * Timestamp_fromMmsValue(Timestamp *self, MmsValue *mmsValue)
Get the Timestamp value from an MmsValue instance of type MMS_UTC_TIME.
LIB61850_API MmsValue * Timestamp_toMmsValue(Timestamp *self, MmsValue *mmsValue)
Set an MmsValue instance of type UTCTime to the timestamp value.
LIB61850_API float Timestamp_getFractionOfSecond(Timestamp *self)
LIB61850_API bool Timestamp_isClockNotSynchronized(Timestamp *self)
LIB61850_API bool Timestamp_hasClockFailure(Timestamp *self)
LIB61850_API uint32_t Timestamp_getFractionOfSecondPart(Timestamp *self)
LIB61850_API Timestamp * Timestamp_createFromByteArray(const uint8_t *byteArray)
LIB61850_API void Timestamp_setTimeInNanoseconds(Timestamp *self, nsSinceEpoch nsTime)
Set the time in nanoseconds.
LIB61850_API void Timestamp_setTimeInSeconds(Timestamp *self, uint32_t secondsSinceEpoch)
Set the time in seconds.
LIB61850_API void Timestamp_setLeapSecondKnown(Timestamp *self, bool value)
LIB61850_API char * LibIEC61850_getVersionString(void)
Get the version of the library as string.
LIB61850_API bool Timestamp_isLeapSecondKnown(Timestamp *self)
LIB61850_API uint32_t Timestamp_getTimeInSeconds(Timestamp *self)
LIB61850_API void Timestamp_clearFlags(Timestamp *self)
ACSIClass
Definition: iec61850_common.h:59
ControlModel
Control model (represented by "ctlModel" attribute)
Definition: iec61850_common.h:76
@ ACSI_CLASS_URCB
Definition: iec61850_common.h:63
@ ACSI_CLASS_DATA_SET
Definition: iec61850_common.h:61
@ ACSI_CLASS_BRCB
Definition: iec61850_common.h:62
@ ACSI_CLASS_MSVCB
Definition: iec61850_common.h:69
@ ACSI_CLASS_DATA_OBJECT
Definition: iec61850_common.h:60
@ ACSI_CLASS_GsCB
Definition: iec61850_common.h:68
@ ACSI_CLASS_LCB
Definition: iec61850_common.h:64
@ ACSI_CLASS_SGCB
Definition: iec61850_common.h:66
@ ACSI_CLASS_GoCB
Definition: iec61850_common.h:67
@ ACSI_CLASS_USVCB
Definition: iec61850_common.h:70
@ ACSI_CLASS_LOG
Definition: iec61850_common.h:65
@ CONTROL_MODEL_DIRECT_ENHANCED
Definition: iec61850_common.h:97
@ CONTROL_MODEL_STATUS_ONLY
Definition: iec61850_common.h:80
@ CONTROL_MODEL_DIRECT_NORMAL
Definition: iec61850_common.h:86
@ CONTROL_MODEL_SBO_ENHANCED
Definition: iec61850_common.h:102
@ CONTROL_MODEL_SBO_NORMAL
Definition: iec61850_common.h:92
Definition: iec61850_common.h:51
uint8_t vlanPriority
Definition: iec61850_common.h:52
uint16_t vlanId
Definition: iec61850_common.h:53
uint16_t appId
Definition: iec61850_common.h:54
Definition: iec61850_common.h:417