diff options
-rw-r--r-- | src/ufo-roof-read-task.c | 15 | ||||
-rw-r--r-- | src/ufo-roof.h | 1 |
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)) |