Commit 154f730a authored by lm's avatar lm

Updated MAVlink

parent 4cc06ffc
/** @file
* @brief MAVLink comm protocol.
* @see http://qgroundcontrol.org/mavlink/
* Generated on Tuesday, August 9 2011, 16:16 UTC
* Generated on Saturday, August 13 2011, 07:20 UTC
*/
#ifndef ARDUPILOTMEGA_H
#define ARDUPILOTMEGA_H
......@@ -11,7 +11,7 @@ extern "C" {
#endif
#include "../protocol.h"
#include "../mavlink_protocol.h"
#define MAVLINK_ENABLED_ARDUPILOTMEGA
......@@ -38,7 +38,12 @@ extern "C" {
// MESSAGE CRC KEYS
#undef MAVLINK_MESSAGE_KEYS
#define MAVLINK_MESSAGE_KEYS { 71, 249, 232, 226, 76, 126, 117, 186, 0, 165, 44, 249, 133, 0, 0, 0, 0, 0, 0, 0, 112, 34, 81, 152, 0, 223, 28, 99, 28, 21, 243, 240, 204, 21, 111, 43, 192, 234, 22, 197, 192, 192, 166, 34, 233, 34, 166, 158, 142, 60, 10, 75, 249, 247, 234, 157, 125, 0, 0, 0, 85, 211, 62, 75, 185, 18, 42, 38, 0, 127, 200, 0, 0, 53, 251, 20, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 141, 211, 166 }
#define MAVLINK_MESSAGE_KEYS { 71, 249, 232, 226, 76, 126, 117, 186, 0, 144, 0, 249, 133, 0, 0, 0, 0, 0, 0, 0, 33, 34, 163, 45, 0, 166, 28, 99, 28, 21, 243, 240, 91, 21, 111, 43, 192, 234, 22, 197, 192, 192, 166, 34, 233, 34, 166, 158, 142, 60, 10, 75, 249, 247, 234, 161, 116, 56, 245, 0, 0, 0, 62, 75, 185, 18, 42, 38, 0, 127, 200, 0, 0, 212, 251, 20, 22, 0, 0, 0, 0, 0, 0, 0, 0, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 8, 238, 165, 0, 0, 0, 0, 0, 0, 0, 218, 218, 235, 0, 0, 0, 0, 0, 0, 225, 114, 0, 0, 0, 0, 0, 0, 0, 0, 221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 171, 122, 0, 0, 0, 0, 0, 0, 0, 92, 99, 4, 169, 10, 0, 0, 0, 0, 0, 52, 163, 16, 0, 0, 0, 0, 0, 0, 0, 200, 135, 217, 254, 0, 0, 255, 185, 0, 14, 136, 53, 0, 212, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 73, 239, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 138, 43, 141, 211, 144 }
// MESSAGE LENGTHS
#undef MAVLINK_MESSAGE_LENGTHS
#define MAVLINK_MESSAGE_LENGTHS { 3, 4, 8, 14, 8, 28, 3, 32, 0, 2, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 20, 2, 24, 22, 0, 30, 26, 101, 26, 16, 32, 32, 38, 32, 11, 17, 17, 16, 18, 36, 4, 4, 2, 2, 4, 2, 2, 3, 14, 12, 18, 16, 8, 27, 25, 18, 18, 20, 20, 0, 0, 0, 26, 16, 36, 5, 6, 56, 0, 21, 18, 0, 0, 20, 20, 20, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 30, 14, 14, 51 }
#ifdef __cplusplus
}
......
/** @file
* @brief MAVLink comm protocol.
* @see http://pixhawk.ethz.ch/software/mavlink
* Generated on Tuesday, August 9 2011, 16:16 UTC
* Generated on Saturday, August 13 2011, 07:20 UTC
*/
#ifndef MAVLINK_H
#define MAVLINK_H
......
/** @file
* @brief MAVLink comm protocol.
* @see http://qgroundcontrol.org/mavlink/
* Generated on Friday, August 12 2011, 20:25 UTC
* Generated on Saturday, August 13 2011, 07:20 UTC
*/
#ifndef COMMON_H
#define COMMON_H
......@@ -300,7 +300,7 @@ enum MAV_CMD
// MESSAGE CRC KEYS
#undef MAVLINK_MESSAGE_KEYS
#define MAVLINK_MESSAGE_KEYS { 71, 249, 232, 226, 76, 126, 117, 186, 0, 144, 0, 249, 133, 0, 0, 0, 0, 0, 0, 0, 33, 34, 163, 45, 0, 166, 28, 99, 28, 21, 243, 240, 91, 21, 111, 43, 192, 234, 22, 197, 192, 192, 166, 34, 233, 34, 166, 158, 142, 60, 10, 75, 249, 247, 234, 161, 116, 56, 245, 0, 0, 0, 62, 75, 185, 18, 42, 38, 0, 127, 200, 0, 0, 212, 251, 20, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 138, 43, 141, 211, 144 }
#define MAVLINK_MESSAGE_KEYS { 71, 249, 232, 226, 76, 126, 117, 186, 0, 144, 0, 249, 133, 0, 0, 0, 0, 0, 0, 0, 33, 34, 163, 45, 0, 166, 28, 99, 28, 21, 243, 240, 91, 21, 111, 43, 192, 234, 22, 197, 192, 192, 166, 34, 233, 34, 166, 158, 142, 60, 10, 75, 249, 247, 234, 161, 116, 56, 245, 0, 0, 0, 62, 75, 185, 18, 42, 38, 0, 127, 200, 0, 0, 212, 251, 20, 22, 0, 0, 0, 0, 0, 0, 0, 0, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 8, 238, 165, 0, 0, 0, 0, 0, 0, 0, 218, 218, 235, 0, 0, 0, 0, 0, 0, 225, 114, 0, 0, 0, 0, 0, 0, 0, 0, 221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 171, 122, 0, 0, 0, 0, 0, 0, 0, 92, 99, 4, 169, 10, 0, 0, 0, 0, 0, 52, 163, 16, 0, 0, 0, 0, 0, 0, 0, 200, 135, 217, 254, 0, 0, 255, 185, 0, 14, 136, 53, 0, 212, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 73, 239, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 138, 43, 141, 211, 144 }
// MESSAGE LENGTHS
......
/** @file
* @brief MAVLink comm protocol.
* @see http://pixhawk.ethz.ch/software/mavlink
* Generated on Friday, August 12 2011, 20:25 UTC
* Generated on Saturday, August 13 2011, 07:20 UTC
*/
#ifndef MAVLINK_H
#define MAVLINK_H
......
......@@ -126,13 +126,13 @@ static inline uint16_t mavlink_finalize_message_chan(mavlink_message_t* msg, uin
static inline uint16_t mavlink_msg_to_send_buffer(uint8_t* buffer, const mavlink_message_t* msg)
{
*(buffer+0) = MAVLINK_STX; ///< Start transmit
// memcpy((buffer+1), msg, msg->len + MAVLINK_CORE_HEADER_LEN); ///< Core header plus payload
// memcpy((buffer+1), msg, msg->len + MAVLINK_CORE_HEADER_LEN); ///< Core header plus payload
memcpy((buffer+1), &msg->len, MAVLINK_CORE_HEADER_LEN); ///< Core header
memcpy((buffer+1+MAVLINK_CORE_HEADER_LEN), &msg->payload[0], msg->len); ///< payload
*(buffer + msg->len + MAVLINK_CORE_HEADER_LEN + 1) = msg->ck_a;
*(buffer + msg->len + MAVLINK_CORE_HEADER_LEN + 2) = msg->ck_b;
return msg->len + MAVLINK_NUM_NON_PAYLOAD_BYTES;
// return 0;
// return 0;
}
/**
......@@ -354,13 +354,8 @@ static inline int16_t mavlink_parse_char(uint8_t chan, uint8_t c, mavlink_messag
if (status->msg_received == 1)
{
if ( r_message != NULL )
{
return r_message;
}
else
{
return rxmsg;
}
else return rxmsg;
} else return NULL;
#else
if (status->msg_received == 1)
......
/** @file
* @brief MAVLink comm protocol.
* @see http://pixhawk.ethz.ch/software/mavlink
* Generated on Tuesday, August 9 2011, 16:16 UTC
* Generated on Saturday, August 13 2011, 07:20 UTC
*/
#ifndef MAVLINK_H
#define MAVLINK_H
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_HEARTBEAT 0
#define MAVLINK_MSG_ID_HEARTBEAT_LEN 3
#define MAVLINK_MSG_0_LEN 3
#define MAVLINK_MSG_ID_HEARTBEAT_KEY 0x47
#define MAVLINK_MSG_0_KEY 0x47
typedef struct __mavlink_heartbeat_t
{
......@@ -69,6 +71,8 @@ static inline uint16_t mavlink_msg_heartbeat_encode(uint8_t system_id, uint8_t c
return mavlink_msg_heartbeat_pack(system_id, component_id, msg, heartbeat->type, heartbeat->autopilot);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a heartbeat message
* @param chan MAVLink channel to send the message
......@@ -76,20 +80,16 @@ static inline uint16_t mavlink_msg_heartbeat_encode(uint8_t system_id, uint8_t c
* @param type Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM)
* @param autopilot Type of the Autopilot: 0: Generic, 1: PIXHAWK, 2: SLUGS, 3: Ardupilot (up to 15 types), defined in MAV_AUTOPILOT_TYPE ENUM
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_heartbeat_send(mavlink_channel_t chan, uint8_t type, uint8_t autopilot)
{
mavlink_header_t hdr;
mavlink_heartbeat_t payload;
uint16_t checksum;
mavlink_heartbeat_t *p = &payload;
p->type = type; // uint8_t:Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM)
p->autopilot = autopilot; // uint8_t:Type of the Autopilot: 0: Generic, 1: PIXHAWK, 2: SLUGS, 3: Ardupilot (up to 15 types), defined in MAV_AUTOPILOT_TYPE ENUM
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_HEARTBEAT_LEN )
payload.type = type; // uint8_t:Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM)
payload.autopilot = autopilot; // uint8_t:Type of the Autopilot: 0: Generic, 1: PIXHAWK, 2: SLUGS, 3: Ardupilot (up to 15 types), defined in MAV_AUTOPILOT_TYPE ENUM
p->mavlink_version = MAVLINK_VERSION; // uint8_t_mavlink_version:MAVLink version
payload.mavlink_version = MAVLINK_VERSION; // uint8_t_mavlink_version:MAVLink version
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_HEARTBEAT_LEN;
hdr.msgid = MAVLINK_MSG_ID_HEARTBEAT;
......@@ -99,14 +99,12 @@ static inline void mavlink_msg_heartbeat_send(mavlink_channel_t chan, uint8_t ty
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0x47, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
/** @file
* @brief MAVLink comm protocol.
* @see http://qgroundcontrol.org/mavlink/
* Generated on Tuesday, August 9 2011, 16:16 UTC
* Generated on Saturday, August 13 2011, 07:20 UTC
*/
#ifndef MINIMAL_H
#define MINIMAL_H
......@@ -11,7 +11,7 @@ extern "C" {
#endif
#include "../protocol.h"
#include "../mavlink_protocol.h"
#define MAVLINK_ENABLED_MINIMAL
......@@ -39,6 +39,11 @@ extern "C" {
#undef MAVLINK_MESSAGE_KEYS
#define MAVLINK_MESSAGE_KEYS { }
// MESSAGE LENGTHS
#undef MAVLINK_MESSAGE_LENGTHS
#define MAVLINK_MESSAGE_LENGTHS { }
#ifdef __cplusplus
}
#endif
......
/** @file
* @brief MAVLink comm protocol.
* @see http://pixhawk.ethz.ch/software/mavlink
* Generated on Tuesday, August 9 2011, 16:49 UTC
* Generated on Saturday, August 13 2011, 07:19 UTC
*/
#ifndef MAVLINK_H
#define MAVLINK_H
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_ATTITUDE_CONTROL 85
#define MAVLINK_MSG_ID_ATTITUDE_CONTROL_LEN 21
#define MAVLINK_MSG_85_LEN 21
#define MAVLINK_MSG_ID_ATTITUDE_CONTROL_KEY 0x7F
#define MAVLINK_MSG_85_KEY 0x7F
typedef struct __mavlink_attitude_control_t
{
......@@ -101,6 +103,8 @@ static inline uint16_t mavlink_msg_attitude_control_encode(uint8_t system_id, ui
return mavlink_msg_attitude_control_pack(system_id, component_id, msg, attitude_control->target, attitude_control->roll, attitude_control->pitch, attitude_control->yaw, attitude_control->thrust, attitude_control->roll_manual, attitude_control->pitch_manual, attitude_control->yaw_manual, attitude_control->thrust_manual);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a attitude_control message
* @param chan MAVLink channel to send the message
......@@ -115,25 +119,21 @@ static inline uint16_t mavlink_msg_attitude_control_encode(uint8_t system_id, ui
* @param yaw_manual yaw auto:0, manual:1
* @param thrust_manual thrust auto:0, manual:1
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_attitude_control_send(mavlink_channel_t chan, uint8_t target, float roll, float pitch, float yaw, float thrust, uint8_t roll_manual, uint8_t pitch_manual, uint8_t yaw_manual, uint8_t thrust_manual)
{
mavlink_header_t hdr;
mavlink_attitude_control_t payload;
uint16_t checksum;
mavlink_attitude_control_t *p = &payload;
p->target = target; // uint8_t:The system to be controlled
p->roll = roll; // float:roll
p->pitch = pitch; // float:pitch
p->yaw = yaw; // float:yaw
p->thrust = thrust; // float:thrust
p->roll_manual = roll_manual; // uint8_t:roll control enabled auto:0, manual:1
p->pitch_manual = pitch_manual; // uint8_t:pitch auto:0, manual:1
p->yaw_manual = yaw_manual; // uint8_t:yaw auto:0, manual:1
p->thrust_manual = thrust_manual; // uint8_t:thrust auto:0, manual:1
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_ATTITUDE_CONTROL_LEN )
payload.target = target; // uint8_t:The system to be controlled
payload.roll = roll; // float:roll
payload.pitch = pitch; // float:pitch
payload.yaw = yaw; // float:yaw
payload.thrust = thrust; // float:thrust
payload.roll_manual = roll_manual; // uint8_t:roll control enabled auto:0, manual:1
payload.pitch_manual = pitch_manual; // uint8_t:pitch auto:0, manual:1
payload.yaw_manual = yaw_manual; // uint8_t:yaw auto:0, manual:1
payload.thrust_manual = thrust_manual; // uint8_t:thrust auto:0, manual:1
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_ATTITUDE_CONTROL_LEN;
......@@ -144,14 +144,12 @@ static inline void mavlink_msg_attitude_control_send(mavlink_channel_t chan, uin
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0x7F, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_AUX_STATUS 142
#define MAVLINK_MSG_ID_AUX_STATUS_LEN 12
#define MAVLINK_MSG_142_LEN 12
#define MAVLINK_MSG_ID_AUX_STATUS_KEY 0x7A
#define MAVLINK_MSG_142_KEY 0x7A
typedef struct __mavlink_aux_status_t
{
......@@ -86,6 +88,8 @@ static inline uint16_t mavlink_msg_aux_status_encode(uint8_t system_id, uint8_t
return mavlink_msg_aux_status_pack(system_id, component_id, msg, aux_status->load, aux_status->i2c0_err_count, aux_status->i2c1_err_count, aux_status->spi0_err_count, aux_status->spi1_err_count, aux_status->uart_total_err_count);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a aux_status message
* @param chan MAVLink channel to send the message
......@@ -97,22 +101,18 @@ static inline uint16_t mavlink_msg_aux_status_encode(uint8_t system_id, uint8_t
* @param spi1_err_count Number of I2C errors since startup
* @param uart_total_err_count Number of I2C errors since startup
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_aux_status_send(mavlink_channel_t chan, uint16_t load, uint16_t i2c0_err_count, uint16_t i2c1_err_count, uint16_t spi0_err_count, uint16_t spi1_err_count, uint16_t uart_total_err_count)
{
mavlink_header_t hdr;
mavlink_aux_status_t payload;
uint16_t checksum;
mavlink_aux_status_t *p = &payload;
p->load = load; // uint16_t:Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000
p->i2c0_err_count = i2c0_err_count; // uint16_t:Number of I2C errors since startup
p->i2c1_err_count = i2c1_err_count; // uint16_t:Number of I2C errors since startup
p->spi0_err_count = spi0_err_count; // uint16_t:Number of I2C errors since startup
p->spi1_err_count = spi1_err_count; // uint16_t:Number of I2C errors since startup
p->uart_total_err_count = uart_total_err_count; // uint16_t:Number of I2C errors since startup
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_AUX_STATUS_LEN )
payload.load = load; // uint16_t:Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000
payload.i2c0_err_count = i2c0_err_count; // uint16_t:Number of I2C errors since startup
payload.i2c1_err_count = i2c1_err_count; // uint16_t:Number of I2C errors since startup
payload.spi0_err_count = spi0_err_count; // uint16_t:Number of I2C errors since startup
payload.spi1_err_count = spi1_err_count; // uint16_t:Number of I2C errors since startup
payload.uart_total_err_count = uart_total_err_count; // uint16_t:Number of I2C errors since startup
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_AUX_STATUS_LEN;
......@@ -123,14 +123,12 @@ static inline void mavlink_msg_aux_status_send(mavlink_channel_t chan, uint16_t
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0x7A, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_BRIEF_FEATURE 172
#define MAVLINK_MSG_ID_BRIEF_FEATURE_LEN 53
#define MAVLINK_MSG_172_LEN 53
#define MAVLINK_MSG_ID_BRIEF_FEATURE_KEY 0xD9
#define MAVLINK_MSG_172_KEY 0xD9
typedef struct __mavlink_brief_feature_t
{
......@@ -97,6 +99,8 @@ static inline uint16_t mavlink_msg_brief_feature_encode(uint8_t system_id, uint8
return mavlink_msg_brief_feature_pack(system_id, component_id, msg, brief_feature->x, brief_feature->y, brief_feature->z, brief_feature->orientation_assignment, brief_feature->size, brief_feature->orientation, brief_feature->descriptor, brief_feature->response);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a brief_feature message
* @param chan MAVLink channel to send the message
......@@ -110,24 +114,20 @@ static inline uint16_t mavlink_msg_brief_feature_encode(uint8_t system_id, uint8
* @param descriptor Descriptor
* @param response Harris operator response at this location
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_brief_feature_send(mavlink_channel_t chan, float x, float y, float z, uint8_t orientation_assignment, uint16_t size, uint16_t orientation, const uint8_t* descriptor, float response)
{
mavlink_header_t hdr;
mavlink_brief_feature_t payload;
uint16_t checksum;
mavlink_brief_feature_t *p = &payload;
p->x = x; // float:x position in m
p->y = y; // float:y position in m
p->z = z; // float:z position in m
p->orientation_assignment = orientation_assignment; // uint8_t:Orientation assignment 0: false, 1:true
p->size = size; // uint16_t:Size in pixels
p->orientation = orientation; // uint16_t:Orientation
memcpy(p->descriptor, descriptor, sizeof(p->descriptor)); // uint8_t[32]:Descriptor
p->response = response; // float:Harris operator response at this location
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_BRIEF_FEATURE_LEN )
payload.x = x; // float:x position in m
payload.y = y; // float:y position in m
payload.z = z; // float:z position in m
payload.orientation_assignment = orientation_assignment; // uint8_t:Orientation assignment 0: false, 1:true
payload.size = size; // uint16_t:Size in pixels
payload.orientation = orientation; // uint16_t:Orientation
memcpy(payload.descriptor, descriptor, sizeof(payload.descriptor)); // uint8_t[32]:Descriptor
payload.response = response; // float:Harris operator response at this location
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_BRIEF_FEATURE_LEN;
......@@ -138,14 +138,12 @@ static inline void mavlink_msg_brief_feature_send(mavlink_channel_t chan, float
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0xD9, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE 170
#define MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN 8
#define MAVLINK_MSG_170_LEN 8
#define MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_KEY 0xC8
#define MAVLINK_MSG_170_KEY 0xC8
typedef struct __mavlink_data_transmission_handshake_t
{
......@@ -81,6 +83,8 @@ static inline uint16_t mavlink_msg_data_transmission_handshake_encode(uint8_t sy
return mavlink_msg_data_transmission_handshake_pack(system_id, component_id, msg, data_transmission_handshake->type, data_transmission_handshake->size, data_transmission_handshake->packets, data_transmission_handshake->payload, data_transmission_handshake->jpg_quality);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a data_transmission_handshake message
* @param chan MAVLink channel to send the message
......@@ -91,21 +95,17 @@ static inline uint16_t mavlink_msg_data_transmission_handshake_encode(uint8_t sy
* @param payload payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)
* @param jpg_quality JPEG quality out of [1,100]
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_data_transmission_handshake_send(mavlink_channel_t chan, uint8_t type, uint32_t size, uint8_t packets, uint8_t payload, uint8_t jpg_quality)
{
mavlink_header_t hdr;
mavlink_data_transmission_handshake_t payload;
uint16_t checksum;
mavlink_data_transmission_handshake_t *p = &payload;
p->type = type; // uint8_t:type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h)
p->size = size; // uint32_t:total data size in bytes (set on ACK only)
p->packets = packets; // uint8_t:number of packets beeing sent (set on ACK only)
p->payload = payload; // uint8_t:payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)
p->jpg_quality = jpg_quality; // uint8_t:JPEG quality out of [1,100]
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN )
payload.type = type; // uint8_t:type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h)
payload.size = size; // uint32_t:total data size in bytes (set on ACK only)
payload.packets = packets; // uint8_t:number of packets beeing sent (set on ACK only)
payload.payload = payload; // uint8_t:payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)
payload.jpg_quality = jpg_quality; // uint8_t:JPEG quality out of [1,100]
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN;
......@@ -116,14 +116,12 @@ static inline void mavlink_msg_data_transmission_handshake_send(mavlink_channel_
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0xC8, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_ENCAPSULATED_DATA 171
#define MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN 255
#define MAVLINK_MSG_171_LEN 255
#define MAVLINK_MSG_ID_ENCAPSULATED_DATA_KEY 0x87
#define MAVLINK_MSG_171_KEY 0x87
typedef struct __mavlink_encapsulated_data_t
{
......@@ -67,6 +69,8 @@ static inline uint16_t mavlink_msg_encapsulated_data_encode(uint8_t system_id, u
return mavlink_msg_encapsulated_data_pack(system_id, component_id, msg, encapsulated_data->seqnr, encapsulated_data->data);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a encapsulated_data message
* @param chan MAVLink channel to send the message
......@@ -74,18 +78,14 @@ static inline uint16_t mavlink_msg_encapsulated_data_encode(uint8_t system_id, u
* @param seqnr sequence number (starting with 0 on every transmission)
* @param data image data bytes
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_encapsulated_data_send(mavlink_channel_t chan, uint16_t seqnr, const uint8_t* data)
{
mavlink_header_t hdr;
mavlink_encapsulated_data_t payload;
uint16_t checksum;
mavlink_encapsulated_data_t *p = &payload;
p->seqnr = seqnr; // uint16_t:sequence number (starting with 0 on every transmission)
memcpy(p->data, data, sizeof(p->data)); // uint8_t[253]:image data bytes
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN )
payload.seqnr = seqnr; // uint16_t:sequence number (starting with 0 on every transmission)
memcpy(payload.data, data, sizeof(payload.data)); // uint8_t[253]:image data bytes
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN;
......@@ -96,14 +96,12 @@ static inline void mavlink_msg_encapsulated_data_send(mavlink_channel_t chan, ui
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0x87, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_IMAGE_AVAILABLE 103
#define MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN 92
#define MAVLINK_MSG_103_LEN 92
#define MAVLINK_MSG_ID_IMAGE_AVAILABLE_KEY 0xA5
#define MAVLINK_MSG_103_KEY 0xA5
typedef struct __mavlink_image_available_t
{
......@@ -171,6 +173,8 @@ static inline uint16_t mavlink_msg_image_available_encode(uint8_t system_id, uin
return mavlink_msg_image_available_pack(system_id, component_id, msg, image_available->cam_id, image_available->cam_no, image_available->timestamp, image_available->valid_until, image_available->img_seq, image_available->img_buf_index, image_available->width, image_available->height, image_available->depth, image_available->channels, image_available->key, image_available->exposure, image_available->gain, image_available->roll, image_available->pitch, image_available->yaw, image_available->local_z, image_available->lat, image_available->lon, image_available->alt, image_available->ground_x, image_available->ground_y, image_available->ground_z);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a image_available message
* @param chan MAVLink channel to send the message
......@@ -199,39 +203,35 @@ static inline uint16_t mavlink_msg_image_available_encode(uint8_t system_id, uin
* @param ground_y Ground truth Y
* @param ground_z Ground truth Z
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_image_available_send(mavlink_channel_t chan, uint64_t cam_id, uint8_t cam_no, uint64_t timestamp, uint64_t valid_until, uint32_t img_seq, uint32_t img_buf_index, uint16_t width, uint16_t height, uint16_t depth, uint8_t channels, uint32_t key, uint32_t exposure, float gain, float roll, float pitch, float yaw, float local_z, float lat, float lon, float alt, float ground_x, float ground_y, float ground_z)
{
mavlink_header_t hdr;
mavlink_image_available_t payload;
uint16_t checksum;
mavlink_image_available_t *p = &payload;
p->cam_id = cam_id; // uint64_t:Camera id
p->cam_no = cam_no; // uint8_t:Camera # (starts with 0)
p->timestamp = timestamp; // uint64_t:Timestamp
p->valid_until = valid_until; // uint64_t:Until which timestamp this buffer will stay valid
p->img_seq = img_seq; // uint32_t:The image sequence number
p->img_buf_index = img_buf_index; // uint32_t:Position of the image in the buffer, starts with 0
p->width = width; // uint16_t:Image width
p->height = height; // uint16_t:Image height
p->depth = depth; // uint16_t:Image depth
p->channels = channels; // uint8_t:Image channels
p->key = key; // uint32_t:Shared memory area key
p->exposure = exposure; // uint32_t:Exposure time, in microseconds
p->gain = gain; // float:Camera gain
p->roll = roll; // float:Roll angle in rad
p->pitch = pitch; // float:Pitch angle in rad
p->yaw = yaw; // float:Yaw angle in rad
p->local_z = local_z; // float:Local frame Z coordinate (height over ground)
p->lat = lat; // float:GPS X coordinate
p->lon = lon; // float:GPS Y coordinate
p->alt = alt; // float:Global frame altitude
p->ground_x = ground_x; // float:Ground truth X
p->ground_y = ground_y; // float:Ground truth Y
p->ground_z = ground_z; // float:Ground truth Z
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN )
payload.cam_id = cam_id; // uint64_t:Camera id
payload.cam_no = cam_no; // uint8_t:Camera # (starts with 0)
payload.timestamp = timestamp; // uint64_t:Timestamp
payload.valid_until = valid_until; // uint64_t:Until which timestamp this buffer will stay valid
payload.img_seq = img_seq; // uint32_t:The image sequence number
payload.img_buf_index = img_buf_index; // uint32_t:Position of the image in the buffer, starts with 0
payload.width = width; // uint16_t:Image width
payload.height = height; // uint16_t:Image height
payload.depth = depth; // uint16_t:Image depth
payload.channels = channels; // uint8_t:Image channels
payload.key = key; // uint32_t:Shared memory area key
payload.exposure = exposure; // uint32_t:Exposure time, in microseconds
payload.gain = gain; // float:Camera gain
payload.roll = roll; // float:Roll angle in rad
payload.pitch = pitch; // float:Pitch angle in rad
payload.yaw = yaw; // float:Yaw angle in rad
payload.local_z = local_z; // float:Local frame Z coordinate (height over ground)
payload.lat = lat; // float:GPS X coordinate
payload.lon = lon; // float:GPS Y coordinate
payload.alt = alt; // float:Global frame altitude
payload.ground_x = ground_x; // float:Ground truth X
payload.ground_y = ground_y; // float:Ground truth Y
payload.ground_z = ground_z; // float:Ground truth Z
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_IMAGE_AVAILABLE_LEN;
......@@ -242,14 +242,12 @@ static inline void mavlink_msg_image_available_send(mavlink_channel_t chan, uint
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0xA5, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL 102
#define MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_LEN 1
#define MAVLINK_MSG_102_LEN 1
#define MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_KEY 0xEE
#define MAVLINK_MSG_102_KEY 0xEE
typedef struct __mavlink_image_trigger_control_t
{
......@@ -61,23 +63,21 @@ static inline uint16_t mavlink_msg_image_trigger_control_encode(uint8_t system_i
return mavlink_msg_image_trigger_control_pack(system_id, component_id, msg, image_trigger_control->enable);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a image_trigger_control message
* @param chan MAVLink channel to send the message
*
* @param enable 0 to disable, 1 to enable
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_image_trigger_control_send(mavlink_channel_t chan, uint8_t enable)
{
mavlink_header_t hdr;
mavlink_image_trigger_control_t payload;
uint16_t checksum;
mavlink_image_trigger_control_t *p = &payload;
p->enable = enable; // uint8_t:0 to disable, 1 to enable
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_LEN )
payload.enable = enable; // uint8_t:0 to disable, 1 to enable
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_LEN;
......@@ -88,14 +88,12 @@ static inline void mavlink_msg_image_trigger_control_send(mavlink_channel_t chan
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0xEE, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_IMAGE_TRIGGERED 101
#define MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN 52
#define MAVLINK_MSG_101_LEN 52
#define MAVLINK_MSG_ID_IMAGE_TRIGGERED_KEY 0x8
#define MAVLINK_MSG_101_KEY 0x8
typedef struct __mavlink_image_triggered_t
{
......@@ -116,6 +118,8 @@ static inline uint16_t mavlink_msg_image_triggered_encode(uint8_t system_id, uin
return mavlink_msg_image_triggered_pack(system_id, component_id, msg, image_triggered->timestamp, image_triggered->seq, image_triggered->roll, image_triggered->pitch, image_triggered->yaw, image_triggered->local_z, image_triggered->lat, image_triggered->lon, image_triggered->alt, image_triggered->ground_x, image_triggered->ground_y, image_triggered->ground_z);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a image_triggered message
* @param chan MAVLink channel to send the message
......@@ -133,28 +137,24 @@ static inline uint16_t mavlink_msg_image_triggered_encode(uint8_t system_id, uin
* @param ground_y Ground truth Y
* @param ground_z Ground truth Z
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_image_triggered_send(mavlink_channel_t chan, uint64_t timestamp, uint32_t seq, float roll, float pitch, float yaw, float local_z, float lat, float lon, float alt, float ground_x, float ground_y, float ground_z)
{
mavlink_header_t hdr;
mavlink_image_triggered_t payload;
uint16_t checksum;
mavlink_image_triggered_t *p = &payload;
p->timestamp = timestamp; // uint64_t:Timestamp
p->seq = seq; // uint32_t:IMU seq
p->roll = roll; // float:Roll angle in rad
p->pitch = pitch; // float:Pitch angle in rad
p->yaw = yaw; // float:Yaw angle in rad
p->local_z = local_z; // float:Local frame Z coordinate (height over ground)
p->lat = lat; // float:GPS X coordinate
p->lon = lon; // float:GPS Y coordinate
p->alt = alt; // float:Global frame altitude
p->ground_x = ground_x; // float:Ground truth X
p->ground_y = ground_y; // float:Ground truth Y
p->ground_z = ground_z; // float:Ground truth Z
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN )
payload.timestamp = timestamp; // uint64_t:Timestamp
payload.seq = seq; // uint32_t:IMU seq
payload.roll = roll; // float:Roll angle in rad
payload.pitch = pitch; // float:Pitch angle in rad
payload.yaw = yaw; // float:Yaw angle in rad
payload.local_z = local_z; // float:Local frame Z coordinate (height over ground)
payload.lat = lat; // float:GPS X coordinate
payload.lon = lon; // float:GPS Y coordinate
payload.alt = alt; // float:Global frame altitude
payload.ground_x = ground_x; // float:Ground truth X
payload.ground_y = ground_y; // float:Ground truth Y
payload.ground_z = ground_z; // float:Ground truth Z
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN;
......@@ -165,14 +165,12 @@ static inline void mavlink_msg_image_triggered_send(mavlink_channel_t chan, uint
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0x8, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_MARKER 130
#define MAVLINK_MSG_ID_MARKER_LEN 26
#define MAVLINK_MSG_130_LEN 26
#define MAVLINK_MSG_ID_MARKER_KEY 0xDD
#define MAVLINK_MSG_130_KEY 0xDD
typedef struct __mavlink_marker_t
{
......@@ -91,6 +93,8 @@ static inline uint16_t mavlink_msg_marker_encode(uint8_t system_id, uint8_t comp
return mavlink_msg_marker_pack(system_id, component_id, msg, marker->id, marker->x, marker->y, marker->z, marker->roll, marker->pitch, marker->yaw);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a marker message
* @param chan MAVLink channel to send the message
......@@ -103,23 +107,19 @@ static inline uint16_t mavlink_msg_marker_encode(uint8_t system_id, uint8_t comp
* @param pitch pitch orientation
* @param yaw yaw orientation
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_marker_send(mavlink_channel_t chan, uint16_t id, float x, float y, float z, float roll, float pitch, float yaw)
{
mavlink_header_t hdr;
mavlink_marker_t payload;
uint16_t checksum;
mavlink_marker_t *p = &payload;
p->id = id; // uint16_t:ID
p->x = x; // float:x position
p->y = y; // float:y position
p->z = z; // float:z position
p->roll = roll; // float:roll orientation
p->pitch = pitch; // float:pitch orientation
p->yaw = yaw; // float:yaw orientation
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_MARKER_LEN )
payload.id = id; // uint16_t:ID
payload.x = x; // float:x position
payload.y = y; // float:y position
payload.z = z; // float:z position
payload.roll = roll; // float:roll orientation
payload.pitch = pitch; // float:pitch orientation
payload.yaw = yaw; // float:yaw orientation
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_MARKER_LEN;
......@@ -130,14 +130,12 @@ static inline void mavlink_msg_marker_send(mavlink_channel_t chan, uint16_t id,
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0xDD, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_PATTERN_DETECTED 160
#define MAVLINK_MSG_ID_PATTERN_DETECTED_LEN 106
#define MAVLINK_MSG_160_LEN 106
#define MAVLINK_MSG_ID_PATTERN_DETECTED_KEY 0x34
#define MAVLINK_MSG_160_KEY 0x34
typedef struct __mavlink_pattern_detected_t
{
......@@ -77,6 +79,8 @@ static inline uint16_t mavlink_msg_pattern_detected_encode(uint8_t system_id, ui
return mavlink_msg_pattern_detected_pack(system_id, component_id, msg, pattern_detected->type, pattern_detected->confidence, pattern_detected->file, pattern_detected->detected);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a pattern_detected message
* @param chan MAVLink channel to send the message
......@@ -86,20 +90,16 @@ static inline uint16_t mavlink_msg_pattern_detected_encode(uint8_t system_id, ui
* @param file Pattern file name
* @param detected Accepted as true detection, 0 no, 1 yes
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_pattern_detected_send(mavlink_channel_t chan, uint8_t type, float confidence, const char* file, uint8_t detected)
{
mavlink_header_t hdr;
mavlink_pattern_detected_t payload;
uint16_t checksum;
mavlink_pattern_detected_t *p = &payload;
p->type = type; // uint8_t:0: Pattern, 1: Letter
p->confidence = confidence; // float:Confidence of detection
memcpy(p->file, file, sizeof(p->file)); // char[100]:Pattern file name
p->detected = detected; // uint8_t:Accepted as true detection, 0 no, 1 yes
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_PATTERN_DETECTED_LEN )
payload.type = type; // uint8_t:0: Pattern, 1: Letter
payload.confidence = confidence; // float:Confidence of detection
memcpy(payload.file, file, sizeof(payload.file)); // char[100]:Pattern file name
payload.detected = detected; // uint8_t:Accepted as true detection, 0 no, 1 yes
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_PATTERN_DETECTED_LEN;
......@@ -110,14 +110,12 @@ static inline void mavlink_msg_pattern_detected_send(mavlink_channel_t chan, uin
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0x34, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_POINT_OF_INTEREST 161
#define MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN 43
#define MAVLINK_MSG_161_LEN 43
#define MAVLINK_MSG_ID_POINT_OF_INTEREST_KEY 0xA3
#define MAVLINK_MSG_161_KEY 0xA3
typedef struct __mavlink_point_of_interest_t
{
......@@ -97,6 +99,8 @@ static inline uint16_t mavlink_msg_point_of_interest_encode(uint8_t system_id, u
return mavlink_msg_point_of_interest_pack(system_id, component_id, msg, point_of_interest->type, point_of_interest->color, point_of_interest->coordinate_system, point_of_interest->timeout, point_of_interest->x, point_of_interest->y, point_of_interest->z, point_of_interest->name);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a point_of_interest message
* @param chan MAVLink channel to send the message
......@@ -110,24 +114,20 @@ static inline uint16_t mavlink_msg_point_of_interest_encode(uint8_t system_id, u
* @param z Z Position
* @param name POI name
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_point_of_interest_send(mavlink_channel_t chan, uint8_t type, uint8_t color, uint8_t coordinate_system, uint16_t timeout, float x, float y, float z, const char* name)
{
mavlink_header_t hdr;
mavlink_point_of_interest_t payload;
uint16_t checksum;
mavlink_point_of_interest_t *p = &payload;
p->type = type; // uint8_t:0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug
p->color = color; // uint8_t:0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta
p->coordinate_system = coordinate_system; // uint8_t:0: global, 1:local
p->timeout = timeout; // uint16_t:0: no timeout, >1: timeout in seconds
p->x = x; // float:X Position
p->y = y; // float:Y Position
p->z = z; // float:Z Position
memcpy(p->name, name, sizeof(p->name)); // char[26]:POI name
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN )
payload.type = type; // uint8_t:0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug
payload.color = color; // uint8_t:0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta
payload.coordinate_system = coordinate_system; // uint8_t:0: global, 1:local
payload.timeout = timeout; // uint16_t:0: no timeout, >1: timeout in seconds
payload.x = x; // float:X Position
payload.y = y; // float:Y Position
payload.z = z; // float:Z Position
memcpy(payload.name, name, sizeof(payload.name)); // char[26]:POI name
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN;
......@@ -138,14 +138,12 @@ static inline void mavlink_msg_point_of_interest_send(mavlink_channel_t chan, ui
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0xA3, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION 162
#define MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN 55
#define MAVLINK_MSG_162_LEN 55
#define MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_KEY 0x10
#define MAVLINK_MSG_162_KEY 0x10
typedef struct __mavlink_point_of_interest_connection_t
{
......@@ -112,6 +114,8 @@ static inline uint16_t mavlink_msg_point_of_interest_connection_encode(uint8_t s
return mavlink_msg_point_of_interest_connection_pack(system_id, component_id, msg, point_of_interest_connection->type, point_of_interest_connection->color, point_of_interest_connection->coordinate_system, point_of_interest_connection->timeout, point_of_interest_connection->xp1, point_of_interest_connection->yp1, point_of_interest_connection->zp1, point_of_interest_connection->xp2, point_of_interest_connection->yp2, point_of_interest_connection->zp2, point_of_interest_connection->name);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a point_of_interest_connection message
* @param chan MAVLink channel to send the message
......@@ -128,27 +132,23 @@ static inline uint16_t mavlink_msg_point_of_interest_connection_encode(uint8_t s
* @param zp2 Z2 Position
* @param name POI connection name
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_point_of_interest_connection_send(mavlink_channel_t chan, uint8_t type, uint8_t color, uint8_t coordinate_system, uint16_t timeout, float xp1, float yp1, float zp1, float xp2, float yp2, float zp2, const char* name)
{
mavlink_header_t hdr;
mavlink_point_of_interest_connection_t payload;
uint16_t checksum;
mavlink_point_of_interest_connection_t *p = &payload;
p->type = type; // uint8_t:0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug
p->color = color; // uint8_t:0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta
p->coordinate_system = coordinate_system; // uint8_t:0: global, 1:local
p->timeout = timeout; // uint16_t:0: no timeout, >1: timeout in seconds
p->xp1 = xp1; // float:X1 Position
p->yp1 = yp1; // float:Y1 Position
p->zp1 = zp1; // float:Z1 Position
p->xp2 = xp2; // float:X2 Position
p->yp2 = yp2; // float:Y2 Position
p->zp2 = zp2; // float:Z2 Position
memcpy(p->name, name, sizeof(p->name)); // char[26]:POI connection name
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN )
payload.type = type; // uint8_t:0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug
payload.color = color; // uint8_t:0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta
payload.coordinate_system = coordinate_system; // uint8_t:0: global, 1:local
payload.timeout = timeout; // uint16_t:0: no timeout, >1: timeout in seconds
payload.xp1 = xp1; // float:X1 Position
payload.yp1 = yp1; // float:Y1 Position
payload.zp1 = zp1; // float:Z1 Position
payload.xp2 = xp2; // float:X2 Position
payload.yp2 = yp2; // float:Y2 Position
payload.zp2 = zp2; // float:Z2 Position
memcpy(payload.name, name, sizeof(payload.name)); // char[26]:POI connection name
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN;
......@@ -159,14 +159,12 @@ static inline void mavlink_msg_point_of_interest_connection_send(mavlink_channel
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0x10, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_POSITION_CONTROL_OFFSET_SET 154
#define MAVLINK_MSG_ID_POSITION_CONTROL_OFFSET_SET_LEN 18
#define MAVLINK_MSG_154_LEN 18
#define MAVLINK_MSG_ID_POSITION_CONTROL_OFFSET_SET_KEY 0xA
#define MAVLINK_MSG_154_KEY 0xA
typedef struct __mavlink_position_control_offset_set_t
{
......@@ -86,6 +88,8 @@ static inline uint16_t mavlink_msg_position_control_offset_set_encode(uint8_t sy
return mavlink_msg_position_control_offset_set_pack(system_id, component_id, msg, position_control_offset_set->target_system, position_control_offset_set->target_component, position_control_offset_set->x, position_control_offset_set->y, position_control_offset_set->z, position_control_offset_set->yaw);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a position_control_offset_set message
* @param chan MAVLink channel to send the message
......@@ -97,22 +101,18 @@ static inline uint16_t mavlink_msg_position_control_offset_set_encode(uint8_t sy
* @param z z position offset
* @param yaw yaw orientation offset in radians, 0 = NORTH
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_position_control_offset_set_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, float x, float y, float z, float yaw)
{
mavlink_header_t hdr;
mavlink_position_control_offset_set_t payload;
uint16_t checksum;
mavlink_position_control_offset_set_t *p = &payload;
p->target_system = target_system; // uint8_t:System ID
p->target_component = target_component; // uint8_t:Component ID
p->x = x; // float:x position offset
p->y = y; // float:y position offset
p->z = z; // float:z position offset
p->yaw = yaw; // float:yaw orientation offset in radians, 0 = NORTH
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_POSITION_CONTROL_OFFSET_SET_LEN )
payload.target_system = target_system; // uint8_t:System ID
payload.target_component = target_component; // uint8_t:Component ID
payload.x = x; // float:x position offset
payload.y = y; // float:y position offset
payload.z = z; // float:z position offset
payload.yaw = yaw; // float:yaw orientation offset in radians, 0 = NORTH
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_POSITION_CONTROL_OFFSET_SET_LEN;
......@@ -123,14 +123,12 @@ static inline void mavlink_msg_position_control_offset_set_send(mavlink_channel_
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0xA, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT 121
#define MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_LEN 18
#define MAVLINK_MSG_121_LEN 18
#define MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_KEY 0x72
#define MAVLINK_MSG_121_KEY 0x72
typedef struct __mavlink_position_control_setpoint_t
{
......@@ -81,6 +83,8 @@ static inline uint16_t mavlink_msg_position_control_setpoint_encode(uint8_t syst
return mavlink_msg_position_control_setpoint_pack(system_id, component_id, msg, position_control_setpoint->id, position_control_setpoint->x, position_control_setpoint->y, position_control_setpoint->z, position_control_setpoint->yaw);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a position_control_setpoint message
* @param chan MAVLink channel to send the message
......@@ -91,21 +95,17 @@ static inline uint16_t mavlink_msg_position_control_setpoint_encode(uint8_t syst
* @param z z position
* @param yaw yaw orientation in radians, 0 = NORTH
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_position_control_setpoint_send(mavlink_channel_t chan, uint16_t id, float x, float y, float z, float yaw)
{
mavlink_header_t hdr;
mavlink_position_control_setpoint_t payload;
uint16_t checksum;
mavlink_position_control_setpoint_t *p = &payload;
p->id = id; // uint16_t:ID of waypoint, 0 for plain position
p->x = x; // float:x position
p->y = y; // float:y position
p->z = z; // float:z position
p->yaw = yaw; // float:yaw orientation in radians, 0 = NORTH
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_LEN )
payload.id = id; // uint16_t:ID of waypoint, 0 for plain position
payload.x = x; // float:x position
payload.y = y; // float:y position
payload.z = z; // float:z position
payload.yaw = yaw; // float:yaw orientation in radians, 0 = NORTH
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_LEN;
......@@ -116,14 +116,12 @@ static inline void mavlink_msg_position_control_setpoint_send(mavlink_channel_t
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0x72, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_SET 120
#define MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_SET_LEN 20
#define MAVLINK_MSG_120_LEN 20
#define MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_SET_KEY 0xE1
#define MAVLINK_MSG_120_KEY 0xE1
typedef struct __mavlink_position_control_setpoint_set_t
{
......@@ -91,6 +93,8 @@ static inline uint16_t mavlink_msg_position_control_setpoint_set_encode(uint8_t
return mavlink_msg_position_control_setpoint_set_pack(system_id, component_id, msg, position_control_setpoint_set->target_system, position_control_setpoint_set->target_component, position_control_setpoint_set->id, position_control_setpoint_set->x, position_control_setpoint_set->y, position_control_setpoint_set->z, position_control_setpoint_set->yaw);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a position_control_setpoint_set message
* @param chan MAVLink channel to send the message
......@@ -103,23 +107,19 @@ static inline uint16_t mavlink_msg_position_control_setpoint_set_encode(uint8_t
* @param z z position
* @param yaw yaw orientation in radians, 0 = NORTH
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_position_control_setpoint_set_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t id, float x, float y, float z, float yaw)
{
mavlink_header_t hdr;
mavlink_position_control_setpoint_set_t payload;
uint16_t checksum;
mavlink_position_control_setpoint_set_t *p = &payload;
p->target_system = target_system; // uint8_t:System ID
p->target_component = target_component; // uint8_t:Component ID
p->id = id; // uint16_t:ID of waypoint, 0 for plain position
p->x = x; // float:x position
p->y = y; // float:y position
p->z = z; // float:z position
p->yaw = yaw; // float:yaw orientation in radians, 0 = NORTH
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_SET_LEN )
payload.target_system = target_system; // uint8_t:System ID
payload.target_component = target_component; // uint8_t:Component ID
payload.id = id; // uint16_t:ID of waypoint, 0 for plain position
payload.x = x; // float:x position
payload.y = y; // float:y position
payload.z = z; // float:z position
payload.yaw = yaw; // float:yaw orientation in radians, 0 = NORTH
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_SET_LEN;
......@@ -130,14 +130,12 @@ static inline void mavlink_msg_position_control_setpoint_set_send(mavlink_channe
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0xE1, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_RAW_AUX 141
#define MAVLINK_MSG_ID_RAW_AUX_LEN 16
#define MAVLINK_MSG_141_LEN 16
#define MAVLINK_MSG_ID_RAW_AUX_KEY 0xAB
#define MAVLINK_MSG_141_KEY 0xAB
typedef struct __mavlink_raw_aux_t
{
......@@ -91,6 +93,8 @@ static inline uint16_t mavlink_msg_raw_aux_encode(uint8_t system_id, uint8_t com
return mavlink_msg_raw_aux_pack(system_id, component_id, msg, raw_aux->adc1, raw_aux->adc2, raw_aux->adc3, raw_aux->adc4, raw_aux->vbat, raw_aux->temp, raw_aux->baro);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a raw_aux message
* @param chan MAVLink channel to send the message
......@@ -103,23 +107,19 @@ static inline uint16_t mavlink_msg_raw_aux_encode(uint8_t system_id, uint8_t com
* @param temp Temperature (degrees celcius)
* @param baro Barometric pressure (hecto Pascal)
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_raw_aux_send(mavlink_channel_t chan, uint16_t adc1, uint16_t adc2, uint16_t adc3, uint16_t adc4, uint16_t vbat, int16_t temp, int32_t baro)
{
mavlink_header_t hdr;
mavlink_raw_aux_t payload;
uint16_t checksum;
mavlink_raw_aux_t *p = &payload;
p->adc1 = adc1; // uint16_t:ADC1 (J405 ADC3, LPC2148 AD0.6)
p->adc2 = adc2; // uint16_t:ADC2 (J405 ADC5, LPC2148 AD0.2)
p->adc3 = adc3; // uint16_t:ADC3 (J405 ADC6, LPC2148 AD0.1)
p->adc4 = adc4; // uint16_t:ADC4 (J405 ADC7, LPC2148 AD1.3)
p->vbat = vbat; // uint16_t:Battery voltage
p->temp = temp; // int16_t:Temperature (degrees celcius)
p->baro = baro; // int32_t:Barometric pressure (hecto Pascal)
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_RAW_AUX_LEN )
payload.adc1 = adc1; // uint16_t:ADC1 (J405 ADC3, LPC2148 AD0.6)
payload.adc2 = adc2; // uint16_t:ADC2 (J405 ADC5, LPC2148 AD0.2)
payload.adc3 = adc3; // uint16_t:ADC3 (J405 ADC6, LPC2148 AD0.1)
payload.adc4 = adc4; // uint16_t:ADC4 (J405 ADC7, LPC2148 AD1.3)
payload.vbat = vbat; // uint16_t:Battery voltage
payload.temp = temp; // int16_t:Temperature (degrees celcius)
payload.baro = baro; // int32_t:Barometric pressure (hecto Pascal)
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_RAW_AUX_LEN;
......@@ -130,14 +130,12 @@ static inline void mavlink_msg_raw_aux_send(mavlink_channel_t chan, uint16_t adc
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0xAB, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_SET_CAM_SHUTTER 100
#define MAVLINK_MSG_ID_SET_CAM_SHUTTER_LEN 11
#define MAVLINK_MSG_100_LEN 11
#define MAVLINK_MSG_ID_SET_CAM_SHUTTER_KEY 0x24
#define MAVLINK_MSG_100_KEY 0x24
typedef struct __mavlink_set_cam_shutter_t
{
......@@ -86,6 +88,8 @@ static inline uint16_t mavlink_msg_set_cam_shutter_encode(uint8_t system_id, uin
return mavlink_msg_set_cam_shutter_pack(system_id, component_id, msg, set_cam_shutter->cam_no, set_cam_shutter->cam_mode, set_cam_shutter->trigger_pin, set_cam_shutter->interval, set_cam_shutter->exposure, set_cam_shutter->gain);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a set_cam_shutter message
* @param chan MAVLink channel to send the message
......@@ -97,22 +101,18 @@ static inline uint16_t mavlink_msg_set_cam_shutter_encode(uint8_t system_id, uin
* @param exposure Exposure time, in microseconds
* @param gain Camera gain
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_set_cam_shutter_send(mavlink_channel_t chan, uint8_t cam_no, uint8_t cam_mode, uint8_t trigger_pin, uint16_t interval, uint16_t exposure, float gain)
{
mavlink_header_t hdr;
mavlink_set_cam_shutter_t payload;
uint16_t checksum;
mavlink_set_cam_shutter_t *p = &payload;
p->cam_no = cam_no; // uint8_t:Camera id
p->cam_mode = cam_mode; // uint8_t:Camera mode: 0 = auto, 1 = manual
p->trigger_pin = trigger_pin; // uint8_t:Trigger pin, 0-3 for PtGrey FireFly
p->interval = interval; // uint16_t:Shutter interval, in microseconds
p->exposure = exposure; // uint16_t:Exposure time, in microseconds
p->gain = gain; // float:Camera gain
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_SET_CAM_SHUTTER_LEN )
payload.cam_no = cam_no; // uint8_t:Camera id
payload.cam_mode = cam_mode; // uint8_t:Camera mode: 0 = auto, 1 = manual
payload.trigger_pin = trigger_pin; // uint8_t:Trigger pin, 0-3 for PtGrey FireFly
payload.interval = interval; // uint16_t:Shutter interval, in microseconds
payload.exposure = exposure; // uint16_t:Exposure time, in microseconds
payload.gain = gain; // float:Camera gain
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_SET_CAM_SHUTTER_LEN;
......@@ -123,14 +123,12 @@ static inline void mavlink_msg_set_cam_shutter_send(mavlink_channel_t chan, uint
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0x24, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE 112
#define MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN 32
#define MAVLINK_MSG_112_LEN 32
#define MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_KEY 0xDA
#define MAVLINK_MSG_112_KEY 0xDA
typedef struct __mavlink_vicon_position_estimate_t
{
......@@ -91,6 +93,8 @@ static inline uint16_t mavlink_msg_vicon_position_estimate_encode(uint8_t system
return mavlink_msg_vicon_position_estimate_pack(system_id, component_id, msg, vicon_position_estimate->usec, vicon_position_estimate->x, vicon_position_estimate->y, vicon_position_estimate->z, vicon_position_estimate->roll, vicon_position_estimate->pitch, vicon_position_estimate->yaw);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a vicon_position_estimate message
* @param chan MAVLink channel to send the message
......@@ -103,23 +107,19 @@ static inline uint16_t mavlink_msg_vicon_position_estimate_encode(uint8_t system
* @param pitch Pitch angle in rad
* @param yaw Yaw angle in rad
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_vicon_position_estimate_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw)
{
mavlink_header_t hdr;
mavlink_vicon_position_estimate_t payload;
uint16_t checksum;
mavlink_vicon_position_estimate_t *p = &payload;
p->usec = usec; // uint64_t:Timestamp (milliseconds)
p->x = x; // float:Global X position
p->y = y; // float:Global Y position
p->z = z; // float:Global Z position
p->roll = roll; // float:Roll angle in rad
p->pitch = pitch; // float:Pitch angle in rad
p->yaw = yaw; // float:Yaw angle in rad
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN )
payload.usec = usec; // uint64_t:Timestamp (milliseconds)
payload.x = x; // float:Global X position
payload.y = y; // float:Global Y position
payload.z = z; // float:Global Z position
payload.roll = roll; // float:Roll angle in rad
payload.pitch = pitch; // float:Pitch angle in rad
payload.yaw = yaw; // float:Yaw angle in rad
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN;
......@@ -130,14 +130,12 @@ static inline void mavlink_msg_vicon_position_estimate_send(mavlink_channel_t ch
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0xDA, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE 111
#define MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN 32
#define MAVLINK_MSG_111_LEN 32
#define MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_KEY 0xDA
#define MAVLINK_MSG_111_KEY 0xDA
typedef struct __mavlink_vision_position_estimate_t
{
......@@ -91,6 +93,8 @@ static inline uint16_t mavlink_msg_vision_position_estimate_encode(uint8_t syste
return mavlink_msg_vision_position_estimate_pack(system_id, component_id, msg, vision_position_estimate->usec, vision_position_estimate->x, vision_position_estimate->y, vision_position_estimate->z, vision_position_estimate->roll, vision_position_estimate->pitch, vision_position_estimate->yaw);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a vision_position_estimate message
* @param chan MAVLink channel to send the message
......@@ -103,23 +107,19 @@ static inline uint16_t mavlink_msg_vision_position_estimate_encode(uint8_t syste
* @param pitch Pitch angle in rad
* @param yaw Yaw angle in rad
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_vision_position_estimate_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z, float roll, float pitch, float yaw)
{
mavlink_header_t hdr;
mavlink_vision_position_estimate_t payload;
uint16_t checksum;
mavlink_vision_position_estimate_t *p = &payload;
p->usec = usec; // uint64_t:Timestamp (milliseconds)
p->x = x; // float:Global X position
p->y = y; // float:Global Y position
p->z = z; // float:Global Z position
p->roll = roll; // float:Roll angle in rad
p->pitch = pitch; // float:Pitch angle in rad
p->yaw = yaw; // float:Yaw angle in rad
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN )
payload.usec = usec; // uint64_t:Timestamp (milliseconds)
payload.x = x; // float:Global X position
payload.y = y; // float:Global Y position
payload.z = z; // float:Global Z position
payload.roll = roll; // float:Roll angle in rad
payload.pitch = pitch; // float:Pitch angle in rad
payload.yaw = yaw; // float:Yaw angle in rad
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN;
......@@ -130,14 +130,12 @@ static inline void mavlink_msg_vision_position_estimate_send(mavlink_channel_t c
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0xDA, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE 113
#define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN 20
#define MAVLINK_MSG_113_LEN 20
#define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_KEY 0xEB
#define MAVLINK_MSG_113_KEY 0xEB
typedef struct __mavlink_vision_speed_estimate_t
{
......@@ -76,6 +78,8 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_encode(uint8_t system_i
return mavlink_msg_vision_speed_estimate_pack(system_id, component_id, msg, vision_speed_estimate->usec, vision_speed_estimate->x, vision_speed_estimate->y, vision_speed_estimate->z);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a vision_speed_estimate message
* @param chan MAVLink channel to send the message
......@@ -85,20 +89,16 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_encode(uint8_t system_i
* @param y Global Y speed
* @param z Global Z speed
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_vision_speed_estimate_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z)
{
mavlink_header_t hdr;
mavlink_vision_speed_estimate_t payload;
uint16_t checksum;
mavlink_vision_speed_estimate_t *p = &payload;
p->usec = usec; // uint64_t:Timestamp (milliseconds)
p->x = x; // float:Global X speed
p->y = y; // float:Global Y speed
p->z = z; // float:Global Z speed
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN )
payload.usec = usec; // uint64_t:Timestamp (milliseconds)
payload.x = x; // float:Global X speed
payload.y = y; // float:Global Y speed
payload.z = z; // float:Global Z speed
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN;
......@@ -109,14 +109,12 @@ static inline void mavlink_msg_vision_speed_estimate_send(mavlink_channel_t chan
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0xEB, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_WATCHDOG_COMMAND 153
#define MAVLINK_MSG_ID_WATCHDOG_COMMAND_LEN 6
#define MAVLINK_MSG_153_LEN 6
#define MAVLINK_MSG_ID_WATCHDOG_COMMAND_KEY 0xA9
#define MAVLINK_MSG_153_KEY 0xA9
typedef struct __mavlink_watchdog_command_t
{
......@@ -76,6 +78,8 @@ static inline uint16_t mavlink_msg_watchdog_command_encode(uint8_t system_id, ui
return mavlink_msg_watchdog_command_pack(system_id, component_id, msg, watchdog_command->target_system_id, watchdog_command->watchdog_id, watchdog_command->process_id, watchdog_command->command_id);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a watchdog_command message
* @param chan MAVLink channel to send the message
......@@ -85,20 +89,16 @@ static inline uint16_t mavlink_msg_watchdog_command_encode(uint8_t system_id, ui
* @param process_id Process ID
* @param command_id Command ID
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_watchdog_command_send(mavlink_channel_t chan, uint8_t target_system_id, uint16_t watchdog_id, uint16_t process_id, uint8_t command_id)
{
mavlink_header_t hdr;
mavlink_watchdog_command_t payload;
uint16_t checksum;
mavlink_watchdog_command_t *p = &payload;
p->target_system_id = target_system_id; // uint8_t:Target system ID
p->watchdog_id = watchdog_id; // uint16_t:Watchdog ID
p->process_id = process_id; // uint16_t:Process ID
p->command_id = command_id; // uint8_t:Command ID
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_WATCHDOG_COMMAND_LEN )
payload.target_system_id = target_system_id; // uint8_t:Target system ID
payload.watchdog_id = watchdog_id; // uint16_t:Watchdog ID
payload.process_id = process_id; // uint16_t:Process ID
payload.command_id = command_id; // uint8_t:Command ID
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_WATCHDOG_COMMAND_LEN;
......@@ -109,14 +109,12 @@ static inline void mavlink_msg_watchdog_command_send(mavlink_channel_t chan, uin
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0xA9, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT 150
#define MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_LEN 4
#define MAVLINK_MSG_150_LEN 4
#define MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_KEY 0x5C
#define MAVLINK_MSG_150_KEY 0x5C
typedef struct __mavlink_watchdog_heartbeat_t
{
......@@ -66,6 +68,8 @@ static inline uint16_t mavlink_msg_watchdog_heartbeat_encode(uint8_t system_id,
return mavlink_msg_watchdog_heartbeat_pack(system_id, component_id, msg, watchdog_heartbeat->watchdog_id, watchdog_heartbeat->process_count);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a watchdog_heartbeat message
* @param chan MAVLink channel to send the message
......@@ -73,18 +77,14 @@ static inline uint16_t mavlink_msg_watchdog_heartbeat_encode(uint8_t system_id,
* @param watchdog_id Watchdog ID
* @param process_count Number of processes
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_watchdog_heartbeat_send(mavlink_channel_t chan, uint16_t watchdog_id, uint16_t process_count)
{
mavlink_header_t hdr;
mavlink_watchdog_heartbeat_t payload;
uint16_t checksum;
mavlink_watchdog_heartbeat_t *p = &payload;
p->watchdog_id = watchdog_id; // uint16_t:Watchdog ID
p->process_count = process_count; // uint16_t:Number of processes
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_LEN )
payload.watchdog_id = watchdog_id; // uint16_t:Watchdog ID
payload.process_count = process_count; // uint16_t:Number of processes
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_LEN;
......@@ -95,14 +95,12 @@ static inline void mavlink_msg_watchdog_heartbeat_send(mavlink_channel_t chan, u
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0x5C, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO 151
#define MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN 255
#define MAVLINK_MSG_151_LEN 255
#define MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_KEY 0x63
#define MAVLINK_MSG_151_KEY 0x63
typedef struct __mavlink_watchdog_process_info_t
{
......@@ -83,6 +85,8 @@ static inline uint16_t mavlink_msg_watchdog_process_info_encode(uint8_t system_i
return mavlink_msg_watchdog_process_info_pack(system_id, component_id, msg, watchdog_process_info->watchdog_id, watchdog_process_info->process_id, watchdog_process_info->name, watchdog_process_info->arguments, watchdog_process_info->timeout);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a watchdog_process_info message
* @param chan MAVLink channel to send the message
......@@ -93,21 +97,17 @@ static inline uint16_t mavlink_msg_watchdog_process_info_encode(uint8_t system_i
* @param arguments Process arguments
* @param timeout Timeout (seconds)
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_watchdog_process_info_send(mavlink_channel_t chan, uint16_t watchdog_id, uint16_t process_id, const char* name, const char* arguments, int32_t timeout)
{
mavlink_header_t hdr;
mavlink_watchdog_process_info_t payload;
uint16_t checksum;
mavlink_watchdog_process_info_t *p = &payload;
p->watchdog_id = watchdog_id; // uint16_t:Watchdog ID
p->process_id = process_id; // uint16_t:Process ID
memcpy(p->name, name, sizeof(p->name)); // char[100]:Process name
memcpy(p->arguments, arguments, sizeof(p->arguments)); // char[147]:Process arguments
p->timeout = timeout; // int32_t:Timeout (seconds)
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN )
payload.watchdog_id = watchdog_id; // uint16_t:Watchdog ID
payload.process_id = process_id; // uint16_t:Process ID
memcpy(payload.name, name, sizeof(payload.name)); // char[100]:Process name
memcpy(payload.arguments, arguments, sizeof(payload.arguments)); // char[147]:Process arguments
payload.timeout = timeout; // int32_t:Timeout (seconds)
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN;
......@@ -118,14 +118,12 @@ static inline void mavlink_msg_watchdog_process_info_send(mavlink_channel_t chan
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0x63, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS 152
#define MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN 12
#define MAVLINK_MSG_152_LEN 12
#define MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_KEY 0x4
#define MAVLINK_MSG_152_KEY 0x4
typedef struct __mavlink_watchdog_process_status_t
{
......@@ -86,6 +88,8 @@ static inline uint16_t mavlink_msg_watchdog_process_status_encode(uint8_t system
return mavlink_msg_watchdog_process_status_pack(system_id, component_id, msg, watchdog_process_status->watchdog_id, watchdog_process_status->process_id, watchdog_process_status->state, watchdog_process_status->muted, watchdog_process_status->pid, watchdog_process_status->crashes);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a watchdog_process_status message
* @param chan MAVLink channel to send the message
......@@ -97,22 +101,18 @@ static inline uint16_t mavlink_msg_watchdog_process_status_encode(uint8_t system
* @param pid PID
* @param crashes Number of crashes
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_watchdog_process_status_send(mavlink_channel_t chan, uint16_t watchdog_id, uint16_t process_id, uint8_t state, uint8_t muted, int32_t pid, uint16_t crashes)
{
mavlink_header_t hdr;
mavlink_watchdog_process_status_t payload;
uint16_t checksum;
mavlink_watchdog_process_status_t *p = &payload;
p->watchdog_id = watchdog_id; // uint16_t:Watchdog ID
p->process_id = process_id; // uint16_t:Process ID
p->state = state; // uint8_t:Is running / finished / suspended / crashed
p->muted = muted; // uint8_t:Is muted
p->pid = pid; // int32_t:PID
p->crashes = crashes; // uint16_t:Number of crashes
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN )
payload.watchdog_id = watchdog_id; // uint16_t:Watchdog ID
payload.process_id = process_id; // uint16_t:Process ID
payload.state = state; // uint8_t:Is running / finished / suspended / crashed
payload.muted = muted; // uint8_t:Is muted
payload.pid = pid; // int32_t:PID
payload.crashes = crashes; // uint16_t:Number of crashes
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN;
......@@ -123,14 +123,12 @@ static inline void mavlink_msg_watchdog_process_status_send(mavlink_channel_t ch
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0x4, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
/** @file
* @brief MAVLink comm protocol.
* @see http://qgroundcontrol.org/mavlink/
* Generated on Tuesday, August 9 2011, 16:49 UTC
* Generated on Saturday, August 13 2011, 07:19 UTC
*/
#ifndef PIXHAWK_H
#define PIXHAWK_H
......@@ -11,7 +11,7 @@ extern "C" {
#endif
#include "../protocol.h"
#include "../mavlink_protocol.h"
#define MAVLINK_ENABLED_PIXHAWK
......@@ -71,7 +71,12 @@ enum DATA_TYPES
// MESSAGE CRC KEYS
#undef MAVLINK_MESSAGE_KEYS
#define MAVLINK_MESSAGE_KEYS { 71, 249, 232, 226, 76, 126, 117, 186, 0, 144, 0, 249, 133, 0, 0, 0, 0, 0, 0, 0, 33, 34, 163, 45, 0, 223, 28, 99, 28, 21, 243, 240, 204, 21, 111, 43, 192, 234, 22, 197, 192, 192, 166, 34, 233, 34, 166, 158, 142, 60, 10, 75, 249, 247, 234, 157, 125, 0, 0, 0, 85, 211, 62, 75, 185, 18, 42, 38, 0, 127, 200, 0, 0, 53, 251, 20, 22, 0, 0, 0, 0, 0, 0, 0, 0, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 8, 238, 165, 0, 0, 0, 0, 0, 0, 0, 218, 218, 235, 0, 0, 0, 0, 0, 0, 225, 114, 0, 0, 0, 0, 0, 0, 0, 0, 221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 171, 122, 0, 0, 0, 0, 0, 0, 0, 92, 99, 4, 169, 10, 0, 0, 0, 0, 0, 52, 163, 16, 0, 0, 0, 0, 0, 0, 0, 200, 135, 217, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 141, 211, 144 }
#define MAVLINK_MESSAGE_KEYS { 71, 249, 232, 226, 76, 126, 117, 186, 0, 144, 0, 249, 133, 0, 0, 0, 0, 0, 0, 0, 33, 34, 163, 45, 0, 166, 28, 99, 28, 21, 243, 240, 91, 21, 111, 43, 192, 234, 22, 197, 192, 192, 166, 34, 233, 34, 166, 158, 142, 60, 10, 75, 249, 247, 234, 161, 116, 56, 245, 0, 0, 0, 62, 75, 185, 18, 42, 38, 0, 127, 200, 0, 0, 212, 251, 20, 22, 0, 0, 0, 0, 0, 0, 0, 0, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 8, 238, 165, 0, 0, 0, 0, 0, 0, 0, 218, 218, 235, 0, 0, 0, 0, 0, 0, 225, 114, 0, 0, 0, 0, 0, 0, 0, 0, 221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 171, 122, 0, 0, 0, 0, 0, 0, 0, 92, 99, 4, 169, 10, 0, 0, 0, 0, 0, 52, 163, 16, 0, 0, 0, 0, 0, 0, 0, 200, 135, 217, 254, 0, 0, 255, 185, 0, 14, 136, 53, 0, 212, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 73, 239, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 138, 43, 141, 211, 144 }
// MESSAGE LENGTHS
#undef MAVLINK_MESSAGE_LENGTHS
#define MAVLINK_MESSAGE_LENGTHS { 3, 4, 8, 14, 8, 28, 3, 32, 0, 2, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 20, 2, 24, 22, 0, 30, 26, 101, 26, 16, 32, 32, 38, 32, 11, 17, 17, 16, 18, 36, 4, 4, 2, 2, 4, 2, 2, 3, 14, 12, 18, 16, 8, 27, 25, 18, 18, 20, 20, 0, 0, 0, 26, 16, 36, 5, 6, 56, 0, 21, 18, 0, 0, 20, 20, 20, 8, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 52, 1, 92, 0, 0, 0, 0, 0, 0, 0, 32, 32, 20, 0, 0, 0, 0, 0, 0, 20, 18, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 12, 0, 0, 0, 0, 0, 0, 0, 4, 255, 12, 6, 18, 0, 0, 0, 0, 0, 106, 43, 55, 0, 0, 0, 0, 0, 0, 0, 8, 255, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 30, 14, 14, 51 }
#ifdef __cplusplus
}
......
/** @file
* @brief MAVLink comm protocol.
* @see http://pixhawk.ethz.ch/software/mavlink
* Generated on Tuesday, August 9 2011, 16:16 UTC
* Generated on Saturday, August 13 2011, 07:19 UTC
*/
#ifndef MAVLINK_H
#define MAVLINK_H
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_AIR_DATA 171
#define MAVLINK_MSG_ID_AIR_DATA_LEN 10
#define MAVLINK_MSG_171_LEN 10
#define MAVLINK_MSG_ID_AIR_DATA_KEY 0x90
#define MAVLINK_MSG_171_KEY 0x90
typedef struct __mavlink_air_data_t
{
......@@ -71,6 +73,8 @@ static inline uint16_t mavlink_msg_air_data_encode(uint8_t system_id, uint8_t co
return mavlink_msg_air_data_pack(system_id, component_id, msg, air_data->dynamicPressure, air_data->staticPressure, air_data->temperature);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a air_data message
* @param chan MAVLink channel to send the message
......@@ -79,19 +83,15 @@ static inline uint16_t mavlink_msg_air_data_encode(uint8_t system_id, uint8_t co
* @param staticPressure Static pressure (Pa)
* @param temperature Board temperature
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_air_data_send(mavlink_channel_t chan, float dynamicPressure, float staticPressure, uint16_t temperature)
{
mavlink_header_t hdr;
mavlink_air_data_t payload;
uint16_t checksum;
mavlink_air_data_t *p = &payload;
p->dynamicPressure = dynamicPressure; // float:Dynamic pressure (Pa)
p->staticPressure = staticPressure; // float:Static pressure (Pa)
p->temperature = temperature; // uint16_t:Board temperature
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_AIR_DATA_LEN )
payload.dynamicPressure = dynamicPressure; // float:Dynamic pressure (Pa)
payload.staticPressure = staticPressure; // float:Static pressure (Pa)
payload.temperature = temperature; // uint16_t:Board temperature
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_AIR_DATA_LEN;
......@@ -102,14 +102,12 @@ static inline void mavlink_msg_air_data_send(mavlink_channel_t chan, float dynam
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0x90, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_CPU_LOAD 170
#define MAVLINK_MSG_ID_CPU_LOAD_LEN 4
#define MAVLINK_MSG_170_LEN 4
#define MAVLINK_MSG_ID_CPU_LOAD_KEY 0xCA
#define MAVLINK_MSG_170_KEY 0xCA
typedef struct __mavlink_cpu_load_t
{
......@@ -71,6 +73,8 @@ static inline uint16_t mavlink_msg_cpu_load_encode(uint8_t system_id, uint8_t co
return mavlink_msg_cpu_load_pack(system_id, component_id, msg, cpu_load->sensLoad, cpu_load->ctrlLoad, cpu_load->batVolt);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a cpu_load message
* @param chan MAVLink channel to send the message
......@@ -79,19 +83,15 @@ static inline uint16_t mavlink_msg_cpu_load_encode(uint8_t system_id, uint8_t co
* @param ctrlLoad Control DSC Load
* @param batVolt Battery Voltage in millivolts
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_cpu_load_send(mavlink_channel_t chan, uint8_t sensLoad, uint8_t ctrlLoad, uint16_t batVolt)
{
mavlink_header_t hdr;
mavlink_cpu_load_t payload;
uint16_t checksum;
mavlink_cpu_load_t *p = &payload;
p->sensLoad = sensLoad; // uint8_t:Sensor DSC Load
p->ctrlLoad = ctrlLoad; // uint8_t:Control DSC Load
p->batVolt = batVolt; // uint16_t:Battery Voltage in millivolts
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_CPU_LOAD_LEN )
payload.sensLoad = sensLoad; // uint8_t:Sensor DSC Load
payload.ctrlLoad = ctrlLoad; // uint8_t:Control DSC Load
payload.batVolt = batVolt; // uint16_t:Battery Voltage in millivolts
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_CPU_LOAD_LEN;
......@@ -102,14 +102,12 @@ static inline void mavlink_msg_cpu_load_send(mavlink_channel_t chan, uint8_t sen
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0xCA, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_CTRL_SRFC_PT 181
#define MAVLINK_MSG_ID_CTRL_SRFC_PT_LEN 3
#define MAVLINK_MSG_181_LEN 3
#define MAVLINK_MSG_ID_CTRL_SRFC_PT_KEY 0x35
#define MAVLINK_MSG_181_KEY 0x35
typedef struct __mavlink_ctrl_srfc_pt_t
{
......@@ -66,6 +68,8 @@ static inline uint16_t mavlink_msg_ctrl_srfc_pt_encode(uint8_t system_id, uint8_
return mavlink_msg_ctrl_srfc_pt_pack(system_id, component_id, msg, ctrl_srfc_pt->target, ctrl_srfc_pt->bitfieldPt);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a ctrl_srfc_pt message
* @param chan MAVLink channel to send the message
......@@ -73,18 +77,14 @@ static inline uint16_t mavlink_msg_ctrl_srfc_pt_encode(uint8_t system_id, uint8_
* @param target The system setting the commands
* @param bitfieldPt Bitfield containing the PT configuration
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_ctrl_srfc_pt_send(mavlink_channel_t chan, uint8_t target, uint16_t bitfieldPt)
{
mavlink_header_t hdr;
mavlink_ctrl_srfc_pt_t payload;
uint16_t checksum;
mavlink_ctrl_srfc_pt_t *p = &payload;
p->target = target; // uint8_t:The system setting the commands
p->bitfieldPt = bitfieldPt; // uint16_t:Bitfield containing the PT configuration
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_CTRL_SRFC_PT_LEN )
payload.target = target; // uint8_t:The system setting the commands
payload.bitfieldPt = bitfieldPt; // uint16_t:Bitfield containing the PT configuration
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_CTRL_SRFC_PT_LEN;
......@@ -95,14 +95,12 @@ static inline void mavlink_msg_ctrl_srfc_pt_send(mavlink_channel_t chan, uint8_t
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0x35, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_DATA_LOG 177
#define MAVLINK_MSG_ID_DATA_LOG_LEN 24
#define MAVLINK_MSG_177_LEN 24
#define MAVLINK_MSG_ID_DATA_LOG_KEY 0xB9
#define MAVLINK_MSG_177_KEY 0xB9
typedef struct __mavlink_data_log_t
{
......@@ -86,6 +88,8 @@ static inline uint16_t mavlink_msg_data_log_encode(uint8_t system_id, uint8_t co
return mavlink_msg_data_log_pack(system_id, component_id, msg, data_log->fl_1, data_log->fl_2, data_log->fl_3, data_log->fl_4, data_log->fl_5, data_log->fl_6);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a data_log message
* @param chan MAVLink channel to send the message
......@@ -97,22 +101,18 @@ static inline uint16_t mavlink_msg_data_log_encode(uint8_t system_id, uint8_t co
* @param fl_5 Log value 5
* @param fl_6 Log value 6
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_data_log_send(mavlink_channel_t chan, float fl_1, float fl_2, float fl_3, float fl_4, float fl_5, float fl_6)
{
mavlink_header_t hdr;
mavlink_data_log_t payload;
uint16_t checksum;
mavlink_data_log_t *p = &payload;
p->fl_1 = fl_1; // float:Log value 1
p->fl_2 = fl_2; // float:Log value 2
p->fl_3 = fl_3; // float:Log value 3
p->fl_4 = fl_4; // float:Log value 4
p->fl_5 = fl_5; // float:Log value 5
p->fl_6 = fl_6; // float:Log value 6
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_DATA_LOG_LEN )
payload.fl_1 = fl_1; // float:Log value 1
payload.fl_2 = fl_2; // float:Log value 2
payload.fl_3 = fl_3; // float:Log value 3
payload.fl_4 = fl_4; // float:Log value 4
payload.fl_5 = fl_5; // float:Log value 5
payload.fl_6 = fl_6; // float:Log value 6
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_DATA_LOG_LEN;
......@@ -123,14 +123,12 @@ static inline void mavlink_msg_data_log_send(mavlink_channel_t chan, float fl_1,
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0xB9, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_DIAGNOSTIC 173
#define MAVLINK_MSG_ID_DIAGNOSTIC_LEN 18
#define MAVLINK_MSG_173_LEN 18
#define MAVLINK_MSG_ID_DIAGNOSTIC_KEY 0xFE
#define MAVLINK_MSG_173_KEY 0xFE
typedef struct __mavlink_diagnostic_t
{
......@@ -86,6 +88,8 @@ static inline uint16_t mavlink_msg_diagnostic_encode(uint8_t system_id, uint8_t
return mavlink_msg_diagnostic_pack(system_id, component_id, msg, diagnostic->diagFl1, diagnostic->diagFl2, diagnostic->diagFl3, diagnostic->diagSh1, diagnostic->diagSh2, diagnostic->diagSh3);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a diagnostic message
* @param chan MAVLink channel to send the message
......@@ -97,22 +101,18 @@ static inline uint16_t mavlink_msg_diagnostic_encode(uint8_t system_id, uint8_t
* @param diagSh2 Diagnostic short 2
* @param diagSh3 Diagnostic short 3
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_diagnostic_send(mavlink_channel_t chan, float diagFl1, float diagFl2, float diagFl3, int16_t diagSh1, int16_t diagSh2, int16_t diagSh3)
{
mavlink_header_t hdr;
mavlink_diagnostic_t payload;
uint16_t checksum;
mavlink_diagnostic_t *p = &payload;
p->diagFl1 = diagFl1; // float:Diagnostic float 1
p->diagFl2 = diagFl2; // float:Diagnostic float 2
p->diagFl3 = diagFl3; // float:Diagnostic float 3
p->diagSh1 = diagSh1; // int16_t:Diagnostic short 1
p->diagSh2 = diagSh2; // int16_t:Diagnostic short 2
p->diagSh3 = diagSh3; // int16_t:Diagnostic short 3
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_DIAGNOSTIC_LEN )
payload.diagFl1 = diagFl1; // float:Diagnostic float 1
payload.diagFl2 = diagFl2; // float:Diagnostic float 2
payload.diagFl3 = diagFl3; // float:Diagnostic float 3
payload.diagSh1 = diagSh1; // int16_t:Diagnostic short 1
payload.diagSh2 = diagSh2; // int16_t:Diagnostic short 2
payload.diagSh3 = diagSh3; // int16_t:Diagnostic short 3
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_DIAGNOSTIC_LEN;
......@@ -123,14 +123,12 @@ static inline void mavlink_msg_diagnostic_send(mavlink_channel_t chan, float dia
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0xFE, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_GPS_DATE_TIME 179
#define MAVLINK_MSG_ID_GPS_DATE_TIME_LEN 7
#define MAVLINK_MSG_179_LEN 7
#define MAVLINK_MSG_ID_GPS_DATE_TIME_KEY 0xE
#define MAVLINK_MSG_179_KEY 0xE
typedef struct __mavlink_gps_date_time_t
{
......@@ -91,6 +93,8 @@ static inline uint16_t mavlink_msg_gps_date_time_encode(uint8_t system_id, uint8
return mavlink_msg_gps_date_time_pack(system_id, component_id, msg, gps_date_time->year, gps_date_time->month, gps_date_time->day, gps_date_time->hour, gps_date_time->min, gps_date_time->sec, gps_date_time->visSat);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a gps_date_time message
* @param chan MAVLink channel to send the message
......@@ -103,23 +107,19 @@ static inline uint16_t mavlink_msg_gps_date_time_encode(uint8_t system_id, uint8
* @param sec Sec reported by Gps
* @param visSat Visible sattelites reported by Gps
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_gps_date_time_send(mavlink_channel_t chan, uint8_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t min, uint8_t sec, uint8_t visSat)
{
mavlink_header_t hdr;
mavlink_gps_date_time_t payload;
uint16_t checksum;
mavlink_gps_date_time_t *p = &payload;
p->year = year; // uint8_t:Year reported by Gps
p->month = month; // uint8_t:Month reported by Gps
p->day = day; // uint8_t:Day reported by Gps
p->hour = hour; // uint8_t:Hour reported by Gps
p->min = min; // uint8_t:Min reported by Gps
p->sec = sec; // uint8_t:Sec reported by Gps
p->visSat = visSat; // uint8_t:Visible sattelites reported by Gps
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN )
payload.year = year; // uint8_t:Year reported by Gps
payload.month = month; // uint8_t:Month reported by Gps
payload.day = day; // uint8_t:Day reported by Gps
payload.hour = hour; // uint8_t:Hour reported by Gps
payload.min = min; // uint8_t:Min reported by Gps
payload.sec = sec; // uint8_t:Sec reported by Gps
payload.visSat = visSat; // uint8_t:Visible sattelites reported by Gps
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_GPS_DATE_TIME_LEN;
......@@ -130,14 +130,12 @@ static inline void mavlink_msg_gps_date_time_send(mavlink_channel_t chan, uint8_
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0xE, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_MID_LVL_CMDS 180
#define MAVLINK_MSG_ID_MID_LVL_CMDS_LEN 13
#define MAVLINK_MSG_180_LEN 13
#define MAVLINK_MSG_ID_MID_LVL_CMDS_KEY 0x88
#define MAVLINK_MSG_180_KEY 0x88
typedef struct __mavlink_mid_lvl_cmds_t
{
......@@ -76,6 +78,8 @@ static inline uint16_t mavlink_msg_mid_lvl_cmds_encode(uint8_t system_id, uint8_
return mavlink_msg_mid_lvl_cmds_pack(system_id, component_id, msg, mid_lvl_cmds->target, mid_lvl_cmds->hCommand, mid_lvl_cmds->uCommand, mid_lvl_cmds->rCommand);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a mid_lvl_cmds message
* @param chan MAVLink channel to send the message
......@@ -85,20 +89,16 @@ static inline uint16_t mavlink_msg_mid_lvl_cmds_encode(uint8_t system_id, uint8_
* @param uCommand Log value 2
* @param rCommand Log value 3
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_mid_lvl_cmds_send(mavlink_channel_t chan, uint8_t target, float hCommand, float uCommand, float rCommand)
{
mavlink_header_t hdr;
mavlink_mid_lvl_cmds_t payload;
uint16_t checksum;
mavlink_mid_lvl_cmds_t *p = &payload;
p->target = target; // uint8_t:The system setting the commands
p->hCommand = hCommand; // float:Commanded Airspeed
p->uCommand = uCommand; // float:Log value 2
p->rCommand = rCommand; // float:Log value 3
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_MID_LVL_CMDS_LEN )
payload.target = target; // uint8_t:The system setting the commands
payload.hCommand = hCommand; // float:Commanded Airspeed
payload.uCommand = uCommand; // float:Log value 2
payload.rCommand = rCommand; // float:Log value 3
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_MID_LVL_CMDS_LEN;
......@@ -109,14 +109,12 @@ static inline void mavlink_msg_mid_lvl_cmds_send(mavlink_channel_t chan, uint8_t
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0x88, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_SENSOR_BIAS 172
#define MAVLINK_MSG_ID_SENSOR_BIAS_LEN 24
#define MAVLINK_MSG_172_LEN 24
#define MAVLINK_MSG_ID_SENSOR_BIAS_KEY 0x6A
#define MAVLINK_MSG_172_KEY 0x6A
typedef struct __mavlink_sensor_bias_t
{
......@@ -86,6 +88,8 @@ static inline uint16_t mavlink_msg_sensor_bias_encode(uint8_t system_id, uint8_t
return mavlink_msg_sensor_bias_pack(system_id, component_id, msg, sensor_bias->axBias, sensor_bias->ayBias, sensor_bias->azBias, sensor_bias->gxBias, sensor_bias->gyBias, sensor_bias->gzBias);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a sensor_bias message
* @param chan MAVLink channel to send the message
......@@ -97,22 +101,18 @@ static inline uint16_t mavlink_msg_sensor_bias_encode(uint8_t system_id, uint8_t
* @param gyBias Gyro Y bias (rad/s)
* @param gzBias Gyro Z bias (rad/s)
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_sensor_bias_send(mavlink_channel_t chan, float axBias, float ayBias, float azBias, float gxBias, float gyBias, float gzBias)
{
mavlink_header_t hdr;
mavlink_sensor_bias_t payload;
uint16_t checksum;
mavlink_sensor_bias_t *p = &payload;
p->axBias = axBias; // float:Accelerometer X bias (m/s)
p->ayBias = ayBias; // float:Accelerometer Y bias (m/s)
p->azBias = azBias; // float:Accelerometer Z bias (m/s)
p->gxBias = gxBias; // float:Gyro X bias (rad/s)
p->gyBias = gyBias; // float:Gyro Y bias (rad/s)
p->gzBias = gzBias; // float:Gyro Z bias (rad/s)
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_SENSOR_BIAS_LEN )
payload.axBias = axBias; // float:Accelerometer X bias (m/s)
payload.ayBias = ayBias; // float:Accelerometer Y bias (m/s)
payload.azBias = azBias; // float:Accelerometer Z bias (m/s)
payload.gxBias = gxBias; // float:Gyro X bias (rad/s)
payload.gyBias = gyBias; // float:Gyro Y bias (rad/s)
payload.gzBias = gzBias; // float:Gyro Z bias (rad/s)
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_SENSOR_BIAS_LEN;
......@@ -123,14 +123,12 @@ static inline void mavlink_msg_sensor_bias_send(mavlink_channel_t chan, float ax
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0x6A, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_SLUGS_ACTION 183
#define MAVLINK_MSG_ID_SLUGS_ACTION_LEN 4
#define MAVLINK_MSG_183_LEN 4
#define MAVLINK_MSG_ID_SLUGS_ACTION_KEY 0xD4
#define MAVLINK_MSG_183_KEY 0xD4
typedef struct __mavlink_slugs_action_t
{
......@@ -71,6 +73,8 @@ static inline uint16_t mavlink_msg_slugs_action_encode(uint8_t system_id, uint8_
return mavlink_msg_slugs_action_pack(system_id, component_id, msg, slugs_action->target, slugs_action->actionId, slugs_action->actionVal);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a slugs_action message
* @param chan MAVLink channel to send the message
......@@ -79,19 +83,15 @@ static inline uint16_t mavlink_msg_slugs_action_encode(uint8_t system_id, uint8_
* @param actionId Action ID. See apDefinitions.h in the SLUGS /clib directory for the ID names
* @param actionVal Value associated with the action
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_slugs_action_send(mavlink_channel_t chan, uint8_t target, uint8_t actionId, uint16_t actionVal)
{
mavlink_header_t hdr;
mavlink_slugs_action_t payload;
uint16_t checksum;
mavlink_slugs_action_t *p = &payload;
p->target = target; // uint8_t:The system reporting the action
p->actionId = actionId; // uint8_t:Action ID. See apDefinitions.h in the SLUGS /clib directory for the ID names
p->actionVal = actionVal; // uint16_t:Value associated with the action
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_SLUGS_ACTION_LEN )
payload.target = target; // uint8_t:The system reporting the action
payload.actionId = actionId; // uint8_t:Action ID. See apDefinitions.h in the SLUGS /clib directory for the ID names
payload.actionVal = actionVal; // uint16_t:Value associated with the action
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_SLUGS_ACTION_LEN;
......@@ -102,14 +102,12 @@ static inline void mavlink_msg_slugs_action_send(mavlink_channel_t chan, uint8_t
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0xD4, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_SLUGS_NAVIGATION 176
#define MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN 30
#define MAVLINK_MSG_176_LEN 30
#define MAVLINK_MSG_ID_SLUGS_NAVIGATION_KEY 0xFF
#define MAVLINK_MSG_176_KEY 0xFF
typedef struct __mavlink_slugs_navigation_t
{
......@@ -101,6 +103,8 @@ static inline uint16_t mavlink_msg_slugs_navigation_encode(uint8_t system_id, ui
return mavlink_msg_slugs_navigation_pack(system_id, component_id, msg, slugs_navigation->u_m, slugs_navigation->phi_c, slugs_navigation->theta_c, slugs_navigation->psiDot_c, slugs_navigation->ay_body, slugs_navigation->totalDist, slugs_navigation->dist2Go, slugs_navigation->fromWP, slugs_navigation->toWP);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a slugs_navigation message
* @param chan MAVLink channel to send the message
......@@ -115,25 +119,21 @@ static inline uint16_t mavlink_msg_slugs_navigation_encode(uint8_t system_id, ui
* @param fromWP Origin WP
* @param toWP Destination WP
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_slugs_navigation_send(mavlink_channel_t chan, float u_m, float phi_c, float theta_c, float psiDot_c, float ay_body, float totalDist, float dist2Go, uint8_t fromWP, uint8_t toWP)
{
mavlink_header_t hdr;
mavlink_slugs_navigation_t payload;
uint16_t checksum;
mavlink_slugs_navigation_t *p = &payload;
p->u_m = u_m; // float:Measured Airspeed prior to the Nav Filter
p->phi_c = phi_c; // float:Commanded Roll
p->theta_c = theta_c; // float:Commanded Pitch
p->psiDot_c = psiDot_c; // float:Commanded Turn rate
p->ay_body = ay_body; // float:Y component of the body acceleration
p->totalDist = totalDist; // float:Total Distance to Run on this leg of Navigation
p->dist2Go = dist2Go; // float:Remaining distance to Run on this leg of Navigation
p->fromWP = fromWP; // uint8_t:Origin WP
p->toWP = toWP; // uint8_t:Destination WP
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN )
payload.u_m = u_m; // float:Measured Airspeed prior to the Nav Filter
payload.phi_c = phi_c; // float:Commanded Roll
payload.theta_c = theta_c; // float:Commanded Pitch
payload.psiDot_c = psiDot_c; // float:Commanded Turn rate
payload.ay_body = ay_body; // float:Y component of the body acceleration
payload.totalDist = totalDist; // float:Total Distance to Run on this leg of Navigation
payload.dist2Go = dist2Go; // float:Remaining distance to Run on this leg of Navigation
payload.fromWP = fromWP; // uint8_t:Origin WP
payload.toWP = toWP; // uint8_t:Destination WP
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN;
......@@ -144,14 +144,12 @@ static inline void mavlink_msg_slugs_navigation_send(mavlink_channel_t chan, flo
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0xFF, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
/** @file
* @brief MAVLink comm protocol.
* @see http://qgroundcontrol.org/mavlink/
* Generated on Tuesday, August 9 2011, 16:16 UTC
* Generated on Saturday, August 13 2011, 07:19 UTC
*/
#ifndef SLUGS_H
#define SLUGS_H
......@@ -11,7 +11,7 @@ extern "C" {
#endif
#include "../protocol.h"
#include "../mavlink_protocol.h"
#define MAVLINK_ENABLED_SLUGS
......@@ -48,7 +48,12 @@ extern "C" {
// MESSAGE CRC KEYS
#undef MAVLINK_MESSAGE_KEYS
#define MAVLINK_MESSAGE_KEYS { 71, 249, 232, 226, 76, 126, 117, 186, 0, 165, 44, 249, 133, 0, 0, 0, 0, 0, 0, 0, 112, 34, 81, 152, 0, 223, 28, 99, 28, 21, 243, 240, 204, 21, 111, 43, 192, 234, 22, 197, 192, 192, 166, 34, 233, 34, 166, 158, 142, 60, 10, 75, 249, 247, 234, 157, 125, 0, 0, 0, 85, 211, 62, 75, 185, 18, 42, 38, 0, 127, 200, 0, 0, 53, 251, 20, 22, 0, 0, 0, 0, 0, 0, 0, 0, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 8, 238, 165, 0, 0, 0, 0, 0, 0, 0, 218, 218, 235, 0, 0, 0, 0, 0, 0, 225, 114, 0, 0, 0, 0, 0, 0, 0, 0, 221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 171, 122, 0, 0, 0, 0, 0, 0, 0, 92, 114, 4, 169, 10, 0, 0, 0, 0, 0, 72, 62, 83, 0, 0, 0, 0, 0, 0, 0, 202, 144, 106, 254, 0, 0, 255, 185, 0, 14, 136, 53, 0, 212, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 141, 211, 166 }
#define MAVLINK_MESSAGE_KEYS { 71, 249, 232, 226, 76, 126, 117, 186, 0, 144, 0, 249, 133, 0, 0, 0, 0, 0, 0, 0, 33, 34, 163, 45, 0, 166, 28, 99, 28, 21, 243, 240, 91, 21, 111, 43, 192, 234, 22, 197, 192, 192, 166, 34, 233, 34, 166, 158, 142, 60, 10, 75, 249, 247, 234, 161, 116, 56, 245, 0, 0, 0, 62, 75, 185, 18, 42, 38, 0, 127, 200, 0, 0, 212, 251, 20, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 202, 144, 106, 254, 0, 0, 255, 185, 0, 14, 136, 53, 0, 212, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 73, 239, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 138, 43, 141, 211, 144 }
// MESSAGE LENGTHS
#undef MAVLINK_MESSAGE_LENGTHS
#define MAVLINK_MESSAGE_LENGTHS { 3, 4, 8, 14, 8, 28, 3, 32, 0, 2, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 20, 2, 24, 22, 0, 30, 26, 101, 26, 16, 32, 32, 38, 32, 11, 17, 17, 16, 18, 36, 4, 4, 2, 2, 4, 2, 2, 3, 14, 12, 18, 16, 8, 27, 25, 18, 18, 20, 20, 0, 0, 0, 26, 16, 36, 5, 6, 56, 0, 21, 18, 0, 0, 20, 20, 20, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 10, 24, 18, 0, 0, 30, 24, 0, 7, 13, 3, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 30, 14, 14, 51 }
#ifdef __cplusplus
}
......
/** @file
* @brief MAVLink comm protocol.
* @see http://pixhawk.ethz.ch/software/mavlink
* Generated on Tuesday, August 9 2011, 16:16 UTC
* Generated on Saturday, August 13 2011, 07:19 UTC
*/
#ifndef MAVLINK_H
#define MAVLINK_H
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_NAV_FILTER_BIAS 220
#define MAVLINK_MSG_ID_NAV_FILTER_BIAS_LEN 32
#define MAVLINK_MSG_220_LEN 32
#define MAVLINK_MSG_ID_NAV_FILTER_BIAS_KEY 0xFF
#define MAVLINK_MSG_220_KEY 0xFF
typedef struct __mavlink_nav_filter_bias_t
{
......@@ -91,6 +93,8 @@ static inline uint16_t mavlink_msg_nav_filter_bias_encode(uint8_t system_id, uin
return mavlink_msg_nav_filter_bias_pack(system_id, component_id, msg, nav_filter_bias->usec, nav_filter_bias->accel_0, nav_filter_bias->accel_1, nav_filter_bias->accel_2, nav_filter_bias->gyro_0, nav_filter_bias->gyro_1, nav_filter_bias->gyro_2);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a nav_filter_bias message
* @param chan MAVLink channel to send the message
......@@ -103,23 +107,19 @@ static inline uint16_t mavlink_msg_nav_filter_bias_encode(uint8_t system_id, uin
* @param gyro_1 b_f[1]
* @param gyro_2 b_f[2]
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_nav_filter_bias_send(mavlink_channel_t chan, uint64_t usec, float accel_0, float accel_1, float accel_2, float gyro_0, float gyro_1, float gyro_2)
{
mavlink_header_t hdr;
mavlink_nav_filter_bias_t payload;
uint16_t checksum;
mavlink_nav_filter_bias_t *p = &payload;
p->usec = usec; // uint64_t:Timestamp (microseconds)
p->accel_0 = accel_0; // float:b_f[0]
p->accel_1 = accel_1; // float:b_f[1]
p->accel_2 = accel_2; // float:b_f[2]
p->gyro_0 = gyro_0; // float:b_f[0]
p->gyro_1 = gyro_1; // float:b_f[1]
p->gyro_2 = gyro_2; // float:b_f[2]
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_NAV_FILTER_BIAS_LEN )
payload.usec = usec; // uint64_t:Timestamp (microseconds)
payload.accel_0 = accel_0; // float:b_f[0]
payload.accel_1 = accel_1; // float:b_f[1]
payload.accel_2 = accel_2; // float:b_f[2]
payload.gyro_0 = gyro_0; // float:b_f[0]
payload.gyro_1 = gyro_1; // float:b_f[1]
payload.gyro_2 = gyro_2; // float:b_f[2]
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_NAV_FILTER_BIAS_LEN;
......@@ -130,14 +130,12 @@ static inline void mavlink_msg_nav_filter_bias_send(mavlink_channel_t chan, uint
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0xFF, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_RADIO_CALIBRATION 221
#define MAVLINK_MSG_ID_RADIO_CALIBRATION_LEN 42
#define MAVLINK_MSG_221_LEN 42
#define MAVLINK_MSG_ID_RADIO_CALIBRATION_KEY 0x49
#define MAVLINK_MSG_221_KEY 0x49
typedef struct __mavlink_radio_calibration_t
{
......@@ -92,6 +94,8 @@ static inline uint16_t mavlink_msg_radio_calibration_encode(uint8_t system_id, u
return mavlink_msg_radio_calibration_pack(system_id, component_id, msg, radio_calibration->aileron, radio_calibration->elevator, radio_calibration->rudder, radio_calibration->gyro, radio_calibration->pitch, radio_calibration->throttle);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a radio_calibration message
* @param chan MAVLink channel to send the message
......@@ -103,22 +107,18 @@ static inline uint16_t mavlink_msg_radio_calibration_encode(uint8_t system_id, u
* @param pitch Pitch curve setpoints (every 25%)
* @param throttle Throttle curve setpoints (every 25%)
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_radio_calibration_send(mavlink_channel_t chan, const uint16_t* aileron, const uint16_t* elevator, const uint16_t* rudder, const uint16_t* gyro, const uint16_t* pitch, const uint16_t* throttle)
{
mavlink_header_t hdr;
mavlink_radio_calibration_t payload;
uint16_t checksum;
mavlink_radio_calibration_t *p = &payload;
memcpy(p->aileron, aileron, sizeof(p->aileron)); // uint16_t[3]:Aileron setpoints: left, center, right
memcpy(p->elevator, elevator, sizeof(p->elevator)); // uint16_t[3]:Elevator setpoints: nose down, center, nose up
memcpy(p->rudder, rudder, sizeof(p->rudder)); // uint16_t[3]:Rudder setpoints: nose left, center, nose right
memcpy(p->gyro, gyro, sizeof(p->gyro)); // uint16_t[2]:Tail gyro mode/gain setpoints: heading hold, rate mode
memcpy(p->pitch, pitch, sizeof(p->pitch)); // uint16_t[5]:Pitch curve setpoints (every 25%)
memcpy(p->throttle, throttle, sizeof(p->throttle)); // uint16_t[5]:Throttle curve setpoints (every 25%)
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_RADIO_CALIBRATION_LEN )
memcpy(payload.aileron, aileron, sizeof(payload.aileron)); // uint16_t[3]:Aileron setpoints: left, center, right
memcpy(payload.elevator, elevator, sizeof(payload.elevator)); // uint16_t[3]:Elevator setpoints: nose down, center, nose up
memcpy(payload.rudder, rudder, sizeof(payload.rudder)); // uint16_t[3]:Rudder setpoints: nose left, center, nose right
memcpy(payload.gyro, gyro, sizeof(payload.gyro)); // uint16_t[2]:Tail gyro mode/gain setpoints: heading hold, rate mode
memcpy(payload.pitch, pitch, sizeof(payload.pitch)); // uint16_t[5]:Pitch curve setpoints (every 25%)
memcpy(payload.throttle, throttle, sizeof(payload.throttle)); // uint16_t[5]:Throttle curve setpoints (every 25%)
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_RADIO_CALIBRATION_LEN;
......@@ -129,14 +129,12 @@ static inline void mavlink_msg_radio_calibration_send(mavlink_channel_t chan, co
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0x49, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
......@@ -3,6 +3,8 @@
#define MAVLINK_MSG_ID_UALBERTA_SYS_STATUS 222
#define MAVLINK_MSG_ID_UALBERTA_SYS_STATUS_LEN 3
#define MAVLINK_MSG_222_LEN 3
#define MAVLINK_MSG_ID_UALBERTA_SYS_STATUS_KEY 0xEF
#define MAVLINK_MSG_222_KEY 0xEF
typedef struct __mavlink_ualberta_sys_status_t
{
......@@ -71,6 +73,8 @@ static inline uint16_t mavlink_msg_ualberta_sys_status_encode(uint8_t system_id,
return mavlink_msg_ualberta_sys_status_pack(system_id, component_id, msg, ualberta_sys_status->mode, ualberta_sys_status->nav_mode, ualberta_sys_status->pilot);
}
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
/**
* @brief Send a ualberta_sys_status message
* @param chan MAVLink channel to send the message
......@@ -79,19 +83,15 @@ static inline uint16_t mavlink_msg_ualberta_sys_status_encode(uint8_t system_id,
* @param nav_mode Navigation mode, see UALBERTA_NAV_MODE ENUM
* @param pilot Pilot mode, see UALBERTA_PILOT_MODE
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_ualberta_sys_status_send(mavlink_channel_t chan, uint8_t mode, uint8_t nav_mode, uint8_t pilot)
{
mavlink_header_t hdr;
mavlink_ualberta_sys_status_t payload;
uint16_t checksum;
mavlink_ualberta_sys_status_t *p = &payload;
p->mode = mode; // uint8_t:System mode, see UALBERTA_AUTOPILOT_MODE ENUM
p->nav_mode = nav_mode; // uint8_t:Navigation mode, see UALBERTA_NAV_MODE ENUM
p->pilot = pilot; // uint8_t:Pilot mode, see UALBERTA_PILOT_MODE
MAVLINK_BUFFER_CHECK_START( chan, MAVLINK_MSG_ID_UALBERTA_SYS_STATUS_LEN )
payload.mode = mode; // uint8_t:System mode, see UALBERTA_AUTOPILOT_MODE ENUM
payload.nav_mode = nav_mode; // uint8_t:Navigation mode, see UALBERTA_NAV_MODE ENUM
payload.pilot = pilot; // uint8_t:Pilot mode, see UALBERTA_PILOT_MODE
hdr.STX = MAVLINK_STX;
hdr.len = MAVLINK_MSG_ID_UALBERTA_SYS_STATUS_LEN;
......@@ -102,14 +102,12 @@ static inline void mavlink_msg_ualberta_sys_status_send(mavlink_channel_t chan,
mavlink_get_channel_status(chan)->current_tx_seq = hdr.seq + 1;
mavlink_send_mem(chan, (uint8_t *)&hdr.STX, MAVLINK_NUM_HEADER_BYTES );
crc_init(&checksum);
checksum = crc_calculate_mem((uint8_t *)&hdr.len, &checksum, MAVLINK_CORE_HEADER_LEN);
checksum = crc_calculate_mem((uint8_t *)&payload, &checksum, hdr.len );
hdr.ck_a = (uint8_t)(checksum & 0xFF); ///< Low byte
hdr.ck_b = (uint8_t)(checksum >> 8); ///< High byte
mavlink_send_mem(chan, (uint8_t *)&payload, hdr.len);
mavlink_send_mem(chan, (uint8_t *)&hdr.ck_a, MAVLINK_NUM_CHECKSUM_BYTES);
crc_init(&hdr.ck);
crc_calculate_mem((uint8_t *)&hdr.len, &hdr.ck, MAVLINK_CORE_HEADER_LEN);
crc_calculate_mem((uint8_t *)&payload, &hdr.ck, hdr.len );
crc_accumulate( 0xEF, &hdr.ck); /// include key in X25 checksum
mavlink_send_mem(chan, (uint8_t *)&hdr.ck, MAVLINK_NUM_CHECKSUM_BYTES);
MAVLINK_BUFFER_CHECK_END
}
#endif
......
/** @file
* @brief MAVLink comm protocol.
* @see http://qgroundcontrol.org/mavlink/
* Generated on Tuesday, August 9 2011, 16:16 UTC
* Generated on Saturday, August 13 2011, 07:19 UTC
*/
#ifndef UALBERTA_H
#define UALBERTA_H
......@@ -11,7 +11,7 @@ extern "C" {
#endif
#include "../protocol.h"
#include "../mavlink_protocol.h"
#define MAVLINK_ENABLED_UALBERTA
......@@ -71,7 +71,12 @@ enum UALBERTA_PILOT_MODE
// MESSAGE CRC KEYS
#undef MAVLINK_MESSAGE_KEYS
#define MAVLINK_MESSAGE_KEYS { 71, 249, 232, 226, 76, 126, 117, 186, 0, 165, 44, 249, 133, 0, 0, 0, 0, 0, 0, 0, 112, 34, 81, 152, 0, 223, 28, 99, 28, 21, 243, 240, 204, 21, 111, 43, 192, 234, 22, 197, 192, 192, 166, 34, 233, 34, 166, 158, 142, 60, 10, 75, 249, 247, 234, 157, 125, 0, 0, 0, 85, 211, 62, 75, 185, 18, 42, 38, 0, 127, 200, 0, 0, 53, 251, 20, 22, 0, 0, 0, 0, 0, 0, 0, 0, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 8, 238, 165, 0, 0, 0, 0, 0, 0, 0, 218, 218, 235, 0, 0, 0, 0, 0, 0, 225, 114, 0, 0, 0, 0, 0, 0, 0, 0, 221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 171, 122, 0, 0, 0, 0, 0, 0, 0, 92, 114, 4, 169, 10, 0, 0, 0, 0, 0, 72, 62, 83, 0, 0, 0, 0, 0, 0, 0, 202, 144, 106, 254, 0, 0, 255, 185, 0, 14, 136, 53, 0, 212, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 73, 239, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 141, 211, 166 }
#define MAVLINK_MESSAGE_KEYS { 71, 249, 232, 226, 76, 126, 117, 186, 0, 144, 0, 249, 133, 0, 0, 0, 0, 0, 0, 0, 33, 34, 163, 45, 0, 166, 28, 99, 28, 21, 243, 240, 91, 21, 111, 43, 192, 234, 22, 197, 192, 192, 166, 34, 233, 34, 166, 158, 142, 60, 10, 75, 249, 247, 234, 161, 116, 56, 245, 0, 0, 0, 62, 75, 185, 18, 42, 38, 0, 127, 200, 0, 0, 212, 251, 20, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 73, 239, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 138, 43, 141, 211, 144 }
// MESSAGE LENGTHS
#undef MAVLINK_MESSAGE_LENGTHS
#define MAVLINK_MESSAGE_LENGTHS { 3, 4, 8, 14, 8, 28, 3, 32, 0, 2, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 20, 2, 24, 22, 0, 30, 26, 101, 26, 16, 32, 32, 38, 32, 11, 17, 17, 16, 18, 36, 4, 4, 2, 2, 4, 2, 2, 3, 14, 12, 18, 16, 8, 27, 25, 18, 18, 20, 20, 0, 0, 0, 26, 16, 36, 5, 6, 56, 0, 21, 18, 0, 0, 20, 20, 20, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 42, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 30, 14, 14, 51 }
#ifdef __cplusplus
}
......
/*******************************************************************************
Copyright (C) 2011 Lorenz Meier lm ( a t ) inf.ethz.ch
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#include "testing/mavlink_missionlib_data.h"
#include "mavlink_parameters.h"
#include "math.h" /* isinf / isnan checks */
extern mavlink_system_t mavlink_system;
extern mavlink_pm_storage pm;
extern void mavlink_missionlib_send_message(mavlink_message_t* msg);
extern void mavlink_missionlib_send_gcs_string(const char* string);
void mavlink_pm_message_handler(const mavlink_channel_t chan, const mavlink_message_t* msg)
{
switch (msg->msgid)
{
case MAVLINK_MSG_ID_PARAM_REQUEST_LIST:
{
// Start sending parameters
pm.next_param = 0;
mavlink_missionlib_send_gcs_string("PM SENDING LIST");
}
break;
case MAVLINK_MSG_ID_PARAM_SET:
{
mavlink_param_set_t set;
mavlink_msg_param_set_decode(msg, &set);
// Check if this message is for this system
if (set.target_system == mavlink_system.sysid && set.target_component == mavlink_system.compid)
{
char* key = set.param_id;
for (uint16_t i = 0; i < MAVLINK_MSG_PARAM_VALUE_FIELD_PARAM_ID_LEN; i++)
{
bool match = true;
for (uint16_t j = 0; j < MAVLINK_MSG_PARAM_VALUE_FIELD_PARAM_ID_LEN; j++)
{
// Compare
if (pm.param_names[i][j] != key[j])
{
match = false;
}
// End matching if null termination is reached
if (pm.param_names[i][j] == '\0')
{
break;
}
}
// Check if matched
if (match)
{
// Only write and emit changes if there is actually a difference
// AND only write if new value is NOT "not-a-number"
// AND is NOT infinity
if (pm.param_values[i] != set.param_value
&& !isnan(set.param_value)
&& !isinf(set.param_value))
{
pm.param_values[i] = set.param_value;
// Report back new value
#ifndef MAVLINK_USE_CONVENIENCE_FUNCTIONS
mavlink_message_t tx_msg;
mavlink_msg_param_value_pack_chan(mavlink_system.sysid,
mavlink_system.compid,
MAVLINK_COMM_0,
&tx_msg,
pm.param_names[i],
pm.param_values[i],
pm.size,
i);
mavlink_missionlib_send_message(&tx_msg);
#else
mavlink_msg_param_value_send(MAVLINK_COMM_0,
pm.param_names[i],
pm.param_values[i],
pm.size,
i);
#endif
mavlink_missionlib_send_gcs_string("PM received param");
} // End valid value check
} // End match check
} // End for loop
} // End system ID check
} // End case
break;
} // End switch
}
/**
* @brief Send low-priority messages at a maximum rate of xx Hertz
*
* This function sends messages at a lower rate to not exceed the wireless
* bandwidth. It sends one message each time it is called until the buffer is empty.
* Call this function with xx Hertz to increase/decrease the bandwidth.
*/
void mavlink_pm_queued_send(void)
{
//send parameters one by one
if (pm.next_param < pm.size)
{
//for (int i.. all active comm links)
#ifndef MAVLINK_USE_CONVENIENCE_FUNCTIONS
mavlink_message_t tx_msg;
mavlink_msg_param_value_pack_chan(mavlink_system.sysid,
mavlink_system.compid,
MAVLINK_COMM_0,
&tx_msg,
pm.param_names[pm.next_param],
pm.param_values[pm.next_param],
pm.size,
pm.next_param);
mavlink_missionlib_send_message(&tx_msg);
#else
mavlink_msg_param_value_send(MAVLINK_COMM_0,
pm.param_names[pm.next_param],
pm.param_values[pm.next_param],
pm.size,
pm.next_param);
#endif
pm.next_param++;
}
}
\ No newline at end of file
/*******************************************************************************
Copyright (C) 2011 Lorenz Meier lm ( a t ) inf.ethz.ch
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
/* This assumes you have the mavlink headers on your include path
or in the same folder as this source file */
// Disable auto-data structures
#ifndef MAVLINK_NO_DATA
#define MAVLINK_NO_DATA
#endif
#include "mavlink.h"
#include <stdbool.h>
/* PARAMETER MANAGER - MISSION LIB */
//#ifndef MAVLINK_PM_MAX_PARAM_COUNT
//#error You have not defined the ENUM with your parameters with MAVLINK_PM_MAX_PARAM_COUNT at the end.
//#endif
#ifndef MAVLINK_PM_TEXT_FEEDBACK
#define MAVLINK_PM_TEXT_FEEDBACK 1 ///< Report back status information as text
#endif
void mavlink_pm_message_handler(const mavlink_channel_t chan, const mavlink_message_t* msg);
void mavlink_pm_queued_send(void);
\ No newline at end of file
/*******************************************************************************
Copyright (C) 2011 Lorenz Meier lm ( a t ) inf.ethz.ch
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
/* This assumes you have the mavlink headers on your include path
or in the same folder as this source file */
// Disable auto-data structures
#ifndef MAVLINK_NO_DATA
#define MAVLINK_NO_DATA
#endif
#include "mavlink.h"
#include <stdbool.h>
/* MISSION LIB DATA STORAGE */
enum MAVLINK_PM_PARAMETERS
{
MAVLINK_PM_PARAM_SYSTEM_ID,
MAVLINK_PM_PARAM_ATT_K_D,
MAVLINK_PM_MAX_PARAM_COUNT // VERY IMPORTANT! KEEP THIS AS LAST ENTRY
};
/* DO NOT EDIT THIS FILE BELOW THIS POINT! */
//extern void mavlink_pm_queued_send();
struct mavlink_pm_storage {
char param_names[MAVLINK_PM_MAX_PARAM_COUNT][MAVLINK_MSG_PARAM_VALUE_FIELD_PARAM_ID_LEN]; ///< Parameter names
float param_values[MAVLINK_PM_MAX_PARAM_COUNT]; ///< Parameter values
uint16_t next_param;
uint16_t size;
};
typedef struct mavlink_pm_storage mavlink_pm_storage;
void mavlink_pm_reset_params(mavlink_pm_storage* pm);
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
......@@ -19,6 +19,12 @@
/* This assumes you have the mavlink headers on your include path
or in the same folder as this source file */
// Disable auto-data structures
#ifndef MAVLINK_NO_DATA
#define MAVLINK_NO_DATA
#endif
#include <mavlink.h>
#include <stdbool.h>
......@@ -47,11 +53,9 @@ enum MAVLINK_WPM_CODES
/* WAYPOINT MANAGER - MISSION LIB */
#define MAVLINK_WPM_MAX_WP_COUNT 30
#define MAVLINK_WPM_MAX_WP_COUNT 15
#define MAVLINK_WPM_CONFIG_IN_FLIGHT_UPDATE ///< Enable double buffer and in-flight updates
#define MAVLINK_WPM_TEXT_FEEDBACK 1 ///< Report back status information as text
#define MAVLINK_WPM_SYSTEM_ID 1
#define MAVLINK_WPM_COMPONENT_ID 1
#define MAVLINK_WPM_PROTOCOL_TIMEOUT_DEFAULT 2000000
#define MAVLINK_WPM_SETPOINT_DELAY_DEFAULT 1000000
#define MAVLINK_WPM_PROTOCOL_DELAY_DEFAULT 40
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment