Commit 411875fd authored by LM's avatar LM
Browse files

Updated packaged files

parent 51069e06
......@@ -12,15 +12,15 @@ extern "C" {
// MESSAGE LENGTHS AND CRCS
#ifndef MAVLINK_MESSAGE_LENGTHS
#define MAVLINK_MESSAGE_LENGTHS {8, 23, 12, 8, 14, 28, 3, 32, 0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 0, 30, 26, 101, 26, 16, 32, 32, 38, 32, 0, 17, 17, 16, 18, 36, 4, 4, 2, 2, 4, 2, 2, 3, 14, 12, 18, 16, 14, 27, 25, 18, 18, 20, 20, 0, 0, 0, 26, 16, 36, 0, 6, 4, 0, 21, 18, 0, 0, 20, 20, 20, 32, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 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, 36, 30, 14, 14, 51, 5}
#define MAVLINK_MESSAGE_LENGTHS {7, 33, 12, 0, 14, 28, 3, 32, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 0, 30, 101, 22, 26, 16, 14, 28, 28, 24, 0, 22, 22, 21, 0, 36, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 18, 16, 14, 14, 27, 25, 18, 18, 20, 20, 0, 0, 26, 0, 36, 0, 6, 4, 0, 21, 18, 0, 0, 0, 20, 20, 32, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 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, 36, 30, 18, 18, 51, 9, 3}
#endif
#ifndef MAVLINK_MESSAGE_CRCS
#define MAVLINK_MESSAGE_CRCS {153, 114, 143, 191, 105, 217, 104, 119, 0, 0, 0, 186, 194, 8, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 0, 185, 222, 23, 179, 136, 66, 126, 198, 147, 0, 252, 162, 215, 229, 205, 51, 80, 101, 213, 8, 229, 21, 214, 170, 14, 73, 50, 142, 15, 3, 100, 24, 141, 148, 0, 0, 0, 183, 126, 130, 0, 148, 21, 0, 52, 124, 0, 0, 241, 20, 160, 168, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 250, 156, 0, 0, 0, 0, 0, 0, 0, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 219, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 15, 248, 63, 83, 127}
#define MAVLINK_MESSAGE_CRCS {88, 28, 137, 0, 237, 217, 104, 119, 0, 0, 0, 197, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 0, 24, 23, 170, 144, 67, 115, 39, 231, 102, 0, 244, 237, 222, 0, 205, 51, 80, 101, 213, 8, 229, 21, 214, 41, 39, 131, 50, 142, 53, 15, 3, 100, 24, 239, 238, 0, 0, 183, 0, 130, 0, 148, 21, 0, 52, 124, 0, 0, 0, 20, 160, 168, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 219, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 49, 170, 44, 83, 46, 247}
#endif
#ifndef MAVLINK_MESSAGE_INFO
#define MAVLINK_MESSAGE_INFO {MAVLINK_MESSAGE_INFO_HEARTBEAT, MAVLINK_MESSAGE_INFO_SYS_STATUS, MAVLINK_MESSAGE_INFO_SYSTEM_TIME, MAVLINK_MESSAGE_INFO_SYSTEM_TIME_UTC, MAVLINK_MESSAGE_INFO_PING, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK, MAVLINK_MESSAGE_INFO_AUTH_KEY, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, MAVLINK_MESSAGE_INFO_SET_MODE, MAVLINK_MESSAGE_INFO_SET_FLIGHT_MODE, MAVLINK_MESSAGE_INFO_SET_SAFETY_MODE, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST, MAVLINK_MESSAGE_INFO_PARAM_VALUE, MAVLINK_MESSAGE_INFO_PARAM_SET, {"EMPTY",0,{}}, MAVLINK_MESSAGE_INFO_GPS_RAW_INT, MAVLINK_MESSAGE_INFO_SCALED_IMU, MAVLINK_MESSAGE_INFO_GPS_STATUS, MAVLINK_MESSAGE_INFO_RAW_IMU, MAVLINK_MESSAGE_INFO_RAW_PRESSURE, MAVLINK_MESSAGE_INFO_ATTITUDE, MAVLINK_MESSAGE_INFO_LOCAL_POSITION, MAVLINK_MESSAGE_INFO_GPS_RAW, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION, {"EMPTY",0,{}}, MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW, MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED, MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE, MAVLINK_MESSAGE_INFO_WAYPOINT, MAVLINK_MESSAGE_INFO_WAYPOINT_REQUEST, MAVLINK_MESSAGE_INFO_WAYPOINT_SET_CURRENT, MAVLINK_MESSAGE_INFO_WAYPOINT_CURRENT, MAVLINK_MESSAGE_INFO_WAYPOINT_REQUEST_LIST, MAVLINK_MESSAGE_INFO_WAYPOINT_COUNT, MAVLINK_MESSAGE_INFO_WAYPOINT_CLEAR_ALL, MAVLINK_MESSAGE_INFO_WAYPOINT_REACHED, MAVLINK_MESSAGE_INFO_WAYPOINT_ACK, MAVLINK_MESSAGE_INFO_GPS_SET_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_GPS_LOCAL_ORIGIN_SET, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT_SET, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_SETPOINT_INT, MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_THRUST, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_SPEED_THRUST, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_THRUST_SETPOINT, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT, MAVLINK_MESSAGE_INFO_POSITION_TARGET, MAVLINK_MESSAGE_INFO_STATE_CORRECTION, {"EMPTY",0,{}}, MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM, MAVLINK_MESSAGE_INFO_DATA_STREAM, {"EMPTY",0,{}}, MAVLINK_MESSAGE_INFO_MANUAL_CONTROL, MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE, {"EMPTY",0,{}}, {"EMPTY",0,{}}, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT, MAVLINK_MESSAGE_INFO_VFR_HUD, MAVLINK_MESSAGE_INFO_COMMAND_SHORT, MAVLINK_MESSAGE_INFO_COMMAND_LONG, MAVLINK_MESSAGE_INFO_COMMAND_ACK, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, MAVLINK_MESSAGE_INFO_HIL_STATE, MAVLINK_MESSAGE_INFO_HIL_CONTROLS, MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, MAVLINK_MESSAGE_INFO_SENSOR_OFFSETS, MAVLINK_MESSAGE_INFO_SET_MAG_OFFSETS, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, MAVLINK_MESSAGE_INFO_MEMORY_VECT, MAVLINK_MESSAGE_INFO_DEBUG_VECT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT, MAVLINK_MESSAGE_INFO_STATUSTEXT, MAVLINK_MESSAGE_INFO_DEBUG}
#define MAVLINK_MESSAGE_INFO {MAVLINK_MESSAGE_INFO_HEARTBEAT, MAVLINK_MESSAGE_INFO_SYS_STATUS, MAVLINK_MESSAGE_INFO_SYSTEM_TIME, {NULL}, MAVLINK_MESSAGE_INFO_PING, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK, MAVLINK_MESSAGE_INFO_AUTH_KEY, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_SET_MODE, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST, MAVLINK_MESSAGE_INFO_PARAM_VALUE, MAVLINK_MESSAGE_INFO_PARAM_SET, {NULL}, MAVLINK_MESSAGE_INFO_GPS_RAW_INT, MAVLINK_MESSAGE_INFO_GPS_STATUS, MAVLINK_MESSAGE_INFO_SCALED_IMU, MAVLINK_MESSAGE_INFO_RAW_IMU, MAVLINK_MESSAGE_INFO_RAW_PRESSURE, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE, MAVLINK_MESSAGE_INFO_ATTITUDE, MAVLINK_MESSAGE_INFO_LOCAL_POSITION, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT, {NULL}, MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW, MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED, MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW, {NULL}, MAVLINK_MESSAGE_INFO_WAYPOINT, MAVLINK_MESSAGE_INFO_WAYPOINT_REQUEST, MAVLINK_MESSAGE_INFO_WAYPOINT_SET_CURRENT, MAVLINK_MESSAGE_INFO_WAYPOINT_CURRENT, MAVLINK_MESSAGE_INFO_WAYPOINT_REQUEST_LIST, MAVLINK_MESSAGE_INFO_WAYPOINT_COUNT, MAVLINK_MESSAGE_INFO_WAYPOINT_CLEAR_ALL, MAVLINK_MESSAGE_INFO_WAYPOINT_REACHED, MAVLINK_MESSAGE_INFO_WAYPOINT_ACK, MAVLINK_MESSAGE_INFO_SET_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_SET_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_SETPOINT_INT, MAVLINK_MESSAGE_INFO_SET_GLOBAL_POSITION_SETPOINT_INT, MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_THRUST, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_SPEED_THRUST, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_THRUST_SETPOINT, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT, {NULL}, MAVLINK_MESSAGE_INFO_STATE_CORRECTION, {NULL}, MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM, MAVLINK_MESSAGE_INFO_DATA_STREAM, {NULL}, MAVLINK_MESSAGE_INFO_MANUAL_CONTROL, MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_VFR_HUD, MAVLINK_MESSAGE_INFO_COMMAND_SHORT, MAVLINK_MESSAGE_INFO_COMMAND_LONG, MAVLINK_MESSAGE_INFO_COMMAND_ACK, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_HIL_STATE, MAVLINK_MESSAGE_INFO_HIL_CONTROLS, MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_SENSOR_OFFSETS, MAVLINK_MESSAGE_INFO_SET_MAG_OFFSETS, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_MEMORY_VECT, MAVLINK_MESSAGE_INFO_DEBUG_VECT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT, MAVLINK_MESSAGE_INFO_STATUSTEXT, MAVLINK_MESSAGE_INFO_DEBUG, MAVLINK_MESSAGE_INFO_EXTENDED_MESSAGE}
#endif
#include "../protocol.h"
......
......@@ -65,21 +65,41 @@ typedef struct __mavlink_sensor_offsets_t
static inline uint16_t mavlink_msg_sensor_offsets_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
int16_t mag_ofs_x, int16_t mag_ofs_y, int16_t mag_ofs_z, float mag_declination, int32_t raw_press, int32_t raw_temp, float gyro_cal_x, float gyro_cal_y, float gyro_cal_z, float accel_cal_x, float accel_cal_y, float accel_cal_z)
{
msg->msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS;
put_float_by_index(msg, 0, mag_declination); // magnetic declination (radians)
put_int32_t_by_index(msg, 4, raw_press); // raw pressure from barometer
put_int32_t_by_index(msg, 8, raw_temp); // raw temperature from barometer
put_float_by_index(msg, 12, gyro_cal_x); // gyro X calibration
put_float_by_index(msg, 16, gyro_cal_y); // gyro Y calibration
put_float_by_index(msg, 20, gyro_cal_z); // gyro Z calibration
put_float_by_index(msg, 24, accel_cal_x); // accel X calibration
put_float_by_index(msg, 28, accel_cal_y); // accel Y calibration
put_float_by_index(msg, 32, accel_cal_z); // accel Z calibration
put_int16_t_by_index(msg, 36, mag_ofs_x); // magnetometer X offset
put_int16_t_by_index(msg, 38, mag_ofs_y); // magnetometer Y offset
put_int16_t_by_index(msg, 40, mag_ofs_z); // magnetometer Z offset
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[42];
_mav_put_float(buf, 0, mag_declination);
_mav_put_int32_t(buf, 4, raw_press);
_mav_put_int32_t(buf, 8, raw_temp);
_mav_put_float(buf, 12, gyro_cal_x);
_mav_put_float(buf, 16, gyro_cal_y);
_mav_put_float(buf, 20, gyro_cal_z);
_mav_put_float(buf, 24, accel_cal_x);
_mav_put_float(buf, 28, accel_cal_y);
_mav_put_float(buf, 32, accel_cal_z);
_mav_put_int16_t(buf, 36, mag_ofs_x);
_mav_put_int16_t(buf, 38, mag_ofs_y);
_mav_put_int16_t(buf, 40, mag_ofs_z);
memcpy(_MAV_PAYLOAD(msg), buf, 42);
#else
mavlink_sensor_offsets_t packet;
packet.mag_declination = mag_declination;
packet.raw_press = raw_press;
packet.raw_temp = raw_temp;
packet.gyro_cal_x = gyro_cal_x;
packet.gyro_cal_y = gyro_cal_y;
packet.gyro_cal_z = gyro_cal_z;
packet.accel_cal_x = accel_cal_x;
packet.accel_cal_y = accel_cal_y;
packet.accel_cal_z = accel_cal_z;
packet.mag_ofs_x = mag_ofs_x;
packet.mag_ofs_y = mag_ofs_y;
packet.mag_ofs_z = mag_ofs_z;
memcpy(_MAV_PAYLOAD(msg), &packet, 42);
#endif
msg->msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS;
return mavlink_finalize_message(msg, system_id, component_id, 42, 134);
}
......@@ -107,21 +127,41 @@ static inline uint16_t mavlink_msg_sensor_offsets_pack_chan(uint8_t system_id, u
mavlink_message_t* msg,
int16_t mag_ofs_x,int16_t mag_ofs_y,int16_t mag_ofs_z,float mag_declination,int32_t raw_press,int32_t raw_temp,float gyro_cal_x,float gyro_cal_y,float gyro_cal_z,float accel_cal_x,float accel_cal_y,float accel_cal_z)
{
msg->msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS;
put_float_by_index(msg, 0, mag_declination); // magnetic declination (radians)
put_int32_t_by_index(msg, 4, raw_press); // raw pressure from barometer
put_int32_t_by_index(msg, 8, raw_temp); // raw temperature from barometer
put_float_by_index(msg, 12, gyro_cal_x); // gyro X calibration
put_float_by_index(msg, 16, gyro_cal_y); // gyro Y calibration
put_float_by_index(msg, 20, gyro_cal_z); // gyro Z calibration
put_float_by_index(msg, 24, accel_cal_x); // accel X calibration
put_float_by_index(msg, 28, accel_cal_y); // accel Y calibration
put_float_by_index(msg, 32, accel_cal_z); // accel Z calibration
put_int16_t_by_index(msg, 36, mag_ofs_x); // magnetometer X offset
put_int16_t_by_index(msg, 38, mag_ofs_y); // magnetometer Y offset
put_int16_t_by_index(msg, 40, mag_ofs_z); // magnetometer Z offset
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[42];
_mav_put_float(buf, 0, mag_declination);
_mav_put_int32_t(buf, 4, raw_press);
_mav_put_int32_t(buf, 8, raw_temp);
_mav_put_float(buf, 12, gyro_cal_x);
_mav_put_float(buf, 16, gyro_cal_y);
_mav_put_float(buf, 20, gyro_cal_z);
_mav_put_float(buf, 24, accel_cal_x);
_mav_put_float(buf, 28, accel_cal_y);
_mav_put_float(buf, 32, accel_cal_z);
_mav_put_int16_t(buf, 36, mag_ofs_x);
_mav_put_int16_t(buf, 38, mag_ofs_y);
_mav_put_int16_t(buf, 40, mag_ofs_z);
memcpy(_MAV_PAYLOAD(msg), buf, 42);
#else
mavlink_sensor_offsets_t packet;
packet.mag_declination = mag_declination;
packet.raw_press = raw_press;
packet.raw_temp = raw_temp;
packet.gyro_cal_x = gyro_cal_x;
packet.gyro_cal_y = gyro_cal_y;
packet.gyro_cal_z = gyro_cal_z;
packet.accel_cal_x = accel_cal_x;
packet.accel_cal_y = accel_cal_y;
packet.accel_cal_z = accel_cal_z;
packet.mag_ofs_x = mag_ofs_x;
packet.mag_ofs_y = mag_ofs_y;
packet.mag_ofs_z = mag_ofs_z;
memcpy(_MAV_PAYLOAD(msg), &packet, 42);
#endif
msg->msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 42, 134);
}
......@@ -159,23 +199,39 @@ static inline uint16_t mavlink_msg_sensor_offsets_encode(uint8_t system_id, uint
static inline void mavlink_msg_sensor_offsets_send(mavlink_channel_t chan, int16_t mag_ofs_x, int16_t mag_ofs_y, int16_t mag_ofs_z, float mag_declination, int32_t raw_press, int32_t raw_temp, float gyro_cal_x, float gyro_cal_y, float gyro_cal_z, float accel_cal_x, float accel_cal_y, float accel_cal_z)
{
MAVLINK_ALIGNED_MESSAGE(msg, 42);
msg->msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS;
put_float_by_index(msg, 0, mag_declination); // magnetic declination (radians)
put_int32_t_by_index(msg, 4, raw_press); // raw pressure from barometer
put_int32_t_by_index(msg, 8, raw_temp); // raw temperature from barometer
put_float_by_index(msg, 12, gyro_cal_x); // gyro X calibration
put_float_by_index(msg, 16, gyro_cal_y); // gyro Y calibration
put_float_by_index(msg, 20, gyro_cal_z); // gyro Z calibration
put_float_by_index(msg, 24, accel_cal_x); // accel X calibration
put_float_by_index(msg, 28, accel_cal_y); // accel Y calibration
put_float_by_index(msg, 32, accel_cal_z); // accel Z calibration
put_int16_t_by_index(msg, 36, mag_ofs_x); // magnetometer X offset
put_int16_t_by_index(msg, 38, mag_ofs_y); // magnetometer Y offset
put_int16_t_by_index(msg, 40, mag_ofs_z); // magnetometer Z offset
mavlink_finalize_message_chan_send(msg, chan, 42, 134);
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[42];
_mav_put_float(buf, 0, mag_declination);
_mav_put_int32_t(buf, 4, raw_press);
_mav_put_int32_t(buf, 8, raw_temp);
_mav_put_float(buf, 12, gyro_cal_x);
_mav_put_float(buf, 16, gyro_cal_y);
_mav_put_float(buf, 20, gyro_cal_z);
_mav_put_float(buf, 24, accel_cal_x);
_mav_put_float(buf, 28, accel_cal_y);
_mav_put_float(buf, 32, accel_cal_z);
_mav_put_int16_t(buf, 36, mag_ofs_x);
_mav_put_int16_t(buf, 38, mag_ofs_y);
_mav_put_int16_t(buf, 40, mag_ofs_z);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_OFFSETS, buf, 42, 134);
#else
mavlink_sensor_offsets_t packet;
packet.mag_declination = mag_declination;
packet.raw_press = raw_press;
packet.raw_temp = raw_temp;
packet.gyro_cal_x = gyro_cal_x;
packet.gyro_cal_y = gyro_cal_y;
packet.gyro_cal_z = gyro_cal_z;
packet.accel_cal_x = accel_cal_x;
packet.accel_cal_y = accel_cal_y;
packet.accel_cal_z = accel_cal_z;
packet.mag_ofs_x = mag_ofs_x;
packet.mag_ofs_y = mag_ofs_y;
packet.mag_ofs_z = mag_ofs_z;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENSOR_OFFSETS, (const char *)&packet, 42, 134);
#endif
}
#endif
......@@ -190,7 +246,7 @@ static inline void mavlink_msg_sensor_offsets_send(mavlink_channel_t chan, int16
*/
static inline int16_t mavlink_msg_sensor_offsets_get_mag_ofs_x(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_int16_t(msg, 36);
return _MAV_RETURN_int16_t(msg, 36);
}
/**
......@@ -200,7 +256,7 @@ static inline int16_t mavlink_msg_sensor_offsets_get_mag_ofs_x(const mavlink_mes
*/
static inline int16_t mavlink_msg_sensor_offsets_get_mag_ofs_y(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_int16_t(msg, 38);
return _MAV_RETURN_int16_t(msg, 38);
}
/**
......@@ -210,7 +266,7 @@ static inline int16_t mavlink_msg_sensor_offsets_get_mag_ofs_y(const mavlink_mes
*/
static inline int16_t mavlink_msg_sensor_offsets_get_mag_ofs_z(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_int16_t(msg, 40);
return _MAV_RETURN_int16_t(msg, 40);
}
/**
......@@ -220,7 +276,7 @@ static inline int16_t mavlink_msg_sensor_offsets_get_mag_ofs_z(const mavlink_mes
*/
static inline float mavlink_msg_sensor_offsets_get_mag_declination(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 0);
return _MAV_RETURN_float(msg, 0);
}
/**
......@@ -230,7 +286,7 @@ static inline float mavlink_msg_sensor_offsets_get_mag_declination(const mavlink
*/
static inline int32_t mavlink_msg_sensor_offsets_get_raw_press(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_int32_t(msg, 4);
return _MAV_RETURN_int32_t(msg, 4);
}
/**
......@@ -240,7 +296,7 @@ static inline int32_t mavlink_msg_sensor_offsets_get_raw_press(const mavlink_mes
*/
static inline int32_t mavlink_msg_sensor_offsets_get_raw_temp(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_int32_t(msg, 8);
return _MAV_RETURN_int32_t(msg, 8);
}
/**
......@@ -250,7 +306,7 @@ static inline int32_t mavlink_msg_sensor_offsets_get_raw_temp(const mavlink_mess
*/
static inline float mavlink_msg_sensor_offsets_get_gyro_cal_x(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 12);
return _MAV_RETURN_float(msg, 12);
}
/**
......@@ -260,7 +316,7 @@ static inline float mavlink_msg_sensor_offsets_get_gyro_cal_x(const mavlink_mess
*/
static inline float mavlink_msg_sensor_offsets_get_gyro_cal_y(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 16);
return _MAV_RETURN_float(msg, 16);
}
/**
......@@ -270,7 +326,7 @@ static inline float mavlink_msg_sensor_offsets_get_gyro_cal_y(const mavlink_mess
*/
static inline float mavlink_msg_sensor_offsets_get_gyro_cal_z(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 20);
return _MAV_RETURN_float(msg, 20);
}
/**
......@@ -280,7 +336,7 @@ static inline float mavlink_msg_sensor_offsets_get_gyro_cal_z(const mavlink_mess
*/
static inline float mavlink_msg_sensor_offsets_get_accel_cal_x(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 24);
return _MAV_RETURN_float(msg, 24);
}
/**
......@@ -290,7 +346,7 @@ static inline float mavlink_msg_sensor_offsets_get_accel_cal_x(const mavlink_mes
*/
static inline float mavlink_msg_sensor_offsets_get_accel_cal_y(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 28);
return _MAV_RETURN_float(msg, 28);
}
/**
......@@ -300,7 +356,7 @@ static inline float mavlink_msg_sensor_offsets_get_accel_cal_y(const mavlink_mes
*/
static inline float mavlink_msg_sensor_offsets_get_accel_cal_z(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 32);
return _MAV_RETURN_float(msg, 32);
}
/**
......@@ -325,6 +381,6 @@ static inline void mavlink_msg_sensor_offsets_decode(const mavlink_message_t* ms
sensor_offsets->mag_ofs_y = mavlink_msg_sensor_offsets_get_mag_ofs_y(msg);
sensor_offsets->mag_ofs_z = mavlink_msg_sensor_offsets_get_mag_ofs_z(msg);
#else
memcpy(sensor_offsets, MAVLINK_PAYLOAD(msg), 42);
memcpy(sensor_offsets, _MAV_PAYLOAD(msg), 42);
#endif
}
......@@ -44,14 +44,27 @@ typedef struct __mavlink_set_mag_offsets_t
static inline uint16_t mavlink_msg_set_mag_offsets_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target_system, uint8_t target_component, int16_t mag_ofs_x, int16_t mag_ofs_y, int16_t mag_ofs_z)
{
msg->msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS;
put_int16_t_by_index(msg, 0, mag_ofs_x); // magnetometer X offset
put_int16_t_by_index(msg, 2, mag_ofs_y); // magnetometer Y offset
put_int16_t_by_index(msg, 4, mag_ofs_z); // magnetometer Z offset
put_uint8_t_by_index(msg, 6, target_system); // System ID
put_uint8_t_by_index(msg, 7, target_component); // Component ID
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[8];
_mav_put_int16_t(buf, 0, mag_ofs_x);
_mav_put_int16_t(buf, 2, mag_ofs_y);
_mav_put_int16_t(buf, 4, mag_ofs_z);
_mav_put_uint8_t(buf, 6, target_system);
_mav_put_uint8_t(buf, 7, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 8);
#else
mavlink_set_mag_offsets_t packet;
packet.mag_ofs_x = mag_ofs_x;
packet.mag_ofs_y = mag_ofs_y;
packet.mag_ofs_z = mag_ofs_z;
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 8);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS;
return mavlink_finalize_message(msg, system_id, component_id, 8, 219);
}
......@@ -72,14 +85,27 @@ static inline uint16_t mavlink_msg_set_mag_offsets_pack_chan(uint8_t system_id,
mavlink_message_t* msg,
uint8_t target_system,uint8_t target_component,int16_t mag_ofs_x,int16_t mag_ofs_y,int16_t mag_ofs_z)
{
msg->msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS;
put_int16_t_by_index(msg, 0, mag_ofs_x); // magnetometer X offset
put_int16_t_by_index(msg, 2, mag_ofs_y); // magnetometer Y offset
put_int16_t_by_index(msg, 4, mag_ofs_z); // magnetometer Z offset
put_uint8_t_by_index(msg, 6, target_system); // System ID
put_uint8_t_by_index(msg, 7, target_component); // Component ID
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[8];
_mav_put_int16_t(buf, 0, mag_ofs_x);
_mav_put_int16_t(buf, 2, mag_ofs_y);
_mav_put_int16_t(buf, 4, mag_ofs_z);
_mav_put_uint8_t(buf, 6, target_system);
_mav_put_uint8_t(buf, 7, target_component);
memcpy(_MAV_PAYLOAD(msg), buf, 8);
#else
mavlink_set_mag_offsets_t packet;
packet.mag_ofs_x = mag_ofs_x;
packet.mag_ofs_y = mag_ofs_y;
packet.mag_ofs_z = mag_ofs_z;
packet.target_system = target_system;
packet.target_component = target_component;
memcpy(_MAV_PAYLOAD(msg), &packet, 8);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 8, 219);
}
......@@ -110,16 +136,25 @@ static inline uint16_t mavlink_msg_set_mag_offsets_encode(uint8_t system_id, uin
static inline void mavlink_msg_set_mag_offsets_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int16_t mag_ofs_x, int16_t mag_ofs_y, int16_t mag_ofs_z)
{
MAVLINK_ALIGNED_MESSAGE(msg, 8);
msg->msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS;
put_int16_t_by_index(msg, 0, mag_ofs_x); // magnetometer X offset
put_int16_t_by_index(msg, 2, mag_ofs_y); // magnetometer Y offset
put_int16_t_by_index(msg, 4, mag_ofs_z); // magnetometer Z offset
put_uint8_t_by_index(msg, 6, target_system); // System ID
put_uint8_t_by_index(msg, 7, target_component); // Component ID
mavlink_finalize_message_chan_send(msg, chan, 8, 219);
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[8];
_mav_put_int16_t(buf, 0, mag_ofs_x);
_mav_put_int16_t(buf, 2, mag_ofs_y);
_mav_put_int16_t(buf, 4, mag_ofs_z);
_mav_put_uint8_t(buf, 6, target_system);
_mav_put_uint8_t(buf, 7, target_component);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MAG_OFFSETS, buf, 8, 219);
#else
mavlink_set_mag_offsets_t packet;
packet.mag_ofs_x = mag_ofs_x;
packet.mag_ofs_y = mag_ofs_y;
packet.mag_ofs_z = mag_ofs_z;
packet.target_system = target_system;
packet.target_component = target_component;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MAG_OFFSETS, (const char *)&packet, 8, 219);
#endif
}
#endif
......@@ -134,7 +169,7 @@ static inline void mavlink_msg_set_mag_offsets_send(mavlink_channel_t chan, uint
*/
static inline uint8_t mavlink_msg_set_mag_offsets_get_target_system(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_uint8_t(msg, 6);
return _MAV_RETURN_uint8_t(msg, 6);
}
/**
......@@ -144,7 +179,7 @@ static inline uint8_t mavlink_msg_set_mag_offsets_get_target_system(const mavlin
*/
static inline uint8_t mavlink_msg_set_mag_offsets_get_target_component(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_uint8_t(msg, 7);
return _MAV_RETURN_uint8_t(msg, 7);
}
/**
......@@ -154,7 +189,7 @@ static inline uint8_t mavlink_msg_set_mag_offsets_get_target_component(const mav
*/
static inline int16_t mavlink_msg_set_mag_offsets_get_mag_ofs_x(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_int16_t(msg, 0);
return _MAV_RETURN_int16_t(msg, 0);
}
/**
......@@ -164,7 +199,7 @@ static inline int16_t mavlink_msg_set_mag_offsets_get_mag_ofs_x(const mavlink_me
*/
static inline int16_t mavlink_msg_set_mag_offsets_get_mag_ofs_y(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_int16_t(msg, 2);
return _MAV_RETURN_int16_t(msg, 2);
}
/**
......@@ -174,7 +209,7 @@ static inline int16_t mavlink_msg_set_mag_offsets_get_mag_ofs_y(const mavlink_me
*/
static inline int16_t mavlink_msg_set_mag_offsets_get_mag_ofs_z(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_int16_t(msg, 4);
return _MAV_RETURN_int16_t(msg, 4);
}
/**
......@@ -192,6 +227,6 @@ static inline void mavlink_msg_set_mag_offsets_decode(const mavlink_message_t* m
set_mag_offsets->target_system = mavlink_msg_set_mag_offsets_get_target_system(msg);
set_mag_offsets->target_component = mavlink_msg_set_mag_offsets_get_target_component(msg);
#else
memcpy(set_mag_offsets, MAVLINK_PAYLOAD(msg), 8);
memcpy(set_mag_offsets, _MAV_PAYLOAD(msg), 8);
#endif
}
......@@ -11,25 +11,25 @@ extern "C" {
#ifndef MAVLINK_TEST_ALL
#define MAVLINK_TEST_ALL
static void mavlink_test_common(uint8_t, uint8_t);
static void mavlink_test_ardupilotmega(uint8_t, uint8_t);
static void mavlink_test_common(uint8_t, uint8_t, mavlink_message_t *last_msg);
static void mavlink_test_ardupilotmega(uint8_t, uint8_t, mavlink_message_t *last_msg);
static void mavlink_test_all(uint8_t system_id, uint8_t component_id)
static void mavlink_test_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_test_common(system_id, component_id);
mavlink_test_ardupilotmega(system_id, component_id);
mavlink_test_common(system_id, component_id, last_msg);
mavlink_test_ardupilotmega(system_id, component_id, last_msg);
}
#endif
#include "../common/testsuite.h"
static void mavlink_test_sensor_offsets(uint8_t system_id, uint8_t component_id)
static void mavlink_test_sensor_offsets(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_message_t msg;
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
uint16_t i;
mavlink_sensor_offsets_t packet2, packet1 = {
mavlink_sensor_offsets_t packet_in = {
17.0,
963497672,
963497880,
......@@ -43,52 +43,107 @@ static void mavlink_test_sensor_offsets(uint8_t system_id, uint8_t component_id)
19211,
19315,
};
if (sizeof(packet2) != 42) {
packet2 = packet1; // cope with alignment within the packet
}
mavlink_sensor_offsets_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.mag_declination = packet_in.mag_declination;
packet1.raw_press = packet_in.raw_press;
packet1.raw_temp = packet_in.raw_temp;
packet1.gyro_cal_x = packet_in.gyro_cal_x;
packet1.gyro_cal_y = packet_in.gyro_cal_y;
packet1.gyro_cal_z = packet_in.gyro_cal_z;
packet1.accel_cal_x = packet_in.accel_cal_x;
packet1.accel_cal_y = packet_in.accel_cal_y;
packet1.accel_cal_z = packet_in.accel_cal_z;
packet1.mag_ofs_x = packet_in.mag_ofs_x;
packet1.mag_ofs_y = packet_in.mag_ofs_y;
packet1.mag_ofs_z = packet_in.mag_ofs_z;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_sensor_offsets_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_sensor_offsets_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_sensor_offsets_pack(system_id, component_id, &msg , packet1.mag_ofs_x , packet1.mag_ofs_y , packet1.mag_ofs_z , packet1.mag_declination , packet1.raw_press , packet1.raw_temp , packet1.gyro_cal_x , packet1.gyro_cal_y , packet1.gyro_cal_z , packet1.accel_cal_x , packet1.accel_cal_y , packet1.accel_cal_z );
mavlink_msg_sensor_offsets_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_sensor_offsets_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.mag_ofs_x , packet1.mag_ofs_y , packet1.mag_ofs_z , packet1.mag_declination , packet1.raw_press , packet1.raw_temp , packet1.gyro_cal_x , packet1.gyro_cal_y , packet1.gyro_cal_z , packet1.accel_cal_x , packet1.accel_cal_y , packet1.accel_cal_z );
mavlink_msg_sensor_offsets_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_to_send_buffer(buffer, &msg);
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
}
mavlink_msg_sensor_offsets_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_sensor_offsets_send(MAVLINK_COMM_1 , packet1.mag_ofs_x , packet1.mag_ofs_y , packet1.mag_ofs_z , packet1.mag_declination , packet1.raw_press , packet1.raw_temp , packet1.gyro_cal_x , packet1.gyro_cal_y , packet1.gyro_cal_z , packet1.accel_cal_x , packet1.accel_cal_y , packet1.accel_cal_z );
mavlink_msg_sensor_offsets_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_set_mag_offsets(uint8_t system_id, uint8_t component_id)
static void mavlink_test_set_mag_offsets(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_message_t msg;
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
uint16_t i;
mavlink_set_mag_offsets_t packet2, packet1 = {
mavlink_set_mag_offsets_t packet_in = {
17235,
17339,
17443,
151,
218,
};
if (sizeof(packet2) != 8) {
packet2 = packet1; // cope with alignment within the packet
}
mavlink_set_mag_offsets_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.mag_ofs_x = packet_in.mag_ofs_x;
packet1.mag_ofs_y = packet_in.mag_ofs_y;
packet1.mag_ofs_z = packet_in.mag_ofs_z;
packet1.target_system = packet_in.target_system;
packet1.target_component = packet_in.target_component;
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_set_mag_offsets_encode(system_id, component_id, &msg, &packet1);
mavlink_msg_set_mag_offsets_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_set_mag_offsets_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.mag_ofs_x , packet1.mag_ofs_y , packet1.mag_ofs_z );
mavlink_msg_set_mag_offsets_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_set_mag_offsets_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.mag_ofs_x , packet1.mag_ofs_y , packet1.mag_ofs_z );
mavlink_msg_set_mag_offsets_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_to_send_buffer(buffer, &msg);
for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
comm_send_ch(MAVLINK_COMM_0, buffer[i]);
}
mavlink_msg_set_mag_offsets_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_set_mag_offsets_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.mag_ofs_x , packet1.mag_ofs_y , packet1.mag_ofs_z );
mavlink_msg_set_mag_offsets_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
static void mavlink_test_ardupilotmega(uint8_t system_id, uint8_t component_id)
static void mavlink_test_ardupilotmega(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
mavlink_test_sensor_offsets(system_id, component_id);
mavlink_test_set_mag_offsets(system_id, component_id);
mavlink_test_sensor_offsets(system_id, component_id, last_msg);
mavlink_test_set_mag_offsets(system_id, component_id, last_msg);
}
#ifdef __cplusplus
......
......@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Aug 29 10:37:55 2011"
#define MAVLINK_BUILD_DATE "Wed Aug 31 10:19:04 2011"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#include "mavlink.h"
......
......@@ -64,6 +64,23 @@ static inline uint16_t crc_calculate(uint8_t* pBuffer, uint16_t length)
return crcTmp;
}
/**
* @brief Accumulate the X.25 CRC by adding an array of bytes
*
* The checksum function adds the hash of one char at a time to the
* 16 bit checksum (uint16_t).
*
* @param data new bytes to hash
* @param crcAccum the already accumulated checksum
**/
static inline void crc_accumulate_buffer(uint16_t *crcAccum, const char *pBuffer, uint8_t length)
{
const uint8_t *p = (const uint8_t *)pBuffer;
while (length--) {
crc_accumulate(*p++, crcAccum);
}
}
......
......@@ -12,15 +12,15 @@ extern "C" {
// MESSAGE LENGTHS AND CRCS
#ifndef MAVLINK_MESSAGE_LENGTHS
#define MAVLINK_MESSAGE_LENGTHS {7, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 0, 30, 101, 22, 26, 16, 14, 28, 28, 24, 0, 22, 22, 21, 0, 36, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 18, 16, 14, 14, 27, 25, 18, 18, 20, 20, 0, 0, 26, 0, 36, 0, 6, 4, 0, 21, 18, 0, 0, 0, 20, 20, 32, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 18, 18, 51, 9, 3}
#define MAVLINK_MESSAGE_LENGTHS {7, 33, 12, 0, 14, 28, 3, 32, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 0, 30, 101, 22, 26, 16, 14, 28, 28, 24, 0, 22, 22, 21, 0, 36, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 18, 16, 14, 14, 27, 25, 18, 18, 20, 20, 0, 0, 26, 0, 36, 0, 6, 4, 0, 21, 18, 0, 0, 0, 20, 20, 32, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 18, 18, 51, 9, 3}
#endif
#ifndef MAVLINK_MESSAGE_CRCS
#define MAVLINK_MESSAGE_CRCS {88, 236, 137, 0, 237, 217, 104, 119, 0, 0, 0, 197, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 0, 24, 23, 170, 144, 67, 115, 39, 231, 102, 0, 244, 237, 222, 0, 205, 51, 80, 101, 213, 8, 229, 21, 214, 41, 39, 131, 50, 142, 53, 15, 3, 100, 24, 239, 238, 0, 0, 183, 0, 130, 0, 148, 21, 0, 52, 124, 0, 0, 0, 20, 160, 168, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 49, 170, 44, 83, 46, 247}
#define MAVLINK_MESSAGE_CRCS {88, 28, 137, 0, 237, 217, 104, 119, 0, 0, 0, 197, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 0, 24, 23, 170, 144, 67, 115, 39, 231, 102, 0, 244, 237, 222, 0, 205, 51, 80, 101, 213, 8, 229, 21, 214, 41, 39, 131, 50, 142, 53, 15, 3, 100, 24, 239, 238, 0, 0, 183, 0, 130, 0, 148, 21, 0, 52, 124, 0, 0, 0, 20, 160, 168, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 49, 170, 44, 83, 46, 247}
#endif
#ifndef MAVLINK_MESSAGE_INFO
#define MAVLINK_MESSAGE_INFO {MAVLINK_MESSAGE_INFO_HEARTBEAT, MAVLINK_MESSAGE_INFO_SYS_STATUS, MAVLINK_MESSAGE_INFO_SYSTEM_TIME, {"EMPTY",0,{}}, MAVLINK_MESSAGE_INFO_PING, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK, MAVLINK_MESSAGE_INFO_AUTH_KEY, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, MAVLINK_MESSAGE_INFO_SET_MODE, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST, MAVLINK_MESSAGE_INFO_PARAM_VALUE, MAVLINK_MESSAGE_INFO_PARAM_SET, {"EMPTY",0,{}}, MAVLINK_MESSAGE_INFO_GPS_RAW_INT, MAVLINK_MESSAGE_INFO_GPS_STATUS, MAVLINK_MESSAGE_INFO_SCALED_IMU, MAVLINK_MESSAGE_INFO_RAW_IMU, MAVLINK_MESSAGE_INFO_RAW_PRESSURE, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE, MAVLINK_MESSAGE_INFO_ATTITUDE, MAVLINK_MESSAGE_INFO_LOCAL_POSITION, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT, {"EMPTY",0,{}}, MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW, MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED, MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW, {"EMPTY",0,{}}, MAVLINK_MESSAGE_INFO_WAYPOINT, MAVLINK_MESSAGE_INFO_WAYPOINT_REQUEST, MAVLINK_MESSAGE_INFO_WAYPOINT_SET_CURRENT, MAVLINK_MESSAGE_INFO_WAYPOINT_CURRENT, MAVLINK_MESSAGE_INFO_WAYPOINT_REQUEST_LIST, MAVLINK_MESSAGE_INFO_WAYPOINT_COUNT, MAVLINK_MESSAGE_INFO_WAYPOINT_CLEAR_ALL, MAVLINK_MESSAGE_INFO_WAYPOINT_REACHED, MAVLINK_MESSAGE_INFO_WAYPOINT_ACK, MAVLINK_MESSAGE_INFO_SET_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_SET_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_SETPOINT_INT, MAVLINK_MESSAGE_INFO_SET_GLOBAL_POSITION_SETPOINT_INT, MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_THRUST, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_SPEED_THRUST, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_THRUST_SETPOINT, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, {"EMPTY",0,{}}, {"EMPTY",0,{}}, MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT, {"EMPTY",0,{}}, MAVLINK_MESSAGE_INFO_STATE_CORRECTION, {"EMPTY",0,{}}, MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM, MAVLINK_MESSAGE_INFO_DATA_STREAM, {"EMPTY",0,{}}, MAVLINK_MESSAGE_INFO_MANUAL_CONTROL, MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, MAVLINK_MESSAGE_INFO_VFR_HUD, MAVLINK_MESSAGE_INFO_COMMAND_SHORT, MAVLINK_MESSAGE_INFO_COMMAND_LONG, MAVLINK_MESSAGE_INFO_COMMAND_ACK, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, MAVLINK_MESSAGE_INFO_HIL_STATE, MAVLINK_MESSAGE_INFO_HIL_CONTROLS, MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, {"EMPTY",0,{}}, MAVLINK_MESSAGE_INFO_MEMORY_VECT, MAVLINK_MESSAGE_INFO_DEBUG_VECT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT, MAVLINK_MESSAGE_INFO_STATUSTEXT, MAVLINK_MESSAGE_INFO_DEBUG, MAVLINK_MESSAGE_INFO_EXTENDED_MESSAGE}
#define MAVLINK_MESSAGE_INFO {MAVLINK_MESSAGE_INFO_HEARTBEAT, MAVLINK_MESSAGE_INFO_SYS_STATUS, MAVLINK_MESSAGE_INFO_SYSTEM_TIME, {NULL}, MAVLINK_MESSAGE_INFO_PING, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL, MAVLINK_MESSAGE_INFO_CHANGE_OPERATOR_CONTROL_ACK, MAVLINK_MESSAGE_INFO_AUTH_KEY, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_SET_MODE, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST, MAVLINK_MESSAGE_INFO_PARAM_VALUE, MAVLINK_MESSAGE_INFO_PARAM_SET, {NULL}, MAVLINK_MESSAGE_INFO_GPS_RAW_INT, MAVLINK_MESSAGE_INFO_GPS_STATUS, MAVLINK_MESSAGE_INFO_SCALED_IMU, MAVLINK_MESSAGE_INFO_RAW_IMU, MAVLINK_MESSAGE_INFO_RAW_PRESSURE, MAVLINK_MESSAGE_INFO_SCALED_PRESSURE, MAVLINK_MESSAGE_INFO_ATTITUDE, MAVLINK_MESSAGE_INFO_LOCAL_POSITION, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT, {NULL}, MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW, MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED, MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW, {NULL}, MAVLINK_MESSAGE_INFO_WAYPOINT, MAVLINK_MESSAGE_INFO_WAYPOINT_REQUEST, MAVLINK_MESSAGE_INFO_WAYPOINT_SET_CURRENT, MAVLINK_MESSAGE_INFO_WAYPOINT_CURRENT, MAVLINK_MESSAGE_INFO_WAYPOINT_REQUEST_LIST, MAVLINK_MESSAGE_INFO_WAYPOINT_COUNT, MAVLINK_MESSAGE_INFO_WAYPOINT_CLEAR_ALL, MAVLINK_MESSAGE_INFO_WAYPOINT_REACHED, MAVLINK_MESSAGE_INFO_WAYPOINT_ACK, MAVLINK_MESSAGE_INFO_SET_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_GPS_GLOBAL_ORIGIN, MAVLINK_MESSAGE_INFO_SET_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_SETPOINT, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_SETPOINT_INT, MAVLINK_MESSAGE_INFO_SET_GLOBAL_POSITION_SETPOINT_INT, MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_THRUST, MAVLINK_MESSAGE_INFO_SET_ROLL_PITCH_YAW_SPEED_THRUST, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_THRUST_SETPOINT, MAVLINK_MESSAGE_INFO_ROLL_PITCH_YAW_SPEED_THRUST_SETPOINT, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT, {NULL}, MAVLINK_MESSAGE_INFO_STATE_CORRECTION, {NULL}, MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM, MAVLINK_MESSAGE_INFO_DATA_STREAM, {NULL}, MAVLINK_MESSAGE_INFO_MANUAL_CONTROL, MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_VFR_HUD, MAVLINK_MESSAGE_INFO_COMMAND_SHORT, MAVLINK_MESSAGE_INFO_COMMAND_LONG, MAVLINK_MESSAGE_INFO_COMMAND_ACK, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_HIL_STATE, MAVLINK_MESSAGE_INFO_HIL_CONTROLS, MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, MAVLINK_MESSAGE_INFO_MEMORY_VECT, MAVLINK_MESSAGE_INFO_DEBUG_VECT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT, MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT, MAVLINK_MESSAGE_INFO_STATUSTEXT, MAVLINK_MESSAGE_INFO_DEBUG, MAVLINK_MESSAGE_INFO_EXTENDED_MESSAGE}
#endif
#include "../protocol.h"
......
......@@ -50,16 +50,31 @@ typedef struct __mavlink_attitude_t
static inline uint16_t mavlink_msg_attitude_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint32_t time_boot_ms, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed)
{
msg->msgid = MAVLINK_MSG_ID_ATTITUDE;
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[28];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_float(buf, 4, roll);
_mav_put_float(buf, 8, pitch);
_mav_put_float(buf, 12, yaw);
_mav_put_float(buf, 16, rollspeed);
_mav_put_float(buf, 20, pitchspeed);
_mav_put_float(buf, 24, yawspeed);
memcpy(_MAV_PAYLOAD(msg), buf, 28);
#else
mavlink_attitude_t packet;
packet.time_boot_ms = time_boot_ms;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.rollspeed = rollspeed;
packet.pitchspeed = pitchspeed;
packet.yawspeed = yawspeed;
put_uint32_t_by_index(msg, 0, time_boot_ms); // Timestamp (milliseconds since system boot)
put_float_by_index(msg, 4, roll); // Roll angle (rad)
put_float_by_index(msg, 8, pitch); // Pitch angle (rad)
put_float_by_index(msg, 12, yaw); // Yaw angle (rad)
put_float_by_index(msg, 16, rollspeed); // Roll angular speed (rad/s)
put_float_by_index(msg, 20, pitchspeed); // Pitch angular speed (rad/s)
put_float_by_index(msg, 24, yawspeed); // Yaw angular speed (rad/s)
memcpy(_MAV_PAYLOAD(msg), &packet, 28);
#endif
msg->msgid = MAVLINK_MSG_ID_ATTITUDE;
return mavlink_finalize_message(msg, system_id, component_id, 28, 39);
}
......@@ -82,16 +97,31 @@ static inline uint16_t mavlink_msg_attitude_pack_chan(uint8_t system_id, uint8_t
mavlink_message_t* msg,
uint32_t time_boot_ms,float roll,float pitch,float yaw,float rollspeed,float pitchspeed,float yawspeed)
{
msg->msgid = MAVLINK_MSG_ID_ATTITUDE;
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[28];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_float(buf, 4, roll);
_mav_put_float(buf, 8, pitch);
_mav_put_float(buf, 12, yaw);
_mav_put_float(buf, 16, rollspeed);
_mav_put_float(buf, 20, pitchspeed);
_mav_put_float(buf, 24, yawspeed);
put_uint32_t_by_index(msg, 0, time_boot_ms); // Timestamp (milliseconds since system boot)
put_float_by_index(msg, 4, roll); // Roll angle (rad)
put_float_by_index(msg, 8, pitch); // Pitch angle (rad)
put_float_by_index(msg, 12, yaw); // Yaw angle (rad)
put_float_by_index(msg, 16, rollspeed); // Roll angular speed (rad/s)
put_float_by_index(msg, 20, pitchspeed); // Pitch angular speed (rad/s)
put_float_by_index(msg, 24, yawspeed); // Yaw angular speed (rad/s)
memcpy(_MAV_PAYLOAD(msg), buf, 28);
#else
mavlink_attitude_t packet;
packet.time_boot_ms = time_boot_ms;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.rollspeed = rollspeed;
packet.pitchspeed = pitchspeed;
packet.yawspeed = yawspeed;
memcpy(_MAV_PAYLOAD(msg), &packet, 28);
#endif
msg->msgid = MAVLINK_MSG_ID_ATTITUDE;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 28, 39);
}
......@@ -124,18 +154,29 @@ static inline uint16_t mavlink_msg_attitude_encode(uint8_t system_id, uint8_t co
static inline void mavlink_msg_attitude_send(mavlink_channel_t chan, uint32_t time_boot_ms, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed)
{
MAVLINK_ALIGNED_MESSAGE(msg, 28);
msg->msgid = MAVLINK_MSG_ID_ATTITUDE;
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[28];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_float(buf, 4, roll);
_mav_put_float(buf, 8, pitch);
_mav_put_float(buf, 12, yaw);
_mav_put_float(buf, 16, rollspeed);
_mav_put_float(buf, 20, pitchspeed);
_mav_put_float(buf, 24, yawspeed);
put_uint32_t_by_index(msg, 0, time_boot_ms); // Timestamp (milliseconds since system boot)
put_float_by_index(msg, 4, roll); // Roll angle (rad)
put_float_by_index(msg, 8, pitch); // Pitch angle (rad)
put_float_by_index(msg, 12, yaw); // Yaw angle (rad)
put_float_by_index(msg, 16, rollspeed); // Roll angular speed (rad/s)
put_float_by_index(msg, 20, pitchspeed); // Pitch angular speed (rad/s)
put_float_by_index(msg, 24, yawspeed); // Yaw angular speed (rad/s)
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, buf, 28, 39);
#else
mavlink_attitude_t packet;
packet.time_boot_ms = time_boot_ms;
packet.roll = roll;
packet.pitch = pitch;
packet.yaw = yaw;
packet.rollspeed = rollspeed;
packet.pitchspeed = pitchspeed;
packet.yawspeed = yawspeed;
mavlink_finalize_message_chan_send(msg, chan, 28, 39);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE, (const char *)&packet, 28, 39);
#endif
}
#endif
......@@ -150,7 +191,7 @@ static inline void mavlink_msg_attitude_send(mavlink_channel_t chan, uint32_t ti
*/
static inline uint32_t mavlink_msg_attitude_get_time_boot_ms(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_uint32_t(msg, 0);
return _MAV_RETURN_uint32_t(msg, 0);
}
/**
......@@ -160,7 +201,7 @@ static inline uint32_t mavlink_msg_attitude_get_time_boot_ms(const mavlink_messa
*/
static inline float mavlink_msg_attitude_get_roll(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 4);
return _MAV_RETURN_float(msg, 4);
}
/**
......@@ -170,7 +211,7 @@ static inline float mavlink_msg_attitude_get_roll(const mavlink_message_t* msg)
*/
static inline float mavlink_msg_attitude_get_pitch(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 8);
return _MAV_RETURN_float(msg, 8);
}
/**
......@@ -180,7 +221,7 @@ static inline float mavlink_msg_attitude_get_pitch(const mavlink_message_t* msg)
*/
static inline float mavlink_msg_attitude_get_yaw(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 12);
return _MAV_RETURN_float(msg, 12);
}
/**
......@@ -190,7 +231,7 @@ static inline float mavlink_msg_attitude_get_yaw(const mavlink_message_t* msg)
*/
static inline float mavlink_msg_attitude_get_rollspeed(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 16);
return _MAV_RETURN_float(msg, 16);
}
/**
......@@ -200,7 +241,7 @@ static inline float mavlink_msg_attitude_get_rollspeed(const mavlink_message_t*
*/
static inline float mavlink_msg_attitude_get_pitchspeed(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 20);
return _MAV_RETURN_float(msg, 20);
}
/**
......@@ -210,7 +251,7 @@ static inline float mavlink_msg_attitude_get_pitchspeed(const mavlink_message_t*
*/
static inline float mavlink_msg_attitude_get_yawspeed(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 24);
return _MAV_RETURN_float(msg, 24);
}
/**
......@@ -230,6 +271,6 @@ static inline void mavlink_msg_attitude_decode(const mavlink_message_t* msg, mav
attitude->pitchspeed = mavlink_msg_attitude_get_pitchspeed(msg);
attitude->yawspeed = mavlink_msg_attitude_get_yawspeed(msg);
#else
memcpy(attitude, MAVLINK_PAYLOAD(msg), 28);
memcpy(attitude, _MAV_PAYLOAD(msg), 28);
#endif
}
......@@ -32,10 +32,19 @@ typedef struct __mavlink_auth_key_t
static inline uint16_t mavlink_msg_auth_key_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const char *key)
{
msg->msgid = MAVLINK_MSG_ID_AUTH_KEY;
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
_mav_put_char_array(buf, 0, key, 32);
memcpy(_MAV_PAYLOAD(msg), buf, 32);
#else
mavlink_auth_key_t packet;
put_char_array_by_index(msg, 0, key, 32); // key
memcpy(packet.key, key, sizeof(char)*32);
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_AUTH_KEY;
return mavlink_finalize_message(msg, system_id, component_id, 32, 119);
}
......@@ -52,10 +61,19 @@ static inline uint16_t mavlink_msg_auth_key_pack_chan(uint8_t system_id, uint8_t
mavlink_message_t* msg,
const char *key)
{
msg->msgid = MAVLINK_MSG_ID_AUTH_KEY;
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
put_char_array_by_index(msg, 0, key, 32); // key
_mav_put_char_array(buf, 0, key, 32);
memcpy(_MAV_PAYLOAD(msg), buf, 32);
#else
mavlink_auth_key_t packet;
memcpy(packet.key, key, sizeof(char)*32);
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_AUTH_KEY;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 32, 119);
}
......@@ -82,12 +100,17 @@ static inline uint16_t mavlink_msg_auth_key_encode(uint8_t system_id, uint8_t co
static inline void mavlink_msg_auth_key_send(mavlink_channel_t chan, const char *key)
{
MAVLINK_ALIGNED_MESSAGE(msg, 32);
msg->msgid = MAVLINK_MSG_ID_AUTH_KEY;
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
put_char_array_by_index(msg, 0, key, 32); // key
_mav_put_char_array(buf, 0, key, 32);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, buf, 32, 119);
#else
mavlink_auth_key_t packet;
mavlink_finalize_message_chan_send(msg, chan, 32, 119);
memcpy(packet.key, key, sizeof(char)*32);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, (const char *)&packet, 32, 119);
#endif
}
#endif
......@@ -102,7 +125,7 @@ static inline void mavlink_msg_auth_key_send(mavlink_channel_t chan, const char
*/
static inline uint16_t mavlink_msg_auth_key_get_key(const mavlink_message_t* msg, char *key)
{
return MAVLINK_MSG_RETURN_char_array(msg, key, 32, 0);
return _MAV_RETURN_char_array(msg, key, 32, 0);
}
/**
......@@ -116,6 +139,6 @@ static inline void mavlink_msg_auth_key_decode(const mavlink_message_t* msg, mav
#if MAVLINK_NEED_BYTE_SWAP
mavlink_msg_auth_key_get_key(msg, auth_key->key);
#else
memcpy(auth_key, MAVLINK_PAYLOAD(msg), 32);
memcpy(auth_key, _MAV_PAYLOAD(msg), 32);
#endif
}
......@@ -41,13 +41,23 @@ typedef struct __mavlink_change_operator_control_t
static inline uint16_t mavlink_msg_change_operator_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target_system, uint8_t control_request, uint8_t version, const char *passkey)
{
msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL;
put_uint8_t_by_index(msg, 0, target_system); // System the GCS requests control for
put_uint8_t_by_index(msg, 1, control_request); // 0: request control of this MAV, 1: Release control of this MAV
put_uint8_t_by_index(msg, 2, version); // 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch.
put_char_array_by_index(msg, 3, passkey, 25); // Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-"
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[28];
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, control_request);
_mav_put_uint8_t(buf, 2, version);
_mav_put_char_array(buf, 3, passkey, 25);
memcpy(_MAV_PAYLOAD(msg), buf, 28);
#else
mavlink_change_operator_control_t packet;
packet.target_system = target_system;
packet.control_request = control_request;
packet.version = version;
memcpy(packet.passkey, passkey, sizeof(char)*25);
memcpy(_MAV_PAYLOAD(msg), &packet, 28);
#endif
msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL;
return mavlink_finalize_message(msg, system_id, component_id, 28, 217);
}
......@@ -67,13 +77,23 @@ static inline uint16_t mavlink_msg_change_operator_control_pack_chan(uint8_t sys
mavlink_message_t* msg,
uint8_t target_system,uint8_t control_request,uint8_t version,const char *passkey)
{
msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL;
put_uint8_t_by_index(msg, 0, target_system); // System the GCS requests control for
put_uint8_t_by_index(msg, 1, control_request); // 0: request control of this MAV, 1: Release control of this MAV
put_uint8_t_by_index(msg, 2, version); // 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch.
put_char_array_by_index(msg, 3, passkey, 25); // Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-"
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[28];
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, control_request);
_mav_put_uint8_t(buf, 2, version);
_mav_put_char_array(buf, 3, passkey, 25);
memcpy(_MAV_PAYLOAD(msg), buf, 28);
#else
mavlink_change_operator_control_t packet;
packet.target_system = target_system;
packet.control_request = control_request;
packet.version = version;
memcpy(packet.passkey, passkey, sizeof(char)*25);
memcpy(_MAV_PAYLOAD(msg), &packet, 28);
#endif
msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 28, 217);
}
......@@ -103,15 +123,21 @@ static inline uint16_t mavlink_msg_change_operator_control_encode(uint8_t system
static inline void mavlink_msg_change_operator_control_send(mavlink_channel_t chan, uint8_t target_system, uint8_t control_request, uint8_t version, const char *passkey)
{
MAVLINK_ALIGNED_MESSAGE(msg, 28);
msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL;
put_uint8_t_by_index(msg, 0, target_system); // System the GCS requests control for
put_uint8_t_by_index(msg, 1, control_request); // 0: request control of this MAV, 1: Release control of this MAV
put_uint8_t_by_index(msg, 2, version); // 0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch.
put_char_array_by_index(msg, 3, passkey, 25); // Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and "!?,.-"
mavlink_finalize_message_chan_send(msg, chan, 28, 217);
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[28];
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, control_request);
_mav_put_uint8_t(buf, 2, version);
_mav_put_char_array(buf, 3, passkey, 25);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, buf, 28, 217);
#else
mavlink_change_operator_control_t packet;
packet.target_system = target_system;
packet.control_request = control_request;
packet.version = version;
memcpy(packet.passkey, passkey, sizeof(char)*25);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL, (const char *)&packet, 28, 217);
#endif
}
#endif
......@@ -126,7 +152,7 @@ static inline void mavlink_msg_change_operator_control_send(mavlink_channel_t ch
*/
static inline uint8_t mavlink_msg_change_operator_control_get_target_system(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_uint8_t(msg, 0);
return _MAV_RETURN_uint8_t(msg, 0);
}
/**
......@@ -136,7 +162,7 @@ static inline uint8_t mavlink_msg_change_operator_control_get_target_system(cons
*/
static inline uint8_t mavlink_msg_change_operator_control_get_control_request(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_uint8_t(msg, 1);
return _MAV_RETURN_uint8_t(msg, 1);
}
/**
......@@ -146,7 +172,7 @@ static inline uint8_t mavlink_msg_change_operator_control_get_control_request(co
*/
static inline uint8_t mavlink_msg_change_operator_control_get_version(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_uint8_t(msg, 2);
return _MAV_RETURN_uint8_t(msg, 2);
}
/**
......@@ -156,7 +182,7 @@ static inline uint8_t mavlink_msg_change_operator_control_get_version(const mavl
*/
static inline uint16_t mavlink_msg_change_operator_control_get_passkey(const mavlink_message_t* msg, char *passkey)
{
return MAVLINK_MSG_RETURN_char_array(msg, passkey, 25, 3);
return _MAV_RETURN_char_array(msg, passkey, 25, 3);
}
/**
......@@ -173,6 +199,6 @@ static inline void mavlink_msg_change_operator_control_decode(const mavlink_mess
change_operator_control->version = mavlink_msg_change_operator_control_get_version(msg);
mavlink_msg_change_operator_control_get_passkey(msg, change_operator_control->passkey);
#else
memcpy(change_operator_control, MAVLINK_PAYLOAD(msg), 28);
memcpy(change_operator_control, _MAV_PAYLOAD(msg), 28);
#endif
}
......@@ -38,12 +38,23 @@ typedef struct __mavlink_change_operator_control_ack_t
static inline uint16_t mavlink_msg_change_operator_control_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t gcs_system_id, uint8_t control_request, uint8_t ack)
{
msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK;
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[3];
_mav_put_uint8_t(buf, 0, gcs_system_id);
_mav_put_uint8_t(buf, 1, control_request);
_mav_put_uint8_t(buf, 2, ack);
memcpy(_MAV_PAYLOAD(msg), buf, 3);
#else
mavlink_change_operator_control_ack_t packet;
packet.gcs_system_id = gcs_system_id;
packet.control_request = control_request;
packet.ack = ack;
put_uint8_t_by_index(msg, 0, gcs_system_id); // ID of the GCS this message
put_uint8_t_by_index(msg, 1, control_request); // 0: request control of this MAV, 1: Release control of this MAV
put_uint8_t_by_index(msg, 2, ack); // 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control
memcpy(_MAV_PAYLOAD(msg), &packet, 3);
#endif
msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK;
return mavlink_finalize_message(msg, system_id, component_id, 3, 104);
}
......@@ -62,12 +73,23 @@ static inline uint16_t mavlink_msg_change_operator_control_ack_pack_chan(uint8_t
mavlink_message_t* msg,
uint8_t gcs_system_id,uint8_t control_request,uint8_t ack)
{
msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK;
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[3];
_mav_put_uint8_t(buf, 0, gcs_system_id);
_mav_put_uint8_t(buf, 1, control_request);
_mav_put_uint8_t(buf, 2, ack);
put_uint8_t_by_index(msg, 0, gcs_system_id); // ID of the GCS this message
put_uint8_t_by_index(msg, 1, control_request); // 0: request control of this MAV, 1: Release control of this MAV
put_uint8_t_by_index(msg, 2, ack); // 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control
memcpy(_MAV_PAYLOAD(msg), buf, 3);
#else
mavlink_change_operator_control_ack_t packet;
packet.gcs_system_id = gcs_system_id;
packet.control_request = control_request;
packet.ack = ack;
memcpy(_MAV_PAYLOAD(msg), &packet, 3);
#endif
msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3, 104);
}
......@@ -96,14 +118,21 @@ static inline uint16_t mavlink_msg_change_operator_control_ack_encode(uint8_t sy
static inline void mavlink_msg_change_operator_control_ack_send(mavlink_channel_t chan, uint8_t gcs_system_id, uint8_t control_request, uint8_t ack)
{
MAVLINK_ALIGNED_MESSAGE(msg, 3);
msg->msgid = MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK;
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[3];
_mav_put_uint8_t(buf, 0, gcs_system_id);
_mav_put_uint8_t(buf, 1, control_request);
_mav_put_uint8_t(buf, 2, ack);
put_uint8_t_by_index(msg, 0, gcs_system_id); // ID of the GCS this message
put_uint8_t_by_index(msg, 1, control_request); // 0: request control of this MAV, 1: Release control of this MAV
put_uint8_t_by_index(msg, 2, ack); // 0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, buf, 3, 104);
#else
mavlink_change_operator_control_ack_t packet;
packet.gcs_system_id = gcs_system_id;
packet.control_request = control_request;
packet.ack = ack;
mavlink_finalize_message_chan_send(msg, chan, 3, 104);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK, (const char *)&packet, 3, 104);
#endif
}
#endif
......@@ -118,7 +147,7 @@ static inline void mavlink_msg_change_operator_control_ack_send(mavlink_channel_
*/
static inline uint8_t mavlink_msg_change_operator_control_ack_get_gcs_system_id(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_uint8_t(msg, 0);
return _MAV_RETURN_uint8_t(msg, 0);
}
/**
......@@ -128,7 +157,7 @@ static inline uint8_t mavlink_msg_change_operator_control_ack_get_gcs_system_id(
*/
static inline uint8_t mavlink_msg_change_operator_control_ack_get_control_request(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_uint8_t(msg, 1);
return _MAV_RETURN_uint8_t(msg, 1);
}
/**
......@@ -138,7 +167,7 @@ static inline uint8_t mavlink_msg_change_operator_control_ack_get_control_reques
*/
static inline uint8_t mavlink_msg_change_operator_control_ack_get_ack(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_uint8_t(msg, 2);
return _MAV_RETURN_uint8_t(msg, 2);
}
/**
......@@ -154,6 +183,6 @@ static inline void mavlink_msg_change_operator_control_ack_decode(const mavlink_
change_operator_control_ack->control_request = mavlink_msg_change_operator_control_ack_get_control_request(msg);
change_operator_control_ack->ack = mavlink_msg_change_operator_control_ack_get_ack(msg);
#else
memcpy(change_operator_control_ack, MAVLINK_PAYLOAD(msg), 3);
memcpy(change_operator_control_ack, _MAV_PAYLOAD(msg), 3);
#endif
}
......@@ -35,11 +35,21 @@ typedef struct __mavlink_command_ack_t
static inline uint16_t mavlink_msg_command_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
float command, float result)
{
msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK;
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[8];
_mav_put_float(buf, 0, command);
_mav_put_float(buf, 4, result);
memcpy(_MAV_PAYLOAD(msg), buf, 8);
#else
mavlink_command_ack_t packet;
packet.command = command;
packet.result = result;
put_float_by_index(msg, 0, command); // Current airspeed in m/s
put_float_by_index(msg, 4, result); // 1: Action ACCEPTED and EXECUTED, 1: Action TEMPORARY REJECTED/DENIED, 2: Action PERMANENTLY DENIED, 3: Action UNKNOWN/UNSUPPORTED, 4: Requesting CONFIRMATION
memcpy(_MAV_PAYLOAD(msg), &packet, 8);
#endif
msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK;
return mavlink_finalize_message(msg, system_id, component_id, 8, 8);
}
......@@ -57,11 +67,21 @@ static inline uint16_t mavlink_msg_command_ack_pack_chan(uint8_t system_id, uint
mavlink_message_t* msg,
float command,float result)
{
msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK;
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[8];
_mav_put_float(buf, 0, command);
_mav_put_float(buf, 4, result);
put_float_by_index(msg, 0, command); // Current airspeed in m/s
put_float_by_index(msg, 4, result); // 1: Action ACCEPTED and EXECUTED, 1: Action TEMPORARY REJECTED/DENIED, 2: Action PERMANENTLY DENIED, 3: Action UNKNOWN/UNSUPPORTED, 4: Requesting CONFIRMATION
memcpy(_MAV_PAYLOAD(msg), buf, 8);
#else
mavlink_command_ack_t packet;
packet.command = command;
packet.result = result;
memcpy(_MAV_PAYLOAD(msg), &packet, 8);
#endif
msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 8, 8);
}
......@@ -89,13 +109,19 @@ static inline uint16_t mavlink_msg_command_ack_encode(uint8_t system_id, uint8_t
static inline void mavlink_msg_command_ack_send(mavlink_channel_t chan, float command, float result)
{
MAVLINK_ALIGNED_MESSAGE(msg, 8);
msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK;
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[8];
_mav_put_float(buf, 0, command);
_mav_put_float(buf, 4, result);
put_float_by_index(msg, 0, command); // Current airspeed in m/s
put_float_by_index(msg, 4, result); // 1: Action ACCEPTED and EXECUTED, 1: Action TEMPORARY REJECTED/DENIED, 2: Action PERMANENTLY DENIED, 3: Action UNKNOWN/UNSUPPORTED, 4: Requesting CONFIRMATION
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, buf, 8, 8);
#else
mavlink_command_ack_t packet;
packet.command = command;
packet.result = result;
mavlink_finalize_message_chan_send(msg, chan, 8, 8);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, (const char *)&packet, 8, 8);
#endif
}
#endif
......@@ -110,7 +136,7 @@ static inline void mavlink_msg_command_ack_send(mavlink_channel_t chan, float co
*/
static inline float mavlink_msg_command_ack_get_command(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 0);
return _MAV_RETURN_float(msg, 0);
}
/**
......@@ -120,7 +146,7 @@ static inline float mavlink_msg_command_ack_get_command(const mavlink_message_t*
*/
static inline float mavlink_msg_command_ack_get_result(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 4);
return _MAV_RETURN_float(msg, 4);
}
/**
......@@ -135,6 +161,6 @@ static inline void mavlink_msg_command_ack_decode(const mavlink_message_t* msg,
command_ack->command = mavlink_msg_command_ack_get_command(msg);
command_ack->result = mavlink_msg_command_ack_get_result(msg);
#else
memcpy(command_ack, MAVLINK_PAYLOAD(msg), 8);
memcpy(command_ack, _MAV_PAYLOAD(msg), 8);
#endif
}
......@@ -62,20 +62,39 @@ typedef struct __mavlink_command_long_t
static inline uint16_t mavlink_msg_command_long_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target_system, uint8_t target_component, uint8_t command, uint8_t confirmation, float param1, float param2, float param3, float param4, float param5, float param6, float param7)
{
msg->msgid = MAVLINK_MSG_ID_COMMAND_LONG;
put_float_by_index(msg, 0, param1); // Parameter 1, as defined by MAV_CMD enum.
put_float_by_index(msg, 4, param2); // Parameter 2, as defined by MAV_CMD enum.
put_float_by_index(msg, 8, param3); // Parameter 3, as defined by MAV_CMD enum.
put_float_by_index(msg, 12, param4); // Parameter 4, as defined by MAV_CMD enum.
put_float_by_index(msg, 16, param5); // Parameter 5, as defined by MAV_CMD enum.
put_float_by_index(msg, 20, param6); // Parameter 6, as defined by MAV_CMD enum.
put_float_by_index(msg, 24, param7); // Parameter 7, as defined by MAV_CMD enum.
put_uint8_t_by_index(msg, 28, target_system); // System which should execute the command
put_uint8_t_by_index(msg, 29, target_component); // Component which should execute the command, 0 for all components
put_uint8_t_by_index(msg, 30, command); // Command ID, as defined by MAV_CMD enum.
put_uint8_t_by_index(msg, 31, confirmation); // 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
_mav_put_float(buf, 0, param1);
_mav_put_float(buf, 4, param2);
_mav_put_float(buf, 8, param3);
_mav_put_float(buf, 12, param4);
_mav_put_float(buf, 16, param5);
_mav_put_float(buf, 20, param6);
_mav_put_float(buf, 24, param7);
_mav_put_uint8_t(buf, 28, target_system);
_mav_put_uint8_t(buf, 29, target_component);
_mav_put_uint8_t(buf, 30, command);
_mav_put_uint8_t(buf, 31, confirmation);
memcpy(_MAV_PAYLOAD(msg), buf, 32);
#else
mavlink_command_long_t packet;
packet.param1 = param1;
packet.param2 = param2;
packet.param3 = param3;
packet.param4 = param4;
packet.param5 = param5;
packet.param6 = param6;
packet.param7 = param7;
packet.target_system = target_system;
packet.target_component = target_component;
packet.command = command;
packet.confirmation = confirmation;
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_COMMAND_LONG;
return mavlink_finalize_message(msg, system_id, component_id, 32, 168);
}
......@@ -102,20 +121,39 @@ static inline uint16_t mavlink_msg_command_long_pack_chan(uint8_t system_id, uin
mavlink_message_t* msg,
uint8_t target_system,uint8_t target_component,uint8_t command,uint8_t confirmation,float param1,float param2,float param3,float param4,float param5,float param6,float param7)
{
msg->msgid = MAVLINK_MSG_ID_COMMAND_LONG;
put_float_by_index(msg, 0, param1); // Parameter 1, as defined by MAV_CMD enum.
put_float_by_index(msg, 4, param2); // Parameter 2, as defined by MAV_CMD enum.
put_float_by_index(msg, 8, param3); // Parameter 3, as defined by MAV_CMD enum.
put_float_by_index(msg, 12, param4); // Parameter 4, as defined by MAV_CMD enum.
put_float_by_index(msg, 16, param5); // Parameter 5, as defined by MAV_CMD enum.
put_float_by_index(msg, 20, param6); // Parameter 6, as defined by MAV_CMD enum.
put_float_by_index(msg, 24, param7); // Parameter 7, as defined by MAV_CMD enum.
put_uint8_t_by_index(msg, 28, target_system); // System which should execute the command
put_uint8_t_by_index(msg, 29, target_component); // Component which should execute the command, 0 for all components
put_uint8_t_by_index(msg, 30, command); // Command ID, as defined by MAV_CMD enum.
put_uint8_t_by_index(msg, 31, confirmation); // 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
_mav_put_float(buf, 0, param1);
_mav_put_float(buf, 4, param2);
_mav_put_float(buf, 8, param3);
_mav_put_float(buf, 12, param4);
_mav_put_float(buf, 16, param5);
_mav_put_float(buf, 20, param6);
_mav_put_float(buf, 24, param7);
_mav_put_uint8_t(buf, 28, target_system);
_mav_put_uint8_t(buf, 29, target_component);
_mav_put_uint8_t(buf, 30, command);
_mav_put_uint8_t(buf, 31, confirmation);
memcpy(_MAV_PAYLOAD(msg), buf, 32);
#else
mavlink_command_long_t packet;
packet.param1 = param1;
packet.param2 = param2;
packet.param3 = param3;
packet.param4 = param4;
packet.param5 = param5;
packet.param6 = param6;
packet.param7 = param7;
packet.target_system = target_system;
packet.target_component = target_component;
packet.command = command;
packet.confirmation = confirmation;
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_COMMAND_LONG;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 32, 168);
}
......@@ -152,22 +190,37 @@ static inline uint16_t mavlink_msg_command_long_encode(uint8_t system_id, uint8_
static inline void mavlink_msg_command_long_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t command, uint8_t confirmation, float param1, float param2, float param3, float param4, float param5, float param6, float param7)
{
MAVLINK_ALIGNED_MESSAGE(msg, 32);
msg->msgid = MAVLINK_MSG_ID_COMMAND_LONG;
put_float_by_index(msg, 0, param1); // Parameter 1, as defined by MAV_CMD enum.
put_float_by_index(msg, 4, param2); // Parameter 2, as defined by MAV_CMD enum.
put_float_by_index(msg, 8, param3); // Parameter 3, as defined by MAV_CMD enum.
put_float_by_index(msg, 12, param4); // Parameter 4, as defined by MAV_CMD enum.
put_float_by_index(msg, 16, param5); // Parameter 5, as defined by MAV_CMD enum.
put_float_by_index(msg, 20, param6); // Parameter 6, as defined by MAV_CMD enum.
put_float_by_index(msg, 24, param7); // Parameter 7, as defined by MAV_CMD enum.
put_uint8_t_by_index(msg, 28, target_system); // System which should execute the command
put_uint8_t_by_index(msg, 29, target_component); // Component which should execute the command, 0 for all components
put_uint8_t_by_index(msg, 30, command); // Command ID, as defined by MAV_CMD enum.
put_uint8_t_by_index(msg, 31, confirmation); // 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)
mavlink_finalize_message_chan_send(msg, chan, 32, 168);
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
_mav_put_float(buf, 0, param1);
_mav_put_float(buf, 4, param2);
_mav_put_float(buf, 8, param3);
_mav_put_float(buf, 12, param4);
_mav_put_float(buf, 16, param5);
_mav_put_float(buf, 20, param6);
_mav_put_float(buf, 24, param7);
_mav_put_uint8_t(buf, 28, target_system);
_mav_put_uint8_t(buf, 29, target_component);
_mav_put_uint8_t(buf, 30, command);
_mav_put_uint8_t(buf, 31, confirmation);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, buf, 32, 168);
#else
mavlink_command_long_t packet;
packet.param1 = param1;
packet.param2 = param2;
packet.param3 = param3;
packet.param4 = param4;
packet.param5 = param5;
packet.param6 = param6;
packet.param7 = param7;
packet.target_system = target_system;
packet.target_component = target_component;
packet.command = command;
packet.confirmation = confirmation;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, (const char *)&packet, 32, 168);
#endif
}
#endif
......@@ -182,7 +235,7 @@ static inline void mavlink_msg_command_long_send(mavlink_channel_t chan, uint8_t
*/
static inline uint8_t mavlink_msg_command_long_get_target_system(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_uint8_t(msg, 28);
return _MAV_RETURN_uint8_t(msg, 28);
}
/**
......@@ -192,7 +245,7 @@ static inline uint8_t mavlink_msg_command_long_get_target_system(const mavlink_m
*/
static inline uint8_t mavlink_msg_command_long_get_target_component(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_uint8_t(msg, 29);
return _MAV_RETURN_uint8_t(msg, 29);
}
/**
......@@ -202,7 +255,7 @@ static inline uint8_t mavlink_msg_command_long_get_target_component(const mavlin
*/
static inline uint8_t mavlink_msg_command_long_get_command(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_uint8_t(msg, 30);
return _MAV_RETURN_uint8_t(msg, 30);
}
/**
......@@ -212,7 +265,7 @@ static inline uint8_t mavlink_msg_command_long_get_command(const mavlink_message
*/
static inline uint8_t mavlink_msg_command_long_get_confirmation(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_uint8_t(msg, 31);
return _MAV_RETURN_uint8_t(msg, 31);
}
/**
......@@ -222,7 +275,7 @@ static inline uint8_t mavlink_msg_command_long_get_confirmation(const mavlink_me
*/
static inline float mavlink_msg_command_long_get_param1(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 0);
return _MAV_RETURN_float(msg, 0);
}
/**
......@@ -232,7 +285,7 @@ static inline float mavlink_msg_command_long_get_param1(const mavlink_message_t*
*/
static inline float mavlink_msg_command_long_get_param2(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 4);
return _MAV_RETURN_float(msg, 4);
}
/**
......@@ -242,7 +295,7 @@ static inline float mavlink_msg_command_long_get_param2(const mavlink_message_t*
*/
static inline float mavlink_msg_command_long_get_param3(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 8);
return _MAV_RETURN_float(msg, 8);
}
/**
......@@ -252,7 +305,7 @@ static inline float mavlink_msg_command_long_get_param3(const mavlink_message_t*
*/
static inline float mavlink_msg_command_long_get_param4(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 12);
return _MAV_RETURN_float(msg, 12);
}
/**
......@@ -262,7 +315,7 @@ static inline float mavlink_msg_command_long_get_param4(const mavlink_message_t*
*/
static inline float mavlink_msg_command_long_get_param5(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 16);
return _MAV_RETURN_float(msg, 16);
}
/**
......@@ -272,7 +325,7 @@ static inline float mavlink_msg_command_long_get_param5(const mavlink_message_t*
*/
static inline float mavlink_msg_command_long_get_param6(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 20);
return _MAV_RETURN_float(msg, 20);
}
/**
......@@ -282,7 +335,7 @@ static inline float mavlink_msg_command_long_get_param6(const mavlink_message_t*
*/
static inline float mavlink_msg_command_long_get_param7(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 24);
return _MAV_RETURN_float(msg, 24);
}
/**
......@@ -306,6 +359,6 @@ static inline void mavlink_msg_command_long_decode(const mavlink_message_t* msg,
command_long->command = mavlink_msg_command_long_get_command(msg);
command_long->confirmation = mavlink_msg_command_long_get_confirmation(msg);
#else
memcpy(command_long, MAVLINK_PAYLOAD(msg), 32);
memcpy(command_long, _MAV_PAYLOAD(msg), 32);
#endif
}
......@@ -53,17 +53,33 @@ typedef struct __mavlink_command_short_t
static inline uint16_t mavlink_msg_command_short_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target_system, uint8_t target_component, uint8_t command, uint8_t confirmation, float param1, float param2, float param3, float param4)
{
msg->msgid = MAVLINK_MSG_ID_COMMAND_SHORT;
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[20];
_mav_put_float(buf, 0, param1);
_mav_put_float(buf, 4, param2);
_mav_put_float(buf, 8, param3);
_mav_put_float(buf, 12, param4);
_mav_put_uint8_t(buf, 16, target_system);
_mav_put_uint8_t(buf, 17, target_component);
_mav_put_uint8_t(buf, 18, command);
_mav_put_uint8_t(buf, 19, confirmation);
memcpy(_MAV_PAYLOAD(msg), buf, 20);
#else
mavlink_command_short_t packet;
packet.param1 = param1;
packet.param2 = param2;
packet.param3 = param3;
packet.param4 = param4;
packet.target_system = target_system;
packet.target_component = target_component;
packet.command = command;
packet.confirmation = confirmation;
put_float_by_index(msg, 0, param1); // Parameter 1, as defined by MAV_CMD enum.
put_float_by_index(msg, 4, param2); // Parameter 2, as defined by MAV_CMD enum.
put_float_by_index(msg, 8, param3); // Parameter 3, as defined by MAV_CMD enum.
put_float_by_index(msg, 12, param4); // Parameter 4, as defined by MAV_CMD enum.
put_uint8_t_by_index(msg, 16, target_system); // System which should execute the command
put_uint8_t_by_index(msg, 17, target_component); // Component which should execute the command, 0 for all components
put_uint8_t_by_index(msg, 18, command); // Command ID, as defined by MAV_CMD enum.
put_uint8_t_by_index(msg, 19, confirmation); // 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)
memcpy(_MAV_PAYLOAD(msg), &packet, 20);
#endif
msg->msgid = MAVLINK_MSG_ID_COMMAND_SHORT;
return mavlink_finalize_message(msg, system_id, component_id, 20, 160);
}
......@@ -87,17 +103,33 @@ static inline uint16_t mavlink_msg_command_short_pack_chan(uint8_t system_id, ui
mavlink_message_t* msg,
uint8_t target_system,uint8_t target_component,uint8_t command,uint8_t confirmation,float param1,float param2,float param3,float param4)
{
msg->msgid = MAVLINK_MSG_ID_COMMAND_SHORT;
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[20];
_mav_put_float(buf, 0, param1);
_mav_put_float(buf, 4, param2);
_mav_put_float(buf, 8, param3);
_mav_put_float(buf, 12, param4);
_mav_put_uint8_t(buf, 16, target_system);
_mav_put_uint8_t(buf, 17, target_component);
_mav_put_uint8_t(buf, 18, command);
_mav_put_uint8_t(buf, 19, confirmation);
put_float_by_index(msg, 0, param1); // Parameter 1, as defined by MAV_CMD enum.
put_float_by_index(msg, 4, param2); // Parameter 2, as defined by MAV_CMD enum.
put_float_by_index(msg, 8, param3); // Parameter 3, as defined by MAV_CMD enum.
put_float_by_index(msg, 12, param4); // Parameter 4, as defined by MAV_CMD enum.
put_uint8_t_by_index(msg, 16, target_system); // System which should execute the command
put_uint8_t_by_index(msg, 17, target_component); // Component which should execute the command, 0 for all components
put_uint8_t_by_index(msg, 18, command); // Command ID, as defined by MAV_CMD enum.
put_uint8_t_by_index(msg, 19, confirmation); // 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)
memcpy(_MAV_PAYLOAD(msg), buf, 20);
#else
mavlink_command_short_t packet;
packet.param1 = param1;
packet.param2 = param2;
packet.param3 = param3;
packet.param4 = param4;
packet.target_system = target_system;
packet.target_component = target_component;
packet.command = command;
packet.confirmation = confirmation;
memcpy(_MAV_PAYLOAD(msg), &packet, 20);
#endif
msg->msgid = MAVLINK_MSG_ID_COMMAND_SHORT;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 20, 160);
}
......@@ -131,19 +163,31 @@ static inline uint16_t mavlink_msg_command_short_encode(uint8_t system_id, uint8
static inline void mavlink_msg_command_short_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t command, uint8_t confirmation, float param1, float param2, float param3, float param4)
{
MAVLINK_ALIGNED_MESSAGE(msg, 20);
msg->msgid = MAVLINK_MSG_ID_COMMAND_SHORT;
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[20];
_mav_put_float(buf, 0, param1);
_mav_put_float(buf, 4, param2);
_mav_put_float(buf, 8, param3);
_mav_put_float(buf, 12, param4);
_mav_put_uint8_t(buf, 16, target_system);
_mav_put_uint8_t(buf, 17, target_component);
_mav_put_uint8_t(buf, 18, command);
_mav_put_uint8_t(buf, 19, confirmation);
put_float_by_index(msg, 0, param1); // Parameter 1, as defined by MAV_CMD enum.
put_float_by_index(msg, 4, param2); // Parameter 2, as defined by MAV_CMD enum.
put_float_by_index(msg, 8, param3); // Parameter 3, as defined by MAV_CMD enum.
put_float_by_index(msg, 12, param4); // Parameter 4, as defined by MAV_CMD enum.
put_uint8_t_by_index(msg, 16, target_system); // System which should execute the command
put_uint8_t_by_index(msg, 17, target_component); // Component which should execute the command, 0 for all components
put_uint8_t_by_index(msg, 18, command); // Command ID, as defined by MAV_CMD enum.
put_uint8_t_by_index(msg, 19, confirmation); // 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_SHORT, buf, 20, 160);
#else
mavlink_command_short_t packet;
packet.param1 = param1;
packet.param2 = param2;
packet.param3 = param3;
packet.param4 = param4;
packet.target_system = target_system;
packet.target_component = target_component;
packet.command = command;
packet.confirmation = confirmation;
mavlink_finalize_message_chan_send(msg, chan, 20, 160);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_SHORT, (const char *)&packet, 20, 160);
#endif
}
#endif
......@@ -158,7 +202,7 @@ static inline void mavlink_msg_command_short_send(mavlink_channel_t chan, uint8_
*/
static inline uint8_t mavlink_msg_command_short_get_target_system(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_uint8_t(msg, 16);
return _MAV_RETURN_uint8_t(msg, 16);
}
/**
......@@ -168,7 +212,7 @@ static inline uint8_t mavlink_msg_command_short_get_target_system(const mavlink_
*/
static inline uint8_t mavlink_msg_command_short_get_target_component(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_uint8_t(msg, 17);
return _MAV_RETURN_uint8_t(msg, 17);
}
/**
......@@ -178,7 +222,7 @@ static inline uint8_t mavlink_msg_command_short_get_target_component(const mavli
*/
static inline uint8_t mavlink_msg_command_short_get_command(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_uint8_t(msg, 18);
return _MAV_RETURN_uint8_t(msg, 18);
}
/**
......@@ -188,7 +232,7 @@ static inline uint8_t mavlink_msg_command_short_get_command(const mavlink_messag
*/
static inline uint8_t mavlink_msg_command_short_get_confirmation(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_uint8_t(msg, 19);
return _MAV_RETURN_uint8_t(msg, 19);
}
/**
......@@ -198,7 +242,7 @@ static inline uint8_t mavlink_msg_command_short_get_confirmation(const mavlink_m
*/
static inline float mavlink_msg_command_short_get_param1(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 0);
return _MAV_RETURN_float(msg, 0);
}
/**
......@@ -208,7 +252,7 @@ static inline float mavlink_msg_command_short_get_param1(const mavlink_message_t
*/
static inline float mavlink_msg_command_short_get_param2(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 4);
return _MAV_RETURN_float(msg, 4);
}
/**
......@@ -218,7 +262,7 @@ static inline float mavlink_msg_command_short_get_param2(const mavlink_message_t
*/
static inline float mavlink_msg_command_short_get_param3(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 8);
return _MAV_RETURN_float(msg, 8);
}
/**
......@@ -228,7 +272,7 @@ static inline float mavlink_msg_command_short_get_param3(const mavlink_message_t
*/
static inline float mavlink_msg_command_short_get_param4(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 12);
return _MAV_RETURN_float(msg, 12);
}
/**
......@@ -249,6 +293,6 @@ static inline void mavlink_msg_command_short_decode(const mavlink_message_t* msg
command_short->command = mavlink_msg_command_short_get_command(msg);
command_short->confirmation = mavlink_msg_command_short_get_confirmation(msg);
#else
memcpy(command_short, MAVLINK_PAYLOAD(msg), 20);
memcpy(command_short, _MAV_PAYLOAD(msg), 20);
#endif
}
......@@ -38,12 +38,23 @@ typedef struct __mavlink_data_stream_t
static inline uint16_t mavlink_msg_data_stream_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t stream_id, uint16_t message_rate, uint8_t on_off)
{
msg->msgid = MAVLINK_MSG_ID_DATA_STREAM;
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[4];
_mav_put_uint16_t(buf, 0, message_rate);
_mav_put_uint8_t(buf, 2, stream_id);
_mav_put_uint8_t(buf, 3, on_off);
memcpy(_MAV_PAYLOAD(msg), buf, 4);
#else
mavlink_data_stream_t packet;
packet.message_rate = message_rate;
packet.stream_id = stream_id;
packet.on_off = on_off;
put_uint16_t_by_index(msg, 0, message_rate); // The requested interval between two messages of this type
put_uint8_t_by_index(msg, 2, stream_id); // The ID of the requested data stream
put_uint8_t_by_index(msg, 3, on_off); // 1 stream is enabled, 0 stream is stopped.
memcpy(_MAV_PAYLOAD(msg), &packet, 4);
#endif
msg->msgid = MAVLINK_MSG_ID_DATA_STREAM;
return mavlink_finalize_message(msg, system_id, component_id, 4, 21);
}
......@@ -62,12 +73,23 @@ static inline uint16_t mavlink_msg_data_stream_pack_chan(uint8_t system_id, uint
mavlink_message_t* msg,
uint8_t stream_id,uint16_t message_rate,uint8_t on_off)
{
msg->msgid = MAVLINK_MSG_ID_DATA_STREAM;
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[4];
_mav_put_uint16_t(buf, 0, message_rate);
_mav_put_uint8_t(buf, 2, stream_id);
_mav_put_uint8_t(buf, 3, on_off);
put_uint16_t_by_index(msg, 0, message_rate); // The requested interval between two messages of this type
put_uint8_t_by_index(msg, 2, stream_id); // The ID of the requested data stream
put_uint8_t_by_index(msg, 3, on_off); // 1 stream is enabled, 0 stream is stopped.
memcpy(_MAV_PAYLOAD(msg), buf, 4);
#else
mavlink_data_stream_t packet;
packet.message_rate = message_rate;
packet.stream_id = stream_id;
packet.on_off = on_off;
memcpy(_MAV_PAYLOAD(msg), &packet, 4);
#endif
msg->msgid = MAVLINK_MSG_ID_DATA_STREAM;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4, 21);
}
......@@ -96,14 +118,21 @@ static inline uint16_t mavlink_msg_data_stream_encode(uint8_t system_id, uint8_t
static inline void mavlink_msg_data_stream_send(mavlink_channel_t chan, uint8_t stream_id, uint16_t message_rate, uint8_t on_off)
{
MAVLINK_ALIGNED_MESSAGE(msg, 4);
msg->msgid = MAVLINK_MSG_ID_DATA_STREAM;
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[4];
_mav_put_uint16_t(buf, 0, message_rate);
_mav_put_uint8_t(buf, 2, stream_id);
_mav_put_uint8_t(buf, 3, on_off);
put_uint16_t_by_index(msg, 0, message_rate); // The requested interval between two messages of this type
put_uint8_t_by_index(msg, 2, stream_id); // The ID of the requested data stream
put_uint8_t_by_index(msg, 3, on_off); // 1 stream is enabled, 0 stream is stopped.
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, buf, 4, 21);
#else
mavlink_data_stream_t packet;
packet.message_rate = message_rate;
packet.stream_id = stream_id;
packet.on_off = on_off;
mavlink_finalize_message_chan_send(msg, chan, 4, 21);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, (const char *)&packet, 4, 21);
#endif
}
#endif
......@@ -118,7 +147,7 @@ static inline void mavlink_msg_data_stream_send(mavlink_channel_t chan, uint8_t
*/
static inline uint8_t mavlink_msg_data_stream_get_stream_id(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_uint8_t(msg, 2);
return _MAV_RETURN_uint8_t(msg, 2);
}
/**
......@@ -128,7 +157,7 @@ static inline uint8_t mavlink_msg_data_stream_get_stream_id(const mavlink_messag
*/
static inline uint16_t mavlink_msg_data_stream_get_message_rate(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_uint16_t(msg, 0);
return _MAV_RETURN_uint16_t(msg, 0);
}
/**
......@@ -138,7 +167,7 @@ static inline uint16_t mavlink_msg_data_stream_get_message_rate(const mavlink_me
*/
static inline uint8_t mavlink_msg_data_stream_get_on_off(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_uint8_t(msg, 3);
return _MAV_RETURN_uint8_t(msg, 3);
}
/**
......@@ -154,6 +183,6 @@ static inline void mavlink_msg_data_stream_decode(const mavlink_message_t* msg,
data_stream->stream_id = mavlink_msg_data_stream_get_stream_id(msg);
data_stream->on_off = mavlink_msg_data_stream_get_on_off(msg);
#else
memcpy(data_stream, MAVLINK_PAYLOAD(msg), 4);
memcpy(data_stream, _MAV_PAYLOAD(msg), 4);
#endif
}
......@@ -38,12 +38,23 @@ typedef struct __mavlink_debug_t
static inline uint16_t mavlink_msg_debug_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint32_t time_boot_ms, uint8_t ind, float value)
{
msg->msgid = MAVLINK_MSG_ID_DEBUG;
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[9];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_float(buf, 4, value);
_mav_put_uint8_t(buf, 8, ind);
memcpy(_MAV_PAYLOAD(msg), buf, 9);
#else
mavlink_debug_t packet;
packet.time_boot_ms = time_boot_ms;
packet.value = value;
packet.ind = ind;
put_uint32_t_by_index(msg, 0, time_boot_ms); // Timestamp (milliseconds since system boot)
put_float_by_index(msg, 4, value); // DEBUG value
put_uint8_t_by_index(msg, 8, ind); // index of debug variable
memcpy(_MAV_PAYLOAD(msg), &packet, 9);
#endif
msg->msgid = MAVLINK_MSG_ID_DEBUG;
return mavlink_finalize_message(msg, system_id, component_id, 9, 46);
}
......@@ -62,12 +73,23 @@ static inline uint16_t mavlink_msg_debug_pack_chan(uint8_t system_id, uint8_t co
mavlink_message_t* msg,
uint32_t time_boot_ms,uint8_t ind,float value)
{
msg->msgid = MAVLINK_MSG_ID_DEBUG;
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[9];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_float(buf, 4, value);
_mav_put_uint8_t(buf, 8, ind);
put_uint32_t_by_index(msg, 0, time_boot_ms); // Timestamp (milliseconds since system boot)
put_float_by_index(msg, 4, value); // DEBUG value
put_uint8_t_by_index(msg, 8, ind); // index of debug variable
memcpy(_MAV_PAYLOAD(msg), buf, 9);
#else
mavlink_debug_t packet;
packet.time_boot_ms = time_boot_ms;
packet.value = value;
packet.ind = ind;
memcpy(_MAV_PAYLOAD(msg), &packet, 9);
#endif
msg->msgid = MAVLINK_MSG_ID_DEBUG;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 9, 46);
}
......@@ -96,14 +118,21 @@ static inline uint16_t mavlink_msg_debug_encode(uint8_t system_id, uint8_t compo
static inline void mavlink_msg_debug_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t ind, float value)
{
MAVLINK_ALIGNED_MESSAGE(msg, 9);
msg->msgid = MAVLINK_MSG_ID_DEBUG;
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[9];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_float(buf, 4, value);
_mav_put_uint8_t(buf, 8, ind);
put_uint32_t_by_index(msg, 0, time_boot_ms); // Timestamp (milliseconds since system boot)
put_float_by_index(msg, 4, value); // DEBUG value
put_uint8_t_by_index(msg, 8, ind); // index of debug variable
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, buf, 9, 46);
#else
mavlink_debug_t packet;
packet.time_boot_ms = time_boot_ms;
packet.value = value;
packet.ind = ind;
mavlink_finalize_message_chan_send(msg, chan, 9, 46);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, (const char *)&packet, 9, 46);
#endif
}
#endif
......@@ -118,7 +147,7 @@ static inline void mavlink_msg_debug_send(mavlink_channel_t chan, uint32_t time_
*/
static inline uint32_t mavlink_msg_debug_get_time_boot_ms(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_uint32_t(msg, 0);
return _MAV_RETURN_uint32_t(msg, 0);
}
/**
......@@ -128,7 +157,7 @@ static inline uint32_t mavlink_msg_debug_get_time_boot_ms(const mavlink_message_
*/
static inline uint8_t mavlink_msg_debug_get_ind(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_uint8_t(msg, 8);
return _MAV_RETURN_uint8_t(msg, 8);
}
/**
......@@ -138,7 +167,7 @@ static inline uint8_t mavlink_msg_debug_get_ind(const mavlink_message_t* msg)
*/
static inline float mavlink_msg_debug_get_value(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 4);
return _MAV_RETURN_float(msg, 4);
}
/**
......@@ -154,6 +183,6 @@ static inline void mavlink_msg_debug_decode(const mavlink_message_t* msg, mavlin
debug->value = mavlink_msg_debug_get_value(msg);
debug->ind = mavlink_msg_debug_get_ind(msg);
#else
memcpy(debug, MAVLINK_PAYLOAD(msg), 9);
memcpy(debug, _MAV_PAYLOAD(msg), 9);
#endif
}
......@@ -44,14 +44,25 @@ typedef struct __mavlink_debug_vect_t
static inline uint16_t mavlink_msg_debug_vect_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const char *name, uint64_t time_usec, float x, float y, float z)
{
msg->msgid = MAVLINK_MSG_ID_DEBUG_VECT;
put_uint64_t_by_index(msg, 0, time_usec); // Timestamp
put_float_by_index(msg, 8, x); // x
put_float_by_index(msg, 12, y); // y
put_float_by_index(msg, 16, z); // z
put_char_array_by_index(msg, 20, name, 10); // Name
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[30];
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, x);
_mav_put_float(buf, 12, y);
_mav_put_float(buf, 16, z);
_mav_put_char_array(buf, 20, name, 10);
memcpy(_MAV_PAYLOAD(msg), buf, 30);
#else
mavlink_debug_vect_t packet;
packet.time_usec = time_usec;
packet.x = x;
packet.y = y;
packet.z = z;
memcpy(packet.name, name, sizeof(char)*10);
memcpy(_MAV_PAYLOAD(msg), &packet, 30);
#endif
msg->msgid = MAVLINK_MSG_ID_DEBUG_VECT;
return mavlink_finalize_message(msg, system_id, component_id, 30, 49);
}
......@@ -72,14 +83,25 @@ static inline uint16_t mavlink_msg_debug_vect_pack_chan(uint8_t system_id, uint8
mavlink_message_t* msg,
const char *name,uint64_t time_usec,float x,float y,float z)
{
msg->msgid = MAVLINK_MSG_ID_DEBUG_VECT;
put_uint64_t_by_index(msg, 0, time_usec); // Timestamp
put_float_by_index(msg, 8, x); // x
put_float_by_index(msg, 12, y); // y
put_float_by_index(msg, 16, z); // z
put_char_array_by_index(msg, 20, name, 10); // Name
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[30];
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, x);
_mav_put_float(buf, 12, y);
_mav_put_float(buf, 16, z);
_mav_put_char_array(buf, 20, name, 10);
memcpy(_MAV_PAYLOAD(msg), buf, 30);
#else
mavlink_debug_vect_t packet;
packet.time_usec = time_usec;
packet.x = x;
packet.y = y;
packet.z = z;
memcpy(packet.name, name, sizeof(char)*10);
memcpy(_MAV_PAYLOAD(msg), &packet, 30);
#endif
msg->msgid = MAVLINK_MSG_ID_DEBUG_VECT;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 30, 49);
}
......@@ -110,16 +132,23 @@ static inline uint16_t mavlink_msg_debug_vect_encode(uint8_t system_id, uint8_t
static inline void mavlink_msg_debug_vect_send(mavlink_channel_t chan, const char *name, uint64_t time_usec, float x, float y, float z)
{
MAVLINK_ALIGNED_MESSAGE(msg, 30);
msg->msgid = MAVLINK_MSG_ID_DEBUG_VECT;
put_uint64_t_by_index(msg, 0, time_usec); // Timestamp
put_float_by_index(msg, 8, x); // x
put_float_by_index(msg, 12, y); // y
put_float_by_index(msg, 16, z); // z
put_char_array_by_index(msg, 20, name, 10); // Name
mavlink_finalize_message_chan_send(msg, chan, 30, 49);
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[30];
_mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, x);
_mav_put_float(buf, 12, y);
_mav_put_float(buf, 16, z);
_mav_put_char_array(buf, 20, name, 10);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, buf, 30, 49);
#else
mavlink_debug_vect_t packet;
packet.time_usec = time_usec;
packet.x = x;
packet.y = y;
packet.z = z;
memcpy(packet.name, name, sizeof(char)*10);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG_VECT, (const char *)&packet, 30, 49);
#endif
}
#endif
......@@ -134,7 +163,7 @@ static inline void mavlink_msg_debug_vect_send(mavlink_channel_t chan, const cha
*/
static inline uint16_t mavlink_msg_debug_vect_get_name(const mavlink_message_t* msg, char *name)
{
return MAVLINK_MSG_RETURN_char_array(msg, name, 10, 20);
return _MAV_RETURN_char_array(msg, name, 10, 20);
}
/**
......@@ -144,7 +173,7 @@ static inline uint16_t mavlink_msg_debug_vect_get_name(const mavlink_message_t*
*/
static inline uint64_t mavlink_msg_debug_vect_get_time_usec(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_uint64_t(msg, 0);
return _MAV_RETURN_uint64_t(msg, 0);
}
/**
......@@ -154,7 +183,7 @@ static inline uint64_t mavlink_msg_debug_vect_get_time_usec(const mavlink_messag
*/
static inline float mavlink_msg_debug_vect_get_x(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 8);
return _MAV_RETURN_float(msg, 8);
}
/**
......@@ -164,7 +193,7 @@ static inline float mavlink_msg_debug_vect_get_x(const mavlink_message_t* msg)
*/
static inline float mavlink_msg_debug_vect_get_y(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 12);
return _MAV_RETURN_float(msg, 12);
}
/**
......@@ -174,7 +203,7 @@ static inline float mavlink_msg_debug_vect_get_y(const mavlink_message_t* msg)
*/
static inline float mavlink_msg_debug_vect_get_z(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_float(msg, 16);
return _MAV_RETURN_float(msg, 16);
}
/**
......@@ -192,6 +221,6 @@ static inline void mavlink_msg_debug_vect_decode(const mavlink_message_t* msg, m
debug_vect->z = mavlink_msg_debug_vect_get_z(msg);
mavlink_msg_debug_vect_get_name(msg, debug_vect->name);
#else
memcpy(debug_vect, MAVLINK_PAYLOAD(msg), 30);
memcpy(debug_vect, _MAV_PAYLOAD(msg), 30);
#endif
}
......@@ -38,12 +38,23 @@ typedef struct __mavlink_extended_message_t
static inline uint16_t mavlink_msg_extended_message_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target_system, uint8_t target_component, uint8_t protocol_flags)
{
msg->msgid = MAVLINK_MSG_ID_EXTENDED_MESSAGE;
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[3];
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
_mav_put_uint8_t(buf, 2, protocol_flags);
memcpy(_MAV_PAYLOAD(msg), buf, 3);
#else
mavlink_extended_message_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
packet.protocol_flags = protocol_flags;
put_uint8_t_by_index(msg, 0, target_system); // System which should execute the command
put_uint8_t_by_index(msg, 1, target_component); // Component which should execute the command, 0 for all components
put_uint8_t_by_index(msg, 2, protocol_flags); // Retransmission / ACK flags
memcpy(_MAV_PAYLOAD(msg), &packet, 3);
#endif
msg->msgid = MAVLINK_MSG_ID_EXTENDED_MESSAGE;
return mavlink_finalize_message(msg, system_id, component_id, 3, 247);
}
......@@ -62,12 +73,23 @@ static inline uint16_t mavlink_msg_extended_message_pack_chan(uint8_t system_id,
mavlink_message_t* msg,
uint8_t target_system,uint8_t target_component,uint8_t protocol_flags)
{
msg->msgid = MAVLINK_MSG_ID_EXTENDED_MESSAGE;
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[3];
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
_mav_put_uint8_t(buf, 2, protocol_flags);
put_uint8_t_by_index(msg, 0, target_system); // System which should execute the command
put_uint8_t_by_index(msg, 1, target_component); // Component which should execute the command, 0 for all components
put_uint8_t_by_index(msg, 2, protocol_flags); // Retransmission / ACK flags
memcpy(_MAV_PAYLOAD(msg), buf, 3);
#else
mavlink_extended_message_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
packet.protocol_flags = protocol_flags;
memcpy(_MAV_PAYLOAD(msg), &packet, 3);
#endif
msg->msgid = MAVLINK_MSG_ID_EXTENDED_MESSAGE;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3, 247);
}
......@@ -96,14 +118,21 @@ static inline uint16_t mavlink_msg_extended_message_encode(uint8_t system_id, ui
static inline void mavlink_msg_extended_message_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t protocol_flags)
{
MAVLINK_ALIGNED_MESSAGE(msg, 3);
msg->msgid = MAVLINK_MSG_ID_EXTENDED_MESSAGE;
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[3];
_mav_put_uint8_t(buf, 0, target_system);
_mav_put_uint8_t(buf, 1, target_component);
_mav_put_uint8_t(buf, 2, protocol_flags);
put_uint8_t_by_index(msg, 0, target_system); // System which should execute the command
put_uint8_t_by_index(msg, 1, target_component); // Component which should execute the command, 0 for all components
put_uint8_t_by_index(msg, 2, protocol_flags); // Retransmission / ACK flags
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_MESSAGE, buf, 3, 247);
#else
mavlink_extended_message_t packet;
packet.target_system = target_system;
packet.target_component = target_component;
packet.protocol_flags = protocol_flags;
mavlink_finalize_message_chan_send(msg, chan, 3, 247);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EXTENDED_MESSAGE, (const char *)&packet, 3, 247);
#endif
}
#endif
......@@ -118,7 +147,7 @@ static inline void mavlink_msg_extended_message_send(mavlink_channel_t chan, uin
*/
static inline uint8_t mavlink_msg_extended_message_get_target_system(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_uint8_t(msg, 0);
return _MAV_RETURN_uint8_t(msg, 0);
}
/**
......@@ -128,7 +157,7 @@ static inline uint8_t mavlink_msg_extended_message_get_target_system(const mavli
*/
static inline uint8_t mavlink_msg_extended_message_get_target_component(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_uint8_t(msg, 1);
return _MAV_RETURN_uint8_t(msg, 1);
}
/**
......@@ -138,7 +167,7 @@ static inline uint8_t mavlink_msg_extended_message_get_target_component(const ma
*/
static inline uint8_t mavlink_msg_extended_message_get_protocol_flags(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_uint8_t(msg, 2);
return _MAV_RETURN_uint8_t(msg, 2);
}
/**
......@@ -154,6 +183,6 @@ static inline void mavlink_msg_extended_message_decode(const mavlink_message_t*
extended_message->target_component = mavlink_msg_extended_message_get_target_component(msg);
extended_message->protocol_flags = mavlink_msg_extended_message_get_protocol_flags(msg);
#else
memcpy(extended_message, MAVLINK_PAYLOAD(msg), 3);
memcpy(extended_message, _MAV_PAYLOAD(msg), 3);
#endif
}
// MESSAGE GLOBAL_POSITION PACKING
#define MAVLINK_MSG_ID_GLOBAL_POSITION 33
typedef struct __mavlink_global_position_t
{
uint64_t usec; ///< Timestamp (microseconds since unix epoch)
float lat; ///< Latitude, in degrees
float lon; ///< Longitude, in degrees
float alt; ///< Absolute altitude, in meters
float vx; ///< X Speed (in Latitude direction, positive: going north)
float vy; ///< Y Speed (in Longitude direction, positive: going east)
float vz; ///< Z Speed (in Altitude direction, positive: going up)
} mavlink_global_position_t;
#define MAVLINK_MSG_ID_GLOBAL_POSITION_LEN 32
#define MAVLINK_MSG_ID_33_LEN 32
#define MAVLINK_MESSAGE_INFO_GLOBAL_POSITION { \
"GLOBAL_POSITION", \
7, \
{ { "usec", MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_global_position_t, usec) }, \
{ "lat", MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_global_position_t, lat) }, \
{ "lon", MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_global_position_t, lon) }, \
{ "alt", MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_global_position_t, alt) }, \
{ "vx", MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_global_position_t, vx) }, \
{ "vy", MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_global_position_t, vy) }, \
{ "vz", MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_global_position_t, vz) }, \
} \
}
/**
* @brief Pack a global_position message
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param usec Timestamp (microseconds since unix epoch)
* @param lat Latitude, in degrees
* @param lon Longitude, in degrees
* @param alt Absolute altitude, in meters
* @param vx X Speed (in Latitude direction, positive: going north)
* @param vy Y Speed (in Longitude direction, positive: going east)
* @param vz Z Speed (in Altitude direction, positive: going up)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_global_position_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint64_t usec, float lat, float lon, float alt, float vx, float vy, float vz)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
_mav_put_uint64_t(buf, 0, usec);
_mav_put_float(buf, 8, lat);
_mav_put_float(buf, 12, lon);
_mav_put_float(buf, 16, alt);
_mav_put_float(buf, 20, vx);
_mav_put_float(buf, 24, vy);
_mav_put_float(buf, 28, vz);
memcpy(_MAV_PAYLOAD(msg), buf, 32);
#else
mavlink_global_position_t packet;
packet.usec = usec;
packet.lat = lat;
packet.lon = lon;
packet.alt = alt;
packet.vx = vx;
packet.vy = vy;
packet.vz = vz;
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION;
return mavlink_finalize_message(msg, system_id, component_id, 32, 147);
}
/**
* @brief Pack a global_position message on a channel
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message was sent over
* @param msg The MAVLink message to compress the data into
* @param usec Timestamp (microseconds since unix epoch)
* @param lat Latitude, in degrees
* @param lon Longitude, in degrees
* @param alt Absolute altitude, in meters
* @param vx X Speed (in Latitude direction, positive: going north)
* @param vy Y Speed (in Longitude direction, positive: going east)
* @param vz Z Speed (in Altitude direction, positive: going up)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_global_position_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint64_t usec,float lat,float lon,float alt,float vx,float vy,float vz)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
_mav_put_uint64_t(buf, 0, usec);
_mav_put_float(buf, 8, lat);
_mav_put_float(buf, 12, lon);
_mav_put_float(buf, 16, alt);
_mav_put_float(buf, 20, vx);
_mav_put_float(buf, 24, vy);
_mav_put_float(buf, 28, vz);
memcpy(_MAV_PAYLOAD(msg), buf, 32);
#else
mavlink_global_position_t packet;
packet.usec = usec;
packet.lat = lat;
packet.lon = lon;
packet.alt = alt;
packet.vx = vx;
packet.vy = vy;
packet.vz = vz;
memcpy(_MAV_PAYLOAD(msg), &packet, 32);
#endif
msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 32, 147);
}
/**
* @brief Encode a global_position struct into a message
*
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
* @param global_position C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_global_position_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_global_position_t* global_position)
{
return mavlink_msg_global_position_pack(system_id, component_id, msg, global_position->usec, global_position->lat, global_position->lon, global_position->alt, global_position->vx, global_position->vy, global_position->vz);
}
/**
* @brief Send a global_position message
* @param chan MAVLink channel to send the message
*
* @param usec Timestamp (microseconds since unix epoch)
* @param lat Latitude, in degrees
* @param lon Longitude, in degrees
* @param alt Absolute altitude, in meters
* @param vx X Speed (in Latitude direction, positive: going north)
* @param vy Y Speed (in Longitude direction, positive: going east)
* @param vz Z Speed (in Altitude direction, positive: going up)
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_global_position_send(mavlink_channel_t chan, uint64_t usec, float lat, float lon, float alt, float vx, float vy, float vz)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[32];
_mav_put_uint64_t(buf, 0, usec);
_mav_put_float(buf, 8, lat);
_mav_put_float(buf, 12, lon);
_mav_put_float(buf, 16, alt);
_mav_put_float(buf, 20, vx);
_mav_put_float(buf, 24, vy);
_mav_put_float(buf, 28, vz);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION, buf, 32, 147);
#else
mavlink_global_position_t packet;
packet.usec = usec;
packet.lat = lat;
packet.lon = lon;
packet.alt = alt;
packet.vx = vx;
packet.vy = vy;
packet.vz = vz;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION, (const char *)&packet, 32, 147);
#endif
}
#endif
// MESSAGE GLOBAL_POSITION UNPACKING
/**
* @brief Get field usec from global_position message
*
* @return Timestamp (microseconds since unix epoch)
*/
static inline uint64_t mavlink_msg_global_position_get_usec(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
}
/**
* @brief Get field lat from global_position message
*
* @return Latitude, in degrees
*/
static inline float mavlink_msg_global_position_get_lat(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
* @brief Get field lon from global_position message
*
* @return Longitude, in degrees
*/
static inline float mavlink_msg_global_position_get_lon(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
}
/**
* @brief Get field alt from global_position message
*
* @return Absolute altitude, in meters
*/
static inline float mavlink_msg_global_position_get_alt(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field vx from global_position message
*
* @return X Speed (in Latitude direction, positive: going north)
*/
static inline float mavlink_msg_global_position_get_vx(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Get field vy from global_position message
*
* @return Y Speed (in Longitude direction, positive: going east)
*/
static inline float mavlink_msg_global_position_get_vy(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 24);
}
/**
* @brief Get field vz from global_position message
*
* @return Z Speed (in Altitude direction, positive: going up)
*/
static inline float mavlink_msg_global_position_get_vz(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 28);
}
/**
* @brief Decode a global_position message into a struct
*
* @param msg The message to decode
* @param global_position C-struct to decode the message contents into
*/
static inline void mavlink_msg_global_position_decode(const mavlink_message_t* msg, mavlink_global_position_t* global_position)
{
#if MAVLINK_NEED_BYTE_SWAP
global_position->usec = mavlink_msg_global_position_get_usec(msg);
global_position->lat = mavlink_msg_global_position_get_lat(msg);
global_position->lon = mavlink_msg_global_position_get_lon(msg);
global_position->alt = mavlink_msg_global_position_get_alt(msg);
global_position->vx = mavlink_msg_global_position_get_vx(msg);
global_position->vy = mavlink_msg_global_position_get_vy(msg);
global_position->vz = mavlink_msg_global_position_get_vz(msg);
#else
memcpy(global_position, _MAV_PAYLOAD(msg), 32);
#endif
}
......@@ -53,17 +53,33 @@ typedef struct __mavlink_global_position_int_t
static inline uint16_t mavlink_msg_global_position_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint32_t time_boot_ms, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz, uint16_t hdg)
{
msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT;
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[24];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_int32_t(buf, 4, lat);
_mav_put_int32_t(buf, 8, lon);
_mav_put_int32_t(buf, 12, alt);
_mav_put_int16_t(buf, 16, vx);
_mav_put_int16_t(buf, 18, vy);
_mav_put_int16_t(buf, 20, vz);
_mav_put_uint16_t(buf, 22, hdg);
memcpy(_MAV_PAYLOAD(msg), buf, 24);
#else
mavlink_global_position_int_t packet;
packet.time_boot_ms = time_boot_ms;
packet.lat = lat;
packet.lon = lon;
packet.alt = alt;
packet.vx = vx;
packet.vy = vy;
packet.vz = vz;
packet.hdg = hdg;
put_uint32_t_by_index(msg, 0, time_boot_ms); // Timestamp (milliseconds since system boot)
put_int32_t_by_index(msg, 4, lat); // Latitude, expressed as * 1E7
put_int32_t_by_index(msg, 8, lon); // Longitude, expressed as * 1E7
put_int32_t_by_index(msg, 12, alt); // Altitude in meters, expressed as * 1000 (millimeters), above MSL
put_int16_t_by_index(msg, 16, vx); // Ground X Speed (Latitude), expressed as m/s * 100
put_int16_t_by_index(msg, 18, vy); // Ground Y Speed (Longitude), expressed as m/s * 100
put_int16_t_by_index(msg, 20, vz); // Ground Z Speed (Altitude), expressed as m/s * 100
put_uint16_t_by_index(msg, 22, hdg); // Compass heading in degrees * 100, 0.0..359.99 degrees. If unknown, set to: 65535
memcpy(_MAV_PAYLOAD(msg), &packet, 24);
#endif
msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT;
return mavlink_finalize_message(msg, system_id, component_id, 24, 102);
}
......@@ -87,17 +103,33 @@ static inline uint16_t mavlink_msg_global_position_int_pack_chan(uint8_t system_
mavlink_message_t* msg,
uint32_t time_boot_ms,int32_t lat,int32_t lon,int32_t alt,int16_t vx,int16_t vy,int16_t vz,uint16_t hdg)
{
msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT;
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[24];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_int32_t(buf, 4, lat);
_mav_put_int32_t(buf, 8, lon);
_mav_put_int32_t(buf, 12, alt);
_mav_put_int16_t(buf, 16, vx);
_mav_put_int16_t(buf, 18, vy);
_mav_put_int16_t(buf, 20, vz);
_mav_put_uint16_t(buf, 22, hdg);
put_uint32_t_by_index(msg, 0, time_boot_ms); // Timestamp (milliseconds since system boot)
put_int32_t_by_index(msg, 4, lat); // Latitude, expressed as * 1E7
put_int32_t_by_index(msg, 8, lon); // Longitude, expressed as * 1E7
put_int32_t_by_index(msg, 12, alt); // Altitude in meters, expressed as * 1000 (millimeters), above MSL
put_int16_t_by_index(msg, 16, vx); // Ground X Speed (Latitude), expressed as m/s * 100
put_int16_t_by_index(msg, 18, vy); // Ground Y Speed (Longitude), expressed as m/s * 100
put_int16_t_by_index(msg, 20, vz); // Ground Z Speed (Altitude), expressed as m/s * 100
put_uint16_t_by_index(msg, 22, hdg); // Compass heading in degrees * 100, 0.0..359.99 degrees. If unknown, set to: 65535
memcpy(_MAV_PAYLOAD(msg), buf, 24);
#else
mavlink_global_position_int_t packet;
packet.time_boot_ms = time_boot_ms;
packet.lat = lat;
packet.lon = lon;
packet.alt = alt;
packet.vx = vx;
packet.vy = vy;
packet.vz = vz;
packet.hdg = hdg;
memcpy(_MAV_PAYLOAD(msg), &packet, 24);
#endif
msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 24, 102);
}
......@@ -131,19 +163,31 @@ static inline uint16_t mavlink_msg_global_position_int_encode(uint8_t system_id,
static inline void mavlink_msg_global_position_int_send(mavlink_channel_t chan, uint32_t time_boot_ms, int32_t lat, int32_t lon, int32_t alt, int16_t vx, int16_t vy, int16_t vz, uint16_t hdg)
{
MAVLINK_ALIGNED_MESSAGE(msg, 24);
msg->msgid = MAVLINK_MSG_ID_GLOBAL_POSITION_INT;
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[24];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_int32_t(buf, 4, lat);
_mav_put_int32_t(buf, 8, lon);
_mav_put_int32_t(buf, 12, alt);
_mav_put_int16_t(buf, 16, vx);
_mav_put_int16_t(buf, 18, vy);
_mav_put_int16_t(buf, 20, vz);
_mav_put_uint16_t(buf, 22, hdg);
put_uint32_t_by_index(msg, 0, time_boot_ms); // Timestamp (milliseconds since system boot)
put_int32_t_by_index(msg, 4, lat); // Latitude, expressed as * 1E7
put_int32_t_by_index(msg, 8, lon); // Longitude, expressed as * 1E7
put_int32_t_by_index(msg, 12, alt); // Altitude in meters, expressed as * 1000 (millimeters), above MSL
put_int16_t_by_index(msg, 16, vx); // Ground X Speed (Latitude), expressed as m/s * 100
put_int16_t_by_index(msg, 18, vy); // Ground Y Speed (Longitude), expressed as m/s * 100
put_int16_t_by_index(msg, 20, vz); // Ground Z Speed (Altitude), expressed as m/s * 100
put_uint16_t_by_index(msg, 22, hdg); // Compass heading in degrees * 100, 0.0..359.99 degrees. If unknown, set to: 65535
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, buf, 24, 102);
#else
mavlink_global_position_int_t packet;
packet.time_boot_ms = time_boot_ms;
packet.lat = lat;
packet.lon = lon;
packet.alt = alt;
packet.vx = vx;
packet.vy = vy;
packet.vz = vz;
packet.hdg = hdg;
mavlink_finalize_message_chan_send(msg, chan, 24, 102);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GLOBAL_POSITION_INT, (const char *)&packet, 24, 102);
#endif
}
#endif
......@@ -158,7 +202,7 @@ static inline void mavlink_msg_global_position_int_send(mavlink_channel_t chan,
*/
static inline uint32_t mavlink_msg_global_position_int_get_time_boot_ms(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_uint32_t(msg, 0);
return _MAV_RETURN_uint32_t(msg, 0);
}
/**
......@@ -168,7 +212,7 @@ static inline uint32_t mavlink_msg_global_position_int_get_time_boot_ms(const ma
*/
static inline int32_t mavlink_msg_global_position_int_get_lat(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_int32_t(msg, 4);
return _MAV_RETURN_int32_t(msg, 4);
}
/**
......@@ -178,7 +222,7 @@ static inline int32_t mavlink_msg_global_position_int_get_lat(const mavlink_mess
*/
static inline int32_t mavlink_msg_global_position_int_get_lon(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_int32_t(msg, 8);
return _MAV_RETURN_int32_t(msg, 8);
}
/**
......@@ -188,7 +232,7 @@ static inline int32_t mavlink_msg_global_position_int_get_lon(const mavlink_mess
*/
static inline int32_t mavlink_msg_global_position_int_get_alt(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_int32_t(msg, 12);
return _MAV_RETURN_int32_t(msg, 12);
}
/**
......@@ -198,7 +242,7 @@ static inline int32_t mavlink_msg_global_position_int_get_alt(const mavlink_mess
*/
static inline int16_t mavlink_msg_global_position_int_get_vx(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_int16_t(msg, 16);
return _MAV_RETURN_int16_t(msg, 16);
}
/**
......@@ -208,7 +252,7 @@ static inline int16_t mavlink_msg_global_position_int_get_vx(const mavlink_messa
*/
static inline int16_t mavlink_msg_global_position_int_get_vy(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_int16_t(msg, 18);
return _MAV_RETURN_int16_t(msg, 18);
}
/**
......@@ -218,7 +262,7 @@ static inline int16_t mavlink_msg_global_position_int_get_vy(const mavlink_messa
*/
static inline int16_t mavlink_msg_global_position_int_get_vz(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_int16_t(msg, 20);
return _MAV_RETURN_int16_t(msg, 20);
}
/**
......@@ -228,7 +272,7 @@ static inline int16_t mavlink_msg_global_position_int_get_vz(const mavlink_messa
*/
static inline uint16_t mavlink_msg_global_position_int_get_hdg(const mavlink_message_t* msg)
{
return MAVLINK_MSG_RETURN_uint16_t(msg, 22);
return _MAV_RETURN_uint16_t(msg, 22);
}
/**
......@@ -249,6 +293,6 @@ static inline void mavlink_msg_global_position_int_decode(const mavlink_message_
global_position_int->vz = mavlink_msg_global_position_int_get_vz(msg);
global_position_int->hdg = mavlink_msg_global_position_int_get_hdg(msg);
#else
memcpy(global_position_int, MAVLINK_PAYLOAD(msg), 24);
memcpy(global_position_int, _MAV_PAYLOAD(msg), 24);
#endif
}
Supports Markdown
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