libiec61850  1.6.0
Typedefs | Enumerations | Functions
MmsValue data type definition and handling functions

Typedefs

typedef struct sMmsValue MmsValue
 

Enumerations

enum  MmsDataAccessError {
  DATA_ACCESS_ERROR_SUCCESS_NO_UPDATE = -3 , DATA_ACCESS_ERROR_NO_RESPONSE = -2 , DATA_ACCESS_ERROR_SUCCESS = -1 , DATA_ACCESS_ERROR_OBJECT_INVALIDATED = 0 ,
  DATA_ACCESS_ERROR_HARDWARE_FAULT = 1 , DATA_ACCESS_ERROR_TEMPORARILY_UNAVAILABLE = 2 , DATA_ACCESS_ERROR_OBJECT_ACCESS_DENIED = 3 , DATA_ACCESS_ERROR_OBJECT_UNDEFINED = 4 ,
  DATA_ACCESS_ERROR_INVALID_ADDRESS = 5 , DATA_ACCESS_ERROR_TYPE_UNSUPPORTED = 6 , DATA_ACCESS_ERROR_TYPE_INCONSISTENT = 7 , DATA_ACCESS_ERROR_OBJECT_ATTRIBUTE_INCONSISTENT = 8 ,
  DATA_ACCESS_ERROR_OBJECT_ACCESS_UNSUPPORTED = 9 , DATA_ACCESS_ERROR_OBJECT_NONE_EXISTENT = 10 , DATA_ACCESS_ERROR_OBJECT_VALUE_INVALID = 11 , DATA_ACCESS_ERROR_UNKNOWN = 12
}
 

Functions

LIB61850_API MmsValueMmsValue_createArray (const MmsVariableSpecification *elementType, int size)
 Create an Array and initialize elements with default values. More...
 
LIB61850_API uint32_t MmsValue_getArraySize (const MmsValue *self)
 Get the size of an array. More...
 
LIB61850_API MmsValueMmsValue_getElement (const MmsValue *array, int index)
 Get an element of an array or structure. More...
 
LIB61850_API MmsValueMmsValue_createEmptyArray (int size)
 Create an emtpy array. More...
 
LIB61850_API void MmsValue_setElement (MmsValue *complexValue, int index, MmsValue *elementValue)
 Set an element of a complex type. More...
 
LIB61850_API MmsDataAccessError MmsValue_getDataAccessError (const MmsValue *self)
 
LIB61850_API int64_t MmsValue_toInt64 (const MmsValue *self)
 Get the int64_t value of a MmsValue object. More...
 
LIB61850_API int32_t MmsValue_toInt32 (const MmsValue *value)
 Get the int32_t value of a MmsValue object. More...
 
LIB61850_API uint32_t MmsValue_toUint32 (const MmsValue *value)
 Get the uint32_t value of a MmsValue object. More...
 
LIB61850_API double MmsValue_toDouble (const MmsValue *self)
 Get the double value of a MmsValue object. More...
 
LIB61850_API float MmsValue_toFloat (const MmsValue *self)
 Get the float value of a MmsValue object. More...
 
LIB61850_API uint32_t MmsValue_toUnixTimestamp (const MmsValue *self)
 Get the unix timestamp of a MmsValue object of type MMS_UTCTIME. More...
 
LIB61850_API void MmsValue_setFloat (MmsValue *self, float newFloatValue)
 Set the float value of a MmsValue object. More...
 
LIB61850_API void MmsValue_setDouble (MmsValue *self, double newFloatValue)
 Set the double value of a MmsValue object. More...
 
LIB61850_API void MmsValue_setInt8 (MmsValue *value, int8_t integer)
 Set the Int8 value of a MmsValue object. More...
 
LIB61850_API void MmsValue_setInt16 (MmsValue *value, int16_t integer)
 Set the Int16 value of a MmsValue object. More...
 
LIB61850_API void MmsValue_setInt32 (MmsValue *self, int32_t integer)
 Set the Int32 value of a MmsValue object. More...
 
LIB61850_API void MmsValue_setInt64 (MmsValue *value, int64_t integer)
 Set the Int64 value of a MmsValue object. More...
 
LIB61850_API void MmsValue_setUint8 (MmsValue *value, uint8_t integer)
 Set the UInt8 value of a MmsValue object. More...
 
LIB61850_API void MmsValue_setUint16 (MmsValue *value, uint16_t integer)
 Set the UInt16 value of a MmsValue object. More...
 
LIB61850_API void MmsValue_setUint32 (MmsValue *value, uint32_t integer)
 Set the UInt32 value of a MmsValue object. More...
 
LIB61850_API void MmsValue_setBoolean (MmsValue *value, bool boolValue)
 Set the bool value of a MmsValue object. More...
 
LIB61850_API bool MmsValue_getBoolean (const MmsValue *value)
 Get the bool value of a MmsValue object. More...
 
LIB61850_API const char * MmsValue_toString (MmsValue *self)
 Returns the value of an MMS_VISIBLE_STRING object as C string. More...
 
LIB61850_API int MmsValue_getStringSize (MmsValue *self)
 Returns the (maximum) length of the string. More...
 
LIB61850_API void MmsValue_setVisibleString (MmsValue *self, const char *string)
 
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. More...
 
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. More...
 
LIB61850_API void MmsValue_deleteAllBitStringBits (MmsValue *self)
 Delete all bits (set to zero) of an MmsType object of type MMS_BITSTRING. More...
 
LIB61850_API int MmsValue_getBitStringSize (const MmsValue *self)
 Get the size of a bit string in bits. More...
 
LIB61850_API int MmsValue_getBitStringByteSize (const MmsValue *self)
 Get the number of bytes required by this bitString. More...
 
