Skip to content

Fix possible bug in FSK decoder

George Vardakis requested to merge gh-6f6c3c06/73/GVardakis/fsk_bug_fix into master

In case the preamble and sync word length is 3 to 6, the variable d_search_for_sync_thrhld is initialized to 1. When the first preamble byte is found, the variable d_decoded_bytes becomes 1. If after 8 bits the next preamble byte is found, d_decoded_bytes is increased to 2 in line 233. Then the statement if(d_decoded_bytes == d_search_for_sync_thrhld) will not be satisfied (d_decoded_bytes=2, d_search_for_sync_thrhld=1), although it should, and as a matter of fact it will not ever be satisfied, which will result in the code never start searching for the sync word.

Merge request reports