diff --git a/src/shared/radio/MavlinkDriver/MavlinkDriver.h b/src/shared/radio/MavlinkDriver/MavlinkDriver.h index a1186fc2505ea36d780c40b89889ee4adb7572f5..a4bdcf780d3caa5f11ca82f4334a742a151f374c 100644 --- a/src/shared/radio/MavlinkDriver/MavlinkDriver.h +++ b/src/shared/radio/MavlinkDriver/MavlinkDriver.h @@ -178,11 +178,12 @@ private: size_t outBufferMaxAge; uint16_t pollingTime = 100; // ms - // Buffers - static constexpr size_t MAV_IN_BUFFER_SIZE = 256; + // Buffers (equal to MTU for ethernet) + static constexpr size_t MAV_IN_BUFFER_SIZE = 1500; SyncPacketQueue<PktLength, OutQueueSize> outQueue; - uint8_t rcvBuffer[MAV_IN_BUFFER_SIZE]; + std::unique_ptr<uint8_t[]> rcvBuffer = + std::make_unique<uint8_t[]>(MAV_IN_BUFFER_SIZE); // Status MavlinkStatus status; @@ -329,7 +330,7 @@ void MavlinkDriver<PktLength, OutQueueSize, MavMsgLength>::runReceiver() while (!stopFlag) { // Check for a new message on the device - rcvSize = device->receive(rcvBuffer, MAV_IN_BUFFER_SIZE); + rcvSize = device->receive(rcvBuffer.get(), MAV_IN_BUFFER_SIZE); // If there's a new message ... if (rcvSize > 0)