Merge pull request #1434 from paparazzi/mavlink_protocol_cleanup

update the Paparazzi specific mavlink messages
- remove `len` field from `SCRIPT_ITEM`
- report current block with `SCRIPT_CURRENT` message
This commit is contained in:
Felix Ruess
2015-11-22 13:25:48 +01:00
3 changed files with 6 additions and 4 deletions
@@ -50,9 +50,10 @@ void mavlink_send_block(uint16_t seq)
static const char *blocks[] = FP_BLOCKS;
char block_name[50];
strncpy(block_name, blocks[seq], 49); // String containing the name of the block
uint8_t len = strlen(blocks[seq]); // Length of the block name
// make sure the string is null terminated if longer than 49chars
block_name[49] = 0;
mavlink_msg_script_item_send(MAVLINK_COMM_0, mission_mgr.rem_sysid, mission_mgr.rem_compid,
seq, len, block_name);
seq, block_name);
MAVLinkSendMessage();
MAVLINK_DEBUG("Sent BLOCK_ITEM message: seq %i, name %s\n", seq, block_name);
} else {
@@ -92,7 +92,8 @@ void mavlink_mission_periodic(void)
// FIXME: really use the SCRIPT_ITEM message to indicate current block?
if (mission_mgr.current_block != nav_block) {
mission_mgr.current_block = nav_block;
mavlink_send_block(nav_block); // send the current block seq
mavlink_msg_script_current_send(MAVLINK_COMM_0, nav_block);
MAVLinkSendMessage();
}
// check if we had a timeout on a transaction
if (sys_time_check_and_ack_timer(mission_mgr.timer_id)) {