Adjusted Device Object type decoding to use uint16_t rather than int. Corrected unit tests.

This commit is contained in:
skarg
2008-10-22 02:19:03 +00:00
parent 63ca977553
commit 35236bea22
15 changed files with 74 additions and 40 deletions
+22
View File
@@ -539,6 +539,28 @@ size_t octetstring_capacity(
return length;
}
/* returns true if the same length and contents */
bool octetstring_value_same(
BACNET_OCTET_STRING * octet_string1,
BACNET_OCTET_STRING * octet_string2)
{
size_t i = 0; /* loop counter */
if (octet_string1 && octet_string2) {
if ((octet_string1->length == octet_string2->length) &&
(octet_string1->length <= sizeof(octet_string1->value))) {
for (i = 0; i < octet_string1->length; i++) {
if (octet_string1->value[i] != octet_string2->value[i]) {
return false;
}
}
return true;
}
}
return false;
}
#ifdef TEST
#include <assert.h>
#include <string.h>