Fix wrong calculation of frames in bacapp_data_len (#491)
* Fixed wrong calculation of data length. In cases when 2 sets of opening & closing tags (first opening tag context tag is 3, second is 0) were sent, one of the frames wasn't added, and the resulted sum was wrong * Added unit test for case with two sets of opening & closing tags
This commit is contained in:
@@ -1546,6 +1546,8 @@ int bacapp_data_len(
|
||||
} else if (tag_number == opening_tag_number) {
|
||||
total_len_enable = true;
|
||||
opening_tag_number_counter++;
|
||||
} else {
|
||||
total_len_enable = true;
|
||||
}
|
||||
} else if (bacnet_is_closing_tag(apdu, apdu_len_max)) {
|
||||
len = bacnet_tag_number_and_value_decode(
|
||||
|
||||
Reference in New Issue
Block a user