LIB61850_API int MmsValue_getNumberOfSetBits (const MmsValue *self)
 Count the number of set bits in a bit string. More...
 
LIB61850_API void MmsValue_setAllBitStringBits (MmsValue *self)
 
LIB61850_API uint32_t MmsValue_getBitStringAsInteger (const MmsValue *self)
 Convert a bit string to an unsigned integer. More...
 
LIB61850_API void MmsValue_setBitStringFromInteger (MmsValue *self, uint32_t intValue)
 Convert an unsigned integer to a bit string. More...
 
LIB61850_API uint32_t MmsValue_getBitStringAsIntegerBigEndian (const MmsValue *self)
 Convert a bit string to an unsigned integer (big endian bit order) More...
 
LIB61850_API void MmsValue_setBitStringFromIntegerBigEndian (MmsValue *self, uint32_t intValue)
 Convert an unsigned integer to a bit string (big endian bit order) More...
 
LIB61850_API MmsValueMmsValue_setUtcTime (MmsValue *self, uint32_t timeval)
 Update an MmsValue object of UtcTime type with a timestamp in s. More...
 
LIB61850_API MmsValueMmsValue_setUtcTimeMs (MmsValue *self, uint64_t timeval)
 Update an MmsValue object of type MMS_UTCTIME with a millisecond time. More...
 
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. More...
 
LIB61850_API uint8_t * MmsValue_getUtcTimeBuffer (MmsValue *self)
 return the raw buffer containing the UTC time data More...
 
LIB61850_API uint64_t MmsValue_getUtcTimeInMs (const MmsValue *value)
 Get a millisecond time value from an MmsValue object of MMS_UTCTIME type. More...
 
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. More...
 
LIB61850_API void MmsValue_setUtcTimeQuality (MmsValue *self, uint8_t timeQuality)
 set the TimeQuality byte of the UtcTime More...
 
LIB61850_API MmsValueMmsValue_setUtcTimeMsEx (MmsValue *self, uint64_t timeval, uint8_t timeQuality)
 Update an MmsValue object of type MMS_UTCTIME with a millisecond time. More...
 
LIB61850_API uint8_t MmsValue_getUtcTimeQuality (const MmsValue *self)
 get the TimeQuality byte of the UtcTime More...
 
LIB61850_API void MmsValue_setBinaryTime (MmsValue *self, uint64_t timestamp)
 Update an MmsValue object of type MMS_BINARYTIME with a millisecond time. More...
 
LIB61850_API uint64_t MmsValue_getBinaryTimeAsUtcMs (const MmsValue *self)
 Get a millisecond time value from an MmsValue object of type MMS_BINARYTIME. More...
 
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. More...
 
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. More...
 
LIB61850_API uint16_t MmsValue_getOctetStringSize (const MmsValue *self)
 Returns the size in bytes of an MmsValue object of type MMS_OCTET_STRING. More...
 
LIB61850_API uint16_t MmsValue_getOctetStringMaxSize (MmsValue *self)
 Returns the maximum size in bytes of an MmsValue object of type MMS_OCTET_STRING. More...
 
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. More...
 
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. More...
 
LIB61850_API bool MmsValue_update (MmsValue *self, const MmsValue *source)
 Update the value of an MmsValue instance by the value of another MmsValue instance. More...
 
LIB61850_API bool MmsValue_equals (const MmsValue *self, const MmsValue *otherValue)
 Check if two instances of MmsValue have the same value. More...
 
LIB61850_API bool MmsValue_equalTypes (const MmsValue *self, const MmsValue *otherValue)
 Check if two (complex) instances of MmsValue have the same type. More...
 
LIB61850_API MmsValueMmsValue_newDataAccessError (MmsDataAccessError accessError)
 
LIB61850_API MmsValueMmsValue_newInteger (int size)
 
LIB61850_API MmsValueMmsValue_newUnsigned (int size)
 
LIB61850_API MmsValueMmsValue_newBoolean (bool boolean)
 
LIB61850_API MmsValueMmsValue_newBitString (int bitSize)
 Create a new MmsValue instance of type MMS_BITSTRING. More...
 
LIB61850_API MmsValueMmsValue_newOctetString (int size, int maxSize)
 
LIB61850_API MmsValueMmsValue_newStructure (const MmsVariableSpecification *typeSpec)
 
LIB61850_API MmsValueMmsValue_createEmptyStructure (int size)
 
LIB61850_API MmsValueMmsValue_newDefaultValue (const MmsVariableSpecification *typeSpec)
 
LIB61850_API MmsValueMmsValue_newIntegerFromInt8 (int8_t integer)
 
LIB61850_API MmsValueMmsValue_newIntegerFromInt16 (int16_t integer)
 
LIB61850_API MmsValueMmsValue_newIntegerFromInt32 (int32_t integer)
 
LIB61850_API MmsValueMmsValue_newIntegerFromInt64 (int64_t integer)
 
LIB61850_API MmsValueMmsValue_newUnsignedFromUint32 (uint32_t integer)
 
LIB61850_API MmsValueMmsValue_newFloat (float value)
 Create a new 32 bit wide float variable and initialize with value. More...
 
LIB61850_API MmsValueMmsValue_newDouble (double value)
 Create a new 64 bit wide float variable and initialize with value. More...
 
LIB61850_API MmsValueMmsValue_clone (const MmsValue *self)
 Create a (deep) copy of an MmsValue instance. More...
 
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. More...
 
LIB61850_API int MmsValue_getSizeInMemory (const MmsValue *self)
 Determine the required amount of bytes by a clone. More...
 
