Debug prints

This commit is contained in:
vivek-shankar 2017-01-25 23:48:54 -05:00
parent 24494cee0a
commit 1313355949
1 changed files with 4 additions and 3 deletions

View File

@ -370,7 +370,7 @@ inline void CommunicationManager::Check_In_Messages_and_Transfer_To_Topics()
&current_int64); &current_int64);
header = u64_cvt_u16(current_int64); header = u64_cvt_u16(current_int64);
uint16_t checksum_cur=header[1]; uint16_t checksum_cur=header[1];
std::cout << "Received header" <<header[0] <<header[1] << header[2]<< header[3]<< std::endl;
if(header[3]==1){ if(header[3]==1){
for (std::size_t i = 1; i < in_message->size(); i++) for (std::size_t i = 1; i < in_message->size(); i++)
{ {
@ -383,12 +383,13 @@ inline void CommunicationManager::Check_In_Messages_and_Transfer_To_Topics()
} }
} }
std::cout << "Single packet message" << std::endl; std::cout << "Single packet message received" << std::endl;
mavlink_publisher_.publish(mavlink_msg); mavlink_publisher_.publish(mavlink_msg);
delete[] header; delete[] header;
} }
else{ else{
std::cout << "Multi packet message" << std::endl; std::cout << "Multi packet message" << std::endl;
if (msgs.size()==0 && header[2]==1){ if (msgs.size()==0 && header[2]==1){
std::cout << "first message" << std::endl; std::cout << "first message" << std::endl;
checksum_cur=header[1]; checksum_cur=header[1];
@ -549,7 +550,7 @@ inline void CommunicationManager::Send_Mavlink_Message_Callback(
cnt++; cnt++;
} }
else else
{ { std::cout << "Multi frame sent no:"<<number << std::endl;
Generate_Transmit_Request_Frame(temporary_buffer, &frame); Generate_Transmit_Request_Frame(temporary_buffer, &frame);
serial_device_.Send_Frame(frame); serial_device_.Send_Frame(frame);
number++; number++;