From 0fa60586c49c2ba10f1e24c6533ebf4980372f2f Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Sun, 8 Mar 2020 15:51:25 +0100 Subject: Introduce debuging builds: Store first packets on each channel --- src/ufo-roof-read-task.c | 15 +++++++++++++++ src/ufo-roof.h | 1 + 2 files changed, 16 insertions(+) diff --git a/src/ufo-roof-read-task.c b/src/ufo-roof-read-task.c index a8ddded..7d55b79 100644 --- a/src/ufo-roof-read-task.c +++ b/src/ufo-roof-read-task.c @@ -190,6 +190,21 @@ ufo_roof_read_task_generate (UfoTask *task, return FALSE; } +#ifdef UFO_ROOF_DEBUG + // Store first received packet on each channel... + static int debug = 1; + if (debug) { + char fname[256]; + sprintf(fname, "channel%i_packet0.raw", priv->id); + FILE *f = fopen(fname, "w"); + if (f) { + fwrite(output_buffer, 1, cfg->max_packets * cfg->max_packet_size, f); + fclose(f); + } + debug = 0; + } +#endif /* UFO_ROOF_DEBUG */ + // FIXME: End of data (shall we restart in the network case?) if (!packets) return FALSE; diff --git a/src/ufo-roof.h b/src/ufo-roof.h index 9303045..23f8429 100644 --- a/src/ufo-roof.h +++ b/src/ufo-roof.h @@ -4,6 +4,7 @@ #include "ufo-roof-config.h" #include "ufo-roof-error.h" +//#define UFO_ROOF_DEBUG #define UFO_ROOF_PACKET_HEADER(buf) ((UfoRoofPacketHeader*)(buf)) #define UFO_ROOF_PACKET_BLOCK_HEADER(buf, cfg) ((UfoRoofPacketBlockHeader*)(((uint8_t*)buf) + cfg->max_packets * cfg->max_packet_size)) -- cgit v1.2.1