Changed API: encode_tagged is now encode_application since we are encoding an application tag.

This commit is contained in:
skarg
2007-10-13 12:26:16 +00:00
parent fe2c7cd00a
commit 3d6158443c
36 changed files with 466 additions and 464 deletions
+14 -14
View File
@@ -205,7 +205,7 @@ int Multistate_Output_Encode_Property_APDU(uint8_t * apdu,
switch (property) {
case PROP_OBJECT_IDENTIFIER:
apdu_len =
encode_tagged_object_id(&apdu[0], OBJECT_MULTI_STATE_OUTPUT,
encode_application_object_id(&apdu[0], OBJECT_MULTI_STATE_OUTPUT,
object_instance);
break;
/* note: Name and Description don't have to be the same.
@@ -214,15 +214,15 @@ int Multistate_Output_Encode_Property_APDU(uint8_t * apdu,
case PROP_DESCRIPTION:
characterstring_init_ansi(&char_string,
Multistate_Output_Name(object_instance));
apdu_len = encode_tagged_character_string(&apdu[0], &char_string);
apdu_len = encode_application_character_string(&apdu[0], &char_string);
break;
case PROP_OBJECT_TYPE:
apdu_len =
encode_tagged_enumerated(&apdu[0], OBJECT_MULTI_STATE_OUTPUT);
encode_application_enumerated(&apdu[0], OBJECT_MULTI_STATE_OUTPUT);
break;
case PROP_PRESENT_VALUE:
present_value = Multistate_Output_Present_Value(object_instance);
apdu_len = encode_tagged_unsigned(&apdu[0], present_value);
apdu_len = encode_application_unsigned(&apdu[0], present_value);
break;
case PROP_STATUS_FLAGS:
/* note: see the details in the standard on how to use these */
@@ -231,23 +231,23 @@ int Multistate_Output_Encode_Property_APDU(uint8_t * apdu,
bitstring_set_bit(&bit_string, STATUS_FLAG_FAULT, false);
bitstring_set_bit(&bit_string, STATUS_FLAG_OVERRIDDEN, false);
bitstring_set_bit(&bit_string, STATUS_FLAG_OUT_OF_SERVICE, false);
apdu_len = encode_tagged_bitstring(&apdu[0], &bit_string);
apdu_len = encode_application_bitstring(&apdu[0], &bit_string);
break;
case PROP_EVENT_STATE:
/* note: see the details in the standard on how to use this */
apdu_len = encode_tagged_enumerated(&apdu[0], EVENT_STATE_NORMAL);
apdu_len = encode_application_enumerated(&apdu[0], EVENT_STATE_NORMAL);
break;
case PROP_OUT_OF_SERVICE:
object_index =
Multistate_Output_Instance_To_Index(object_instance);
state = Multistate_Output_Out_Of_Service[object_index];
apdu_len = encode_tagged_boolean(&apdu[0], state);
apdu_len = encode_application_boolean(&apdu[0], state);
break;
case PROP_PRIORITY_ARRAY:
/* Array element zero is the number of elements in the array */
if (array_index == 0)
apdu_len =
encode_tagged_unsigned(&apdu[0], BACNET_MAX_PRIORITY);
encode_application_unsigned(&apdu[0], BACNET_MAX_PRIORITY);
/* if no index was specified, then try to encode the entire list */
/* into one packet. */
else if (array_index == BACNET_ARRAY_ALL) {
@@ -257,12 +257,12 @@ int Multistate_Output_Encode_Property_APDU(uint8_t * apdu,
/* FIXME: check if we have room before adding it to APDU */
if (Multistate_Output_Level[object_index][i] ==
MULTISTATE_NULL)
len = encode_tagged_null(&apdu[apdu_len]);
len = encode_application_null(&apdu[apdu_len]);
else {
present_value =
Multistate_Output_Level[object_index][i];
len =
encode_tagged_unsigned(&apdu[apdu_len],
encode_application_unsigned(&apdu[apdu_len],
present_value);
}
/* add it if we have room */
@@ -281,13 +281,13 @@ int Multistate_Output_Encode_Property_APDU(uint8_t * apdu,
if (array_index <= BACNET_MAX_PRIORITY) {
if (Multistate_Output_Level[object_index][array_index -
1] == MULTISTATE_NULL)
apdu_len = encode_tagged_null(&apdu[0]);
apdu_len = encode_application_null(&apdu[0]);
else {
present_value =
Multistate_Output_Level[object_index][array_index -
1];
apdu_len =
encode_tagged_unsigned(&apdu[0], present_value);
encode_application_unsigned(&apdu[0], present_value);
}
} else {
*error_class = ERROR_CLASS_PROPERTY;
@@ -299,10 +299,10 @@ int Multistate_Output_Encode_Property_APDU(uint8_t * apdu,
break;
case PROP_RELINQUISH_DEFAULT:
present_value = MULTISTATE_RELINQUISH_DEFAULT;
apdu_len = encode_tagged_enumerated(&apdu[0], present_value);
apdu_len = encode_application_enumerated(&apdu[0], present_value);
break;
case PROP_NUMBER_OF_STATES:
apdu_len = encode_tagged_unsigned(&apdu[apdu_len],
apdu_len = encode_application_unsigned(&apdu[apdu_len],
MULTISTATE_NUMBER_OF_STATES);
break;