LIB61850_API void MmsValue_delete (MmsValue *self)
 Delete an MmsValue instance. More...
 
LIB61850_API void MmsValue_deleteConditional (MmsValue *value)
 Delete an MmsValue instance. More...
 
LIB61850_API MmsValueMmsValue_newVisibleString (const char *string)
 Create a new MmsValue instance of type MMS_VISIBLE_STRING. More...
 
LIB61850_API MmsValueMmsValue_newVisibleStringWithSize (int size)
 Create a new MmsValue instance of type MMS_VISIBLE_STRING. More...
 
LIB61850_API MmsValueMmsValue_newMmsStringWithSize (int size)
 Create a new MmsValue instance of type MMS_STRING. More...
 
LIB61850_API MmsValueMmsValue_newBinaryTime (bool timeOfDay)
 Create a new MmsValue instance of type MMS_BINARYTIME. More...
 
LIB61850_API MmsValueMmsValue_newVisibleStringFromByteArray (const uint8_t *byteArray, int size)
 Create a new MmsValue instance of type MMS_VISIBLE_STRING from the specified byte array. More...
 
LIB61850_API MmsValueMmsValue_newMmsStringFromByteArray (const uint8_t *byteArray, int size)
 Create a new MmsValue instance of type MMS_STRING from the specified byte array. More...
 
LIB61850_API MmsValueMmsValue_newMmsString (const char *string)
 Create a new MmsValue instance of type MMS_STRING. More...
 
LIB61850_API void MmsValue_setMmsString (MmsValue *value, const char *string)
 Set the value of MmsValue instance of type MMS_STRING. More...
 
LIB61850_API MmsValueMmsValue_newUtcTime (uint32_t timeval)
 Create a new MmsValue instance of type MMS_UTCTIME. More...
 
LIB61850_API MmsValueMmsValue_newUtcTimeByMsTime (uint64_t timeval)
 Create a new MmsValue instance of type MMS_UTCTIME. More...
 
LIB61850_API void MmsValue_setDeletable (MmsValue *self)
 
LIB61850_API void MmsValue_setDeletableRecursive (MmsValue *value)
 
LIB61850_API int MmsValue_isDeletable (MmsValue *self)
 Check if the MmsValue instance has the deletable flag set. More...
 
LIB61850_API MmsType MmsValue_getType (const MmsValue *self)
 Get the MmsType of an MmsValue instance. More...
 
LIB61850_API MmsValueMmsValue_getSubElement (MmsValue *self, MmsVariableSpecification *varSpec, char *mmsPath)
 Get a sub-element of a MMS_STRUCTURE value specified by a path name. More...
 
LIB61850_API char * MmsValue_getTypeString (MmsValue *self)
 return the value type as a human readable string More...
 
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 More...
 
LIB61850_API MmsValueMmsValue_decodeMmsData (uint8_t *buffer, int bufPos, int bufferLength, int *endBufPos)
 create a new MmsValue instance from a BER encoded MMS Data element (deserialize) More...
 
LIB61850_API MmsValueMmsValue_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 maximum recursion depth More...
 
LIB61850_API int MmsValue_encodeMmsData (MmsValue *self, uint8_t *buffer, int bufPos, bool encode)
 Serialize the MmsValue instance as BER encoded MMS Data element. More...
 
LIB61850_API int MmsValue_getMaxEncodedSize (MmsValue *self)
 Get the maximum possible BER encoded size of the MMS data element. More...
 
LIB61850_API int MmsVariableSpecification_getMaxEncodedSize (MmsVariableSpecification *self)
 Calculate the maximum encoded size of a variable of this type. More...
 

Detailed Description

Typedef Documentation

◆ MmsValue

typedef struct sMmsValue MmsValue

MmsValue - complex value type for MMS Client API

Enumeration Type Documentation

◆ MmsDataAccessError

Enumerator
DATA_ACCESS_ERROR_SUCCESS_NO_UPDATE 
DATA_ACCESS_ERROR_NO_RESPONSE 
DATA_ACCESS_ERROR_SUCCESS 
DATA_ACCESS_ERROR_OBJECT_INVALIDATED 
DATA_ACCESS_ERROR_HARDWARE_FAULT 
DATA_ACCESS_ERROR_TEMPORARILY_UNAVAILABLE 
DATA_ACCESS_ERROR_OBJECT_ACCESS_DENIED 
DATA_ACCESS_ERROR_OBJECT_UNDEFINED 
DATA_ACCESS_ERROR_INVALID_ADDRESS 
DATA_ACCESS_ERROR_TYPE_UNSUPPORTED 
DATA_ACCESS_ERROR_TYPE_INCONSISTENT 
DATA_ACCESS_ERROR_OBJECT_ATTRIBUTE_INCONSISTENT 
DATA_ACCESS_ERROR_OBJECT_ACCESS_UNSUPPORTED 
DATA_ACCESS_ERROR_OBJECT_NONE_EXISTENT 
DATA_ACCESS_ERROR_OBJECT_VALUE_INVALID 
DATA_ACCESS_ERROR_UNKNOWN 

Function Documentation

◆ MmsValue_clone()

LIB61850_API MmsValue* MmsValue_clone ( const MmsValue self)

Create a (deep) copy of an MmsValue instance.

This operation will allocate dynamic memory. It is up to the caller to free this memory by calling MmsValue_delete() later.

Parameters
selfthe MmsValue instance that will be cloned
Returns
an MmsValue instance that is an exact copy of the given instance.

◆ MmsValue_cloneToBuffer()

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.

This operation copies the give MmsValue instance to a user provided buffer.

