aboutsummaryrefslogtreecommitdiff
path: root/mavlink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_fence_point.h
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2014-04-13 09:41:23 +0200
committerLorenz Meier <lm@inf.ethz.ch>2014-04-13 23:27:26 +0200
commit14dae529f0b2a41ce7441871f30a9da462be8e72 (patch)
tree41bef0bbff48e97ab4ed2e019dc3939ed31a735e /mavlink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_fence_point.h
parentf183ddad8c62b47bbed6116d07d4b1ac50871557 (diff)
downloadpx4-firmware-14dae529f0b2a41ce7441871f30a9da462be8e72.tar.gz
px4-firmware-14dae529f0b2a41ce7441871f30a9da462be8e72.tar.bz2
px4-firmware-14dae529f0b2a41ce7441871f30a9da462be8e72.zip
mavlink: Updated protocol files
Diffstat (limited to 'mavlink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_fence_point.h')
-rw-r--r--mavlink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_fence_point.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/mavlink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_fence_point.h b/mavlink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_fence_point.h
index febda6cdc..6fc2c83fc 100644
--- a/mavlink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_fence_point.h
+++ b/mavlink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_fence_point.h
@@ -201,6 +201,48 @@ static inline void mavlink_msg_fence_point_send(mavlink_channel_t chan, uint8_t
#endif
}
+#if MAVLINK_MSG_ID_FENCE_POINT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
+/*
+ This varient of _send() can be used to save stack space by re-using
+ memory from the receive buffer. The caller provides a
+ mavlink_message_t which is the size of a full mavlink message. This
+ is usually the receive buffer for the channel, and allows a reply to an
+ incoming message with minimum stack space usage.
+ */
+static inline void mavlink_msg_fence_point_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t idx, uint8_t count, float lat, float lng)
+{
+#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
+ char *buf = (char *)msgbuf;
+ _mav_put_float(buf, 0, lat);
+ _mav_put_float(buf, 4, lng);
+ _mav_put_uint8_t(buf, 8, target_system);
+ _mav_put_uint8_t(buf, 9, target_component);
+ _mav_put_uint8_t(buf, 10, idx);
+ _mav_put_uint8_t(buf, 11, count);
+
+#if MAVLINK_CRC_EXTRA
+ _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_POINT, buf, MAVLINK_MSG_ID_FENCE_POINT_LEN, MAVLINK_MSG_ID_FENCE_POINT_CRC);
+#else
+ _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_POINT, buf, MAVLINK_MSG_ID_FENCE_POINT_LEN);
+#endif
+#else
+ mavlink_fence_point_t *packet = (mavlink_fence_point_t *)msgbuf;
+ packet->lat = lat;
+ packet->lng = lng;
+ packet->target_system = target_system;
+ packet->target_component = target_component;
+ packet->idx = idx;
+ packet->count = count;
+
+#if MAVLINK_CRC_EXTRA
+ _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_POINT, (const char *)packet, MAVLINK_MSG_ID_FENCE_POINT_LEN, MAVLINK_MSG_ID_FENCE_POINT_CRC);
+#else
+ _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_POINT, (const char *)packet, MAVLINK_MSG_ID_FENCE_POINT_LEN);
+#endif
+#endif
+}
+#endif
+
#endif
// MESSAGE FENCE_POINT UNPACKING