Copter: log to dataflash statustext messages from my_gcs

This commit is contained in:
Tom Pittenger 2016-09-26 00:13:30 -07:00
parent 31321b3b60
commit 748beb094d
1 changed files with 14 additions and 0 deletions

View File

@ -1094,6 +1094,20 @@ void GCS_MAVLINK_Copter::handleMessage(mavlink_message_t* msg)
break;
}
case MAVLINK_MSG_ID_STATUSTEXT:
{
// ignore any statustext messages not from our GCS:
if (msg->sysid != copter.g.sysid_my_gcs) {
break;
}
mavlink_statustext_t packet;
mavlink_msg_statustext_decode(msg, &packet);
char text[MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN+1+4] = { 'G','C','S',':'};
memcpy(&text[4], packet.text, MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN);
copter.DataFlash.Log_Write_Message(text);
break;
}
case MAVLINK_MSG_ID_GIMBAL_REPORT:
{
#if MOUNT == ENABLED