Parameters
selfthe MmsValue instance that will be cloned
destinationAddressthe start address of the user provided buffer
Returns
a pointer to the position in the buffer just after the last byte written.

◆ MmsValue_createArray()

LIB61850_API MmsValue* MmsValue_createArray ( const MmsVariableSpecification *  elementType,
int  size 
)

Create an Array and initialize elements with default values.

Parameters
elementTypetype description for the elements the new array
sizethe size of the new array
Returns
a newly created array instance

◆ MmsValue_createEmptyArray()

LIB61850_API MmsValue* MmsValue_createEmptyArray ( int  size)

Create an emtpy array.

Parameters
sizethe size of the new array
Returns
a newly created empty array instance

◆ MmsValue_createEmptyStructure()

LIB61850_API MmsValue* MmsValue_createEmptyStructure ( int  size)

◆ MmsValue_decodeMmsData()

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)

WARNING: API changed with version 1.0.3 (added endBufPos parameter)

Parameters
bufferthe buffer to read from
bufPosthe start position of the mms value data in the buffer
bufferLengththe length of the buffer
endBufPosthe position in the buffer after the read MMS data element (NULL if not required)
Returns
the MmsValue instance created from the buffer

◆ MmsValue_decodeMmsDataMaxRecursion()

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 maximum recursion depth

Parameters
bufferthe buffer to read from
bufPosthe start position of the mms value data in the buffer
bufferLengththe length of the buffer
endBufPosthe position in the buffer after the read MMS data element (NULL if not required)
maxDepththe maximum recursion depth
Returns
the MmsValue instance created from the buffer

◆ MmsValue_delete()

LIB61850_API void MmsValue_delete ( MmsValue self)

Delete an MmsValue instance.

This operation frees all dynamically allocated memory of the MmsValue instance. If the instance is of type MMS_STRUCTURE or MMS_ARRAY all child elements will be deleted too.

Parameters
selfthe MmsValue instance to be deleted.

◆ MmsValue_deleteAllBitStringBits()

LIB61850_API void MmsValue_deleteAllBitStringBits ( MmsValue self)

Delete all bits (set to zero) of an MmsType object of type MMS_BITSTRING.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_BITSTRING.

◆ MmsValue_deleteConditional()

LIB61850_API void MmsValue_deleteConditional ( MmsValue value)

Delete an MmsValue instance.

This operation frees all dynamically allocated memory of the MmsValue instance. If the instance is of type MMS_STRUCTURE or MMS_ARRAY all child elements will be deleted too.

NOTE: this functions only frees the instance if deleteValue field = 0!

Parameters
selfthe MmsValue instance to be deleted.

◆ MmsValue_encodeMmsData()

LIB61850_API int MmsValue_encodeMmsData ( MmsValue self,
uint8_t *  buffer,
int  bufPos,
bool  encode 
)

Serialize the MmsValue instance as BER encoded MMS Data element.

Parameters
selfthe MmsValue instance
bufferthe buffer to encode the MMS data element
bufPosthe position in the buffer where to start encoding
encodeencode to buffer (true) or calculate length only (false)
Returns
the encoded length of the corresponding MMS data element

◆ MmsValue_equals()

LIB61850_API bool MmsValue_equals ( const MmsValue self,
const MmsValue otherValue 
)

Check if two instances of MmsValue have the same value.

Both instances should be of same type. E.g. is self is of type MMS_INTEGER then source has also to be of type MMS_INTEGER. Otherwise the call will return false.

Parameters
selfMmsValue instance to operate on.
otherValueMmsValue that is used to test
Returns
true if both instances are of the same type and have the same value

◆ MmsValue_equalTypes()

LIB61850_API bool MmsValue_equalTypes ( const MmsValue self,
const MmsValue otherValue 
)

Check if two (complex) instances of MmsValue have the same type.

This function will test if the two values are of the same type. The function will return true only if all child instances in the MmsValue instance tree are also of equal type.

Parameters
selfMmsValue instance to operate on.
otherValueMmsValue that is used to test
Returns
true if both instances and all their children are of the same type.

◆ MmsValue_getArraySize()

LIB61850_API uint32_t MmsValue_getArraySize ( const MmsValue self)

Get the size of an array.

Parameters
selfMmsValue instance to operate on. Has to be of type MMS_ARRAY.
Returns
the size of the array

◆ MmsValue_getBinaryTimeAsUtcMs()

LIB61850_API uint64_t MmsValue_getBinaryTimeAsUtcMs ( const MmsValue self)

Get a millisecond time value from an MmsValue object of type MMS_BINARYTIME.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_BINARYTIME.
Returns
the value in milliseconds since epoch (1970/01/01 00:00 UTC)

◆ MmsValue_getBitStringAsInteger()

LIB61850_API uint32_t MmsValue_getBitStringAsInteger ( const MmsValue self)

Convert a bit string to an unsigned integer.

This function assumes that the first bit in the bit string is the least significant bit (little endian bit order).

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_BITSTRING.

◆ MmsValue_getBitStringAsIntegerBigEndian()

LIB61850_API uint32_t MmsValue_getBitStringAsIntegerBigEndian ( const MmsValue self)

Convert a bit string to an unsigned integer (big endian bit order)

This function assumes that the first bit in the bit string is the most significant bit (big endian bit order).

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_BITSTRING.

◆ MmsValue_getBitStringBit()

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.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_BITSTRING.
bitPosthe position of the bit in the bit string. Starting with 0. The bit with position 0 is the first bit if the MmsValue instance is serialized.
Returns
the value of the bit (true = 1 / false = 0)

◆ MmsValue_getBitStringByteSize()

LIB61850_API int MmsValue_getBitStringByteSize ( const MmsValue self)

