Modified the character strings encoding to intialize character strings with NULLs at the end. Changed device object demo to use ANSI X34 only. Fixed bug in WriteProperty for Device Object Name.

This commit is contained in:
skarg
2006-01-05 18:40:11 +00:00
parent 105528e7b1
commit 137f36a977
5 changed files with 64 additions and 53 deletions
-18
View File
@@ -843,24 +843,6 @@ int decode_octet_string(uint8_t * apdu, uint32_t len_value,
return len;
}
// from clause 20.2.9 Encoding of a Character String Value
// returns the number of apdu bytes consumed
int encode_bacnet_string(uint8_t * apdu, const char *char_string, int len)
{
int i;
// limit - 6 octets is the most our tag and type could be
if (len > (MAX_APDU - 6))
len = MAX_APDU - 6;
for (i = 0; i < len; i++) {
apdu[1 + i] = char_string[i];
}
apdu[0] = CHARACTER_ANSI;
len++;
return len;
}
// from clause 20.2.9 Encoding of a Character String Value
// returns the number of apdu bytes consumed
int encode_bacnet_character_string(uint8_t * apdu,