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

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

@ -1356,6 +1356,30 @@ IedConnection_readBitStringAsIntegerBigEndian(IedConnection self, IedClientError
return 0;
}
uint32_t
IedConnection_readBitStringAsInteger(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_getBitStringAsInteger(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
IedConnection_readInt64Value(IedConnection self, IedClientError* error, const char* objectReference, FunctionalConstraint fc)
{

@ -944,6 +944,20 @@ IedConnection_readInt32Value(IedConnection self, IedClientError* error, const ch
uint32_t
IedConnection_readBitStringAsIntegerBigEndian(IedConnection self, IedClientError* error, const char* objectReference, FunctionalConstraint fc);
/**
* \brief read a functional constrained data attribute (FCDA) of type BitString (LittleEndian) 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_readBitStringAsInteger(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
*

Loading…
Cancel
Save