Get the number of bytes required by this bitString.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_BITSTRING.

◆ MmsValue_getBitStringSize()

LIB61850_API int MmsValue_getBitStringSize ( const MmsValue self)

Get the size of a bit string in bits.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_BITSTRING.

◆ MmsValue_getBoolean()

LIB61850_API bool MmsValue_getBoolean ( const MmsValue value)

Get the bool value of a MmsValue object.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_BOOLEAN.
Returns
the MmsValue value as bool value

◆ MmsValue_getDataAccessError()

LIB61850_API MmsDataAccessError MmsValue_getDataAccessError ( const MmsValue self)

◆ MmsValue_getElement()

LIB61850_API MmsValue* MmsValue_getElement ( const MmsValue array,
int  index 
)

Get an element of an array or structure.

Parameters
selfMmsValue instance to operate on. Has to be of type MMS_ARRAY or MMS_STRUCTURE.
indexndex of the requested array or structure element
Returns
the element object

◆ MmsValue_getMaxEncodedSize()

LIB61850_API int MmsValue_getMaxEncodedSize ( MmsValue self)

Get the maximum possible BER encoded size of the MMS data element.

Parameters
selfthe MmsValue instance
Returns
the maximum encoded size in bytes of the MMS data element

◆ MmsValue_getNumberOfSetBits()

LIB61850_API int MmsValue_getNumberOfSetBits ( const MmsValue self)

Count the number of set bits in a bit string.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_BITSTRING.

◆ MmsValue_getOctetStringBuffer()

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.

NOTE: The size of the buffer can be requested with the MmsValue_getOctetStringSize function.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_OCTET_STRING.
Returns
reference to the buffer

◆ MmsValue_getOctetStringMaxSize()

LIB61850_API uint16_t MmsValue_getOctetStringMaxSize ( MmsValue self)

Returns the maximum size in bytes of an MmsValue object of type MMS_OCTET_STRING.

Returns the maximum size if bytes of the MmsValue object of type MMS_OCTET_STRING. This is the size of the internally allocated buffer to hold the octet string data.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_OCTET_STRING.
Returns
maximum size in bytes

◆ MmsValue_getOctetStringOctet()

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.

NOTE: The octet quantity of the octet string can be requested with the MmsValue_getOctetStringSize function.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_OCTET_STRING.
octetPosthe position of the octet in the octet string. Starting with 0. The octet with position 0 is the first octet if the MmsValue instance is serialized.
Returns
the value of the octet (0 to 255, or 0x00 to 0xFF)

◆ MmsValue_getOctetStringSize()

LIB61850_API uint16_t MmsValue_getOctetStringSize ( const MmsValue self)

Returns the size in bytes of an MmsValue object of type MMS_OCTET_STRING.

NOTE: To access the byte in the buffer the function MmsValue_getOctetStringBuffer has to be used.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_OCTET_STRING.
Returns
size in bytes

◆ MmsValue_getSizeInMemory()

LIB61850_API int MmsValue_getSizeInMemory ( const MmsValue self)

Determine the required amount of bytes by a clone.

This function is intended to be used to determine the buffer size of a clone operation (MmsValue_cloneToBuffer) in advance.

Parameters
selfthe MmsValue instance
Returns
the number of bytes required by a clone

◆ MmsValue_getStringSize()

LIB61850_API int MmsValue_getStringSize ( MmsValue self)

Returns the (maximum) length of the string.

NOTE: this function return the amount of memory allocated for the string buffer - 1.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_VISIBLE_STRING or MMS_STRING.

◆ MmsValue_getSubElement()

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.

Parameters
selfthe MmsValue instance
varSpec- type specification if the MMS_STRUCTURE value
mmsPath- path (in MMS variable name syntax) to specify the sub element.
Returns
the sub elements MmsValue instance or NULL if the element does not exist

◆ MmsValue_getType()

LIB61850_API MmsType MmsValue_getType ( const MmsValue self)

Get the MmsType of an MmsValue instance.

Parameters
selfthe MmsValue instance

◆ MmsValue_getTypeString()

LIB61850_API char* MmsValue_getTypeString ( MmsValue self)

return the value type as a human readable string

Parameters
selfthe MmsValue instance
Returns
the value type as a human readable string

◆ MmsValue_getUtcTimeBuffer()

LIB61850_API uint8_t* MmsValue_getUtcTimeBuffer ( MmsValue self)

return the raw buffer containing the UTC time data

Note: This will return the address of the raw byte buffer. The array length is 8 byte.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_UTCTIME.
Returns
the buffer containing the raw data

◆ MmsValue_getUtcTimeInMs()

LIB61850_API uint64_t MmsValue_getUtcTimeInMs ( const MmsValue value)

Get a millisecond time value from an MmsValue object of MMS_UTCTIME type.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_UTCTIME.
Returns
the value in milliseconds since epoch (1970/01/01 00:00 UTC)

◆ MmsValue_getUtcTimeInMsWithUs()

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.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_UTCTIME.
useca pointer to store the us (microsecond) value.
Returns
the value in milliseconds since epoch (1970/01/01 00:00 UTC)

◆ MmsValue_getUtcTimeQuality()

LIB61850_API uint8_t MmsValue_getUtcTimeQuality ( const MmsValue self)

get the TimeQuality byte of the UtcTime

Meaning of the bits in the timeQuality byte:

bit 7 = leapSecondsKnown bit 6 = clockFailure bit 5 = clockNotSynchronized bit 0-4 = subsecond time accuracy (number of significant bits of subsecond time)

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_UTCTIME.
Returns
the byte representing the time quality

◆ MmsValue_isDeletable()

