summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2020-03-08 15:51:25 +0100
committerSuren A. Chilingaryan <csa@suren.me>2020-03-08 15:51:25 +0100
commit0fa60586c49c2ba10f1e24c6533ebf4980372f2f (patch)
treedf6be18afb9ac1bbb22ab40ab704c3fa11debe80
parentf3cec7d31f46697c47529800b532b66707525168 (diff)
downloadufo-roof-temp-0fa60586c49c2ba10f1e24c6533ebf4980372f2f.tar.gz
ufo-roof-temp-0fa60586c49c2ba10f1e24c6533ebf4980372f2f.tar.bz2
ufo-roof-temp-0fa60586c49c2ba10f1e24c6533ebf4980372f2f.tar.xz
ufo-roof-temp-0fa60586c49c2ba10f1e24c6533ebf4980372f2f.zip
Introduce debuging builds: Store first packets on each channel
-rw-r--r--src/ufo-roof-read-task.c15
-rw-r--r--src/ufo-roof.h1
2 files changed, 16 insertions, 0 deletions
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))