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:
bakmaria
2023-09-11 16:41:06 +02:00
committed by GitHub
parent 55b8b3d93c
commit e4dd30ed89
2 changed files with 19 additions and 0 deletions
+2
View File
@@ -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(