|
|
|
@ -39,7 +39,7 @@
@@ -39,7 +39,7 @@
|
|
|
|
|
|
|
|
|
|
// macros used to determine if a message will fit in the space available.
|
|
|
|
|
|
|
|
|
|
void gcs_out_of_space_to_send_count(mavlink_channel_t chan); |
|
|
|
|
void gcs_out_of_space_to_send(mavlink_channel_t chan); |
|
|
|
|
|
|
|
|
|
// important note: despite the names, these messages do NOT check to
|
|
|
|
|
// see if the payload will fit in the buffer. They check to see if
|
|
|
|
@ -56,14 +56,14 @@ void gcs_out_of_space_to_send_count(mavlink_channel_t chan);
@@ -56,14 +56,14 @@ void gcs_out_of_space_to_send_count(mavlink_channel_t chan);
|
|
|
|
|
// anywhere in the code to determine if the mavlink message with ID id
|
|
|
|
|
// can currently fit in the output of _chan. Note the use of the ","
|
|
|
|
|
// operator here to increment a counter.
|
|
|
|
|
#define HAVE_PAYLOAD_SPACE(_chan, id) (comm_get_txspace(_chan) >= PAYLOAD_SIZE(_chan, id) ? true : (gcs_out_of_space_to_send_count(_chan), false)) |
|
|
|
|
#define HAVE_PAYLOAD_SPACE(_chan, id) (comm_get_txspace(_chan) >= PAYLOAD_SIZE(_chan, id) ? true : (gcs_out_of_space_to_send(_chan), false)) |
|
|
|
|
|
|
|
|
|
// CHECK_PAYLOAD_SIZE - macro which may only be used within a
|
|
|
|
|
// GCS_MAVLink object's methods. It inserts code which will
|
|
|
|
|
// immediately return false from the current function if there is no
|
|
|
|
|
// room to fit the mavlink message with id id on the current object's
|
|
|
|
|
// output
|
|
|
|
|
#define CHECK_PAYLOAD_SIZE(id) if (txspace() < unsigned(packet_overhead()+MAVLINK_MSG_ID_ ## id ## _LEN)) { gcs_out_of_space_to_send_count(chan); return false; } |
|
|
|
|
#define CHECK_PAYLOAD_SIZE(id) if (txspace() < unsigned(packet_overhead()+MAVLINK_MSG_ID_ ## id ## _LEN)) { gcs_out_of_space_to_send(chan); return false; } |
|
|
|
|
|
|
|
|
|
// CHECK_PAYLOAD_SIZE2 - macro which inserts code which will
|
|
|
|
|
// immediately return false from the current function if there is no
|
|
|
|
|