31 #include "libiec61850_common_api.h"
164 LIB61850_API uint32_t
194 LIB61850_API uint32_t
302 LIB61850_API
const char*
390 LIB61850_API uint32_t
413 LIB61850_API uint32_t
466 LIB61850_API uint8_t*
476 LIB61850_API uint64_t
487 LIB61850_API uint64_t
558 LIB61850_API uint64_t
600 LIB61850_API uint16_t
613 LIB61850_API uint16_t
625 LIB61850_API uint8_t*
782 LIB61850_API uint8_t*
1003 LIB61850_API
const char*
LIB61850_API int MmsVariableSpecification_getMaxEncodedSize(MmsVariableSpecification *self)
Calculate the maximum encoded size of a variable of this type.
LIB61850_API MmsValue * MmsValue_newBinaryTime(bool timeOfDay)
Create a new MmsValue instance of type MMS_BINARYTIME.
LIB61850_API void MmsValue_setBitStringFromIntegerBigEndian(MmsValue *self, uint32_t intValue)
Convert an unsigned integer to a bit string (big endian bit order)
LIB61850_API MmsValue * MmsValue_setUtcTimeMs(MmsValue *self, uint64_t timeval)
Update an MmsValue object of type MMS_UTCTIME with a millisecond time.
LIB61850_API MmsValue * MmsValue_newIntegerFromInt8(int8_t integer)
LIB61850_API float MmsValue_toFloat(const MmsValue *self)
Get the float value of a MmsValue object.
LIB61850_API uint64_t MmsValue_getBinaryTimeAsUtcMs(const MmsValue *self)
Get a millisecond time value from an MmsValue object of type MMS_BINARYTIME.
LIB61850_API void MmsValue_setInt64(MmsValue *value, int64_t integer)
Set the Int64 value of a MmsValue object.
LIB61850_API MmsValue * MmsValue_newBitString(int bitSize)
Create a new MmsValue instance of type MMS_BITSTRING.
LIB61850_API void MmsValue_setBitStringFromInteger(MmsValue *self, uint32_t intValue)
Convert an unsigned integer to a bit string.
LIB61850_API void MmsValue_setOctetString(MmsValue *self, const uint8_t *buf, int size)
Set the value of an MmsValue object of type MMS_OCTET_STRING.
LIB61850_API int MmsValue_getBitStringByteSize(const MmsValue *self)
Get the number of bytes required by this bitString.
LIB61850_API uint8_t * MmsValue_cloneToBuffer(const MmsValue *self, uint8_t *destinationAddress)
Create a (deep) copy of an MmsValue instance in a user provided buffer.
LIB61850_API char * MmsValue_getTypeString(MmsValue *self)
return the value type as a human readable string
LIB61850_API void MmsValue_setDeletable(MmsValue *self)
LIB61850_API MmsValue * MmsValue_decodeMmsDataMaxRecursion(uint8_t *buffer, int bufPos, int bufferLength, int *endBufPos, int maxDepth)
create a new MmsValue instance from a BER encoded MMS Data element (deserialize) with a defined maxim...
LIB61850_API bool MmsValue_equalTypes(const MmsValue *self, const MmsValue *otherValue)
Check if two (complex) instances of MmsValue have the same type.
LIB61850_API bool MmsValue_getBitStringBit(const MmsValue *self, int bitPos)
Get the value of a single bit (set to one) of an MmsType object of type MMS_BITSTRING.
LIB61850_API MmsValue * MmsValue_newMmsString(const char *string)
Create a new MmsValue instance of type MMS_STRING.
LIB61850_API bool MmsValue_update(MmsValue *self, const MmsValue *source)
Update the value of an MmsValue instance by the value of another MmsValue instance.
LIB61850_API void MmsValue_setOctetStringOctet(MmsValue *self, int octetPos, uint8_t value)
Set a single octet of an MmsValue object of type MMS_OCTET_STRING.
LIB61850_API bool MmsValue_getBoolean(const MmsValue *value)
Get the bool value of a MmsValue object.
LIB61850_API int MmsValue_encodeMmsData(MmsValue *self, uint8_t *buffer, int bufPos, bool encode)
Serialize the MmsValue instance as BER encoded MMS Data element.
LIB61850_API MmsValue * MmsValue_newDataAccessError(MmsDataAccessError accessError)
LIB61850_API MmsValue * MmsValue_newBoolean(bool boolean)
LIB61850_API uint8_t MmsValue_getUtcTimeQuality(const MmsValue *self)
get the TimeQuality byte of the UtcTime
LIB61850_API MmsValue * MmsValue_newOctetString(int size, int maxSize)
LIB61850_API void MmsValue_setDeletableRecursive(MmsValue *value)
LIB61850_API MmsDataAccessError MmsValue_getDataAccessError(const MmsValue *self)
LIB61850_API void MmsValue_setVisibleString(MmsValue *self, const char *string)
LIB61850_API int MmsValue_getNumberOfSetBits(const MmsValue *self)
Count the number of set bits in a bit string.
LIB61850_API void MmsValue_setDouble(MmsValue *self, double newFloatValue)
Set the double value of a MmsValue object.
LIB61850_API MmsValue * MmsValue_newStructure(const MmsVariableSpecification *typeSpec)
LIB61850_API int MmsValue_getStringSize(MmsValue *self)
Returns the (maximum) length of the string.
LIB61850_API void MmsValue_setBoolean(MmsValue *value, bool boolValue)
Set the bool value of a MmsValue object.
LIB61850_API int32_t MmsValue_toInt32(const MmsValue *value)
Get the int32_t value of a MmsValue object.
LIB61850_API MmsValue * MmsValue_createEmptyStructure(int size)
LIB61850_API MmsValue * MmsValue_newVisibleString(const char *string)
Create a new MmsValue instance of type MMS_VISIBLE_STRING.
LIB61850_API MmsValue * MmsValue_newInteger(int size)
LIB61850_API void MmsValue_setFloat(MmsValue *self, float newFloatValue)
Set the float value of a MmsValue object.
LIB61850_API uint32_t MmsValue_toUint32(const MmsValue *value)
Get the uint32_t value of a MmsValue object.
LIB61850_API MmsValue * MmsValue_newIntegerFromInt16(int16_t integer)
LIB61850_API MmsValue * MmsValue_newUnsigned(int size)
LIB61850_API bool MmsValue_equals(const MmsValue *self, const MmsValue *otherValue)
Check if two instances of MmsValue have the same value.
LIB61850_API MmsValue * MmsValue_newFloat(float value)
Create a new 32 bit wide float variable and initialize with value.
LIB61850_API MmsValue * MmsValue_newDefaultValue(const MmsVariableSpecification *typeSpec)
LIB61850_API MmsValue * MmsValue_newVisibleStringFromByteArray(const uint8_t *byteArray, int size)
Create a new MmsValue instance of type MMS_VISIBLE_STRING from the specified byte array.
LIB61850_API uint64_t MmsValue_getUtcTimeInMsWithUs(const MmsValue *self, uint32_t *usec)
Get a millisecond time value and optional us part from an MmsValue object of MMS_UTCTIME type.
LIB61850_API int MmsValue_getSizeInMemory(const MmsValue *self)
Determine the required amount of bytes by a clone.
LIB61850_API MmsValue * MmsValue_clone(const MmsValue *self)
Create a (deep) copy of an MmsValue instance.
LIB61850_API void MmsValue_setInt8(MmsValue *value, int8_t integer)
Set the Int8 value of a MmsValue object.
LIB61850_API void MmsValue_setMmsString(MmsValue *value, const char *string)
Set the value of MmsValue instance of type MMS_STRING.
LIB61850_API void MmsValue_setAllBitStringBits(MmsValue *self)
LIB61850_API MmsValue * MmsValue_createArray(const MmsVariableSpecification *elementType, int size)
Create an Array and initialize elements with default values.
LIB61850_API void MmsValue_setUint32(MmsValue *value, uint32_t integer)
Set the UInt32 value of a MmsValue object.
LIB61850_API void MmsValue_setBitStringBit(MmsValue *self, int bitPos, bool value)
Set a single bit (set to one) of an MmsType object of type MMS_BITSTRING.
LIB61850_API void MmsValue_delete(MmsValue *self)
Delete an MmsValue instance.
LIB61850_API void MmsValue_setUtcTimeQuality(MmsValue *self, uint8_t timeQuality)
set the TimeQuality byte of the UtcTime
LIB61850_API MmsValue * MmsValue_setUtcTimeMsEx(MmsValue *self, uint64_t timeval, uint8_t timeQuality)
Update an MmsValue object of type MMS_UTCTIME with a millisecond time.
LIB61850_API const char * MmsValue_toString(MmsValue *self)
Returns the value of an MMS_VISIBLE_STRING object as C string.
LIB61850_API void MmsValue_setUint16(MmsValue *value, uint16_t integer)
Set the UInt16 value of a MmsValue object.
LIB61850_API uint16_t MmsValue_getOctetStringSize(const MmsValue *self)
Returns the size in bytes of an MmsValue object of type MMS_OCTET_STRING.
LIB61850_API MmsValue * MmsValue_newDouble(double value)
Create a new 64 bit wide float variable and initialize with value.
LIB61850_API uint16_t MmsValue_getOctetStringMaxSize(MmsValue *self)
Returns the maximum size in bytes of an MmsValue object of type MMS_OCTET_STRING.
LIB61850_API void MmsValue_setBinaryTime(MmsValue *self, uint64_t timestamp)
Update an MmsValue object of type MMS_BINARYTIME with a millisecond time.
LIB61850_API void MmsValue_setInt32(MmsValue *self, int32_t integer)
Set the Int32 value of a MmsValue object.
LIB61850_API MmsValue * MmsValue_getElement(const MmsValue *array, int index)
Get an element of an array or structure.
LIB61850_API MmsValue * MmsValue_newIntegerFromInt64(int64_t integer)
LIB61850_API int MmsValue_getBitStringSize(const MmsValue *self)
Get the size of a bit string in bits.
LIB61850_API uint32_t MmsValue_toUnixTimestamp(const MmsValue *self)
Get the unix timestamp of a MmsValue object of type MMS_UTCTIME.
struct sMmsValue MmsValue
Definition: mms_value.h:68
LIB61850_API MmsValue * MmsValue_newUtcTime(uint32_t timeval)
Create a new MmsValue instance of type MMS_UTCTIME.
LIB61850_API void MmsValue_deleteConditional(MmsValue *value)
Delete an MmsValue instance.
LIB61850_API MmsValue * MmsValue_newMmsStringWithSize(int size)
Create a new MmsValue instance of type MMS_STRING.
LIB61850_API MmsValue * MmsValue_newVisibleStringWithSize(int size)
Create a new MmsValue instance of type MMS_VISIBLE_STRING.
LIB61850_API void MmsValue_setInt16(MmsValue *value, int16_t integer)
Set the Int16 value of a MmsValue object.
LIB61850_API uint32_t MmsValue_getArraySize(const MmsValue *self)
Get the size of an array.
LIB61850_API MmsValue * MmsValue_createEmptyArray(int size)
Create an emtpy array.
LIB61850_API uint8_t * MmsValue_getUtcTimeBuffer(MmsValue *self)
return the raw buffer containing the UTC time data
LIB61850_API MmsType MmsValue_getType(const MmsValue *self)
Get the MmsType of an MmsValue instance.
LIB61850_API void MmsValue_deleteAllBitStringBits(MmsValue *self)
Delete all bits (set to zero) of an MmsType object of type MMS_BITSTRING.
LIB61850_API int MmsValue_isDeletable(MmsValue *self)
Check if the MmsValue instance has the deletable flag set.
LIB61850_API MmsValue * MmsValue_setUtcTime(MmsValue *self, uint32_t timeval)
Update an MmsValue object of UtcTime type with a timestamp in s.
LIB61850_API uint8_t * MmsValue_getOctetStringBuffer(MmsValue *self)
Returns the reference to the internally hold buffer of an MmsValue object of type MMS_OCTET_STRING.
LIB61850_API uint32_t MmsValue_getBitStringAsInteger(const MmsValue *self)
Convert a bit string to an unsigned integer.
LIB61850_API void MmsValue_setUtcTimeByBuffer(MmsValue *self, const uint8_t *buffer)
Update an MmsValue object of type MMS_UTCTIME with a buffer containing a BER encoded UTCTime.
LIB61850_API void MmsValue_setElement(MmsValue *complexValue, int index, MmsValue *elementValue)
Set an element of a complex type.
LIB61850_API MmsValue * MmsValue_newMmsStringFromByteArray(const uint8_t *byteArray, int size)
Create a new MmsValue instance of type MMS_STRING from the specified byte array.
MmsDataAccessError
Definition: mms_value.h:46
LIB61850_API double MmsValue_toDouble(const MmsValue *self)
Get the double value of a MmsValue object.
LIB61850_API uint8_t MmsValue_getOctetStringOctet(MmsValue *self, int octetPos)
Get the value of a single octet of an MmsType object of type MMS_OCTET_STRING.
LIB61850_API const char * MmsValue_printToBuffer(const MmsValue *self, char *buffer, int bufferSize)
create a string representation of the MmsValue object in the provided buffer
LIB61850_API MmsValue * MmsValue_decodeMmsData(uint8_t *buffer, int bufPos, int bufferLength, int *endBufPos)
create a new MmsValue instance from a BER encoded MMS Data element (deserialize)
LIB61850_API int64_t MmsValue_toInt64(const MmsValue *self)
Get the int64_t value of a MmsValue object.
LIB61850_API uint32_t MmsValue_getBitStringAsIntegerBigEndian(const MmsValue *self)
Convert a bit string to an unsigned integer (big endian bit order)
LIB61850_API MmsValue * MmsValue_getSubElement(MmsValue *self, MmsVariableSpecification *varSpec, char *mmsPath)
Get a sub-element of a MMS_STRUCTURE value specified by a path name.
LIB61850_API MmsValue * MmsValue_newUtcTimeByMsTime(uint64_t timeval)
Create a new MmsValue instance of type MMS_UTCTIME.
LIB61850_API int MmsValue_getMaxEncodedSize(MmsValue *self)
Get the maximum possible BER encoded size of the MMS data element.
LIB61850_API MmsValue * MmsValue_newUnsignedFromUint32(uint32_t integer)
LIB61850_API uint64_t MmsValue_getUtcTimeInMs(const MmsValue *value)
Get a millisecond time value from an MmsValue object of MMS_UTCTIME type.
LIB61850_API void MmsValue_setUint8(MmsValue *value, uint8_t integer)
Set the UInt8 value of a MmsValue object.
LIB61850_API MmsValue * MmsValue_newIntegerFromInt32(int32_t integer)
@ DATA_ACCESS_ERROR_TYPE_INCONSISTENT
Definition: mms_value.h:57
@ DATA_ACCESS_ERROR_OBJECT_ACCESS_UNSUPPORTED
Definition: mms_value.h:59
@ DATA_ACCESS_ERROR_SUCCESS
Definition: mms_value.h:49
@ DATA_ACCESS_ERROR_HARDWARE_FAULT
Definition: mms_value.h:51
@ DATA_ACCESS_ERROR_TEMPORARILY_UNAVAILABLE
Definition: mms_value.h:52
@ DATA_ACCESS_ERROR_NO_RESPONSE
Definition: mms_value.h:48
@ DATA_ACCESS_ERROR_OBJECT_UNDEFINED
Definition: mms_value.h:54
@ DATA_ACCESS_ERROR_INVALID_ADDRESS
Definition: mms_value.h:55
@ DATA_ACCESS_ERROR_OBJECT_VALUE_INVALID
Definition: mms_value.h:61
@ DATA_ACCESS_ERROR_UNKNOWN
Definition: mms_value.h:62
@ DATA_ACCESS_ERROR_TYPE_UNSUPPORTED
Definition: mms_value.h:56
@ DATA_ACCESS_ERROR_OBJECT_ACCESS_DENIED
Definition: mms_value.h:53
@ DATA_ACCESS_ERROR_OBJECT_INVALIDATED
Definition: mms_value.h:50
@ DATA_ACCESS_ERROR_SUCCESS_NO_UPDATE
Definition: mms_value.h:47
@ DATA_ACCESS_ERROR_OBJECT_ATTRIBUTE_INCONSISTENT
Definition: mms_value.h:58
@ DATA_ACCESS_ERROR_OBJECT_NONE_EXISTENT
Definition: mms_value.h:60
MmsType
Definition: mms_common.h:106