From c1141fddc164fc6f62ca635caecd5e1413a7c5fe Mon Sep 17 00:00:00 2001 From: vivek-shankar Date: Fri, 27 Jan 2017 09:31:42 -0500 Subject: [PATCH] msg receive bug debug --- src/buzz_utility.cpp | 5 +++-- src/roscontroller.cpp | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/buzz_utility.cpp b/src/buzz_utility.cpp index f882d3f..dbc8f07 100644 --- a/src/buzz_utility.cpp +++ b/src/buzz_utility.cpp @@ -86,6 +86,7 @@ namespace buzz_utility{ uint16_t unMsgSize; uint8_t is_msg_pres=*(uint8_t*)(pl + tot); tot+=sizeof(uint8_t); + fprintf(stdout,"is_updater msg present : %i\n",(int)is_msg_pres); if(is_msg_pres){ unMsgSize = *(uint16_t*)(pl + tot); tot+=sizeof(uint16_t); @@ -128,8 +129,8 @@ namespace buzz_utility{ tot += sizeof(uint16_t); uint8_t updater_msg_pre = 0; uint16_t updater_msgSize= 0; - if((int)get_update_mode()!=CODE_RUNNING && is_msg_present()){ - //fprintf(stdout,"transfer code %d\n", transfer_code); + if((int)get_update_mode()!=CODE_RUNNING && is_msg_present()==1){ + fprintf(stdout,"transfer code \n"); updater_msg_pre =1; //transfer_code=0; *(uint8_t*)(buff_send + tot) = (uint8_t)updater_msg_pre; diff --git a/src/roscontroller.cpp b/src/roscontroller.cpp index 9f34cf7..e466ccf 100644 --- a/src/roscontroller.cpp +++ b/src/roscontroller.cpp @@ -184,6 +184,7 @@ namespace rosbzz_node{ else ROS_ERROR("Failed to call service from flight controller"); } /*obtain Pay load to be sent*/ + fprintf(stdout, "before getting msg from utility\n"); uint64_t* payload_out_ptr= buzz_utility::out_msg_process(); uint64_t position[3]; /*Appened current position to message*/