autogenerated headers for rev https://github.com/mavlink/mavlink/tree/f464db99e90b3b8b2fd74d30d2c1f8fcdd14b159
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -5,7 +5,7 @@
|
||||
#ifndef MAVLINK_VERSION_H
|
||||
#define MAVLINK_VERSION_H
|
||||
|
||||
#define MAVLINK_BUILD_DATE "Sat Jul 19 13:05:11 2014"
|
||||
#define MAVLINK_BUILD_DATE "Tue Jul 22 11:45:19 2014"
|
||||
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
|
||||
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
|
||||
|
||||
|
||||
+3
-3
File diff suppressed because one or more lines are too long
+1
-1
@@ -5,7 +5,7 @@
|
||||
#ifndef MAVLINK_VERSION_H
|
||||
#define MAVLINK_VERSION_H
|
||||
|
||||
#define MAVLINK_BUILD_DATE "Sat Jul 19 13:05:18 2014"
|
||||
#define MAVLINK_BUILD_DATE "Tue Jul 22 11:45:26 2014"
|
||||
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
|
||||
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
|
||||
|
||||
|
||||
+7
-3
File diff suppressed because one or more lines are too long
@@ -0,0 +1,233 @@
|
||||
// MESSAGE TERRAIN_CHECK PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_TERRAIN_CHECK 135
|
||||
|
||||
typedef struct __mavlink_terrain_check_t
|
||||
{
|
||||
int32_t lat; ///< Latitude (degrees *10^7)
|
||||
int32_t lon; ///< Longitude (degrees *10^7)
|
||||
} mavlink_terrain_check_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_TERRAIN_CHECK_LEN 8
|
||||
#define MAVLINK_MSG_ID_135_LEN 8
|
||||
|
||||
#define MAVLINK_MSG_ID_TERRAIN_CHECK_CRC 203
|
||||
#define MAVLINK_MSG_ID_135_CRC 203
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_TERRAIN_CHECK { \
|
||||
"TERRAIN_CHECK", \
|
||||
2, \
|
||||
{ { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_terrain_check_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_terrain_check_t, lon) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a terrain_check message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param lat Latitude (degrees *10^7)
|
||||
* @param lon Longitude (degrees *10^7)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_terrain_check_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
int32_t lat, int32_t lon)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_TERRAIN_CHECK_LEN];
|
||||
_mav_put_int32_t(buf, 0, lat);
|
||||
_mav_put_int32_t(buf, 4, lon);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN);
|
||||
#else
|
||||
mavlink_terrain_check_t packet;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_TERRAIN_CHECK;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a terrain_check message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param lat Latitude (degrees *10^7)
|
||||
* @param lon Longitude (degrees *10^7)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_terrain_check_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
int32_t lat,int32_t lon)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_TERRAIN_CHECK_LEN];
|
||||
_mav_put_int32_t(buf, 0, lat);
|
||||
_mav_put_int32_t(buf, 4, lon);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN);
|
||||
#else
|
||||
mavlink_terrain_check_t packet;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_TERRAIN_CHECK;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a terrain_check struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param terrain_check C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_terrain_check_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_terrain_check_t* terrain_check)
|
||||
{
|
||||
return mavlink_msg_terrain_check_pack(system_id, component_id, msg, terrain_check->lat, terrain_check->lon);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a terrain_check struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param terrain_check C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_terrain_check_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_terrain_check_t* terrain_check)
|
||||
{
|
||||
return mavlink_msg_terrain_check_pack_chan(system_id, component_id, chan, msg, terrain_check->lat, terrain_check->lon);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a terrain_check message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param lat Latitude (degrees *10^7)
|
||||
* @param lon Longitude (degrees *10^7)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_terrain_check_send(mavlink_channel_t chan, int32_t lat, int32_t lon)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_TERRAIN_CHECK_LEN];
|
||||
_mav_put_int32_t(buf, 0, lat);
|
||||
_mav_put_int32_t(buf, 4, lon);
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_CHECK, buf, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_CHECK, buf, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN);
|
||||
#endif
|
||||
#else
|
||||
mavlink_terrain_check_t packet;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_CHECK, (const char *)&packet, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_CHECK, (const char *)&packet, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_TERRAIN_CHECK_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_terrain_check_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, int32_t lat, int32_t lon)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_int32_t(buf, 0, lat);
|
||||
_mav_put_int32_t(buf, 4, lon);
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_CHECK, buf, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_CHECK, buf, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN);
|
||||
#endif
|
||||
#else
|
||||
mavlink_terrain_check_t *packet = (mavlink_terrain_check_t *)msgbuf;
|
||||
packet->lat = lat;
|
||||
packet->lon = lon;
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_CHECK, (const char *)packet, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN, MAVLINK_MSG_ID_TERRAIN_CHECK_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_CHECK, (const char *)packet, MAVLINK_MSG_ID_TERRAIN_CHECK_LEN);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE TERRAIN_CHECK UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field lat from terrain_check message
|
||||
*
|
||||
* @return Latitude (degrees *10^7)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_terrain_check_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lon from terrain_check message
|
||||
*
|
||||
* @return Longitude (degrees *10^7)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_terrain_check_get_lon(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a terrain_check message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param terrain_check C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_terrain_check_decode(const mavlink_message_t* msg, mavlink_terrain_check_t* terrain_check)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
terrain_check->lat = mavlink_msg_terrain_check_get_lat(msg);
|
||||
terrain_check->lon = mavlink_msg_terrain_check_get_lon(msg);
|
||||
#else
|
||||
memcpy(terrain_check, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_TERRAIN_CHECK_LEN);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,297 @@
|
||||
// MESSAGE TERRAIN_DATA PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_TERRAIN_DATA 134
|
||||
|
||||
typedef struct __mavlink_terrain_data_t
|
||||
{
|
||||
int32_t lat; ///< Latitude of SW corner of first grid (degrees *10^7)
|
||||
int32_t lon; ///< Longitude of SW corner of first grid (in degrees *10^7)
|
||||
uint16_t grid_spacing; ///< Grid spacing in meters
|
||||
int16_t data[16]; ///< Terrain data in meters AMSL
|
||||
uint8_t gridbit; ///< bit within the terrain request mask
|
||||
} mavlink_terrain_data_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_TERRAIN_DATA_LEN 43
|
||||
#define MAVLINK_MSG_ID_134_LEN 43
|
||||
|
||||
#define MAVLINK_MSG_ID_TERRAIN_DATA_CRC 229
|
||||
#define MAVLINK_MSG_ID_134_CRC 229
|
||||
|
||||
#define MAVLINK_MSG_TERRAIN_DATA_FIELD_DATA_LEN 16
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_TERRAIN_DATA { \
|
||||
"TERRAIN_DATA", \
|
||||
5, \
|
||||
{ { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_terrain_data_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_terrain_data_t, lon) }, \
|
||||
{ "grid_spacing", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_terrain_data_t, grid_spacing) }, \
|
||||
{ "data", NULL, MAVLINK_TYPE_INT16_T, 16, 10, offsetof(mavlink_terrain_data_t, data) }, \
|
||||
{ "gridbit", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_terrain_data_t, gridbit) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a terrain_data message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param lat Latitude of SW corner of first grid (degrees *10^7)
|
||||
* @param lon Longitude of SW corner of first grid (in degrees *10^7)
|
||||
* @param grid_spacing Grid spacing in meters
|
||||
* @param gridbit bit within the terrain request mask
|
||||
* @param data Terrain data in meters AMSL
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_terrain_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
int32_t lat, int32_t lon, uint16_t grid_spacing, uint8_t gridbit, const int16_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_TERRAIN_DATA_LEN];
|
||||
_mav_put_int32_t(buf, 0, lat);
|
||||
_mav_put_int32_t(buf, 4, lon);
|
||||
_mav_put_uint16_t(buf, 8, grid_spacing);
|
||||
_mav_put_uint8_t(buf, 42, gridbit);
|
||||
_mav_put_int16_t_array(buf, 10, data, 16);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TERRAIN_DATA_LEN);
|
||||
#else
|
||||
mavlink_terrain_data_t packet;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.grid_spacing = grid_spacing;
|
||||
packet.gridbit = gridbit;
|
||||
mav_array_memcpy(packet.data, data, sizeof(int16_t)*16);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TERRAIN_DATA_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_TERRAIN_DATA;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TERRAIN_DATA_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TERRAIN_DATA_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a terrain_data message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param lat Latitude of SW corner of first grid (degrees *10^7)
|
||||
* @param lon Longitude of SW corner of first grid (in degrees *10^7)
|
||||
* @param grid_spacing Grid spacing in meters
|
||||
* @param gridbit bit within the terrain request mask
|
||||
* @param data Terrain data in meters AMSL
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_terrain_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
int32_t lat,int32_t lon,uint16_t grid_spacing,uint8_t gridbit,const int16_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_TERRAIN_DATA_LEN];
|
||||
_mav_put_int32_t(buf, 0, lat);
|
||||
_mav_put_int32_t(buf, 4, lon);
|
||||
_mav_put_uint16_t(buf, 8, grid_spacing);
|
||||
_mav_put_uint8_t(buf, 42, gridbit);
|
||||
_mav_put_int16_t_array(buf, 10, data, 16);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TERRAIN_DATA_LEN);
|
||||
#else
|
||||
mavlink_terrain_data_t packet;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.grid_spacing = grid_spacing;
|
||||
packet.gridbit = gridbit;
|
||||
mav_array_memcpy(packet.data, data, sizeof(int16_t)*16);
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TERRAIN_DATA_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_TERRAIN_DATA;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TERRAIN_DATA_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TERRAIN_DATA_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a terrain_data struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param terrain_data C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_terrain_data_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_terrain_data_t* terrain_data)
|
||||
{
|
||||
return mavlink_msg_terrain_data_pack(system_id, component_id, msg, terrain_data->lat, terrain_data->lon, terrain_data->grid_spacing, terrain_data->gridbit, terrain_data->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a terrain_data struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param terrain_data C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_terrain_data_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_terrain_data_t* terrain_data)
|
||||
{
|
||||
return mavlink_msg_terrain_data_pack_chan(system_id, component_id, chan, msg, terrain_data->lat, terrain_data->lon, terrain_data->grid_spacing, terrain_data->gridbit, terrain_data->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a terrain_data message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param lat Latitude of SW corner of first grid (degrees *10^7)
|
||||
* @param lon Longitude of SW corner of first grid (in degrees *10^7)
|
||||
* @param grid_spacing Grid spacing in meters
|
||||
* @param gridbit bit within the terrain request mask
|
||||
* @param data Terrain data in meters AMSL
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_terrain_data_send(mavlink_channel_t chan, int32_t lat, int32_t lon, uint16_t grid_spacing, uint8_t gridbit, const int16_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_TERRAIN_DATA_LEN];
|
||||
_mav_put_int32_t(buf, 0, lat);
|
||||
_mav_put_int32_t(buf, 4, lon);
|
||||
_mav_put_uint16_t(buf, 8, grid_spacing);
|
||||
_mav_put_uint8_t(buf, 42, gridbit);
|
||||
_mav_put_int16_t_array(buf, 10, data, 16);
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_DATA, buf, MAVLINK_MSG_ID_TERRAIN_DATA_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_DATA, buf, MAVLINK_MSG_ID_TERRAIN_DATA_LEN);
|
||||
#endif
|
||||
#else
|
||||
mavlink_terrain_data_t packet;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.grid_spacing = grid_spacing;
|
||||
packet.gridbit = gridbit;
|
||||
mav_array_memcpy(packet.data, data, sizeof(int16_t)*16);
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_DATA, (const char *)&packet, MAVLINK_MSG_ID_TERRAIN_DATA_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_DATA, (const char *)&packet, MAVLINK_MSG_ID_TERRAIN_DATA_LEN);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_TERRAIN_DATA_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_terrain_data_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, int32_t lat, int32_t lon, uint16_t grid_spacing, uint8_t gridbit, const int16_t *data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_int32_t(buf, 0, lat);
|
||||
_mav_put_int32_t(buf, 4, lon);
|
||||
_mav_put_uint16_t(buf, 8, grid_spacing);
|
||||
_mav_put_uint8_t(buf, 42, gridbit);
|
||||
_mav_put_int16_t_array(buf, 10, data, 16);
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_DATA, buf, MAVLINK_MSG_ID_TERRAIN_DATA_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_DATA, buf, MAVLINK_MSG_ID_TERRAIN_DATA_LEN);
|
||||
#endif
|
||||
#else
|
||||
mavlink_terrain_data_t *packet = (mavlink_terrain_data_t *)msgbuf;
|
||||
packet->lat = lat;
|
||||
packet->lon = lon;
|
||||
packet->grid_spacing = grid_spacing;
|
||||
packet->gridbit = gridbit;
|
||||
mav_array_memcpy(packet->data, data, sizeof(int16_t)*16);
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_DATA, (const char *)packet, MAVLINK_MSG_ID_TERRAIN_DATA_LEN, MAVLINK_MSG_ID_TERRAIN_DATA_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_DATA, (const char *)packet, MAVLINK_MSG_ID_TERRAIN_DATA_LEN);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE TERRAIN_DATA UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field lat from terrain_data message
|
||||
*
|
||||
* @return Latitude of SW corner of first grid (degrees *10^7)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_terrain_data_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lon from terrain_data message
|
||||
*
|
||||
* @return Longitude of SW corner of first grid (in degrees *10^7)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_terrain_data_get_lon(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field grid_spacing from terrain_data message
|
||||
*
|
||||
* @return Grid spacing in meters
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_terrain_data_get_grid_spacing(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field gridbit from terrain_data message
|
||||
*
|
||||
* @return bit within the terrain request mask
|
||||
*/
|
||||
static inline uint8_t mavlink_msg_terrain_data_get_gridbit(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint8_t(msg, 42);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field data from terrain_data message
|
||||
*
|
||||
* @return Terrain data in meters AMSL
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_terrain_data_get_data(const mavlink_message_t* msg, int16_t *data)
|
||||
{
|
||||
return _MAV_RETURN_int16_t_array(msg, data, 16, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a terrain_data message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param terrain_data C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_terrain_data_decode(const mavlink_message_t* msg, mavlink_terrain_data_t* terrain_data)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
terrain_data->lat = mavlink_msg_terrain_data_get_lat(msg);
|
||||
terrain_data->lon = mavlink_msg_terrain_data_get_lon(msg);
|
||||
terrain_data->grid_spacing = mavlink_msg_terrain_data_get_grid_spacing(msg);
|
||||
mavlink_msg_terrain_data_get_data(msg, terrain_data->data);
|
||||
terrain_data->gridbit = mavlink_msg_terrain_data_get_gridbit(msg);
|
||||
#else
|
||||
memcpy(terrain_data, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_TERRAIN_DATA_LEN);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,329 @@
|
||||
// MESSAGE TERRAIN_REPORT PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_TERRAIN_REPORT 136
|
||||
|
||||
typedef struct __mavlink_terrain_report_t
|
||||
{
|
||||
int32_t lat; ///< Latitude (degrees *10^7)
|
||||
int32_t lon; ///< Longitude (degrees *10^7)
|
||||
float height; ///< Terrain height in meters AMSL (-32767 if unavailable)
|
||||
uint16_t spacing; ///< grid spacing (zero if terrain at this location unavailable)
|
||||
uint16_t pending; ///< Number of 4x4 terrain blocks waiting to be received or read from disk
|
||||
uint16_t loaded; ///< Number of 4x4 terrain blocks in memory
|
||||
} mavlink_terrain_report_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_TERRAIN_REPORT_LEN 18
|
||||
#define MAVLINK_MSG_ID_136_LEN 18
|
||||
|
||||
#define MAVLINK_MSG_ID_TERRAIN_REPORT_CRC 146
|
||||
#define MAVLINK_MSG_ID_136_CRC 146
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_TERRAIN_REPORT { \
|
||||
"TERRAIN_REPORT", \
|
||||
6, \
|
||||
{ { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_terrain_report_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_terrain_report_t, lon) }, \
|
||||
{ "height", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_terrain_report_t, height) }, \
|
||||
{ "spacing", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_terrain_report_t, spacing) }, \
|
||||
{ "pending", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_terrain_report_t, pending) }, \
|
||||
{ "loaded", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_terrain_report_t, loaded) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a terrain_report message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param lat Latitude (degrees *10^7)
|
||||
* @param lon Longitude (degrees *10^7)
|
||||
* @param spacing grid spacing (zero if terrain at this location unavailable)
|
||||
* @param height Terrain height in meters AMSL (-32767 if unavailable)
|
||||
* @param pending Number of 4x4 terrain blocks waiting to be received or read from disk
|
||||
* @param loaded Number of 4x4 terrain blocks in memory
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_terrain_report_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
int32_t lat, int32_t lon, uint16_t spacing, float height, uint16_t pending, uint16_t loaded)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_TERRAIN_REPORT_LEN];
|
||||
_mav_put_int32_t(buf, 0, lat);
|
||||
_mav_put_int32_t(buf, 4, lon);
|
||||
_mav_put_float(buf, 8, height);
|
||||
_mav_put_uint16_t(buf, 12, spacing);
|
||||
_mav_put_uint16_t(buf, 14, pending);
|
||||
_mav_put_uint16_t(buf, 16, loaded);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN);
|
||||
#else
|
||||
mavlink_terrain_report_t packet;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.height = height;
|
||||
packet.spacing = spacing;
|
||||
packet.pending = pending;
|
||||
packet.loaded = loaded;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_TERRAIN_REPORT;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a terrain_report message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param lat Latitude (degrees *10^7)
|
||||
* @param lon Longitude (degrees *10^7)
|
||||
* @param spacing grid spacing (zero if terrain at this location unavailable)
|
||||
* @param height Terrain height in meters AMSL (-32767 if unavailable)
|
||||
* @param pending Number of 4x4 terrain blocks waiting to be received or read from disk
|
||||
* @param loaded Number of 4x4 terrain blocks in memory
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_terrain_report_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
int32_t lat,int32_t lon,uint16_t spacing,float height,uint16_t pending,uint16_t loaded)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_TERRAIN_REPORT_LEN];
|
||||
_mav_put_int32_t(buf, 0, lat);
|
||||
_mav_put_int32_t(buf, 4, lon);
|
||||
_mav_put_float(buf, 8, height);
|
||||
_mav_put_uint16_t(buf, 12, spacing);
|
||||
_mav_put_uint16_t(buf, 14, pending);
|
||||
_mav_put_uint16_t(buf, 16, loaded);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN);
|
||||
#else
|
||||
mavlink_terrain_report_t packet;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.height = height;
|
||||
packet.spacing = spacing;
|
||||
packet.pending = pending;
|
||||
packet.loaded = loaded;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_TERRAIN_REPORT;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a terrain_report struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param terrain_report C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_terrain_report_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_terrain_report_t* terrain_report)
|
||||
{
|
||||
return mavlink_msg_terrain_report_pack(system_id, component_id, msg, terrain_report->lat, terrain_report->lon, terrain_report->spacing, terrain_report->height, terrain_report->pending, terrain_report->loaded);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a terrain_report struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param terrain_report C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_terrain_report_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_terrain_report_t* terrain_report)
|
||||
{
|
||||
return mavlink_msg_terrain_report_pack_chan(system_id, component_id, chan, msg, terrain_report->lat, terrain_report->lon, terrain_report->spacing, terrain_report->height, terrain_report->pending, terrain_report->loaded);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a terrain_report message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param lat Latitude (degrees *10^7)
|
||||
* @param lon Longitude (degrees *10^7)
|
||||
* @param spacing grid spacing (zero if terrain at this location unavailable)
|
||||
* @param height Terrain height in meters AMSL (-32767 if unavailable)
|
||||
* @param pending Number of 4x4 terrain blocks waiting to be received or read from disk
|
||||
* @param loaded Number of 4x4 terrain blocks in memory
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_terrain_report_send(mavlink_channel_t chan, int32_t lat, int32_t lon, uint16_t spacing, float height, uint16_t pending, uint16_t loaded)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_TERRAIN_REPORT_LEN];
|
||||
_mav_put_int32_t(buf, 0, lat);
|
||||
_mav_put_int32_t(buf, 4, lon);
|
||||
_mav_put_float(buf, 8, height);
|
||||
_mav_put_uint16_t(buf, 12, spacing);
|
||||
_mav_put_uint16_t(buf, 14, pending);
|
||||
_mav_put_uint16_t(buf, 16, loaded);
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, buf, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, buf, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN);
|
||||
#endif
|
||||
#else
|
||||
mavlink_terrain_report_t packet;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.height = height;
|
||||
packet.spacing = spacing;
|
||||
packet.pending = pending;
|
||||
packet.loaded = loaded;
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, (const char *)&packet, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, (const char *)&packet, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_TERRAIN_REPORT_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_terrain_report_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, int32_t lat, int32_t lon, uint16_t spacing, float height, uint16_t pending, uint16_t loaded)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_int32_t(buf, 0, lat);
|
||||
_mav_put_int32_t(buf, 4, lon);
|
||||
_mav_put_float(buf, 8, height);
|
||||
_mav_put_uint16_t(buf, 12, spacing);
|
||||
_mav_put_uint16_t(buf, 14, pending);
|
||||
_mav_put_uint16_t(buf, 16, loaded);
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, buf, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, buf, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN);
|
||||
#endif
|
||||
#else
|
||||
mavlink_terrain_report_t *packet = (mavlink_terrain_report_t *)msgbuf;
|
||||
packet->lat = lat;
|
||||
packet->lon = lon;
|
||||
packet->height = height;
|
||||
packet->spacing = spacing;
|
||||
packet->pending = pending;
|
||||
packet->loaded = loaded;
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, (const char *)packet, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN, MAVLINK_MSG_ID_TERRAIN_REPORT_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REPORT, (const char *)packet, MAVLINK_MSG_ID_TERRAIN_REPORT_LEN);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE TERRAIN_REPORT UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field lat from terrain_report message
|
||||
*
|
||||
* @return Latitude (degrees *10^7)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_terrain_report_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lon from terrain_report message
|
||||
*
|
||||
* @return Longitude (degrees *10^7)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_terrain_report_get_lon(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field spacing from terrain_report message
|
||||
*
|
||||
* @return grid spacing (zero if terrain at this location unavailable)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_terrain_report_get_spacing(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field height from terrain_report message
|
||||
*
|
||||
* @return Terrain height in meters AMSL (-32767 if unavailable)
|
||||
*/
|
||||
static inline float mavlink_msg_terrain_report_get_height(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_float(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field pending from terrain_report message
|
||||
*
|
||||
* @return Number of 4x4 terrain blocks waiting to be received or read from disk
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_terrain_report_get_pending(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 14);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field loaded from terrain_report message
|
||||
*
|
||||
* @return Number of 4x4 terrain blocks in memory
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_terrain_report_get_loaded(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a terrain_report message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param terrain_report C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_terrain_report_decode(const mavlink_message_t* msg, mavlink_terrain_report_t* terrain_report)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
terrain_report->lat = mavlink_msg_terrain_report_get_lat(msg);
|
||||
terrain_report->lon = mavlink_msg_terrain_report_get_lon(msg);
|
||||
terrain_report->height = mavlink_msg_terrain_report_get_height(msg);
|
||||
terrain_report->spacing = mavlink_msg_terrain_report_get_spacing(msg);
|
||||
terrain_report->pending = mavlink_msg_terrain_report_get_pending(msg);
|
||||
terrain_report->loaded = mavlink_msg_terrain_report_get_loaded(msg);
|
||||
#else
|
||||
memcpy(terrain_report, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_TERRAIN_REPORT_LEN);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,281 @@
|
||||
// MESSAGE TERRAIN_REQUEST PACKING
|
||||
|
||||
#define MAVLINK_MSG_ID_TERRAIN_REQUEST 133
|
||||
|
||||
typedef struct __mavlink_terrain_request_t
|
||||
{
|
||||
uint64_t mask; ///< Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)
|
||||
int32_t lat; ///< Latitude of SW corner of first grid (degrees *10^7)
|
||||
int32_t lon; ///< Longitude of SW corner of first grid (in degrees *10^7)
|
||||
uint16_t grid_spacing; ///< Grid spacing in meters
|
||||
} mavlink_terrain_request_t;
|
||||
|
||||
#define MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN 18
|
||||
#define MAVLINK_MSG_ID_133_LEN 18
|
||||
|
||||
#define MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC 6
|
||||
#define MAVLINK_MSG_ID_133_CRC 6
|
||||
|
||||
|
||||
|
||||
#define MAVLINK_MESSAGE_INFO_TERRAIN_REQUEST { \
|
||||
"TERRAIN_REQUEST", \
|
||||
4, \
|
||||
{ { "mask", "0x%07x", MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_terrain_request_t, mask) }, \
|
||||
{ "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_terrain_request_t, lat) }, \
|
||||
{ "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_terrain_request_t, lon) }, \
|
||||
{ "grid_spacing", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_terrain_request_t, grid_spacing) }, \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Pack a terrain_request message
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
*
|
||||
* @param lat Latitude of SW corner of first grid (degrees *10^7)
|
||||
* @param lon Longitude of SW corner of first grid (in degrees *10^7)
|
||||
* @param grid_spacing Grid spacing in meters
|
||||
* @param mask Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_terrain_request_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
||||
int32_t lat, int32_t lon, uint16_t grid_spacing, uint64_t mask)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN];
|
||||
_mav_put_uint64_t(buf, 0, mask);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_uint16_t(buf, 16, grid_spacing);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN);
|
||||
#else
|
||||
mavlink_terrain_request_t packet;
|
||||
packet.mask = mask;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.grid_spacing = grid_spacing;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_TERRAIN_REQUEST;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pack a terrain_request message on a channel
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param lat Latitude of SW corner of first grid (degrees *10^7)
|
||||
* @param lon Longitude of SW corner of first grid (in degrees *10^7)
|
||||
* @param grid_spacing Grid spacing in meters
|
||||
* @param mask Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)
|
||||
* @return length of the message in bytes (excluding serial stream start sign)
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_terrain_request_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
||||
mavlink_message_t* msg,
|
||||
int32_t lat,int32_t lon,uint16_t grid_spacing,uint64_t mask)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN];
|
||||
_mav_put_uint64_t(buf, 0, mask);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_uint16_t(buf, 16, grid_spacing);
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN);
|
||||
#else
|
||||
mavlink_terrain_request_t packet;
|
||||
packet.mask = mask;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.grid_spacing = grid_spacing;
|
||||
|
||||
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN);
|
||||
#endif
|
||||
|
||||
msg->msgid = MAVLINK_MSG_ID_TERRAIN_REQUEST;
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC);
|
||||
#else
|
||||
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a terrain_request struct
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param terrain_request C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_terrain_request_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_terrain_request_t* terrain_request)
|
||||
{
|
||||
return mavlink_msg_terrain_request_pack(system_id, component_id, msg, terrain_request->lat, terrain_request->lon, terrain_request->grid_spacing, terrain_request->mask);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Encode a terrain_request struct on a channel
|
||||
*
|
||||
* @param system_id ID of this system
|
||||
* @param component_id ID of this component (e.g. 200 for IMU)
|
||||
* @param chan The MAVLink channel this message will be sent over
|
||||
* @param msg The MAVLink message to compress the data into
|
||||
* @param terrain_request C-struct to read the message contents from
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_terrain_request_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_terrain_request_t* terrain_request)
|
||||
{
|
||||
return mavlink_msg_terrain_request_pack_chan(system_id, component_id, chan, msg, terrain_request->lat, terrain_request->lon, terrain_request->grid_spacing, terrain_request->mask);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Send a terrain_request message
|
||||
* @param chan MAVLink channel to send the message
|
||||
*
|
||||
* @param lat Latitude of SW corner of first grid (degrees *10^7)
|
||||
* @param lon Longitude of SW corner of first grid (in degrees *10^7)
|
||||
* @param grid_spacing Grid spacing in meters
|
||||
* @param mask Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)
|
||||
*/
|
||||
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
||||
|
||||
static inline void mavlink_msg_terrain_request_send(mavlink_channel_t chan, int32_t lat, int32_t lon, uint16_t grid_spacing, uint64_t mask)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char buf[MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN];
|
||||
_mav_put_uint64_t(buf, 0, mask);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_uint16_t(buf, 16, grid_spacing);
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, buf, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, buf, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN);
|
||||
#endif
|
||||
#else
|
||||
mavlink_terrain_request_t packet;
|
||||
packet.mask = mask;
|
||||
packet.lat = lat;
|
||||
packet.lon = lon;
|
||||
packet.grid_spacing = grid_spacing;
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, (const char *)&packet, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, (const char *)&packet, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MAVLINK_MSG_ID_TERRAIN_REQUEST_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_terrain_request_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, int32_t lat, int32_t lon, uint16_t grid_spacing, uint64_t mask)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
||||
char *buf = (char *)msgbuf;
|
||||
_mav_put_uint64_t(buf, 0, mask);
|
||||
_mav_put_int32_t(buf, 8, lat);
|
||||
_mav_put_int32_t(buf, 12, lon);
|
||||
_mav_put_uint16_t(buf, 16, grid_spacing);
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, buf, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, buf, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN);
|
||||
#endif
|
||||
#else
|
||||
mavlink_terrain_request_t *packet = (mavlink_terrain_request_t *)msgbuf;
|
||||
packet->mask = mask;
|
||||
packet->lat = lat;
|
||||
packet->lon = lon;
|
||||
packet->grid_spacing = grid_spacing;
|
||||
|
||||
#if MAVLINK_CRC_EXTRA
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, (const char *)packet, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN, MAVLINK_MSG_ID_TERRAIN_REQUEST_CRC);
|
||||
#else
|
||||
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TERRAIN_REQUEST, (const char *)packet, MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// MESSAGE TERRAIN_REQUEST UNPACKING
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get field lat from terrain_request message
|
||||
*
|
||||
* @return Latitude of SW corner of first grid (degrees *10^7)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_terrain_request_get_lat(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field lon from terrain_request message
|
||||
*
|
||||
* @return Longitude of SW corner of first grid (in degrees *10^7)
|
||||
*/
|
||||
static inline int32_t mavlink_msg_terrain_request_get_lon(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_int32_t(msg, 12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field grid_spacing from terrain_request message
|
||||
*
|
||||
* @return Grid spacing in meters
|
||||
*/
|
||||
static inline uint16_t mavlink_msg_terrain_request_get_grid_spacing(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint16_t(msg, 16);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field mask from terrain_request message
|
||||
*
|
||||
* @return Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)
|
||||
*/
|
||||
static inline uint64_t mavlink_msg_terrain_request_get_mask(const mavlink_message_t* msg)
|
||||
{
|
||||
return _MAV_RETURN_uint64_t(msg, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode a terrain_request message into a struct
|
||||
*
|
||||
* @param msg The message to decode
|
||||
* @param terrain_request C-struct to decode the message contents into
|
||||
*/
|
||||
static inline void mavlink_msg_terrain_request_decode(const mavlink_message_t* msg, mavlink_terrain_request_t* terrain_request)
|
||||
{
|
||||
#if MAVLINK_NEED_BYTE_SWAP
|
||||
terrain_request->mask = mavlink_msg_terrain_request_get_mask(msg);
|
||||
terrain_request->lat = mavlink_msg_terrain_request_get_lat(msg);
|
||||
terrain_request->lon = mavlink_msg_terrain_request_get_lon(msg);
|
||||
terrain_request->grid_spacing = mavlink_msg_terrain_request_get_grid_spacing(msg);
|
||||
#else
|
||||
memcpy(terrain_request, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_TERRAIN_REQUEST_LEN);
|
||||
#endif
|
||||
}
|
||||
@@ -5622,6 +5622,204 @@ static void mavlink_test_distance_sensor(uint8_t system_id, uint8_t component_id
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_terrain_request(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
|
||||
{
|
||||
mavlink_message_t msg;
|
||||
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
|
||||
uint16_t i;
|
||||
mavlink_terrain_request_t packet_in = {
|
||||
93372036854775807ULL,
|
||||
}963497880,
|
||||
}963498088,
|
||||
}18067,
|
||||
};
|
||||
mavlink_terrain_request_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.mask = packet_in.mask;
|
||||
packet1.lat = packet_in.lat;
|
||||
packet1.lon = packet_in.lon;
|
||||
packet1.grid_spacing = packet_in.grid_spacing;
|
||||
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_terrain_request_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_terrain_request_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_terrain_request_pack(system_id, component_id, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.mask );
|
||||
mavlink_msg_terrain_request_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_terrain_request_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.mask );
|
||||
mavlink_msg_terrain_request_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_to_send_buffer(buffer, &msg);
|
||||
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
|
||||
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
|
||||
}
|
||||
mavlink_msg_terrain_request_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_terrain_request_send(MAVLINK_COMM_1 , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.mask );
|
||||
mavlink_msg_terrain_request_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_terrain_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
|
||||
{
|
||||
mavlink_message_t msg;
|
||||
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
|
||||
uint16_t i;
|
||||
mavlink_terrain_data_t packet_in = {
|
||||
963497464,
|
||||
}963497672,
|
||||
}17651,
|
||||
}{ 17755, 17756, 17757, 17758, 17759, 17760, 17761, 17762, 17763, 17764, 17765, 17766, 17767, 17768, 17769, 17770 },
|
||||
}3,
|
||||
};
|
||||
mavlink_terrain_data_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.lat = packet_in.lat;
|
||||
packet1.lon = packet_in.lon;
|
||||
packet1.grid_spacing = packet_in.grid_spacing;
|
||||
packet1.gridbit = packet_in.gridbit;
|
||||
|
||||
mav_array_memcpy(packet1.data, packet_in.data, sizeof(int16_t)*16);
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_terrain_data_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_terrain_data_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_terrain_data_pack(system_id, component_id, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.gridbit , packet1.data );
|
||||
mavlink_msg_terrain_data_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_terrain_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.gridbit , packet1.data );
|
||||
mavlink_msg_terrain_data_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_to_send_buffer(buffer, &msg);
|
||||
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
|
||||
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
|
||||
}
|
||||
mavlink_msg_terrain_data_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_terrain_data_send(MAVLINK_COMM_1 , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.gridbit , packet1.data );
|
||||
mavlink_msg_terrain_data_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_terrain_check(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
|
||||
{
|
||||
mavlink_message_t msg;
|
||||
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
|
||||
uint16_t i;
|
||||
mavlink_terrain_check_t packet_in = {
|
||||
963497464,
|
||||
}963497672,
|
||||
};
|
||||
mavlink_terrain_check_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.lat = packet_in.lat;
|
||||
packet1.lon = packet_in.lon;
|
||||
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_terrain_check_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_terrain_check_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_terrain_check_pack(system_id, component_id, &msg , packet1.lat , packet1.lon );
|
||||
mavlink_msg_terrain_check_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_terrain_check_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon );
|
||||
mavlink_msg_terrain_check_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_to_send_buffer(buffer, &msg);
|
||||
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
|
||||
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
|
||||
}
|
||||
mavlink_msg_terrain_check_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_terrain_check_send(MAVLINK_COMM_1 , packet1.lat , packet1.lon );
|
||||
mavlink_msg_terrain_check_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_terrain_report(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
|
||||
{
|
||||
mavlink_message_t msg;
|
||||
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
|
||||
uint16_t i;
|
||||
mavlink_terrain_report_t packet_in = {
|
||||
963497464,
|
||||
}963497672,
|
||||
}73.0,
|
||||
}17859,
|
||||
}17963,
|
||||
}18067,
|
||||
};
|
||||
mavlink_terrain_report_t packet1, packet2;
|
||||
memset(&packet1, 0, sizeof(packet1));
|
||||
packet1.lat = packet_in.lat;
|
||||
packet1.lon = packet_in.lon;
|
||||
packet1.height = packet_in.height;
|
||||
packet1.spacing = packet_in.spacing;
|
||||
packet1.pending = packet_in.pending;
|
||||
packet1.loaded = packet_in.loaded;
|
||||
|
||||
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_terrain_report_encode(system_id, component_id, &msg, &packet1);
|
||||
mavlink_msg_terrain_report_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_terrain_report_pack(system_id, component_id, &msg , packet1.lat , packet1.lon , packet1.spacing , packet1.height , packet1.pending , packet1.loaded );
|
||||
mavlink_msg_terrain_report_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_terrain_report_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon , packet1.spacing , packet1.height , packet1.pending , packet1.loaded );
|
||||
mavlink_msg_terrain_report_decode(&msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_to_send_buffer(buffer, &msg);
|
||||
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
|
||||
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
|
||||
}
|
||||
mavlink_msg_terrain_report_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
|
||||
memset(&packet2, 0, sizeof(packet2));
|
||||
mavlink_msg_terrain_report_send(MAVLINK_COMM_1 , packet1.lat , packet1.lon , packet1.spacing , packet1.height , packet1.pending , packet1.loaded );
|
||||
mavlink_msg_terrain_report_decode(last_msg, &packet2);
|
||||
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
||||
}
|
||||
|
||||
static void mavlink_test_battery_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
|
||||
{
|
||||
mavlink_message_t msg;
|
||||
@@ -6189,6 +6387,10 @@ static void mavlink_test_common(uint8_t system_id, uint8_t component_id, mavlink
|
||||
mavlink_test_data_transmission_handshake(system_id, component_id, last_msg);
|
||||
mavlink_test_encapsulated_data(system_id, component_id, last_msg);
|
||||
mavlink_test_distance_sensor(system_id, component_id, last_msg);
|
||||
mavlink_test_terrain_request(system_id, component_id, last_msg);
|
||||
mavlink_test_terrain_data(system_id, component_id, last_msg);
|
||||
mavlink_test_terrain_check(system_id, component_id, last_msg);
|
||||
mavlink_test_terrain_report(system_id, component_id, last_msg);
|
||||
mavlink_test_battery_status(system_id, component_id, last_msg);
|
||||
mavlink_test_setpoint_8dof(system_id, component_id, last_msg);
|
||||
mavlink_test_setpoint_6dof(system_id, component_id, last_msg);
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
#ifndef MAVLINK_VERSION_H
|
||||
#define MAVLINK_VERSION_H
|
||||
|
||||
#define MAVLINK_BUILD_DATE "Sat Jul 19 13:06:04 2014"
|
||||
#define MAVLINK_BUILD_DATE "Tue Jul 22 11:46:11 2014"
|
||||
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
|
||||
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -5,7 +5,7 @@
|
||||
#ifndef MAVLINK_VERSION_H
|
||||
#define MAVLINK_VERSION_H
|
||||
|
||||
#define MAVLINK_BUILD_DATE "Sat Jul 19 13:05:25 2014"
|
||||
#define MAVLINK_BUILD_DATE "Tue Jul 22 11:45:33 2014"
|
||||
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
|
||||
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
#ifndef MAVLINK_VERSION_H
|
||||
#define MAVLINK_VERSION_H
|
||||
|
||||
#define MAVLINK_BUILD_DATE "Sat Jul 19 13:05:31 2014"
|
||||
#define MAVLINK_BUILD_DATE "Tue Jul 22 11:45:39 2014"
|
||||
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
|
||||
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 9
|
||||
|
||||
|
||||
+3
-3
File diff suppressed because one or more lines are too long
+1
-1
@@ -5,7 +5,7 @@
|
||||
#ifndef MAVLINK_VERSION_H
|
||||
#define MAVLINK_VERSION_H
|
||||
|
||||
#define MAVLINK_BUILD_DATE "Sat Jul 19 13:05:32 2014"
|
||||
#define MAVLINK_BUILD_DATE "Tue Jul 22 11:45:40 2014"
|
||||
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
|
||||
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1
-1
@@ -5,7 +5,7 @@
|
||||
#ifndef MAVLINK_VERSION_H
|
||||
#define MAVLINK_VERSION_H
|
||||
|
||||
#define MAVLINK_BUILD_DATE "Sat Jul 19 13:05:39 2014"
|
||||
#define MAVLINK_BUILD_DATE "Tue Jul 22 11:45:47 2014"
|
||||
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
|
||||
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
|
||||
|
||||
|
||||
+3
-3
File diff suppressed because one or more lines are too long
+1
-1
@@ -5,7 +5,7 @@
|
||||
#ifndef MAVLINK_VERSION_H
|
||||
#define MAVLINK_VERSION_H
|
||||
|
||||
#define MAVLINK_BUILD_DATE "Sat Jul 19 13:05:45 2014"
|
||||
#define MAVLINK_BUILD_DATE "Tue Jul 22 11:45:53 2014"
|
||||
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
|
||||
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
#ifndef MAVLINK_VERSION_H
|
||||
#define MAVLINK_VERSION_H
|
||||
|
||||
#define MAVLINK_BUILD_DATE "Sat Jul 19 13:05:52 2014"
|
||||
#define MAVLINK_BUILD_DATE "Tue Jul 22 11:46:00 2014"
|
||||
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
|
||||
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 179
|
||||
|
||||
|
||||
+3
-3
File diff suppressed because one or more lines are too long
+1
-1
@@ -5,7 +5,7 @@
|
||||
#ifndef MAVLINK_VERSION_H
|
||||
#define MAVLINK_VERSION_H
|
||||
|
||||
#define MAVLINK_BUILD_DATE "Sat Jul 19 13:05:53 2014"
|
||||
#define MAVLINK_BUILD_DATE "Tue Jul 22 11:46:01 2014"
|
||||
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
|
||||
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
|
||||
|
||||
|
||||
Reference in New Issue
Block a user