indented.

This commit is contained in:
skarg
2007-11-29 16:39:48 +00:00
parent 06d23fcf1f
commit 1477603af6
123 changed files with 1994 additions and 1688 deletions
+4 -4
View File
@@ -211,14 +211,14 @@ void testAnalogInput(
/* FIXME: we should do a lot more testing here... */
len = Analog_Input_Encode_Property_APDU(&apdu[0],
instance,
len =
Analog_Input_Encode_Property_APDU(&apdu[0], instance,
PROP_OBJECT_IDENTIFIER, BACNET_ARRAY_ALL, &error_class, &error_code);
ct_test(pTest, len >= 0);
len = decode_tag_number_and_value(&apdu[0], &tag_number, &len_value);
ct_test(pTest, tag_number == BACNET_APPLICATION_TAG_OBJECT_ID);
len = decode_object_id(&apdu[len],
(int *) &decoded_type, &decoded_instance);
len =
decode_object_id(&apdu[len], (int *) &decoded_type, &decoded_instance);
ct_test(pTest, decoded_type == OBJECT_ANALOG_INPUT);
ct_test(pTest, decoded_instance == instance);
+6 -5
View File
@@ -411,7 +411,8 @@ bool Analog_Output_Write_Property(
return false;
}
/* decode the some of the request */
len = bacapp_decode_application_data(wp_data->application_data,
len =
bacapp_decode_application_data(wp_data->application_data,
wp_data->application_data_len, &value);
/* FIXME: len < application_data_len: more data? */
/* FIXME: len == 0: unable to decode? */
@@ -491,14 +492,14 @@ void testAnalogOutput(
BACNET_ERROR_CODE error_code;
len = Analog_Output_Encode_Property_APDU(&apdu[0],
instance,
len =
Analog_Output_Encode_Property_APDU(&apdu[0], instance,
PROP_OBJECT_IDENTIFIER, BACNET_ARRAY_ALL, &error_class, &error_code);
ct_test(pTest, len != 0);
len = decode_tag_number_and_value(&apdu[0], &tag_number, &len_value);
ct_test(pTest, tag_number == BACNET_APPLICATION_TAG_OBJECT_ID);
len = decode_object_id(&apdu[len],
(int *) &decoded_type, &decoded_instance);
len =
decode_object_id(&apdu[len], (int *) &decoded_type, &decoded_instance);
ct_test(pTest, decoded_type == OBJECT_ANALOG_OUTPUT);
ct_test(pTest, decoded_instance == instance);
+6 -5
View File
@@ -339,7 +339,8 @@ bool Analog_Value_Write_Property(
return false;
}
/* decode the some of the request */
len = bacapp_decode_application_data(wp_data->application_data,
len =
bacapp_decode_application_data(wp_data->application_data,
wp_data->application_data_len, &value);
/* FIXME: len < application_data_len: more data? */
/* FIXME: len == 0: unable to decode? */
@@ -439,14 +440,14 @@ void testAnalog_Value(
BACNET_ERROR_CODE error_code;
len = Analog_Value_Encode_Property_APDU(&apdu[0],
instance,
len =
Analog_Value_Encode_Property_APDU(&apdu[0], instance,
PROP_OBJECT_IDENTIFIER, BACNET_ARRAY_ALL, &error_class, &error_code);
ct_test(pTest, len != 0);
len = decode_tag_number_and_value(&apdu[0], &tag_number, &len_value);
ct_test(pTest, tag_number == BACNET_APPLICATION_TAG_OBJECT_ID);
len = decode_object_id(&apdu[len],
(int *) &decoded_type, &decoded_instance);
len =
decode_object_id(&apdu[len], (int *) &decoded_type, &decoded_instance);
ct_test(pTest, decoded_type == OBJECT_ANALOG_VALUE);
ct_test(pTest, decoded_instance == instance);
+17 -12
View File
@@ -198,8 +198,9 @@ int bacfile_encode_property_apdu(
(void) array_index;
switch (property) {
case PROP_OBJECT_IDENTIFIER:
apdu_len = encode_application_object_id(&apdu[0],
OBJECT_FILE, object_instance);
apdu_len =
encode_application_object_id(&apdu[0], OBJECT_FILE,
object_instance);
break;
case PROP_OBJECT_NAME:
sprintf(text_string, "FILE %d", object_instance);
@@ -222,7 +223,8 @@ int bacfile_encode_property_apdu(
encode_application_character_string(&apdu[0], &char_string);
break;
case PROP_FILE_SIZE:
apdu_len = encode_application_unsigned(&apdu[0],
apdu_len =
encode_application_unsigned(&apdu[0],
bacfile_file_size(object_instance));
break;
case PROP_MODIFICATION_DATE:
@@ -285,7 +287,8 @@ bool bacfile_write_property(
}
/* decode the some of the request */
len = bacapp_decode_application_data(wp_data->application_data,
len =
bacapp_decode_application_data(wp_data->application_data,
wp_data->application_data_len, &value);
/* FIXME: len < application_data_len: more data? */
/* FIXME: len == 0: unable to decode? */
@@ -371,18 +374,19 @@ uint32_t bacfile_instance_from_tsm(
uint32_t object_instance = BACNET_MAX_INSTANCE + 1; /* return value */
bool found = false;
found = tsm_get_transaction_pdu(invokeID, &dest, &npdu_data, &apdu[0],
found =
tsm_get_transaction_pdu(invokeID, &dest, &npdu_data, &apdu[0],
&apdu_len);
if (found) {
if (!npdu_data.network_layer_message
&& npdu_data.data_expecting_reply
if (!npdu_data.network_layer_message && npdu_data.data_expecting_reply
&& (apdu[0] == PDU_TYPE_CONFIRMED_SERVICE_REQUEST)) {
len =
apdu_decode_confirmed_service_request(&apdu[0],
apdu_len, &service_data, &service_choice,
&service_request, &service_request_len);
apdu_decode_confirmed_service_request(&apdu[0], apdu_len,
&service_data, &service_choice, &service_request,
&service_request_len);
if (service_choice == SERVICE_CONFIRMED_ATOMIC_READ_FILE) {
len = arf_decode_service_request(service_request,
len =
arf_decode_service_request(service_request,
service_request_len, &data);
if (len > 0) {
if (data.object_type == OBJECT_FILE)
@@ -410,7 +414,8 @@ bool bacfile_read_data(
pFile = fopen(pFilename, "rb");
if (pFile) {
(void) fseek(pFile, data->type.stream.fileStartPosition, SEEK_SET);
len = fread(octetstring_value(&data->fileData), 1,
len =
fread(octetstring_value(&data->fileData), 1,
data->type.stream.requestedOctetCount, pFile);
if (len < data->type.stream.requestedOctetCount)
data->endOfFile = true;
+4 -4
View File
@@ -256,14 +256,14 @@ void testBinaryInput(
/* FIXME: we should do a lot more testing here... */
len = Binary_Input_Encode_Property_APDU(&apdu[0],
instance,
len =
Binary_Input_Encode_Property_APDU(&apdu[0], instance,
PROP_OBJECT_IDENTIFIER, BACNET_ARRAY_ALL, &error_class, &error_code);
ct_test(pTest, len >= 0);
len = decode_tag_number_and_value(&apdu[0], &tag_number, &len_value);
ct_test(pTest, tag_number == BACNET_APPLICATION_TAG_OBJECT_ID);
len = decode_object_id(&apdu[len],
(int *) &decoded_type, &decoded_instance);
len =
decode_object_id(&apdu[len], (int *) &decoded_type, &decoded_instance);
ct_test(pTest, decoded_type == OBJECT_BINARY_INPUT);
ct_test(pTest, decoded_instance == instance);
+6 -5
View File
@@ -335,7 +335,8 @@ bool Binary_Output_Write_Property(
return false;
}
/* decode the some of the request */
len = bacapp_decode_application_data(wp_data->application_data,
len =
bacapp_decode_application_data(wp_data->application_data,
wp_data->application_data_len, &value);
/* FIXME: len < application_data_len: more data? */
/* FIXME: len == 0: unable to decode? */
@@ -437,14 +438,14 @@ void testBinaryOutput(
BACNET_ERROR_CODE error_code;
len = Binary_Output_Encode_Property_APDU(&apdu[0],
instance,
len =
Binary_Output_Encode_Property_APDU(&apdu[0], instance,
PROP_OBJECT_IDENTIFIER, BACNET_ARRAY_ALL, &error_class, &error_code);
ct_test(pTest, len != 0);
len = decode_tag_number_and_value(&apdu[0], &tag_number, &len_value);
ct_test(pTest, tag_number == BACNET_APPLICATION_TAG_OBJECT_ID);
len = decode_object_id(&apdu[len],
(int *) &decoded_type, &decoded_instance);
len =
decode_object_id(&apdu[len], (int *) &decoded_type, &decoded_instance);
ct_test(pTest, decoded_type == OBJECT_BINARY_OUTPUT);
ct_test(pTest, decoded_instance == instance);
+6 -5
View File
@@ -328,7 +328,8 @@ bool Binary_Value_Write_Property(
return false;
}
/* decode the some of the request */
len = bacapp_decode_application_data(wp_data->application_data,
len =
bacapp_decode_application_data(wp_data->application_data,
wp_data->application_data_len, &value);
/* FIXME: len < application_data_len: more data? */
/* FIXME: len == 0: unable to decode? */
@@ -429,14 +430,14 @@ void testBinary_Value(
BACNET_ERROR_CODE error_code;
len = Binary_Value_Encode_Property_APDU(&apdu[0],
instance,
len =
Binary_Value_Encode_Property_APDU(&apdu[0], instance,
PROP_OBJECT_IDENTIFIER, BACNET_ARRAY_ALL, &error_class, &error_code);
ct_test(pTest, len != 0);
len = decode_tag_number_and_value(&apdu[0], &tag_number, &len_value);
ct_test(pTest, tag_number == BACNET_APPLICATION_TAG_OBJECT_ID);
len = decode_object_id(&apdu[len],
(int *) &decoded_type, &decoded_instance);
len =
decode_object_id(&apdu[len], (int *) &decoded_type, &decoded_instance);
ct_test(pTest, decoded_type == OBJECT_BINARY_VALUE);
ct_test(pTest, decoded_instance == instance);
+10 -6
View File
@@ -663,7 +663,8 @@ int Device_Encode_Property_APDU(
switch (property) {
case PROP_OBJECT_IDENTIFIER:
apdu_len = encode_application_object_id(&apdu[0], OBJECT_DEVICE,
apdu_len =
encode_application_object_id(&apdu[0], OBJECT_DEVICE,
Object_Instance_Number);
break;
case PROP_OBJECT_NAME:
@@ -839,11 +840,13 @@ int Device_Encode_Property_APDU(
}
break;
case PROP_MAX_APDU_LENGTH_ACCEPTED:
apdu_len = encode_application_unsigned(&apdu[0],
apdu_len =
encode_application_unsigned(&apdu[0],
Device_Max_APDU_Length_Accepted());
break;
case PROP_SEGMENTATION_SUPPORTED:
apdu_len = encode_application_enumerated(&apdu[0],
apdu_len =
encode_application_enumerated(&apdu[0],
Device_Segmentation_Supported());
break;
case PROP_APDU_TIMEOUT:
@@ -897,7 +900,8 @@ bool Device_Write_Property(
return false;
}
/* decode the some of the request */
len = bacapp_decode_application_data(wp_data->application_data,
len =
bacapp_decode_application_data(wp_data->application_data,
wp_data->application_data_len, &value);
/* FIXME: len < application_data_len: more data? */
/* FIXME: len == 0: unable to decode? */
@@ -921,8 +925,8 @@ bool Device_Write_Property(
case PROP_NUMBER_OF_APDU_RETRIES:
if (value.tag == BACNET_APPLICATION_TAG_UNSIGNED_INT) {
/* FIXME: bounds check? */
Device_Set_Number_Of_APDU_Retries((uint8_t) value.
type.Unsigned_Int);
Device_Set_Number_Of_APDU_Retries((uint8_t) value.type.
Unsigned_Int);
status = true;
} else {
*error_class = ERROR_CLASS_PROPERTY;
+50 -34
View File
@@ -314,12 +314,10 @@ struct tm {
timer = time(NULL);
tblock = localtime(&timer);
datetime_set_values(bdatetime,
(uint16_t) tblock->tm_year,
(uint8_t) tblock->tm_mon,
(uint8_t) tblock->tm_mday,
(uint8_t) tblock->tm_hour,
(uint8_t) tblock->tm_min, (uint8_t) tblock->tm_sec, 0);
datetime_set_values(bdatetime, (uint16_t) tblock->tm_year,
(uint8_t) tblock->tm_mon, (uint8_t) tblock->tm_mday,
(uint8_t) tblock->tm_hour, (uint8_t) tblock->tm_min,
(uint8_t) tblock->tm_sec, 0);
}
/* convert the shed level request into an Analog Output Present_Value */
@@ -758,16 +756,19 @@ int Load_Control_Encode_Property_APDU(
case PROP_REQUESTED_SHED_LEVEL:
switch (Requested_Shed_Level[object_index].type) {
case BACNET_SHED_TYPE_PERCENT:
apdu_len = encode_context_unsigned(&apdu[0], 0,
apdu_len =
encode_context_unsigned(&apdu[0], 0,
Requested_Shed_Level[object_index].value.percent);
break;
case BACNET_SHED_TYPE_AMOUNT:
apdu_len = encode_context_real(&apdu[0], 2,
apdu_len =
encode_context_real(&apdu[0], 2,
Requested_Shed_Level[object_index].value.amount);
break;
case BACNET_SHED_TYPE_LEVEL:
default:
apdu_len = encode_context_unsigned(&apdu[0], 1,
apdu_len =
encode_context_unsigned(&apdu[0], 1,
Requested_Shed_Level[object_index].value.level);
break;
}
@@ -777,16 +778,19 @@ int Load_Control_Encode_Property_APDU(
encode_application_date(&apdu[0],
&Start_Time[object_index].date);
apdu_len = len;
len = encode_application_time(&apdu[apdu_len],
len =
encode_application_time(&apdu[apdu_len],
&Start_Time[object_index].time);
apdu_len += len;
break;
case PROP_SHED_DURATION:
apdu_len = encode_application_unsigned(&apdu[0],
apdu_len =
encode_application_unsigned(&apdu[0],
Shed_Duration[object_index]);
break;
case PROP_DUTY_WINDOW:
apdu_len = encode_application_unsigned(&apdu[0],
apdu_len =
encode_application_unsigned(&apdu[0],
Duty_Window[object_index]);
break;
case PROP_ENABLE:
@@ -794,22 +798,26 @@ int Load_Control_Encode_Property_APDU(
apdu_len = encode_application_boolean(&apdu[0], state);
break;
case PROP_FULL_DUTY_BASELINE: /* optional */
apdu_len = encode_application_real(&apdu[0],
apdu_len =
encode_application_real(&apdu[0],
Full_Duty_Baseline[object_index]);
break;
case PROP_EXPECTED_SHED_LEVEL:
switch (Expected_Shed_Level[object_index].type) {
case BACNET_SHED_TYPE_PERCENT:
apdu_len = encode_context_unsigned(&apdu[0], 0,
apdu_len =
encode_context_unsigned(&apdu[0], 0,
Expected_Shed_Level[object_index].value.percent);
break;
case BACNET_SHED_TYPE_AMOUNT:
apdu_len = encode_context_real(&apdu[0], 2,
apdu_len =
encode_context_real(&apdu[0], 2,
Expected_Shed_Level[object_index].value.amount);
break;
case BACNET_SHED_TYPE_LEVEL:
default:
apdu_len = encode_context_unsigned(&apdu[0], 1,
apdu_len =
encode_context_unsigned(&apdu[0], 1,
Expected_Shed_Level[object_index].value.level);
break;
}
@@ -817,16 +825,19 @@ int Load_Control_Encode_Property_APDU(
case PROP_ACTUAL_SHED_LEVEL:
switch (Actual_Shed_Level[object_index].type) {
case BACNET_SHED_TYPE_PERCENT:
apdu_len = encode_context_unsigned(&apdu[0], 0,
apdu_len =
encode_context_unsigned(&apdu[0], 0,
Actual_Shed_Level[object_index].value.percent);
break;
case BACNET_SHED_TYPE_AMOUNT:
apdu_len = encode_context_real(&apdu[0], 2,
apdu_len =
encode_context_real(&apdu[0], 2,
Actual_Shed_Level[object_index].value.amount);
break;
case BACNET_SHED_TYPE_LEVEL:
default:
apdu_len = encode_context_unsigned(&apdu[0], 1,
apdu_len =
encode_context_unsigned(&apdu[0], 1,
Actual_Shed_Level[object_index].value.level);
break;
}
@@ -857,7 +868,8 @@ int Load_Control_Encode_Property_APDU(
}
} else {
if (array_index <= MAX_SHED_LEVELS) {
apdu_len = encode_application_unsigned(&apdu[0],
apdu_len =
encode_application_unsigned(&apdu[0],
Shed_Levels[object_index][array_index - 1]);
} else {
*error_class = ERROR_CLASS_PROPERTY;
@@ -879,7 +891,8 @@ int Load_Control_Encode_Property_APDU(
/* FIXME: check if we have room before adding it to APDU */
characterstring_init_ansi(&char_string,
Shed_Level_Descriptions[i]);
len = encode_application_character_string(&apdu[apdu_len],
len =
encode_application_character_string(&apdu[apdu_len],
&char_string);
/* add it if we have room */
if ((apdu_len + len) < MAX_APDU)
@@ -895,7 +908,8 @@ int Load_Control_Encode_Property_APDU(
if (array_index <= MAX_SHED_LEVELS) {
characterstring_init_ansi(&char_string,
Shed_Level_Descriptions[array_index - 1]);
apdu_len = encode_application_character_string(&apdu[0],
apdu_len =
encode_application_character_string(&apdu[0],
&char_string);
} else {
*error_class = ERROR_CLASS_PROPERTY;
@@ -932,16 +946,18 @@ bool Load_Control_Write_Property(
return false;
}
/* decode the some of the request */
len = bacapp_decode_application_data(wp_data->application_data,
len =
bacapp_decode_application_data(wp_data->application_data,
wp_data->application_data_len, &value);
/* FIXME: len < application_data_len: more data? */
/* FIXME: len == 0: unable to decode? */
object_index = Load_Control_Instance_To_Index(wp_data->object_instance);
switch (wp_data->object_property) {
case PROP_REQUESTED_SHED_LEVEL:
len = bacapp_decode_context_data(wp_data->application_data,
wp_data->application_data_len,
&value, PROP_REQUESTED_SHED_LEVEL);
len =
bacapp_decode_context_data(wp_data->application_data,
wp_data->application_data_len, &value,
PROP_REQUESTED_SHED_LEVEL);
if (value.context_tag == 0) {
/* percent - Unsigned */
Requested_Shed_Level[object_index].type =
@@ -974,8 +990,8 @@ bool Load_Control_Write_Property(
break;
case PROP_START_TIME:
if (value.tag == BACNET_APPLICATION_TAG_DATE) {
memcpy(&Start_Time[object_index].date,
&value.type.Date, sizeof(value.type.Date));
memcpy(&Start_Time[object_index].date, &value.type.Date,
sizeof(value.type.Date));
Start_Time_Property_Written[object_index] = true;
status = true;
} else {
@@ -988,8 +1004,8 @@ bool Load_Control_Write_Property(
bacapp_decode_application_data(wp_data->application_data + len,
wp_data->application_data_len - len, &value);
if (len && value.tag == BACNET_APPLICATION_TAG_TIME) {
memcpy(&Start_Time[object_index].time,
&value.type.Time, sizeof(value.type.Time));
memcpy(&Start_Time[object_index].time, &value.type.Time,
sizeof(value.type.Time));
status = true;
} else {
status = false;
@@ -1455,14 +1471,14 @@ void testLoadControl(
BACNET_ERROR_CLASS error_class;
BACNET_ERROR_CODE error_code;
len = Load_Control_Encode_Property_APDU(&apdu[0],
instance,
len =
Load_Control_Encode_Property_APDU(&apdu[0], instance,
PROP_OBJECT_IDENTIFIER, BACNET_ARRAY_ALL, &error_class, &error_code);
ct_test(pTest, len != 0);
len = decode_tag_number_and_value(&apdu[0], &tag_number, &len_value);
ct_test(pTest, tag_number == BACNET_APPLICATION_TAG_OBJECT_ID);
len = decode_object_id(&apdu[len],
(int *) &decoded_type, &decoded_instance);
len =
decode_object_id(&apdu[len], (int *) &decoded_type, &decoded_instance);
ct_test(pTest, decoded_type == OBJECT_LOAD_CONTROL);
ct_test(pTest, decoded_instance == instance);
+14 -10
View File
@@ -144,8 +144,9 @@ int Lighting_Output_Decode_Lighting_Command(
/* Tag 0: operation */
if (!decode_is_context_tag(&apdu[apdu_len], 0))
return -1;
len = decode_tag_number_and_value(&apdu[apdu_len],
&tag_number, &len_value_type);
len =
decode_tag_number_and_value(&apdu[apdu_len], &tag_number,
&len_value_type);
apdu_len += len;
len =
decode_enumerated(&apdu[apdu_len], len_value_type,
@@ -153,8 +154,9 @@ int Lighting_Output_Decode_Lighting_Command(
apdu_len += len;
/* Tag 1: level - OPTIONAL */
if (decode_is_context_tag(&apdu[apdu_len], 1)) {
len = decode_tag_number_and_value(&apdu[apdu_len],
&tag_number, &len_value_type);
len =
decode_tag_number_and_value(&apdu[apdu_len], &tag_number,
&len_value_type);
apdu_len += len;
len = decode_real(&apdu[apdu_len], &real_value);
apdu_len += len;
@@ -412,7 +414,8 @@ int Lighting_Output_Encode_Property_APDU(
apdu_len = encode_application_real(&apdu[0], real_value);
break;
case PROP_LIGHTING_COMMAND:
apdu_len = Lighting_Output_Encode_Lighting_Command(&apdu[0],
apdu_len =
Lighting_Output_Encode_Lighting_Command(&apdu[0],
&Lighting_Command[object_instance]);
break;
case PROP_STATUS_FLAGS:
@@ -521,7 +524,8 @@ bool Lighting_Output_Write_Property(
return false;
}
/* decode the some of the request */
len = bacapp_decode_application_data(wp_data->application_data,
len =
bacapp_decode_application_data(wp_data->application_data,
wp_data->application_data_len, &value);
/* FIXME: len < application_data_len: more data? */
/* FIXME: len == 0: unable to decode? */
@@ -615,14 +619,14 @@ void testLightingOutput(
BACNET_ERROR_CODE error_code;
len = Lighting_Output_Encode_Property_APDU(&apdu[0],
instance,
len =
Lighting_Output_Encode_Property_APDU(&apdu[0], instance,
PROP_OBJECT_IDENTIFIER, BACNET_ARRAY_ALL, &error_class, &error_code);
ct_test(pTest, len != 0);
len = decode_tag_number_and_value(&apdu[0], &tag_number, &len_value);
ct_test(pTest, tag_number == BACNET_APPLICATION_TAG_OBJECT_ID);
len = decode_object_id(&apdu[len],
(int *) &decoded_type, &decoded_instance);
len =
decode_object_id(&apdu[len], (int *) &decoded_type, &decoded_instance);
ct_test(pTest, decoded_type == OBJECT_LIGHTING_OUTPUT);
ct_test(pTest, decoded_instance == instance);
+6 -5
View File
@@ -307,7 +307,8 @@ bool Life_Safety_Point_Write_Property(
return false;
}
/* decode the some of the request */
len = bacapp_decode_application_data(wp_data->application_data,
len =
bacapp_decode_application_data(wp_data->application_data,
wp_data->application_data_len, &value);
/* FIXME: len < application_data_len: more data? */
/* FIXME: len == 0: unable to decode? */
@@ -373,14 +374,14 @@ void testLifeSafetyPoint(
BACNET_ERROR_CODE error_code;
len = Life_Safety_Point_Encode_Property_APDU(&apdu[0],
instance,
len =
Life_Safety_Point_Encode_Property_APDU(&apdu[0], instance,
PROP_OBJECT_IDENTIFIER, BACNET_ARRAY_ALL, &error_class, &error_code);
ct_test(pTest, len != 0);
len = decode_tag_number_and_value(&apdu[0], &tag_number, &len_value);
ct_test(pTest, tag_number == BACNET_APPLICATION_TAG_OBJECT_ID);
len = decode_object_id(&apdu[len],
(int *) &decoded_type, &decoded_instance);
len =
decode_object_id(&apdu[len], (int *) &decoded_type, &decoded_instance);
ct_test(pTest, decoded_type == OBJECT_LIFE_SAFETY_POINT);
ct_test(pTest, decoded_instance == instance);
+8 -6
View File
@@ -312,7 +312,8 @@ int Multistate_Output_Encode_Property_APDU(
apdu_len = encode_application_enumerated(&apdu[0], present_value);
break;
case PROP_NUMBER_OF_STATES:
apdu_len = encode_application_unsigned(&apdu[apdu_len],
apdu_len =
encode_application_unsigned(&apdu[apdu_len],
MULTISTATE_NUMBER_OF_STATES);
break;
@@ -346,7 +347,8 @@ bool Multistate_Output_Write_Property(
return false;
}
/* decode the some of the request */
len = bacapp_decode_application_data(wp_data->application_data,
len =
bacapp_decode_application_data(wp_data->application_data,
wp_data->application_data_len, &value);
/* FIXME: len < application_data_len: more data? */
/* FIXME: len == 0: unable to decode? */
@@ -451,14 +453,14 @@ void testMultistateOutput(
BACNET_ERROR_CODE error_code;
len = Multistate_Output_Encode_Property_APDU(&apdu[0],
instance,
len =
Multistate_Output_Encode_Property_APDU(&apdu[0], instance,
PROP_OBJECT_IDENTIFIER, BACNET_ARRAY_ALL, &error_class, &error_code);
ct_test(pTest, len != 0);
len = decode_tag_number_and_value(&apdu[0], &tag_number, &len_value);
ct_test(pTest, tag_number == BACNET_APPLICATION_TAG_OBJECT_ID);
len = decode_object_id(&apdu[len],
(int *) &decoded_type, &decoded_instance);
len =
decode_object_id(&apdu[len], (int *) &decoded_type, &decoded_instance);
ct_test(pTest, decoded_type == OBJECT_MULTI_STATE_OUTPUT);
ct_test(pTest, decoded_instance == instance);