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
......
/** @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,12 +3,14 @@
#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
{
uint8_t type; ///< Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM)
uint8_t autopilot; ///< Type of the Autopilot: 0: Generic, 1: PIXHAWK, 2: SLUGS, 3: Ardupilot (up to 15 types), defined in MAV_AUTOPILOT_TYPE ENUM
uint8_t mavlink_version; ///< MAVLink version
uint8_t type; ///< Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM)
uint8_t autopilot; ///< Type of the Autopilot: 0: Generic, 1: PIXHAWK, 2: SLUGS, 3: Ardupilot (up to 15 types), defined in MAV_AUTOPILOT_TYPE ENUM
uint8_t mavlink_version; ///< MAVLink version
} mavlink_heartbeat_t;
......@@ -27,10 +29,10 @@ static inline uint16_t mavlink_msg_heartbeat_pack(uint8_t system_id, uint8_t com
mavlink_heartbeat_t *p = (mavlink_heartbeat_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_HEARTBEAT;
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
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
p->mavlink_version = MAVLINK_VERSION; // uint8_t_mavlink_version:MAVLink version
p->mavlink_version = MAVLINK_VERSION; // uint8_t_mavlink_version:MAVLink version
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HEARTBEAT_LEN);
}
......@@ -49,10 +51,10 @@ static inline uint16_t mavlink_msg_heartbeat_pack_chan(uint8_t system_id, uint8_
mavlink_heartbeat_t *p = (mavlink_heartbeat_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_HEARTBEAT;
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
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
p->mavlink_version = MAVLINK_VERSION; // uint8_t_mavlink_version:MAVLink version
p->mavlink_version = MAVLINK_VERSION; // uint8_t_mavlink_version:MAVLink version
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HEARTBEAT_LEN);
}
......@@ -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,18 +3,20 @@
#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
{
float roll; ///< roll
float pitch; ///< pitch
float yaw; ///< yaw
float thrust; ///< thrust
uint8_t target; ///< The system to be controlled
uint8_t roll_manual; ///< roll control enabled auto:0, manual:1
uint8_t pitch_manual; ///< pitch auto:0, manual:1
uint8_t yaw_manual; ///< yaw auto:0, manual:1
uint8_t thrust_manual; ///< thrust auto:0, manual:1
float roll; ///< roll
float pitch; ///< pitch
float yaw; ///< yaw
float thrust; ///< thrust
uint8_t target; ///< The system to be controlled
uint8_t roll_manual; ///< roll control enabled auto:0, manual:1
uint8_t pitch_manual; ///< pitch auto:0, manual:1
uint8_t yaw_manual; ///< yaw auto:0, manual:1
uint8_t thrust_manual; ///< thrust auto:0, manual:1
} mavlink_attitude_control_t;
......@@ -40,15 +42,15 @@ static inline uint16_t mavlink_msg_attitude_control_pack(uint8_t system_id, uint
mavlink_attitude_control_t *p = (mavlink_attitude_control_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_ATTITUDE_CONTROL;
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
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
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_CONTROL_LEN);
}
......@@ -75,15 +77,15 @@ static inline uint16_t mavlink_msg_attitude_control_pack_chan(uint8_t system_id,
mavlink_attitude_control_t *p = (mavlink_attitude_control_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_ATTITUDE_CONTROL;
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
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
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_CONTROL_LEN);
}
......@@ -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,15 +3,17 @@
#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
{
uint16_t load; ///< Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000
uint16_t i2c0_err_count; ///< Number of I2C errors since startup
uint16_t i2c1_err_count; ///< Number of I2C errors since startup
uint16_t spi0_err_count; ///< Number of I2C errors since startup
uint16_t spi1_err_count; ///< Number of I2C errors since startup
uint16_t uart_total_err_count; ///< Number of I2C errors since startup
uint16_t load; ///< Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000
uint16_t i2c0_err_count; ///< Number of I2C errors since startup
uint16_t i2c1_err_count; ///< Number of I2C errors since startup
uint16_t spi0_err_count; ///< Number of I2C errors since startup
uint16_t spi1_err_count; ///< Number of I2C errors since startup
uint16_t uart_total_err_count; ///< Number of I2C errors since startup
} mavlink_aux_status_t;
......@@ -34,12 +36,12 @@ static inline uint16_t mavlink_msg_aux_status_pack(uint8_t system_id, uint8_t co
mavlink_aux_status_t *p = (mavlink_aux_status_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_AUX_STATUS;
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
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
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AUX_STATUS_LEN);
}
......@@ -63,12 +65,12 @@ static inline uint16_t mavlink_msg_aux_status_pack_chan(uint8_t system_id, uint8
mavlink_aux_status_t *p = (mavlink_aux_status_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_AUX_STATUS;
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
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
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AUX_STATUS_LEN);
}
......@@ -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,17 +3,19 @@
#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
{
float x; ///< x position in m
float y; ///< y position in m
float z; ///< z position in m
float response; ///< Harris operator response at this location
uint16_t size; ///< Size in pixels
uint16_t orientation; ///< Orientation
uint8_t orientation_assignment; ///< Orientation assignment 0: false, 1:true
uint8_t descriptor[32]; ///< Descriptor
float x; ///< x position in m
float y; ///< y position in m
float z; ///< z position in m
float response; ///< Harris operator response at this location
uint16_t size; ///< Size in pixels
uint16_t orientation; ///< Orientation
uint8_t orientation_assignment; ///< Orientation assignment 0: false, 1:true
uint8_t descriptor[32]; ///< Descriptor
} mavlink_brief_feature_t;
#define MAVLINK_MSG_BRIEF_FEATURE_FIELD_DESCRIPTOR_LEN 32
......@@ -39,14 +41,14 @@ static inline uint16_t mavlink_msg_brief_feature_pack(uint8_t system_id, uint8_t
mavlink_brief_feature_t *p = (mavlink_brief_feature_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_BRIEF_FEATURE;
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
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
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_BRIEF_FEATURE_LEN);
}
......@@ -72,14 +74,14 @@ static inline uint16_t mavlink_msg_brief_feature_pack_chan(uint8_t system_id, ui
mavlink_brief_feature_t *p = (mavlink_brief_feature_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_BRIEF_FEATURE;
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
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
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_BRIEF_FEATURE_LEN);
}
......@@ -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,14 +3,16 @@
#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
{
uint32_t size; ///< total data size in bytes (set on ACK only)
uint8_t type; ///< type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h)
uint8_t packets; ///< number of packets beeing sent (set on ACK only)
uint8_t payload; ///< payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)
uint8_t jpg_quality; ///< JPEG quality out of [1,100]
uint32_t size; ///< total data size in bytes (set on ACK only)
uint8_t type; ///< type of requested/acknowledged data (as defined in ENUM DATA_TYPES in mavlink/include/mavlink_types.h)
uint8_t packets; ///< number of packets beeing sent (set on ACK only)
uint8_t payload; ///< payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)
uint8_t jpg_quality; ///< JPEG quality out of [1,100]
} mavlink_data_transmission_handshake_t;
......@@ -32,11 +34,11 @@ static inline uint16_t mavlink_msg_data_transmission_handshake_pack(uint8_t syst
mavlink_data_transmission_handshake_t *p = (mavlink_data_transmission_handshake_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE;
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]
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]
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN);
}
......@@ -59,11 +61,11 @@ static inline uint16_t mavlink_msg_data_transmission_handshake_pack_chan(uint8_t
mavlink_data_transmission_handshake_t *p = (mavlink_data_transmission_handshake_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE;
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]
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]
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_LEN);
}
......@@ -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,11 +3,13 @@
#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
{
uint16_t seqnr; ///< sequence number (starting with 0 on every transmission)
uint8_t data[253]; ///< image data bytes
uint16_t seqnr; ///< sequence number (starting with 0 on every transmission)
uint8_t data[253]; ///< image data bytes
} mavlink_encapsulated_data_t;
#define MAVLINK_MSG_ENCAPSULATED_DATA_FIELD_DATA_LEN 253
......@@ -27,8 +29,8 @@ static inline uint16_t mavlink_msg_encapsulated_data_pack(uint8_t system_id, uin
mavlink_encapsulated_data_t *p = (mavlink_encapsulated_data_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_ENCAPSULATED_DATA;
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
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
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN);
}
......@@ -48,8 +50,8 @@ static inline uint16_t mavlink_msg_encapsulated_data_pack_chan(uint8_t system_id
mavlink_encapsulated_data_t *p = (mavlink_encapsulated_data_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_ENCAPSULATED_DATA;
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
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
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ENCAPSULATED_DATA_LEN);
}
......@@ -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,10 +3,12 @@
#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
{
uint8_t enable; ///< 0 to disable, 1 to enable
uint8_t enable; ///< 0 to disable, 1 to enable
} mavlink_image_trigger_control_t;
......@@ -24,7 +26,7 @@ static inline uint16_t mavlink_msg_image_trigger_control_pack(uint8_t system_id,
mavlink_image_trigger_control_t *p = (mavlink_image_trigger_control_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL;
p->enable = enable; // uint8_t:0 to disable, 1 to enable
p->enable = enable; // uint8_t:0 to disable, 1 to enable
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_LEN);
}
......@@ -43,7 +45,7 @@ static inline uint16_t mavlink_msg_image_trigger_control_pack_chan(uint8_t syste
mavlink_image_trigger_control_t *p = (mavlink_image_trigger_control_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL;
p->enable = enable; // uint8_t:0 to disable, 1 to enable
p->enable = enable; // uint8_t:0 to disable, 1 to enable
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_IMAGE_TRIGGER_CONTROL_LEN);
}
......@@ -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,21 +3,23 @@
#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
{
uint64_t timestamp; ///< Timestamp
uint32_t seq; ///< IMU seq
float roll; ///< Roll angle in rad
float pitch; ///< Pitch angle in rad
float yaw; ///< Yaw angle in rad
float local_z; ///< Local frame Z coordinate (height over ground)
float lat; ///< GPS X coordinate
float lon; ///< GPS Y coordinate
float alt; ///< Global frame altitude
float ground_x; ///< Ground truth X
float ground_y; ///< Ground truth Y
float ground_z; ///< Ground truth Z
uint64_t timestamp; ///< Timestamp
uint32_t seq; ///< IMU seq
float roll; ///< Roll angle in rad
float pitch; ///< Pitch angle in rad
float yaw; ///< Yaw angle in rad
float local_z; ///< Local frame Z coordinate (height over ground)
float lat; ///< GPS X coordinate
float lon; ///< GPS Y coordinate
float alt; ///< Global frame altitude
float ground_x; ///< Ground truth X
float ground_y; ///< Ground truth Y
float ground_z; ///< Ground truth Z
} mavlink_image_triggered_t;
......@@ -46,18 +48,18 @@ static inline uint16_t mavlink_msg_image_triggered_pack(uint8_t system_id, uint8
mavlink_image_triggered_t *p = (mavlink_image_triggered_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_IMAGE_TRIGGERED;
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
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
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN);
}
......@@ -87,18 +89,18 @@ static inline uint16_t mavlink_msg_image_triggered_pack_chan(uint8_t system_id,
mavlink_image_triggered_t *p = (mavlink_image_triggered_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_IMAGE_TRIGGERED;
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
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
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_IMAGE_TRIGGERED_LEN);
}
......@@ -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,16 +3,18 @@
#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
{
float x; ///< x position
float y; ///< y position
float z; ///< z position
float roll; ///< roll orientation
float pitch; ///< pitch orientation
float yaw; ///< yaw orientation
uint16_t id; ///< ID
float x; ///< x position
float y; ///< y position
float z; ///< z position
float roll; ///< roll orientation
float pitch; ///< pitch orientation
float yaw; ///< yaw orientation
uint16_t id; ///< ID
} mavlink_marker_t;
......@@ -36,13 +38,13 @@ static inline uint16_t mavlink_msg_marker_pack(uint8_t system_id, uint8_t compon
mavlink_marker_t *p = (mavlink_marker_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_MARKER;
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
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
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MARKER_LEN);
}
......@@ -67,13 +69,13 @@ static inline uint16_t mavlink_msg_marker_pack_chan(uint8_t system_id, uint8_t c
mavlink_marker_t *p = (mavlink_marker_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_MARKER;
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
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
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MARKER_LEN);
}
......@@ -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,13 +3,15 @@
#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
{
float confidence; ///< Confidence of detection
uint8_t type; ///< 0: Pattern, 1: Letter
char file[100]; ///< Pattern file name
uint8_t detected; ///< Accepted as true detection, 0 no, 1 yes
float confidence; ///< Confidence of detection
uint8_t type; ///< 0: Pattern, 1: Letter
char file[100]; ///< Pattern file name
uint8_t detected; ///< Accepted as true detection, 0 no, 1 yes
} mavlink_pattern_detected_t;
#define MAVLINK_MSG_PATTERN_DETECTED_FIELD_FILE_LEN 100
......@@ -31,10 +33,10 @@ static inline uint16_t mavlink_msg_pattern_detected_pack(uint8_t system_id, uint
mavlink_pattern_detected_t *p = (mavlink_pattern_detected_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_PATTERN_DETECTED;
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
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
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PATTERN_DETECTED_LEN);
}
......@@ -56,10 +58,10 @@ static inline uint16_t mavlink_msg_pattern_detected_pack_chan(uint8_t system_id,
mavlink_pattern_detected_t *p = (mavlink_pattern_detected_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_PATTERN_DETECTED;
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
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
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PATTERN_DETECTED_LEN);
}
......@@ -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,17 +3,19 @@
#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
{
float x; ///< X Position
float y; ///< Y Position
float z; ///< Z Position
uint16_t timeout; ///< 0: no timeout, >1: timeout in seconds
uint8_t type; ///< 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug
uint8_t color; ///< 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta
uint8_t coordinate_system; ///< 0: global, 1:local
char name[26]; ///< POI name
float x; ///< X Position
float y; ///< Y Position
float z; ///< Z Position
uint16_t timeout; ///< 0: no timeout, >1: timeout in seconds
uint8_t type; ///< 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug
uint8_t color; ///< 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta
uint8_t coordinate_system; ///< 0: global, 1:local
char name[26]; ///< POI name
} mavlink_point_of_interest_t;
#define MAVLINK_MSG_POINT_OF_INTEREST_FIELD_NAME_LEN 26
......@@ -39,14 +41,14 @@ static inline uint16_t mavlink_msg_point_of_interest_pack(uint8_t system_id, uin
mavlink_point_of_interest_t *p = (mavlink_point_of_interest_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_POINT_OF_INTEREST;
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
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
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN);
}
......@@ -72,14 +74,14 @@ static inline uint16_t mavlink_msg_point_of_interest_pack_chan(uint8_t system_id
mavlink_point_of_interest_t *p = (mavlink_point_of_interest_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_POINT_OF_INTEREST;
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
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
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POINT_OF_INTEREST_LEN);
}
......@@ -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,20 +3,22 @@
#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
{
float xp1; ///< X1 Position
float yp1; ///< Y1 Position
float zp1; ///< Z1 Position
float xp2; ///< X2 Position
float yp2; ///< Y2 Position
float zp2; ///< Z2 Position
uint16_t timeout; ///< 0: no timeout, >1: timeout in seconds
uint8_t type; ///< 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug
uint8_t color; ///< 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta
uint8_t coordinate_system; ///< 0: global, 1:local
char name[26]; ///< POI connection name
float xp1; ///< X1 Position
float yp1; ///< Y1 Position
float zp1; ///< Z1 Position
float xp2; ///< X2 Position
float yp2; ///< Y2 Position
float zp2; ///< Z2 Position
uint16_t timeout; ///< 0: no timeout, >1: timeout in seconds
uint8_t type; ///< 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug
uint8_t color; ///< 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta
uint8_t coordinate_system; ///< 0: global, 1:local
char name[26]; ///< POI connection name
} mavlink_point_of_interest_connection_t;
#define MAVLINK_MSG_POINT_OF_INTEREST_CONNECTION_FIELD_NAME_LEN 26
......@@ -45,17 +47,17 @@ static inline uint16_t mavlink_msg_point_of_interest_connection_pack(uint8_t sys
mavlink_point_of_interest_connection_t *p = (mavlink_point_of_interest_connection_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION;
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
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
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN);
}
......@@ -84,17 +86,17 @@ static inline uint16_t mavlink_msg_point_of_interest_connection_pack_chan(uint8_
mavlink_point_of_interest_connection_t *p = (mavlink_point_of_interest_connection_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION;
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
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
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION_LEN);
}
......@@ -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,15 +3,17 @@
#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
{
float x; ///< x position offset
float y; ///< y position offset
float z; ///< z position offset
float yaw; ///< yaw orientation offset in radians, 0 = NORTH
uint8_t target_system; ///< System ID
uint8_t target_component; ///< Component ID
float x; ///< x position offset
float y; ///< y position offset
float z; ///< z position offset
float yaw; ///< yaw orientation offset in radians, 0 = NORTH
uint8_t target_system; ///< System ID
uint8_t target_component; ///< Component ID
} mavlink_position_control_offset_set_t;
......@@ -34,12 +36,12 @@ static inline uint16_t mavlink_msg_position_control_offset_set_pack(uint8_t syst
mavlink_position_control_offset_set_t *p = (mavlink_position_control_offset_set_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_POSITION_CONTROL_OFFSET_SET;
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
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
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_POSITION_CONTROL_OFFSET_SET_LEN);
}
......@@ -63,12 +65,12 @@ static inline uint16_t mavlink_msg_position_control_offset_set_pack_chan(uint8_t
mavlink_position_control_offset_set_t *p = (mavlink_position_control_offset_set_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_POSITION_CONTROL_OFFSET_SET;
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
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
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POSITION_CONTROL_OFFSET_SET_LEN);
}
......@@ -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,14 +3,16 @@
#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
{
float x; ///< x position
float y; ///< y position
float z; ///< z position
float yaw; ///< yaw orientation in radians, 0 = NORTH
uint16_t id; ///< ID of waypoint, 0 for plain position
float x; ///< x position
float y; ///< y position
float z; ///< z position
float yaw; ///< yaw orientation in radians, 0 = NORTH
uint16_t id; ///< ID of waypoint, 0 for plain position
} mavlink_position_control_setpoint_t;
......@@ -32,11 +34,11 @@ static inline uint16_t mavlink_msg_position_control_setpoint_pack(uint8_t system
mavlink_position_control_setpoint_t *p = (mavlink_position_control_setpoint_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT;
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
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
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_LEN);
}
......@@ -59,11 +61,11 @@ static inline uint16_t mavlink_msg_position_control_setpoint_pack_chan(uint8_t s
mavlink_position_control_setpoint_t *p = (mavlink_position_control_setpoint_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT;
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
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
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_LEN);
}
......@@ -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,16 +3,18 @@
#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
{
float x; ///< x position
float y; ///< y position
float z; ///< z position
float yaw; ///< yaw orientation in radians, 0 = NORTH
uint16_t id; ///< ID of waypoint, 0 for plain position
uint8_t target_system; ///< System ID
uint8_t target_component; ///< Component ID
float x; ///< x position
float y; ///< y position
float z; ///< z position
float yaw; ///< yaw orientation in radians, 0 = NORTH
uint16_t id; ///< ID of waypoint, 0 for plain position
uint8_t target_system; ///< System ID
uint8_t target_component; ///< Component ID
} mavlink_position_control_setpoint_set_t;
......@@ -36,13 +38,13 @@ static inline uint16_t mavlink_msg_position_control_setpoint_set_pack(uint8_t sy
mavlink_position_control_setpoint_set_t *p = (mavlink_position_control_setpoint_set_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_SET;
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
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
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_SET_LEN);
}
......@@ -67,13 +69,13 @@ static inline uint16_t mavlink_msg_position_control_setpoint_set_pack_chan(uint8
mavlink_position_control_setpoint_set_t *p = (mavlink_position_control_setpoint_set_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_SET;
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
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
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POSITION_CONTROL_SETPOINT_SET_LEN);
}
......@@ -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,16 +3,18 @@
#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
{
int32_t baro; ///< Barometric pressure (hecto Pascal)
uint16_t adc1; ///< ADC1 (J405 ADC3, LPC2148 AD0.6)
uint16_t adc2; ///< ADC2 (J405 ADC5, LPC2148 AD0.2)
uint16_t adc3; ///< ADC3 (J405 ADC6, LPC2148 AD0.1)
uint16_t adc4; ///< ADC4 (J405 ADC7, LPC2148 AD1.3)
uint16_t vbat; ///< Battery voltage
int16_t temp; ///< Temperature (degrees celcius)
int32_t baro; ///< Barometric pressure (hecto Pascal)
uint16_t adc1; ///< ADC1 (J405 ADC3, LPC2148 AD0.6)
uint16_t adc2; ///< ADC2 (J405 ADC5, LPC2148 AD0.2)
uint16_t adc3; ///< ADC3 (J405 ADC6, LPC2148 AD0.1)
uint16_t adc4; ///< ADC4 (J405 ADC7, LPC2148 AD1.3)
uint16_t vbat; ///< Battery voltage
int16_t temp; ///< Temperature (degrees celcius)
} mavlink_raw_aux_t;
......@@ -36,13 +38,13 @@ static inline uint16_t mavlink_msg_raw_aux_pack(uint8_t system_id, uint8_t compo
mavlink_raw_aux_t *p = (mavlink_raw_aux_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_RAW_AUX;
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)
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)
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RAW_AUX_LEN);
}
......@@ -67,13 +69,13 @@ static inline uint16_t mavlink_msg_raw_aux_pack_chan(uint8_t system_id, uint8_t
mavlink_raw_aux_t *p = (mavlink_raw_aux_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_RAW_AUX;
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)
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)
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RAW_AUX_LEN);
}
......@@ -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,15 +3,17 @@
#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
{
float gain; ///< Camera gain
uint16_t interval; ///< Shutter interval, in microseconds
uint16_t exposure; ///< Exposure time, in microseconds
uint8_t cam_no; ///< Camera id
uint8_t cam_mode; ///< Camera mode: 0 = auto, 1 = manual
uint8_t trigger_pin; ///< Trigger pin, 0-3 for PtGrey FireFly
float gain; ///< Camera gain
uint16_t interval; ///< Shutter interval, in microseconds
uint16_t exposure; ///< Exposure time, in microseconds
uint8_t cam_no; ///< Camera id
uint8_t cam_mode; ///< Camera mode: 0 = auto, 1 = manual
uint8_t trigger_pin; ///< Trigger pin, 0-3 for PtGrey FireFly
} mavlink_set_cam_shutter_t;
......@@ -34,12 +36,12 @@ static inline uint16_t mavlink_msg_set_cam_shutter_pack(uint8_t system_id, uint8
mavlink_set_cam_shutter_t *p = (mavlink_set_cam_shutter_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_SET_CAM_SHUTTER;
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
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
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_CAM_SHUTTER_LEN);
}
......@@ -63,12 +65,12 @@ static inline uint16_t mavlink_msg_set_cam_shutter_pack_chan(uint8_t system_id,
mavlink_set_cam_shutter_t *p = (mavlink_set_cam_shutter_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_SET_CAM_SHUTTER;
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
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
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_CAM_SHUTTER_LEN);
}
......@@ -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,16 +3,18 @@
#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
{
uint64_t usec; ///< Timestamp (milliseconds)
float x; ///< Global X position
float y; ///< Global Y position
float z; ///< Global Z position
float roll; ///< Roll angle in rad
float pitch; ///< Pitch angle in rad
float yaw; ///< Yaw angle in rad
uint64_t usec; ///< Timestamp (milliseconds)
float x; ///< Global X position
float y; ///< Global Y position
float z; ///< Global Z position
float roll; ///< Roll angle in rad
float pitch; ///< Pitch angle in rad
float yaw; ///< Yaw angle in rad
} mavlink_vicon_position_estimate_t;
......@@ -36,13 +38,13 @@ static inline uint16_t mavlink_msg_vicon_position_estimate_pack(uint8_t system_i
mavlink_vicon_position_estimate_t *p = (mavlink_vicon_position_estimate_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE;
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
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
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN);
}
......@@ -67,13 +69,13 @@ static inline uint16_t mavlink_msg_vicon_position_estimate_pack_chan(uint8_t sys
mavlink_vicon_position_estimate_t *p = (mavlink_vicon_position_estimate_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE;
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
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
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_LEN);
}
......@@ -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,16 +3,18 @@
#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
{
uint64_t usec; ///< Timestamp (milliseconds)
float x; ///< Global X position
float y; ///< Global Y position
float z; ///< Global Z position
float roll; ///< Roll angle in rad
float pitch; ///< Pitch angle in rad
float yaw; ///< Yaw angle in rad
uint64_t usec; ///< Timestamp (milliseconds)
float x; ///< Global X position
float y; ///< Global Y position
float z; ///< Global Z position
float roll; ///< Roll angle in rad
float pitch; ///< Pitch angle in rad
float yaw; ///< Yaw angle in rad
} mavlink_vision_position_estimate_t;
......@@ -36,13 +38,13 @@ static inline uint16_t mavlink_msg_vision_position_estimate_pack(uint8_t system_
mavlink_vision_position_estimate_t *p = (mavlink_vision_position_estimate_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE;
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
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
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN);
}
......@@ -67,13 +69,13 @@ static inline uint16_t mavlink_msg_vision_position_estimate_pack_chan(uint8_t sy
mavlink_vision_position_estimate_t *p = (mavlink_vision_position_estimate_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE;
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
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
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_LEN);
}
......@@ -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,13 +3,15 @@
#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
{
uint64_t usec; ///< Timestamp (milliseconds)
float x; ///< Global X speed
float y; ///< Global Y speed
float z; ///< Global Z speed
uint64_t usec; ///< Timestamp (milliseconds)
float x; ///< Global X speed
float y; ///< Global Y speed
float z; ///< Global Z speed
} mavlink_vision_speed_estimate_t;
......@@ -30,10 +32,10 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_pack(uint8_t system_id,
mavlink_vision_speed_estimate_t *p = (mavlink_vision_speed_estimate_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE;
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
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
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN);
}
......@@ -55,10 +57,10 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_pack_chan(uint8_t syste
mavlink_vision_speed_estimate_t *p = (mavlink_vision_speed_estimate_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE;
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
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
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN);
}
......@@ -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,13 +3,15 @@
#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
{
uint16_t watchdog_id; ///< Watchdog ID
uint16_t process_id; ///< Process ID
uint8_t target_system_id; ///< Target system ID
uint8_t command_id; ///< Command ID
uint16_t watchdog_id; ///< Watchdog ID
uint16_t process_id; ///< Process ID
uint8_t target_system_id; ///< Target system ID
uint8_t command_id; ///< Command ID
} mavlink_watchdog_command_t;
......@@ -30,10 +32,10 @@ static inline uint16_t mavlink_msg_watchdog_command_pack(uint8_t system_id, uint
mavlink_watchdog_command_t *p = (mavlink_watchdog_command_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_WATCHDOG_COMMAND;
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
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
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_WATCHDOG_COMMAND_LEN);
}
......@@ -55,10 +57,10 @@ static inline uint16_t mavlink_msg_watchdog_command_pack_chan(uint8_t system_id,
mavlink_watchdog_command_t *p = (mavlink_watchdog_command_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_WATCHDOG_COMMAND;
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
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
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_WATCHDOG_COMMAND_LEN);
}
......@@ -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,11 +3,13 @@
#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
{
uint16_t watchdog_id; ///< Watchdog ID
uint16_t process_count; ///< Number of processes
uint16_t watchdog_id; ///< Watchdog ID
uint16_t process_count; ///< Number of processes
} mavlink_watchdog_heartbeat_t;
......@@ -26,8 +28,8 @@ static inline uint16_t mavlink_msg_watchdog_heartbeat_pack(uint8_t system_id, ui
mavlink_watchdog_heartbeat_t *p = (mavlink_watchdog_heartbeat_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT;
p->watchdog_id = watchdog_id; // uint16_t:Watchdog ID
p->process_count = process_count; // uint16_t:Number of processes
p->watchdog_id = watchdog_id; // uint16_t:Watchdog ID
p->process_count = process_count; // uint16_t:Number of processes
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_LEN);
}
......@@ -47,8 +49,8 @@ static inline uint16_t mavlink_msg_watchdog_heartbeat_pack_chan(uint8_t system_i
mavlink_watchdog_heartbeat_t *p = (mavlink_watchdog_heartbeat_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT;
p->watchdog_id = watchdog_id; // uint16_t:Watchdog ID
p->process_count = process_count; // uint16_t:Number of processes
p->watchdog_id = watchdog_id; // uint16_t:Watchdog ID
p->process_count = process_count; // uint16_t:Number of processes
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT_LEN);
}
......@@ -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,14 +3,16 @@
#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
{
int32_t timeout; ///< Timeout (seconds)
uint16_t watchdog_id; ///< Watchdog ID
uint16_t process_id; ///< Process ID
char name[100]; ///< Process name
char arguments[147]; ///< Process arguments
int32_t timeout; ///< Timeout (seconds)
uint16_t watchdog_id; ///< Watchdog ID
uint16_t process_id; ///< Process ID
char name[100]; ///< Process name
char arguments[147]; ///< Process arguments
} mavlink_watchdog_process_info_t;
#define MAVLINK_MSG_WATCHDOG_PROCESS_INFO_FIELD_NAME_LEN 100
......@@ -34,11 +36,11 @@ static inline uint16_t mavlink_msg_watchdog_process_info_pack(uint8_t system_id,
mavlink_watchdog_process_info_t *p = (mavlink_watchdog_process_info_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO;
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)
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)
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN);
}
......@@ -61,11 +63,11 @@ static inline uint16_t mavlink_msg_watchdog_process_info_pack_chan(uint8_t syste
mavlink_watchdog_process_info_t *p = (mavlink_watchdog_process_info_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO;
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)
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)
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_INFO_LEN);
}
......@@ -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,15 +3,17 @@
#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
{
int32_t pid; ///< PID
uint16_t watchdog_id; ///< Watchdog ID
uint16_t process_id; ///< Process ID
uint16_t crashes; ///< Number of crashes
uint8_t state; ///< Is running / finished / suspended / crashed
uint8_t muted; ///< Is muted
int32_t pid; ///< PID
uint16_t watchdog_id; ///< Watchdog ID
uint16_t process_id; ///< Process ID
uint16_t crashes; ///< Number of crashes
uint8_t state; ///< Is running / finished / suspended / crashed
uint8_t muted; ///< Is muted
} mavlink_watchdog_process_status_t;
......@@ -34,12 +36,12 @@ static inline uint16_t mavlink_msg_watchdog_process_status_pack(uint8_t system_i
mavlink_watchdog_process_status_t *p = (mavlink_watchdog_process_status_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS;
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
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
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN);
}
......@@ -63,12 +65,12 @@ static inline uint16_t mavlink_msg_watchdog_process_status_pack_chan(uint8_t sys
mavlink_watchdog_process_status_t *p = (mavlink_watchdog_process_status_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS;
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
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
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_WATCHDOG_PROCESS_STATUS_LEN);
}
......@@ -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,12 +3,14 @@
#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
{
float dynamicPressure; ///< Dynamic pressure (Pa)
float staticPressure; ///< Static pressure (Pa)
uint16_t temperature; ///< Board temperature
float dynamicPressure; ///< Dynamic pressure (Pa)
float staticPressure; ///< Static pressure (Pa)
uint16_t temperature; ///< Board temperature
} mavlink_air_data_t;
......@@ -28,9 +30,9 @@ static inline uint16_t mavlink_msg_air_data_pack(uint8_t system_id, uint8_t comp
mavlink_air_data_t *p = (mavlink_air_data_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_AIR_DATA;
p->dynamicPressure = dynamicPressure; // float:Dynamic pressure (Pa)
p->staticPressure = staticPressure; // float:Static pressure (Pa)
p->temperature = temperature; // uint16_t:Board temperature
p->dynamicPressure = dynamicPressure; // float:Dynamic pressure (Pa)
p->staticPressure = staticPressure; // float:Static pressure (Pa)
p->temperature = temperature; // uint16_t:Board temperature
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AIR_DATA_LEN);
}
......@@ -51,9 +53,9 @@ static inline uint16_t mavlink_msg_air_data_pack_chan(uint8_t system_id, uint8_t
mavlink_air_data_t *p = (mavlink_air_data_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_AIR_DATA;
p->dynamicPressure = dynamicPressure; // float:Dynamic pressure (Pa)
p->staticPressure = staticPressure; // float:Static pressure (Pa)
p->temperature = temperature; // uint16_t:Board temperature
p->dynamicPressure = dynamicPressure; // float:Dynamic pressure (Pa)
p->staticPressure = staticPressure; // float:Static pressure (Pa)
p->temperature = temperature; // uint16_t:Board temperature
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AIR_DATA_LEN);
}
......@@ -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,12 +3,14 @@
#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
{
uint16_t batVolt; ///< Battery Voltage in millivolts
uint8_t sensLoad; ///< Sensor DSC Load
uint8_t ctrlLoad; ///< Control DSC Load
uint16_t batVolt; ///< Battery Voltage in millivolts
uint8_t sensLoad; ///< Sensor DSC Load
uint8_t ctrlLoad; ///< Control DSC Load
} mavlink_cpu_load_t;
......@@ -28,9 +30,9 @@ static inline uint16_t mavlink_msg_cpu_load_pack(uint8_t system_id, uint8_t comp
mavlink_cpu_load_t *p = (mavlink_cpu_load_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_CPU_LOAD;
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
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
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CPU_LOAD_LEN);
}
......@@ -51,9 +53,9 @@ static inline uint16_t mavlink_msg_cpu_load_pack_chan(uint8_t system_id, uint8_t
mavlink_cpu_load_t *p = (mavlink_cpu_load_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_CPU_LOAD;
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
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
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CPU_LOAD_LEN);
}
......@@ -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,11 +3,13 @@
#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
{
uint16_t bitfieldPt; ///< Bitfield containing the PT configuration
uint8_t target; ///< The system setting the commands
uint16_t bitfieldPt; ///< Bitfield containing the PT configuration
uint8_t target; ///< The system setting the commands
} mavlink_ctrl_srfc_pt_t;
......@@ -26,8 +28,8 @@ static inline uint16_t mavlink_msg_ctrl_srfc_pt_pack(uint8_t system_id, uint8_t
mavlink_ctrl_srfc_pt_t *p = (mavlink_ctrl_srfc_pt_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_CTRL_SRFC_PT;
p->target = target; // uint8_t:The system setting the commands
p->bitfieldPt = bitfieldPt; // uint16_t:Bitfield containing the PT configuration
p->target = target; // uint8_t:The system setting the commands
p->bitfieldPt = bitfieldPt; // uint16_t:Bitfield containing the PT configuration
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CTRL_SRFC_PT_LEN);
}
......@@ -47,8 +49,8 @@ static inline uint16_t mavlink_msg_ctrl_srfc_pt_pack_chan(uint8_t system_id, uin
mavlink_ctrl_srfc_pt_t *p = (mavlink_ctrl_srfc_pt_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_CTRL_SRFC_PT;
p->target = target; // uint8_t:The system setting the commands
p->bitfieldPt = bitfieldPt; // uint16_t:Bitfield containing the PT configuration
p->target = target; // uint8_t:The system setting the commands
p->bitfieldPt = bitfieldPt; // uint16_t:Bitfield containing the PT configuration
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CTRL_SRFC_PT_LEN);
}
......@@ -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,15 +3,17 @@
#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
{
float fl_1; ///< Log value 1
float fl_2; ///< Log value 2
float fl_3; ///< Log value 3
float fl_4; ///< Log value 4
float fl_5; ///< Log value 5
float fl_6; ///< Log value 6
float fl_1; ///< Log value 1
float fl_2; ///< Log value 2
float fl_3; ///< Log value 3
float fl_4; ///< Log value 4
float fl_5; ///< Log value 5
float fl_6; ///< Log value 6
} mavlink_data_log_t;
......@@ -34,12 +36,12 @@ static inline uint16_t mavlink_msg_data_log_pack(uint8_t system_id, uint8_t comp
mavlink_data_log_t *p = (mavlink_data_log_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_DATA_LOG;
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
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
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA_LOG_LEN);
}
......@@ -63,12 +65,12 @@ static inline uint16_t mavlink_msg_data_log_pack_chan(uint8_t system_id, uint8_t
mavlink_data_log_t *p = (mavlink_data_log_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_DATA_LOG;
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
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
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA_LOG_LEN);
}
......@@ -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,15 +3,17 @@
#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
{
float diagFl1; ///< Diagnostic float 1
float diagFl2; ///< Diagnostic float 2
float diagFl3; ///< Diagnostic float 3
int16_t diagSh1; ///< Diagnostic short 1
int16_t diagSh2; ///< Diagnostic short 2
int16_t diagSh3; ///< Diagnostic short 3
float diagFl1; ///< Diagnostic float 1
float diagFl2; ///< Diagnostic float 2
float diagFl3; ///< Diagnostic float 3
int16_t diagSh1; ///< Diagnostic short 1
int16_t diagSh2; ///< Diagnostic short 2
int16_t diagSh3; ///< Diagnostic short 3
} mavlink_diagnostic_t;
......@@ -34,12 +36,12 @@ static inline uint16_t mavlink_msg_diagnostic_pack(uint8_t system_id, uint8_t co
mavlink_diagnostic_t *p = (mavlink_diagnostic_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_DIAGNOSTIC;
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
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
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DIAGNOSTIC_LEN);
}
......@@ -63,12 +65,12 @@ static inline uint16_t mavlink_msg_diagnostic_pack_chan(uint8_t system_id, uint8
mavlink_diagnostic_t *p = (mavlink_diagnostic_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_DIAGNOSTIC;
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
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
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DIAGNOSTIC_LEN);
}
......@@ -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,16 +3,18 @@
#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
{
uint8_t year; ///< Year reported by Gps
uint8_t month; ///< Month reported by Gps
uint8_t day; ///< Day reported by Gps
uint8_t hour; ///< Hour reported by Gps
uint8_t min; ///< Min reported by Gps
uint8_t sec; ///< Sec reported by Gps
uint8_t visSat; ///< Visible sattelites reported by Gps
uint8_t year; ///< Year reported by Gps
uint8_t month; ///< Month reported by Gps
uint8_t day; ///< Day reported by Gps
uint8_t hour; ///< Hour reported by Gps
uint8_t min; ///< Min reported by Gps
uint8_t sec; ///< Sec reported by Gps
uint8_t visSat; ///< Visible sattelites reported by Gps
} mavlink_gps_date_time_t;
......@@ -36,13 +38,13 @@ static inline uint16_t mavlink_msg_gps_date_time_pack(uint8_t system_id, uint8_t
mavlink_gps_date_time_t *p = (mavlink_gps_date_time_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_GPS_DATE_TIME;
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
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
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN);
}
......@@ -67,13 +69,13 @@ static inline uint16_t mavlink_msg_gps_date_time_pack_chan(uint8_t system_id, ui
mavlink_gps_date_time_t *p = (mavlink_gps_date_time_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_GPS_DATE_TIME;
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
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
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN);
}
......@@ -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,13 +3,15 @@
#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
{
float hCommand; ///< Commanded Airspeed
float uCommand; ///< Log value 2
float rCommand; ///< Log value 3
uint8_t target; ///< The system setting the commands
float hCommand; ///< Commanded Airspeed
float uCommand; ///< Log value 2
float rCommand; ///< Log value 3
uint8_t target; ///< The system setting the commands
} mavlink_mid_lvl_cmds_t;
......@@ -30,10 +32,10 @@ static inline uint16_t mavlink_msg_mid_lvl_cmds_pack(uint8_t system_id, uint8_t
mavlink_mid_lvl_cmds_t *p = (mavlink_mid_lvl_cmds_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_MID_LVL_CMDS;
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
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
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MID_LVL_CMDS_LEN);
}
......@@ -55,10 +57,10 @@ static inline uint16_t mavlink_msg_mid_lvl_cmds_pack_chan(uint8_t system_id, uin
mavlink_mid_lvl_cmds_t *p = (mavlink_mid_lvl_cmds_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_MID_LVL_CMDS;
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
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
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MID_LVL_CMDS_LEN);
}
......@@ -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,15 +3,17 @@
#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
{
float axBias; ///< Accelerometer X bias (m/s)
float ayBias; ///< Accelerometer Y bias (m/s)
float azBias; ///< Accelerometer Z bias (m/s)
float gxBias; ///< Gyro X bias (rad/s)
float gyBias; ///< Gyro Y bias (rad/s)
float gzBias; ///< Gyro Z bias (rad/s)
float axBias; ///< Accelerometer X bias (m/s)
float ayBias; ///< Accelerometer Y bias (m/s)
float azBias; ///< Accelerometer Z bias (m/s)
float gxBias; ///< Gyro X bias (rad/s)
float gyBias; ///< Gyro Y bias (rad/s)
float gzBias; ///< Gyro Z bias (rad/s)
} mavlink_sensor_bias_t;
......@@ -34,12 +36,12 @@ static inline uint16_t mavlink_msg_sensor_bias_pack(uint8_t system_id, uint8_t c
mavlink_sensor_bias_t *p = (mavlink_sensor_bias_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_SENSOR_BIAS;
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)
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)
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SENSOR_BIAS_LEN);
}
......@@ -63,12 +65,12 @@ static inline uint16_t mavlink_msg_sensor_bias_pack_chan(uint8_t system_id, uint
mavlink_sensor_bias_t *p = (mavlink_sensor_bias_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_SENSOR_BIAS;
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)
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)
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SENSOR_BIAS_LEN);
}
......@@ -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,12 +3,14 @@
#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
{
uint16_t actionVal; ///< Value associated with the action
uint8_t target; ///< The system reporting the action
uint8_t actionId; ///< Action ID. See apDefinitions.h in the SLUGS /clib directory for the ID names
uint16_t actionVal; ///< Value associated with the action
uint8_t target; ///< The system reporting the action
uint8_t actionId; ///< Action ID. See apDefinitions.h in the SLUGS /clib directory for the ID names
} mavlink_slugs_action_t;
......@@ -28,9 +30,9 @@ static inline uint16_t mavlink_msg_slugs_action_pack(uint8_t system_id, uint8_t
mavlink_slugs_action_t *p = (mavlink_slugs_action_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_SLUGS_ACTION;
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
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
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SLUGS_ACTION_LEN);
}
......@@ -51,9 +53,9 @@ static inline uint16_t mavlink_msg_slugs_action_pack_chan(uint8_t system_id, uin
mavlink_slugs_action_t *p = (mavlink_slugs_action_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_SLUGS_ACTION;
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
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
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SLUGS_ACTION_LEN);
}
......@@ -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,18 +3,20 @@
#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
{
float u_m; ///< Measured Airspeed prior to the Nav Filter
float phi_c; ///< Commanded Roll
float theta_c; ///< Commanded Pitch
float psiDot_c; ///< Commanded Turn rate
float ay_body; ///< Y component of the body acceleration
float totalDist; ///< Total Distance to Run on this leg of Navigation
float dist2Go; ///< Remaining distance to Run on this leg of Navigation
uint8_t fromWP; ///< Origin WP
uint8_t toWP; ///< Destination WP
float u_m; ///< Measured Airspeed prior to the Nav Filter
float phi_c; ///< Commanded Roll
float theta_c; ///< Commanded Pitch
float psiDot_c; ///< Commanded Turn rate
float ay_body; ///< Y component of the body acceleration
float totalDist; ///< Total Distance to Run on this leg of Navigation
float dist2Go; ///< Remaining distance to Run on this leg of Navigation
uint8_t fromWP; ///< Origin WP
uint8_t toWP; ///< Destination WP
} mavlink_slugs_navigation_t;
......@@ -40,15 +42,15 @@ static inline uint16_t mavlink_msg_slugs_navigation_pack(uint8_t system_id, uint
mavlink_slugs_navigation_t *p = (mavlink_slugs_navigation_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_SLUGS_NAVIGATION;
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
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
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN);
}
......@@ -75,15 +77,15 @@ static inline uint16_t mavlink_msg_slugs_navigation_pack_chan(uint8_t system_id,
mavlink_slugs_navigation_t *p = (mavlink_slugs_navigation_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_SLUGS_NAVIGATION;
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
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
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SLUGS_NAVIGATION_LEN);
}
......@@ -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,16 +3,18 @@
#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
{
uint64_t usec; ///< Timestamp (microseconds)
float accel_0; ///< b_f[0]
float accel_1; ///< b_f[1]
float accel_2; ///< b_f[2]
float gyro_0; ///< b_f[0]
float gyro_1; ///< b_f[1]
float gyro_2; ///< b_f[2]
uint64_t usec; ///< Timestamp (microseconds)
float accel_0; ///< b_f[0]
float accel_1; ///< b_f[1]
float accel_2; ///< b_f[2]
float gyro_0; ///< b_f[0]
float gyro_1; ///< b_f[1]
float gyro_2; ///< b_f[2]
} mavlink_nav_filter_bias_t;
......@@ -36,13 +38,13 @@ static inline uint16_t mavlink_msg_nav_filter_bias_pack(uint8_t system_id, uint8
mavlink_nav_filter_bias_t *p = (mavlink_nav_filter_bias_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_NAV_FILTER_BIAS;
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]
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]
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_NAV_FILTER_BIAS_LEN);
}
......@@ -67,13 +69,13 @@ static inline uint16_t mavlink_msg_nav_filter_bias_pack_chan(uint8_t system_id,
mavlink_nav_filter_bias_t *p = (mavlink_nav_filter_bias_t *)&msg->payload[0];
msg->msgid = MAVLINK_MSG_ID_NAV_FILTER_BIAS;
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]
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]
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_NAV_FILTER_BIAS_LEN);
}
......@@ -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
......
/** @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
}
......
This diff is collapsed.
This diff is collapsed.
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