pull/277/merge
Michał Hanusek 4 years ago committed by GitHub
commit 2a3448f7ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1344,6 +1344,54 @@ IedConnection_readUnsigned32Value(IedConnection self, IedClientError* error, con
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;
}
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)
{
@ -3861,4 +3909,3 @@ FileDirectoryEntry_getLastModified(FileDirectoryEntry self)
{
return self->lastModified;
}

@ -930,6 +930,34 @@ IedConnection_readStringValue(IedConnection self, IedClientError* error, const c
LIB61850_API int32_t
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 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