LIB61850_API int MmsValue_isDeletable ( MmsValue self)

Check if the MmsValue instance has the deletable flag set.

The deletable flag indicates if an libiec61850 API client should call the MmsValue_delete() method or not if the MmsValue instance was passed to the client by an API call or callback method.

Parameters
selfthe MmsValue instance
Returns
1 if deletable flag is set, otherwise 0

◆ MmsValue_newBinaryTime()

LIB61850_API MmsValue* MmsValue_newBinaryTime ( bool  timeOfDay)

Create a new MmsValue instance of type MMS_BINARYTIME.

If the timeOfDay parameter is set to true then the resulting MMS_BINARYTIME object is only 4 octets long and includes only the seconds since midnight. Otherwise the MMS_BINARYTIME

Parameters
timeOfDayif true only the TimeOfDay value is included.
Returns
new MmsValue instance of type MMS_BINARYTIME

◆ MmsValue_newBitString()

LIB61850_API MmsValue* MmsValue_newBitString ( int  bitSize)

Create a new MmsValue instance of type MMS_BITSTRING.

Parameters
bitSizethe size of the bit string in bit
Returns
new MmsValue instance of type MMS_BITSTRING

◆ MmsValue_newBoolean()

LIB61850_API MmsValue* MmsValue_newBoolean ( bool  boolean)

◆ MmsValue_newDataAccessError()

LIB61850_API MmsValue* MmsValue_newDataAccessError ( MmsDataAccessError  accessError)

◆ MmsValue_newDefaultValue()

LIB61850_API MmsValue* MmsValue_newDefaultValue ( const MmsVariableSpecification *  typeSpec)

◆ MmsValue_newDouble()

LIB61850_API MmsValue* MmsValue_newDouble ( double  value)

Create a new 64 bit wide float variable and initialize with value.

Parameters
valuethe initial value
Returns
new MmsValue instance of type MMS_FLOAT

◆ MmsValue_newFloat()

LIB61850_API MmsValue* MmsValue_newFloat ( float  value)

Create a new 32 bit wide float variable and initialize with value.

Parameters
valuethe initial value
Returns
new MmsValue instance of type MMS_FLOAT

◆ MmsValue_newInteger()

LIB61850_API MmsValue* MmsValue_newInteger ( int  size)

◆ MmsValue_newIntegerFromInt16()

LIB61850_API MmsValue* MmsValue_newIntegerFromInt16 ( int16_t  integer)

◆ MmsValue_newIntegerFromInt32()

LIB61850_API MmsValue* MmsValue_newIntegerFromInt32 ( int32_t  integer)

◆ MmsValue_newIntegerFromInt64()

LIB61850_API MmsValue* MmsValue_newIntegerFromInt64 ( int64_t  integer)

◆ MmsValue_newIntegerFromInt8()

LIB61850_API MmsValue* MmsValue_newIntegerFromInt8 ( int8_t  integer)

◆ MmsValue_newMmsString()

LIB61850_API MmsValue* MmsValue_newMmsString ( const char *  string)

Create a new MmsValue instance of type MMS_STRING.

Parameters
stringa text string that should be the value of the new instance of NULL for an empty string.
Returns
new MmsValue instance of type MMS_STRING

◆ MmsValue_newMmsStringFromByteArray()

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.

Parameters
byteArraythe byte array containing the string data
sizethe size of the byte array
Returns
new MmsValue instance of type MMS_STRING

◆ MmsValue_newMmsStringWithSize()

LIB61850_API MmsValue* MmsValue_newMmsStringWithSize ( int  size)

Create a new MmsValue instance of type MMS_STRING.

This function will create a new empty MmsValue string object. The maximum size of the string is set according to the size parameter. The function allocates as much memory as is required to hold a string of the maximum size.

Parameters
sizethe new maximum size of the string.
Returns
new MmsValue instance of type MMS_STRING

◆ MmsValue_newOctetString()

LIB61850_API MmsValue* MmsValue_newOctetString ( int  size,
int  maxSize 
)

◆ MmsValue_newStructure()

LIB61850_API MmsValue* MmsValue_newStructure ( const MmsVariableSpecification *  typeSpec)

◆ MmsValue_newUnsigned()

LIB61850_API MmsValue* MmsValue_newUnsigned ( int  size)

◆ MmsValue_newUnsignedFromUint32()

LIB61850_API MmsValue* MmsValue_newUnsignedFromUint32 ( uint32_t  integer)

◆ MmsValue_newUtcTime()

LIB61850_API MmsValue* MmsValue_newUtcTime ( uint32_t  timeval)

Create a new MmsValue instance of type MMS_UTCTIME.

Parameters
timevaltime value as UNIX timestamp (seconds since epoch)
Returns
new MmsValue instance of type MMS_UTCTIME

◆ MmsValue_newUtcTimeByMsTime()

LIB61850_API MmsValue* MmsValue_newUtcTimeByMsTime ( uint64_t  timeval)

Create a new MmsValue instance of type MMS_UTCTIME.

Parameters
timevaltime value as millisecond timestamp (milliseconds since epoch)
Returns
new MmsValue instance of type MMS_UTCTIME

◆ MmsValue_newVisibleString()

LIB61850_API MmsValue* MmsValue_newVisibleString ( const char *  string)

Create a new MmsValue instance of type MMS_VISIBLE_STRING.

This function will allocate as much memory as required to hold the string and sets the maximum size of the string to this size.

Parameters
stringa text string that should be the value of the new instance of NULL for an empty string.
Returns
new MmsValue instance of type MMS_VISIBLE_STRING

◆ MmsValue_newVisibleStringFromByteArray()

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.

