|
|
|
@ -212,15 +212,12 @@ static void NOINLINE send_hwstatus(mavlink_channel_t chan)
@@ -212,15 +212,12 @@ static void NOINLINE send_hwstatus(mavlink_channel_t chan)
|
|
|
|
|
|
|
|
|
|
static void NOINLINE send_waypoint_request(mavlink_channel_t chan) |
|
|
|
|
{ |
|
|
|
|
if (chan == MAVLINK_COMM_0) |
|
|
|
|
gcs0.queued_waypoint_send(); |
|
|
|
|
else |
|
|
|
|
gcs3.queued_waypoint_send(); |
|
|
|
|
gcs[chan-MAVLINK_COMM_0].queued_waypoint_send(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void NOINLINE send_statustext(mavlink_channel_t chan) |
|
|
|
|
{ |
|
|
|
|
mavlink_statustext_t *s = (chan == MAVLINK_COMM_0?&gcs0.pending_status:&gcs3.pending_status); |
|
|
|
|
mavlink_statustext_t *s = &gcs[chan-MAVLINK_COMM_0].pending_status; |
|
|
|
|
mavlink_msg_statustext_send( |
|
|
|
|
chan, |
|
|
|
|
s->severity, |
|
|
|
@ -294,11 +291,7 @@ static bool mavlink_try_send_message(mavlink_channel_t chan, enum ap_message id,
@@ -294,11 +291,7 @@ static bool mavlink_try_send_message(mavlink_channel_t chan, enum ap_message id,
|
|
|
|
|
|
|
|
|
|
case MSG_NEXT_PARAM: |
|
|
|
|
CHECK_PAYLOAD_SIZE(PARAM_VALUE); |
|
|
|
|
if (chan == MAVLINK_COMM_0) { |
|
|
|
|
gcs0.queued_param_send(); |
|
|
|
|
} else if (gcs3.initialised) { |
|
|
|
|
gcs3.queued_param_send(); |
|
|
|
|
} |
|
|
|
|
gcs[chan-MAVLINK_COMM_0].queued_param_send(); |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case MSG_NEXT_WAYPOINT: |
|
|
|
@ -403,7 +396,7 @@ void mavlink_send_text(mavlink_channel_t chan, gcs_severity severity, const char
@@ -403,7 +396,7 @@ void mavlink_send_text(mavlink_channel_t chan, gcs_severity severity, const char
|
|
|
|
|
{ |
|
|
|
|
if (severity == SEVERITY_LOW) { |
|
|
|
|
// send via the deferred queuing system |
|
|
|
|
mavlink_statustext_t *s = (chan == MAVLINK_COMM_0?&gcs0.pending_status:&gcs3.pending_status); |
|
|
|
|
mavlink_statustext_t *s = &gcs[chan-MAVLINK_COMM_0].pending_status; |
|
|
|
|
s->severity = (uint8_t)severity; |
|
|
|
|
strncpy((char *)s->text, str, sizeof(s->text)); |
|
|
|
|
mavlink_send_message(chan, MSG_STATUSTEXT, 0); |
|
|
|
@ -1042,7 +1035,7 @@ mission_failed:
@@ -1042,7 +1035,7 @@ mission_failed:
|
|
|
|
|
static void mavlink_delay_cb() |
|
|
|
|
{ |
|
|
|
|
static uint32_t last_1hz, last_50hz, last_5s; |
|
|
|
|
if (!gcs0.initialised) return; |
|
|
|
|
if (!gcs[0].initialised) return; |
|
|
|
|
|
|
|
|
|
in_mavlink_delay = true; |
|
|
|
|
|
|
|
|
@ -1070,9 +1063,10 @@ static void mavlink_delay_cb()
@@ -1070,9 +1063,10 @@ static void mavlink_delay_cb()
|
|
|
|
|
*/ |
|
|
|
|
static void gcs_send_message(enum ap_message id) |
|
|
|
|
{ |
|
|
|
|
gcs0.send_message(id); |
|
|
|
|
if (gcs3.initialised) { |
|
|
|
|
gcs3.send_message(id); |
|
|
|
|
for (uint8_t i=0; i<num_gcs; i++) { |
|
|
|
|
if (gcs[i].initialised) { |
|
|
|
|
gcs[i].send_message(id); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1081,9 +1075,10 @@ static void gcs_send_message(enum ap_message id)
@@ -1081,9 +1075,10 @@ static void gcs_send_message(enum ap_message id)
|
|
|
|
|
*/ |
|
|
|
|
static void gcs_data_stream_send(void) |
|
|
|
|
{ |
|
|
|
|
gcs0.data_stream_send(); |
|
|
|
|
if (gcs3.initialised) { |
|
|
|
|
gcs3.data_stream_send(); |
|
|
|
|
for (uint8_t i=0; i<num_gcs; i++) { |
|
|
|
|
if (gcs[i].initialised) { |
|
|
|
|
gcs[i].data_stream_send(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1092,17 +1087,19 @@ static void gcs_data_stream_send(void)
@@ -1092,17 +1087,19 @@ static void gcs_data_stream_send(void)
|
|
|
|
|
*/ |
|
|
|
|
static void gcs_update(void) |
|
|
|
|
{ |
|
|
|
|
gcs0.update(); |
|
|
|
|
if (gcs3.initialised) { |
|
|
|
|
gcs3.update(); |
|
|
|
|
for (uint8_t i=0; i<num_gcs; i++) { |
|
|
|
|
if (gcs[i].initialised) { |
|
|
|
|
gcs[i].update(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void gcs_send_text_P(gcs_severity severity, const prog_char_t *str) |
|
|
|
|
{ |
|
|
|
|
gcs0.send_text_P(severity, str); |
|
|
|
|
if (gcs3.initialised) { |
|
|
|
|
gcs3.send_text_P(severity, str); |
|
|
|
|
for (uint8_t i=0; i<num_gcs; i++) { |
|
|
|
|
if (gcs[i].initialised) { |
|
|
|
|
gcs[i].send_text_P(severity, str); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#if LOGGING_ENABLED == ENABLED |
|
|
|
|
DataFlash.Log_Write_Message_P(str); |
|
|
|
@ -1117,18 +1114,20 @@ static void gcs_send_text_P(gcs_severity severity, const prog_char_t *str)
@@ -1117,18 +1114,20 @@ static void gcs_send_text_P(gcs_severity severity, const prog_char_t *str)
|
|
|
|
|
void gcs_send_text_fmt(const prog_char_t *fmt, ...) |
|
|
|
|
{ |
|
|
|
|
va_list arg_list; |
|
|
|
|
gcs0.pending_status.severity = (uint8_t)SEVERITY_LOW; |
|
|
|
|
gcs[0].pending_status.severity = (uint8_t)SEVERITY_LOW; |
|
|
|
|
va_start(arg_list, fmt); |
|
|
|
|
hal.util->vsnprintf_P((char *)gcs0.pending_status.text, |
|
|
|
|
sizeof(gcs0.pending_status.text), fmt, arg_list); |
|
|
|
|
hal.util->vsnprintf_P((char *)gcs[0].pending_status.text, |
|
|
|
|
sizeof(gcs[0].pending_status.text), fmt, arg_list); |
|
|
|
|
va_end(arg_list); |
|
|
|
|
#if LOGGING_ENABLED == ENABLED |
|
|
|
|
DataFlash.Log_Write_Message(gcs0.pending_status.text); |
|
|
|
|
DataFlash.Log_Write_Message(gcs[0].pending_status.text); |
|
|
|
|
#endif |
|
|
|
|
gcs3.pending_status = gcs0.pending_status; |
|
|
|
|
mavlink_send_message(MAVLINK_COMM_0, MSG_STATUSTEXT, 0); |
|
|
|
|
if (gcs3.initialised) { |
|
|
|
|
mavlink_send_message(MAVLINK_COMM_1, MSG_STATUSTEXT, 0); |
|
|
|
|
for (uint8_t i=1; i<num_gcs; i++) { |
|
|
|
|
if (gcs[i].initialised) { |
|
|
|
|
gcs[i].pending_status = gcs[0].pending_status; |
|
|
|
|
mavlink_send_message((mavlink_channel_t)i, MSG_STATUSTEXT, 0); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|