diff --git a/src/CommunicationManager.cpp b/src/CommunicationManager.cpp index 6201c53..f7693b0 100644 --- a/src/CommunicationManager.cpp +++ b/src/CommunicationManager.cpp @@ -644,7 +644,7 @@ inline void CommunicationManager::Send_Mavlink_Message_Callback( uint16_t* header_16 = u64_cvt_u16(header); /*buffer byte counter*/ int tot=0; - //std::cout << "Sent header" <payload64.size() <= MAX_NBR_OF_INT64){ @@ -686,18 +686,20 @@ inline void CommunicationManager::Send_Mavlink_Message_Callback( /*Copy the msgs into a 64bit array*/ uint64_t message_obt[mavlink_msg->payload64.size()]; /*buffer for easy handel operation*/ - uint8_t* cpy_buff = (uint8_t*)malloc( sizeof(uint64_t)+sizeof(uint16_t) + ( sizeof(uint64_t)*mavlink_msg->payload64.size() ) ); - memset(cpy_buff, 0,sizeof(uint64_t) + ( sizeof(uint64_t)*mavlink_msg->payload64.size() )); + uint8_t* cpy_buff = (uint8_t*)malloc( sizeof(uint64_t)+sizeof(uint16_t) + ( sizeof(uint64_t)*MAX_NBR_OF_INT64 ) ); + memset(cpy_buff, 0,sizeof(uint64_t) + ( sizeof(uint64_t)*MAX_NBR_OF_INT64 )); for (std::size_t i =0; ipayload64.size(); i++) { message_obt[i] =(uint64_t)mavlink_msg->payload64[i]; } + //std::cout << "put header in dict" <