From c1fe85b59bb5ba0da7dd4aa4f687156eabe2cc31 Mon Sep 17 00:00:00 2001 From: Tommy Vestermark Date: Fri, 10 Jul 2015 17:03:23 +0200 Subject: [PATCH] When reading file, add extra empty samples to ensure EOP detection. Some test data files have too few "idle" samples at the end to ensure end of packet is robustly detected. Decode an extra empty buffer to ensure decoders are flushed. --- src/rtl_433.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/rtl_433.c b/src/rtl_433.c index 3b3fc206..766777f0 100644 --- a/src/rtl_433.c +++ b/src/rtl_433.c @@ -1110,6 +1110,11 @@ int main(int argc, char **argv) { rtlsdr_callback(test_mode_buf, 131072, demod); i++; } + + // Call a last time with cleared samples to ensure EOP detection + memset(test_mode_buf, 128, DEFAULT_BUF_LENGTH); // 128 is 0 in unsigned data + rtlsdr_callback(test_mode_buf, 131072, demod); // Why the magic value 131072? + //Always classify a signal at the end of the file classify_signal(); fprintf(stderr, "Test mode file issued %d packets\n", i);