From 24494cee0ac80b9fa86f1624864cc5a48d29a7d1 Mon Sep 17 00:00:00 2001 From: vivek-shankar Date: Wed, 25 Jan 2017 23:33:04 -0500 Subject: [PATCH] changes in sending and lots of untested stuff --- launch/xbeemav.launch | 4 ++-- src/CommunicationManager.cpp | 14 +++++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/launch/xbeemav.launch b/launch/xbeemav.launch index b2e7c80..060dac3 100644 --- a/launch/xbeemav.launch +++ b/launch/xbeemav.launch @@ -1,8 +1,8 @@ - - + + diff --git a/src/CommunicationManager.cpp b/src/CommunicationManager.cpp index b421ae3..f04f6ed 100644 --- a/src/CommunicationManager.cpp +++ b/src/CommunicationManager.cpp @@ -530,15 +530,18 @@ inline void CommunicationManager::Send_Mavlink_Message_Callback( uint16_t check_sum = (uint16_t)Caculate_Checksum(&frame); uint16_t cnt=0; uint16_t number=1; - uint16_t total =ceil((double)(mavlink_msg->payload64.size()/20)); + uint16_t total =ceil((double)((double)mavlink_msg->payload64.size()/(double)20)); + std::cout <<"Payload size" <payload64.size() << std::endl; uint64_t header = 0 | ((uint64_t)check_sum << 16) | ((uint64_t)number << 32) |((uint64_t) total << 48) ; + std::cout << "Total chunks:" <payload64.size(); i++) { + if(cnt<20){ converted_bytes += sprintf( temporary_buffer+converted_bytes, "%" PRIu64 " ", @@ -557,10 +560,15 @@ inline void CommunicationManager::Send_Mavlink_Message_Callback( converted_bytes = sprintf( temporary_buffer, "%" PRIu64 " ", (uint64_t)header); + } } - + if(total==1){ + std::cout << "Single frame" << std::endl; + Generate_Transmit_Request_Frame(temporary_buffer, &frame); + serial_device_.Send_Frame(frame); + } //} }