Mark non-last print chunks in buffer with 'multi' flag

This commit is contained in:
Oleg Kalachev 2025-07-22 13:53:29 +03:00
parent a9ede4c90f
commit 0533d2716d

View File

@ -208,7 +208,9 @@ void sendMavlinkPrint() {
strlcpy(data, str + i, sizeof(data));
mavlink_message_t msg;
mavlink_msg_serial_control_pack(SYSTEM_ID, MAV_COMP_ID_AUTOPILOT1, &msg,
SERIAL_CONTROL_DEV_SHELL, 0, 0, 0, strlen(data), (uint8_t *)data, 0, 0);
SERIAL_CONTROL_DEV_SHELL,
i + MAVLINK_MSG_SERIAL_CONTROL_FIELD_DATA_LEN < strlen(str) ? SERIAL_CONTROL_FLAG_MULTI : 0, // more chunks to go
0, 0, strlen(data), (uint8_t *)data, 0, 0);
sendMessage(&msg);
}
mavlinkPrintBuffer.clear();