From ac444df03c5633619b52716cdd9d3ea13d7be783 Mon Sep 17 00:00:00 2001 From: vivek-shankar Date: Sat, 28 Jan 2017 04:37:40 -0500 Subject: [PATCH] debug prints and possible fix --- src/buzz_update.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/buzz_update.cpp b/src/buzz_update.cpp index 1c377fb..10d0b57 100644 --- a/src/buzz_update.cpp +++ b/src/buzz_update.cpp @@ -173,9 +173,12 @@ memcpy(updater->inmsg_queue->queue, msg, size); void code_message_inqueue_process(){ int size=0; fprintf(stdout,"[debug]Updater mode %d",(*(int*)(updater->mode)) ); +fprintf(stdout,"[debug] %u : current update number, %u : received update no ",( *(uint16_t*) (updater->update_no) ), (*(uint16_t*)(updater->inmsg_queue->queue)) ); +fprintf(stdout,"[debug]Updater code size %u",(*(uint16_t*)(updater->inmsg_queue->queue) ) ); + if((*(int*)(updater->mode))==CODE_RUNNING){ fprintf(stdout,"[debug]Inside inmsg code running"); - if( (*(uint16_t*)(updater->inmsg_queue->queue)) > (*(uint16_t*) updater->update_no) ){ + if( (*(uint16_t*)(updater->inmsg_queue->queue)) > ( *(uint16_t*) (updater->update_no) ) ){ fprintf(stdout,"[debug]Inside update number comparision"); uint16_t update_no=*(uint16_t*)(updater->inmsg_queue->queue); size +=sizeof(uint16_t);