Parameters
byteArraythe byte array containing the string data
sizethe size of the byte array
Returns
new MmsValue instance of type MMS_VISIBLE_STRING

◆ MmsValue_newVisibleStringWithSize()

LIB61850_API MmsValue* MmsValue_newVisibleStringWithSize ( int  size)

Create a new MmsValue instance of type MMS_VISIBLE_STRING.

This function will create a new empty MmsValue string object. The maximum size of the string is set according to the size parameter. The function allocates as much memory as is required to hold a string of the maximum size.

Parameters
sizethe new maximum size of the string.
Returns
new MmsValue instance of type MMS_VISIBLE_STRING

◆ MmsValue_printToBuffer()

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

NOTE: This function is for debugging purposes only. It may not be aimed to be used in embedded systems. It requires a full featured snprintf function.

Parameters
selfthe MmsValue instance
bufferthe buffer where to copy the string representation
bufferSizethe size of the provided buffer
Returns
a pointer to the start of the buffer

◆ MmsValue_setAllBitStringBits()

LIB61850_API void MmsValue_setAllBitStringBits ( MmsValue self)

Set all bits (set to one) of an MmsType object of type MMS_BITSTRING

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_BITSTRING.

◆ MmsValue_setBinaryTime()

LIB61850_API void MmsValue_setBinaryTime ( MmsValue self,
uint64_t  timestamp 
)

Update an MmsValue object of type MMS_BINARYTIME with a millisecond time.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_UTCTIME.
timevalthe new value in milliseconds since epoch (1970/01/01 00:00 UTC)

◆ MmsValue_setBitStringBit()

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.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_BITSTRING.
bitPosthe position of the bit in the bit string. Starting with 0. The bit with position 0 is the first bit if the MmsValue instance is serialized.
valuethe new value of the bit (true = 1 / false = 0)

◆ MmsValue_setBitStringFromInteger()

LIB61850_API void MmsValue_setBitStringFromInteger ( MmsValue self,
uint32_t  intValue 
)

Convert an unsigned integer to a bit string.

The integer representation in the bit string assumes the first bit is the least significant bit (little endian bit order).

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_BITSTRING.
intValuethe integer value that is used to set the bit string

◆ MmsValue_setBitStringFromIntegerBigEndian()

LIB61850_API void MmsValue_setBitStringFromIntegerBigEndian ( MmsValue self,
uint32_t  intValue 
)

Convert an unsigned integer to a bit string (big endian bit order)

The integer representation in the bit string assumes the first bit is the most significant bit (big endian bit order).

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_BITSTRING.
intValuethe integer value that is used to set the bit string

◆ MmsValue_setBoolean()

LIB61850_API void MmsValue_setBoolean ( MmsValue value,
bool  boolValue 
)

Set the bool value of a MmsValue object.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_BOOLEAN.
boolValuea bool value

◆ MmsValue_setDeletable()

LIB61850_API void MmsValue_setDeletable ( MmsValue self)

◆ MmsValue_setDeletableRecursive()

LIB61850_API void MmsValue_setDeletableRecursive ( MmsValue value)

◆ MmsValue_setDouble()

LIB61850_API void MmsValue_setDouble ( MmsValue self,
double  newFloatValue 
)

Set the double value of a MmsValue object.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_FLOAT.

◆ MmsValue_setElement()

LIB61850_API void MmsValue_setElement ( MmsValue complexValue,
int  index,
MmsValue elementValue 
)

Set an element of a complex type.

NOTE: If the element already exists it will simply be replaced by the provided new value. The caller is responsible to free the replaced value.

Parameters
complexValueMmsValue instance to operate on. Has to be of a type MMS_STRUCTURE or MMS_ARRAY
theindex of the element to set/replace
elementValuethe (new) value of the element

◆ MmsValue_setFloat()

LIB61850_API void MmsValue_setFloat ( MmsValue self,
float  newFloatValue 
)

Set the float value of a MmsValue object.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_FLOAT.

◆ MmsValue_setInt16()

LIB61850_API void MmsValue_setInt16 ( MmsValue value,
int16_t  integer 
)

Set the Int16 value of a MmsValue object.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_INTEGER.
integerthe new value to set

◆ MmsValue_setInt32()

LIB61850_API void MmsValue_setInt32 ( MmsValue self,
int32_t  integer 
)

Set the Int32 value of a MmsValue object.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_INTEGER.
integerthe new value to set

◆ MmsValue_setInt64()

LIB61850_API void MmsValue_setInt64 ( MmsValue value,
int64_t  integer 
)

Set the Int64 value of a MmsValue object.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_INTEGER.
integerthe new value to set

◆ MmsValue_setInt8()

LIB61850_API void MmsValue_setInt8 ( MmsValue value,
int8_t  integer 
)

Set the Int8 value of a MmsValue object.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_INTEGER.
integerthe new value to set

◆ MmsValue_setMmsString()

LIB61850_API void MmsValue_setMmsString ( MmsValue value,
const char *  string 
)

Set the value of MmsValue instance of type MMS_STRING.

Parameters
stringa text string that will be the new value of the instance

◆ MmsValue_setOctetString()

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.

This method will copy the provided buffer to the internal buffer of the MmsValue instance. This will only happen if the internal buffer size is large enough for the new value. Otherwise the object value is not changed.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_OCTET_STRING.
bufthe buffer that contains the new value
sizethe size of the buffer that contains the new value

◆ MmsValue_setOctetStringOctet()

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.

This method will copy the provided octet to the internal buffer of the MmsValue instance, at the 'octetPos' position. This will only happen if the internal buffer size is large enough. Otherwise the object value is not changed.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_OCTET_STRING.
octetPosthe position of the octet in the octet string. Starting with 0. The octet with position 0 is the first octet if the MmsValue instance is serialized.
valuethe new value of the octet (0 to 255, or 0x00 to 0xFF)

