Add function - readBitStringAsIntegerBigEndian() (Issue Ref #276)

pull/277/head
Michał Hanusek 5 years ago
parent cd663dd923
commit dfdbe20cd9

@ -1332,6 +1332,30 @@ IedConnection_readUnsigned32Value(IedConnection self, IedClientError* error, con
return retVal; return retVal;
} }
uint32_t
IedConnection_readBitStringAsIntegerBigEndian(IedConnection self, IedClientError* error, const char* objectReference, FunctionalConstraint fc)
{
MmsValue* value = IedConnection_readObject(self, error, objectReference, fc);
if (value != NULL) {
if(MmsValue_getType(value) == MMS_BIT_STRING)
{
return MmsValue_getBitStringAsIntegerBigEndian(value);
}
else
{
if (MmsValue_getType(value) == MMS_DATA_ACCESS_ERROR)
*error = iedConnection_mapDataAccessErrorToIedError(MmsValue_getDataAccessError(value));
else
*error = IED_ERROR_UNEXPECTED_VALUE_RECEIVED;
}
MmsValue_delete(value);
}
return 0;
}
int64_t int64_t
IedConnection_readInt64Value(IedConnection self, IedClientError* error, const char* objectReference, FunctionalConstraint fc) IedConnection_readInt64Value(IedConnection self, IedClientError* error, const char* objectReference, FunctionalConstraint fc)
{ {
@ -3827,4 +3851,3 @@ FileDirectoryEntry_getLastModified(FileDirectoryEntry self)
{ {
return self->lastModified; return self->lastModified;
} }

@ -930,6 +930,20 @@ IedConnection_readStringValue(IedConnection self, IedClientError* error, const c
LIB61850_API int32_t LIB61850_API int32_t
IedConnection_readInt32Value(IedConnection self, IedClientError* error, const char* objectReference, FunctionalConstraint fc); IedConnection_readInt32Value(IedConnection self, IedClientError* error, const char* objectReference, FunctionalConstraint fc);
/**
* \brief read a functional constrained data attribute (FCDA) of type BitString (BigEndian) and return the result as uint32_t
*
* \param self the connection object to operate on
* \param error the error code if an error occurs
* \param object reference of the data attribute to read
* \param fc the functional constraint of the data attribute to read
*
* \return an uint32_t value of the read data attributes
*/
uint32_t
IedConnection_readBitStringAsIntegerBigEndian(IedConnection self, IedClientError* error, const char* objectReference, FunctionalConstraint fc);
/** /**
* \brief read a functional constrained data attribute (FCDA) of type Integer or Unsigned and return the result as int64_t * \brief read a functional constrained data attribute (FCDA) of type Integer or Unsigned and return the result as int64_t
* *

Loading…
Cancel
Save