◆ MmsValue_setUint16()

LIB61850_API void MmsValue_setUint16 ( MmsValue value,
uint16_t  integer 
)

Set the UInt16 value of a MmsValue object.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_UNSIGNED.
integerthe new value to set

◆ MmsValue_setUint32()

LIB61850_API void MmsValue_setUint32 ( MmsValue value,
uint32_t  integer 
)

Set the UInt32 value of a MmsValue object.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_UNSIGNED.
integerthe new value to set

◆ MmsValue_setUint8()

LIB61850_API void MmsValue_setUint8 ( MmsValue value,
uint8_t  integer 
)

Set the UInt8 value of a MmsValue object.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_UNSIGNED.
integerthe new value to set

◆ MmsValue_setUtcTime()

LIB61850_API MmsValue* MmsValue_setUtcTime ( MmsValue self,
uint32_t  timeval 
)

Update an MmsValue object of UtcTime type with a timestamp in s.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_BOOLEAN.
timevalthe new value in seconds since epoch (1970/01/01 00:00 UTC)

◆ MmsValue_setUtcTimeByBuffer()

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.

The buffer must have a size of 8 bytes!

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_UTCTIME.
bufferbuffer containing the encoded UTCTime.

◆ MmsValue_setUtcTimeMs()

LIB61850_API MmsValue* MmsValue_setUtcTimeMs ( MmsValue self,
uint64_t  timeval 
)

Update an MmsValue object of type MMS_UTCTIME with a millisecond time.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_UTCTIME.
timevalthe new value in milliseconds since epoch (1970/01/01 00:00 UTC)

◆ MmsValue_setUtcTimeMsEx()

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.

Meaning of the bits in the timeQuality byte:

bit 7 = leapSecondsKnown bit 6 = clockFailure bit 5 = clockNotSynchronized bit 0-4 = subsecond time accuracy (number of significant bits of subsecond time)

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_UTCTIME.
timevalthe new value in milliseconds since epoch (1970/01/01 00:00 UTC)
timeQualitythe byte representing the time quality
Returns
the updated MmsValue instance

◆ MmsValue_setUtcTimeQuality()

LIB61850_API void MmsValue_setUtcTimeQuality ( MmsValue self,
uint8_t  timeQuality 
)

set the TimeQuality byte of the UtcTime

Meaning of the bits in the timeQuality byte:

bit 7 = leapSecondsKnown bit 6 = clockFailure bit 5 = clockNotSynchronized bit 0-4 = subsecond time accuracy (number of significant bits of subsecond time)

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_UTCTIME.
timeQualitythe byte representing the time quality

◆ MmsValue_setVisibleString()

LIB61850_API void MmsValue_setVisibleString ( MmsValue self,
const char *  string 
)

◆ MmsValue_toDouble()

LIB61850_API double MmsValue_toDouble ( const MmsValue self)

Get the double value of a MmsValue object.

Parameters
selfMmsValue instance to operate on. Has to be of type MMS_FLOAT.
Returns
64 bit floating point value

◆ MmsValue_toFloat()

LIB61850_API float MmsValue_toFloat ( const MmsValue self)

Get the float value of a MmsValue object.

Parameters
selfMmsValue instance to operate on. Has to be of type MMS_FLOAT.
Returns
32 bit floating point value

◆ MmsValue_toInt32()

LIB61850_API int32_t MmsValue_toInt32 ( const MmsValue value)

Get the int32_t value of a MmsValue object.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_INTEGER or MMS_UNSIGNED
Returns
signed 32 bit integer

◆ MmsValue_toInt64()

LIB61850_API int64_t MmsValue_toInt64 ( const MmsValue self)

Get the int64_t value of a MmsValue object.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_INTEGER or MMS_UNSIGNED
Returns
signed 64 bit integer

◆ MmsValue_toString()

LIB61850_API const char* MmsValue_toString ( MmsValue self)

Returns the value of an MMS_VISIBLE_STRING object as C string.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_VISIBLE_STRING or MMS_STRING.
Returns
the string value as 0 terminated C string

◆ MmsValue_toUint32()

LIB61850_API uint32_t MmsValue_toUint32 ( const MmsValue value)

Get the uint32_t value of a MmsValue object.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_INTEGER or MMS_UNSIGNED
Returns
unsigned 32 bit integer

◆ MmsValue_toUnixTimestamp()

LIB61850_API uint32_t MmsValue_toUnixTimestamp ( const MmsValue self)

Get the unix timestamp of a MmsValue object of type MMS_UTCTIME.

Parameters
selfMmsValue instance to operate on. Has to be of a type MMS_UTC_TIME.
Returns
unix timestamp of the MMS_UTCTIME variable.

◆ MmsValue_update()

LIB61850_API bool MmsValue_update ( MmsValue self,
const MmsValue source 
)

Update the value of an MmsValue instance by the value of another MmsValue instance.

Both instances should be of same time. E.g. is self is of type MMS_INTEGER then source has also to be of type MMS_INTEGER. Otherwise the call will have no effect.

Parameters
selfMmsValue instance to operate on.
sourceMmsValue used as source for the update. Has to be of same type as self
Returns
indicates if the update has been successful (false if not)

◆ MmsVariableSpecification_getMaxEncodedSize()

LIB61850_API int MmsVariableSpecification_getMaxEncodedSize ( MmsVariableSpecification *  self)

Calculate the maximum encoded size of a variable of this type.

Parameters
selfthe MMS variable specification instance