/C-OSD/arducam-osd/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/ardupilotmega.h |
---|
0,0 → 1,151 |
/** @file |
* @brief MAVLink comm protocol generated from ardupilotmega.xml |
* @see http://qgroundcontrol.org/mavlink/ |
*/ |
#ifndef ARDUPILOTMEGA_H |
#define ARDUPILOTMEGA_H |
#ifdef __cplusplus |
extern "C" { |
#endif |
// MESSAGE LENGTHS AND CRCS |
#ifndef MAVLINK_MESSAGE_LENGTHS |
#define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 28, 22, 22, 21, 6, 6, 37, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 19, 17, 15, 15, 27, 25, 18, 18, 20, 20, 9, 54, 26, 0, 36, 0, 6, 4, 0, 21, 18, 0, 0, 0, 20, 0, 33, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 4, 12, 15, 13, 6, 15, 14, 0, 12, 3, 8, 28, 36, 3, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0} |
#endif |
#ifndef MAVLINK_MESSAGE_CRCS |
#define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 214, 223, 141, 33, 15, 3, 100, 24, 239, 238, 30, 200, 183, 0, 130, 0, 148, 21, 0, 52, 124, 0, 0, 0, 20, 0, 152, 143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 208, 188, 84, 22, 19, 21, 134, 0, 78, 68, 189, 127, 42, 21, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0} |
#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_TYPE_CHAR,0,0,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,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_SET_MODE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_READ, MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST, MAVLINK_MESSAGE_INFO_PARAM_VALUE, MAVLINK_MESSAGE_INFO_PARAM_SET, 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_ATTITUDE_QUATERNION, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED, MAVLINK_MESSAGE_INFO_GLOBAL_POSITION_INT, MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED, MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW, MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_PARTIAL_LIST, MAVLINK_MESSAGE_INFO_MISSION_WRITE_PARTIAL_LIST, MAVLINK_MESSAGE_INFO_MISSION_ITEM, MAVLINK_MESSAGE_INFO_MISSION_REQUEST, MAVLINK_MESSAGE_INFO_MISSION_SET_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_CURRENT, MAVLINK_MESSAGE_INFO_MISSION_REQUEST_LIST, MAVLINK_MESSAGE_INFO_MISSION_COUNT, MAVLINK_MESSAGE_INFO_MISSION_CLEAR_ALL, MAVLINK_MESSAGE_INFO_MISSION_ITEM_REACHED, MAVLINK_MESSAGE_INFO_MISSION_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, MAVLINK_MESSAGE_INFO_SET_QUAD_MOTORS_SETPOINT, MAVLINK_MESSAGE_INFO_SET_QUAD_SWARM_ROLL_PITCH_YAW_THRUST, MAVLINK_MESSAGE_INFO_NAV_CONTROLLER_OUTPUT, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_STATE_CORRECTION, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_REQUEST_DATA_STREAM, MAVLINK_MESSAGE_INFO_DATA_STREAM, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_MANUAL_CONTROL, MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_VFR_HUD, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_COMMAND_LONG, MAVLINK_MESSAGE_INFO_COMMAND_ACK, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, MAVLINK_MESSAGE_INFO_HIL_STATE, MAVLINK_MESSAGE_INFO_HIL_CONTROLS, MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_OPTICAL_FLOW, MAVLINK_MESSAGE_INFO_GLOBAL_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_POSITION_ESTIMATE, MAVLINK_MESSAGE_INFO_VISION_SPEED_ESTIMATE, MAVLINK_MESSAGE_INFO_VICON_POSITION_ESTIMATE, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_SENSOR_OFFSETS, MAVLINK_MESSAGE_INFO_SET_MAG_OFFSETS, MAVLINK_MESSAGE_INFO_MEMINFO, MAVLINK_MESSAGE_INFO_AP_ADC, MAVLINK_MESSAGE_INFO_DIGICAM_CONFIGURE, MAVLINK_MESSAGE_INFO_DIGICAM_CONTROL, MAVLINK_MESSAGE_INFO_MOUNT_CONFIGURE, MAVLINK_MESSAGE_INFO_MOUNT_CONTROL, MAVLINK_MESSAGE_INFO_MOUNT_STATUS, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, MAVLINK_MESSAGE_INFO_FENCE_POINT, MAVLINK_MESSAGE_INFO_FENCE_FETCH_POINT, MAVLINK_MESSAGE_INFO_FENCE_STATUS, MAVLINK_MESSAGE_INFO_AHRS, MAVLINK_MESSAGE_INFO_SIMSTATE, MAVLINK_MESSAGE_INFO_HWSTATUS, MAVLINK_MESSAGE_INFO_RADIO, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,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, {"EMPTY",0,{{"","",MAVLINK_TYPE_CHAR,0,0,0}}}} |
#endif |
#include "../protocol.h" |
#define MAVLINK_ENABLED_ARDUPILOTMEGA |
// ENUM DEFINITIONS |
/** @brief Enumeration of possible mount operation modes */ |
#ifndef HAVE_ENUM_MAV_MOUNT_MODE |
#define HAVE_ENUM_MAV_MOUNT_MODE |
enum MAV_MOUNT_MODE |
{ |
MAV_MOUNT_MODE_RETRACT=0, /* Load and keep safe position (Roll,Pitch,Yaw) from EEPROM and stop stabilization | */ |
MAV_MOUNT_MODE_NEUTRAL=1, /* Load and keep neutral position (Roll,Pitch,Yaw) from EEPROM. | */ |
MAV_MOUNT_MODE_MAVLINK_TARGETING=2, /* Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization | */ |
MAV_MOUNT_MODE_RC_TARGETING=3, /* Load neutral position and start RC Roll,Pitch,Yaw control with stabilization | */ |
MAV_MOUNT_MODE_GPS_POINT=4, /* Load neutral position and start to point to Lat,Lon,Alt | */ |
MAV_MOUNT_MODE_ENUM_END=5, /* | */ |
}; |
#endif |
/** @brief */ |
#ifndef HAVE_ENUM_MAV_CMD |
#define HAVE_ENUM_MAV_CMD |
enum MAV_CMD |
{ |
MAV_CMD_NAV_WAYPOINT=16, /* Navigate to MISSION. |Hold time in decimal seconds. (ignored by fixed wing, time to stay at MISSION for rotary wing)| Acceptance radius in meters (if the sphere with this radius is hit, the MISSION counts as reached)| 0 to pass through the WP, if > 0 radius in meters to pass by WP. Positive value for clockwise orbit, negative value for counter-clockwise orbit. Allows trajectory control.| Desired yaw angle at MISSION (rotary wing)| Latitude| Longitude| Altitude| */ |
MAV_CMD_NAV_LOITER_UNLIM=17, /* Loiter around this MISSION an unlimited amount of time |Empty| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */ |
MAV_CMD_NAV_LOITER_TURNS=18, /* Loiter around this MISSION for X turns |Turns| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */ |
MAV_CMD_NAV_LOITER_TIME=19, /* Loiter around this MISSION for X seconds |Seconds (decimal)| Empty| Radius around MISSION, in meters. If positive loiter clockwise, else counter-clockwise| Desired yaw angle.| Latitude| Longitude| Altitude| */ |
MAV_CMD_NAV_RETURN_TO_LAUNCH=20, /* Return to launch location |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ |
MAV_CMD_NAV_LAND=21, /* Land at location |Empty| Empty| Empty| Desired yaw angle.| Latitude| Longitude| Altitude| */ |
MAV_CMD_NAV_TAKEOFF=22, /* Takeoff from ground / hand |Minimum pitch (if airspeed sensor present), desired pitch without sensor| Empty| Empty| Yaw angle (if magnetometer present), ignored without magnetometer| Latitude| Longitude| Altitude| */ |
MAV_CMD_NAV_ROI=80, /* Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicles control system to control the vehicle attitude and the attitude of various sensors such as cameras. |Region of intereset mode. (see MAV_ROI enum)| MISSION index/ target ID. (see MAV_ROI enum)| ROI index (allows a vehicle to manage multiple ROI's)| Empty| x the location of the fixed ROI (see MAV_FRAME)| y| z| */ |
MAV_CMD_NAV_PATHPLANNING=81, /* Control autonomous path planning on the MAV. |0: Disable local obstacle avoidance / local path planning (without resetting map), 1: Enable local path planning, 2: Enable and reset local path planning| 0: Disable full path planning (without resetting map), 1: Enable, 2: Enable and reset map/occupancy grid, 3: Enable and reset planned route, but not occupancy grid| Empty| Yaw angle at goal, in compass degrees, [0..360]| Latitude/X of goal| Longitude/Y of goal| Altitude/Z of goal| */ |
MAV_CMD_NAV_LAST=95, /* NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ |
MAV_CMD_CONDITION_DELAY=112, /* Delay mission state machine. |Delay in seconds (decimal)| Empty| Empty| Empty| Empty| Empty| Empty| */ |
MAV_CMD_CONDITION_CHANGE_ALT=113, /* Ascend/descend at rate. Delay mission state machine until desired altitude reached. |Descent / Ascend rate (m/s)| Empty| Empty| Empty| Empty| Empty| Finish Altitude| */ |
MAV_CMD_CONDITION_DISTANCE=114, /* Delay mission state machine until within desired distance of next NAV point. |Distance (meters)| Empty| Empty| Empty| Empty| Empty| Empty| */ |
MAV_CMD_CONDITION_YAW=115, /* Reach a certain target angle. |target angle: [0-360], 0 is north| speed during yaw change:[deg per second]| direction: negative: counter clockwise, positive: clockwise [-1,1]| relative offset or absolute angle: [ 1,0]| Empty| Empty| Empty| */ |
MAV_CMD_CONDITION_LAST=159, /* NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ |
MAV_CMD_DO_SET_MODE=176, /* Set system mode. |Mode, as defined by ENUM MAV_MODE| Empty| Empty| Empty| Empty| Empty| Empty| */ |
MAV_CMD_DO_JUMP=177, /* Jump to the desired command in the mission list. Repeat this action only the specified number of times |Sequence number| Repeat count| Empty| Empty| Empty| Empty| Empty| */ |
MAV_CMD_DO_CHANGE_SPEED=178, /* Change speed and/or throttle set points. |Speed type (0=Airspeed, 1=Ground Speed)| Speed (m/s, -1 indicates no change)| Throttle ( Percent, -1 indicates no change)| Empty| Empty| Empty| Empty| */ |
MAV_CMD_DO_SET_HOME=179, /* Changes the home location either to the current location or a specified location. |Use current (1=use current location, 0=use specified location)| Empty| Empty| Empty| Latitude| Longitude| Altitude| */ |
MAV_CMD_DO_SET_PARAMETER=180, /* Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter. |Parameter number| Parameter value| Empty| Empty| Empty| Empty| Empty| */ |
MAV_CMD_DO_SET_RELAY=181, /* Set a relay to a condition. |Relay number| Setting (1=on, 0=off, others possible depending on system hardware)| Empty| Empty| Empty| Empty| Empty| */ |
MAV_CMD_DO_REPEAT_RELAY=182, /* Cycle a relay on and off for a desired number of cyles with a desired period. |Relay number| Cycle count| Cycle time (seconds, decimal)| Empty| Empty| Empty| Empty| */ |
MAV_CMD_DO_SET_SERVO=183, /* Set a servo to a desired PWM value. |Servo number| PWM (microseconds, 1000 to 2000 typical)| Empty| Empty| Empty| Empty| Empty| */ |
MAV_CMD_DO_REPEAT_SERVO=184, /* Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period. |Servo number| PWM (microseconds, 1000 to 2000 typical)| Cycle count| Cycle time (seconds)| Empty| Empty| Empty| */ |
MAV_CMD_DO_CONTROL_VIDEO=200, /* Control onboard camera system. |Camera ID (-1 for all)| Transmission: 0: disabled, 1: enabled compressed, 2: enabled raw| Transmission mode: 0: video stream, >0: single images every n seconds (decimal)| Recording: 0: disabled, 1: enabled compressed, 2: enabled raw| Empty| Empty| Empty| */ |
MAV_CMD_DO_DIGICAM_CONFIGURE=202, /* Mission command to configure an on-board camera controller system. |Modes: P, TV, AV, M, Etc| Shutter speed: Divisor number for one second| Aperture: F stop number| ISO number e.g. 80, 100, 200, Etc| Exposure type enumerator| Command Identity| Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off)| */ |
MAV_CMD_DO_DIGICAM_CONTROL=203, /* Mission command to control an on-board camera controller system. |Session control e.g. show/hide lens| Zoom's absolute position| Zooming step value to offset zoom from the current position| Focus Locking, Unlocking or Re-locking| Shooting Command| Command Identity| Empty| */ |
MAV_CMD_DO_MOUNT_CONFIGURE=204, /* Mission command to configure a camera or antenna mount |Mount operation mode (see MAV_MOUNT_MODE enum)| stabilize roll? (1 = yes, 0 = no)| stabilize pitch? (1 = yes, 0 = no)| stabilize yaw? (1 = yes, 0 = no)| Empty| Empty| Empty| */ |
MAV_CMD_DO_MOUNT_CONTROL=205, /* Mission command to control a camera or antenna mount |pitch(deg*100) or lat, depending on mount mode.| roll(deg*100) or lon depending on mount mode| yaw(deg*100) or alt (in cm) depending on mount mode| Empty| Empty| Empty| Empty| */ |
MAV_CMD_DO_LAST=240, /* NOP - This command is only used to mark the upper limit of the DO commands in the enumeration |Empty| Empty| Empty| Empty| Empty| Empty| Empty| */ |
MAV_CMD_PREFLIGHT_CALIBRATION=241, /* Trigger calibration. This command will be only accepted if in pre-flight mode. |Gyro calibration: 0: no, 1: yes| Magnetometer calibration: 0: no, 1: yes| Ground pressure: 0: no, 1: yes| Radio calibration: 0: no, 1: yes| Empty| Empty| Empty| */ |
MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS=242, /* Set sensor offsets. This command will be only accepted if in pre-flight mode. |Sensor to adjust the offsets for: 0: gyros, 1: accelerometer, 2: magnetometer, 3: barometer, 4: optical flow| X axis offset (or generic dimension 1), in the sensor's raw units| Y axis offset (or generic dimension 2), in the sensor's raw units| Z axis offset (or generic dimension 3), in the sensor's raw units| Generic dimension 4, in the sensor's raw units| Generic dimension 5, in the sensor's raw units| Generic dimension 6, in the sensor's raw units| */ |
MAV_CMD_PREFLIGHT_STORAGE=245, /* Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode. |Parameter storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM| Mission storage: 0: READ FROM FLASH/EEPROM, 1: WRITE CURRENT TO FLASH/EEPROM| Reserved| Reserved| Empty| Empty| Empty| */ |
MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN=246, /* Request the reboot or shutdown of system components. |0: Do nothing for autopilot, 1: Reboot autopilot, 2: Shutdown autopilot.| 0: Do nothing for onboard computer, 1: Reboot onboard computer, 2: Shutdown onboard computer.| Reserved| Reserved| Empty| Empty| Empty| */ |
MAV_CMD_OVERRIDE_GOTO=252, /* Hold / continue the current action |MAV_GOTO_DO_HOLD: hold MAV_GOTO_DO_CONTINUE: continue with next item in mission plan| MAV_GOTO_HOLD_AT_CURRENT_POSITION: Hold at current position MAV_GOTO_HOLD_AT_SPECIFIED_POSITION: hold at specified position| MAV_FRAME coordinate frame of hold point| Desired yaw angle in degrees| Latitude / X position| Longitude / Y position| Altitude / Z position| */ |
MAV_CMD_MISSION_START=300, /* start running a mission |first_item: the first mission item to run| last_item: the last mission item to run (after this item is run, the mission ends)| */ |
MAV_CMD_COMPONENT_ARM_DISARM=400, /* Arms / Disarms a component |1 to arm, 0 to disarm| */ |
MAV_CMD_ENUM_END=401, /* | */ |
}; |
#endif |
/** @brief */ |
#ifndef HAVE_ENUM_FENCE_ACTION |
#define HAVE_ENUM_FENCE_ACTION |
enum FENCE_ACTION |
{ |
FENCE_ACTION_NONE=0, /* Disable fenced mode | */ |
FENCE_ACTION_GUIDED=1, /* Switched to guided mode to return point (fence point 0) | */ |
FENCE_ACTION_ENUM_END=2, /* | */ |
}; |
#endif |
/** @brief */ |
#ifndef HAVE_ENUM_FENCE_BREACH |
#define HAVE_ENUM_FENCE_BREACH |
enum FENCE_BREACH |
{ |
FENCE_BREACH_NONE=0, /* No last fence breach | */ |
FENCE_BREACH_MINALT=1, /* Breached minimum altitude | */ |
FENCE_BREACH_MAXALT=2, /* Breached minimum altitude | */ |
FENCE_BREACH_BOUNDARY=3, /* Breached fence boundary | */ |
FENCE_BREACH_ENUM_END=4, /* | */ |
}; |
#endif |
#include "../common/common.h" |
// MAVLINK VERSION |
#ifndef MAVLINK_VERSION |
#define MAVLINK_VERSION 2 |
#endif |
#if (MAVLINK_VERSION == 0) |
#undef MAVLINK_VERSION |
#define MAVLINK_VERSION 2 |
#endif |
// MESSAGE DEFINITIONS |
#include "./mavlink_msg_sensor_offsets.h" |
#include "./mavlink_msg_set_mag_offsets.h" |
#include "./mavlink_msg_meminfo.h" |
#include "./mavlink_msg_ap_adc.h" |
#include "./mavlink_msg_digicam_configure.h" |
#include "./mavlink_msg_digicam_control.h" |
#include "./mavlink_msg_mount_configure.h" |
#include "./mavlink_msg_mount_control.h" |
#include "./mavlink_msg_mount_status.h" |
#include "./mavlink_msg_fence_point.h" |
#include "./mavlink_msg_fence_fetch_point.h" |
#include "./mavlink_msg_fence_status.h" |
#include "./mavlink_msg_ahrs.h" |
#include "./mavlink_msg_simstate.h" |
#include "./mavlink_msg_hwstatus.h" |
#include "./mavlink_msg_radio.h" |
#ifdef __cplusplus |
} |
#endif // __cplusplus |
#endif // ARDUPILOTMEGA_H |
/C-OSD/arducam-osd/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink.h |
---|
0,0 → 1,27 |
/** @file |
* @brief MAVLink comm protocol built from ardupilotmega.xml |
* @see http://pixhawk.ethz.ch/software/mavlink |
*/ |
#ifndef MAVLINK_H |
#define MAVLINK_H |
#ifndef MAVLINK_STX |
#define MAVLINK_STX 254 |
#endif |
#ifndef MAVLINK_ENDIAN |
#define MAVLINK_ENDIAN MAVLINK_LITTLE_ENDIAN |
#endif |
#ifndef MAVLINK_ALIGNED_FIELDS |
#define MAVLINK_ALIGNED_FIELDS 1 |
#endif |
#ifndef MAVLINK_CRC_EXTRA |
#define MAVLINK_CRC_EXTRA 1 |
#endif |
#include "version.h" |
#include "ardupilotmega.h" |
#endif // MAVLINK_H |
/C-OSD/arducam-osd/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_ahrs.h |
---|
0,0 → 1,276 |
// MESSAGE AHRS PACKING |
#define MAVLINK_MSG_ID_AHRS 163 |
typedef struct __mavlink_ahrs_t |
{ |
float omegaIx; ///< X gyro drift estimate rad/s |
float omegaIy; ///< Y gyro drift estimate rad/s |
float omegaIz; ///< Z gyro drift estimate rad/s |
float accel_weight; ///< average accel_weight |
float renorm_val; ///< average renormalisation value |
float error_rp; ///< average error_roll_pitch value |
float error_yaw; ///< average error_yaw value |
} mavlink_ahrs_t; |
#define MAVLINK_MSG_ID_AHRS_LEN 28 |
#define MAVLINK_MSG_ID_163_LEN 28 |
#define MAVLINK_MESSAGE_INFO_AHRS { \ |
"AHRS", \ |
7, \ |
{ { "omegaIx", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_ahrs_t, omegaIx) }, \ |
{ "omegaIy", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_ahrs_t, omegaIy) }, \ |
{ "omegaIz", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_ahrs_t, omegaIz) }, \ |
{ "accel_weight", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_ahrs_t, accel_weight) }, \ |
{ "renorm_val", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_ahrs_t, renorm_val) }, \ |
{ "error_rp", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_ahrs_t, error_rp) }, \ |
{ "error_yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_ahrs_t, error_yaw) }, \ |
} \ |
} |
/** |
* @brief Pack a ahrs 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 omegaIx X gyro drift estimate rad/s |
* @param omegaIy Y gyro drift estimate rad/s |
* @param omegaIz Z gyro drift estimate rad/s |
* @param accel_weight average accel_weight |
* @param renorm_val average renormalisation value |
* @param error_rp average error_roll_pitch value |
* @param error_yaw average error_yaw value |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_ahrs_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, |
float omegaIx, float omegaIy, float omegaIz, float accel_weight, float renorm_val, float error_rp, float error_yaw) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[28]; |
_mav_put_float(buf, 0, omegaIx); |
_mav_put_float(buf, 4, omegaIy); |
_mav_put_float(buf, 8, omegaIz); |
_mav_put_float(buf, 12, accel_weight); |
_mav_put_float(buf, 16, renorm_val); |
_mav_put_float(buf, 20, error_rp); |
_mav_put_float(buf, 24, error_yaw); |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28); |
#else |
mavlink_ahrs_t packet; |
packet.omegaIx = omegaIx; |
packet.omegaIy = omegaIy; |
packet.omegaIz = omegaIz; |
packet.accel_weight = accel_weight; |
packet.renorm_val = renorm_val; |
packet.error_rp = error_rp; |
packet.error_yaw = error_yaw; |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28); |
#endif |
msg->msgid = MAVLINK_MSG_ID_AHRS; |
return mavlink_finalize_message(msg, system_id, component_id, 28, 127); |
} |
/** |
* @brief Pack a ahrs 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 omegaIx X gyro drift estimate rad/s |
* @param omegaIy Y gyro drift estimate rad/s |
* @param omegaIz Z gyro drift estimate rad/s |
* @param accel_weight average accel_weight |
* @param renorm_val average renormalisation value |
* @param error_rp average error_roll_pitch value |
* @param error_yaw average error_yaw value |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_ahrs_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, |
mavlink_message_t* msg, |
float omegaIx,float omegaIy,float omegaIz,float accel_weight,float renorm_val,float error_rp,float error_yaw) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[28]; |
_mav_put_float(buf, 0, omegaIx); |
_mav_put_float(buf, 4, omegaIy); |
_mav_put_float(buf, 8, omegaIz); |
_mav_put_float(buf, 12, accel_weight); |
_mav_put_float(buf, 16, renorm_val); |
_mav_put_float(buf, 20, error_rp); |
_mav_put_float(buf, 24, error_yaw); |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28); |
#else |
mavlink_ahrs_t packet; |
packet.omegaIx = omegaIx; |
packet.omegaIy = omegaIy; |
packet.omegaIz = omegaIz; |
packet.accel_weight = accel_weight; |
packet.renorm_val = renorm_val; |
packet.error_rp = error_rp; |
packet.error_yaw = error_yaw; |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28); |
#endif |
msg->msgid = MAVLINK_MSG_ID_AHRS; |
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 28, 127); |
} |
/** |
* @brief Encode a ahrs 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 ahrs C-struct to read the message contents from |
*/ |
static inline uint16_t mavlink_msg_ahrs_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_ahrs_t* ahrs) |
{ |
return mavlink_msg_ahrs_pack(system_id, component_id, msg, ahrs->omegaIx, ahrs->omegaIy, ahrs->omegaIz, ahrs->accel_weight, ahrs->renorm_val, ahrs->error_rp, ahrs->error_yaw); |
} |
/** |
* @brief Send a ahrs message |
* @param chan MAVLink channel to send the message |
* |
* @param omegaIx X gyro drift estimate rad/s |
* @param omegaIy Y gyro drift estimate rad/s |
* @param omegaIz Z gyro drift estimate rad/s |
* @param accel_weight average accel_weight |
* @param renorm_val average renormalisation value |
* @param error_rp average error_roll_pitch value |
* @param error_yaw average error_yaw value |
*/ |
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS |
static inline void mavlink_msg_ahrs_send(mavlink_channel_t chan, float omegaIx, float omegaIy, float omegaIz, float accel_weight, float renorm_val, float error_rp, float error_yaw) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[28]; |
_mav_put_float(buf, 0, omegaIx); |
_mav_put_float(buf, 4, omegaIy); |
_mav_put_float(buf, 8, omegaIz); |
_mav_put_float(buf, 12, accel_weight); |
_mav_put_float(buf, 16, renorm_val); |
_mav_put_float(buf, 20, error_rp); |
_mav_put_float(buf, 24, error_yaw); |
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AHRS, buf, 28, 127); |
#else |
mavlink_ahrs_t packet; |
packet.omegaIx = omegaIx; |
packet.omegaIy = omegaIy; |
packet.omegaIz = omegaIz; |
packet.accel_weight = accel_weight; |
packet.renorm_val = renorm_val; |
packet.error_rp = error_rp; |
packet.error_yaw = error_yaw; |
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AHRS, (const char *)&packet, 28, 127); |
#endif |
} |
#endif |
// MESSAGE AHRS UNPACKING |
/** |
* @brief Get field omegaIx from ahrs message |
* |
* @return X gyro drift estimate rad/s |
*/ |
static inline float mavlink_msg_ahrs_get_omegaIx(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_float(msg, 0); |
} |
/** |
* @brief Get field omegaIy from ahrs message |
* |
* @return Y gyro drift estimate rad/s |
*/ |
static inline float mavlink_msg_ahrs_get_omegaIy(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_float(msg, 4); |
} |
/** |
* @brief Get field omegaIz from ahrs message |
* |
* @return Z gyro drift estimate rad/s |
*/ |
static inline float mavlink_msg_ahrs_get_omegaIz(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_float(msg, 8); |
} |
/** |
* @brief Get field accel_weight from ahrs message |
* |
* @return average accel_weight |
*/ |
static inline float mavlink_msg_ahrs_get_accel_weight(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_float(msg, 12); |
} |
/** |
* @brief Get field renorm_val from ahrs message |
* |
* @return average renormalisation value |
*/ |
static inline float mavlink_msg_ahrs_get_renorm_val(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_float(msg, 16); |
} |
/** |
* @brief Get field error_rp from ahrs message |
* |
* @return average error_roll_pitch value |
*/ |
static inline float mavlink_msg_ahrs_get_error_rp(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_float(msg, 20); |
} |
/** |
* @brief Get field error_yaw from ahrs message |
* |
* @return average error_yaw value |
*/ |
static inline float mavlink_msg_ahrs_get_error_yaw(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_float(msg, 24); |
} |
/** |
* @brief Decode a ahrs message into a struct |
* |
* @param msg The message to decode |
* @param ahrs C-struct to decode the message contents into |
*/ |
static inline void mavlink_msg_ahrs_decode(const mavlink_message_t* msg, mavlink_ahrs_t* ahrs) |
{ |
#if MAVLINK_NEED_BYTE_SWAP |
ahrs->omegaIx = mavlink_msg_ahrs_get_omegaIx(msg); |
ahrs->omegaIy = mavlink_msg_ahrs_get_omegaIy(msg); |
ahrs->omegaIz = mavlink_msg_ahrs_get_omegaIz(msg); |
ahrs->accel_weight = mavlink_msg_ahrs_get_accel_weight(msg); |
ahrs->renorm_val = mavlink_msg_ahrs_get_renorm_val(msg); |
ahrs->error_rp = mavlink_msg_ahrs_get_error_rp(msg); |
ahrs->error_yaw = mavlink_msg_ahrs_get_error_yaw(msg); |
#else |
memcpy(ahrs, _MAV_PAYLOAD(msg), 28); |
#endif |
} |
/C-OSD/arducam-osd/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_ap_adc.h |
---|
0,0 → 1,254 |
// MESSAGE AP_ADC PACKING |
#define MAVLINK_MSG_ID_AP_ADC 153 |
typedef struct __mavlink_ap_adc_t |
{ |
uint16_t adc1; ///< ADC output 1 |
uint16_t adc2; ///< ADC output 2 |
uint16_t adc3; ///< ADC output 3 |
uint16_t adc4; ///< ADC output 4 |
uint16_t adc5; ///< ADC output 5 |
uint16_t adc6; ///< ADC output 6 |
} mavlink_ap_adc_t; |
#define MAVLINK_MSG_ID_AP_ADC_LEN 12 |
#define MAVLINK_MSG_ID_153_LEN 12 |
#define MAVLINK_MESSAGE_INFO_AP_ADC { \ |
"AP_ADC", \ |
6, \ |
{ { "adc1", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_ap_adc_t, adc1) }, \ |
{ "adc2", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_ap_adc_t, adc2) }, \ |
{ "adc3", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_ap_adc_t, adc3) }, \ |
{ "adc4", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_ap_adc_t, adc4) }, \ |
{ "adc5", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_ap_adc_t, adc5) }, \ |
{ "adc6", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_ap_adc_t, adc6) }, \ |
} \ |
} |
/** |
* @brief Pack a ap_adc 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 adc1 ADC output 1 |
* @param adc2 ADC output 2 |
* @param adc3 ADC output 3 |
* @param adc4 ADC output 4 |
* @param adc5 ADC output 5 |
* @param adc6 ADC output 6 |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_ap_adc_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, |
uint16_t adc1, uint16_t adc2, uint16_t adc3, uint16_t adc4, uint16_t adc5, uint16_t adc6) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[12]; |
_mav_put_uint16_t(buf, 0, adc1); |
_mav_put_uint16_t(buf, 2, adc2); |
_mav_put_uint16_t(buf, 4, adc3); |
_mav_put_uint16_t(buf, 6, adc4); |
_mav_put_uint16_t(buf, 8, adc5); |
_mav_put_uint16_t(buf, 10, adc6); |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); |
#else |
mavlink_ap_adc_t packet; |
packet.adc1 = adc1; |
packet.adc2 = adc2; |
packet.adc3 = adc3; |
packet.adc4 = adc4; |
packet.adc5 = adc5; |
packet.adc6 = adc6; |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); |
#endif |
msg->msgid = MAVLINK_MSG_ID_AP_ADC; |
return mavlink_finalize_message(msg, system_id, component_id, 12, 188); |
} |
/** |
* @brief Pack a ap_adc 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 adc1 ADC output 1 |
* @param adc2 ADC output 2 |
* @param adc3 ADC output 3 |
* @param adc4 ADC output 4 |
* @param adc5 ADC output 5 |
* @param adc6 ADC output 6 |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_ap_adc_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, |
mavlink_message_t* msg, |
uint16_t adc1,uint16_t adc2,uint16_t adc3,uint16_t adc4,uint16_t adc5,uint16_t adc6) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[12]; |
_mav_put_uint16_t(buf, 0, adc1); |
_mav_put_uint16_t(buf, 2, adc2); |
_mav_put_uint16_t(buf, 4, adc3); |
_mav_put_uint16_t(buf, 6, adc4); |
_mav_put_uint16_t(buf, 8, adc5); |
_mav_put_uint16_t(buf, 10, adc6); |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); |
#else |
mavlink_ap_adc_t packet; |
packet.adc1 = adc1; |
packet.adc2 = adc2; |
packet.adc3 = adc3; |
packet.adc4 = adc4; |
packet.adc5 = adc5; |
packet.adc6 = adc6; |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); |
#endif |
msg->msgid = MAVLINK_MSG_ID_AP_ADC; |
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12, 188); |
} |
/** |
* @brief Encode a ap_adc 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 ap_adc C-struct to read the message contents from |
*/ |
static inline uint16_t mavlink_msg_ap_adc_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_ap_adc_t* ap_adc) |
{ |
return mavlink_msg_ap_adc_pack(system_id, component_id, msg, ap_adc->adc1, ap_adc->adc2, ap_adc->adc3, ap_adc->adc4, ap_adc->adc5, ap_adc->adc6); |
} |
/** |
* @brief Send a ap_adc message |
* @param chan MAVLink channel to send the message |
* |
* @param adc1 ADC output 1 |
* @param adc2 ADC output 2 |
* @param adc3 ADC output 3 |
* @param adc4 ADC output 4 |
* @param adc5 ADC output 5 |
* @param adc6 ADC output 6 |
*/ |
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS |
static inline void mavlink_msg_ap_adc_send(mavlink_channel_t chan, uint16_t adc1, uint16_t adc2, uint16_t adc3, uint16_t adc4, uint16_t adc5, uint16_t adc6) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[12]; |
_mav_put_uint16_t(buf, 0, adc1); |
_mav_put_uint16_t(buf, 2, adc2); |
_mav_put_uint16_t(buf, 4, adc3); |
_mav_put_uint16_t(buf, 6, adc4); |
_mav_put_uint16_t(buf, 8, adc5); |
_mav_put_uint16_t(buf, 10, adc6); |
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AP_ADC, buf, 12, 188); |
#else |
mavlink_ap_adc_t packet; |
packet.adc1 = adc1; |
packet.adc2 = adc2; |
packet.adc3 = adc3; |
packet.adc4 = adc4; |
packet.adc5 = adc5; |
packet.adc6 = adc6; |
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AP_ADC, (const char *)&packet, 12, 188); |
#endif |
} |
#endif |
// MESSAGE AP_ADC UNPACKING |
/** |
* @brief Get field adc1 from ap_adc message |
* |
* @return ADC output 1 |
*/ |
static inline uint16_t mavlink_msg_ap_adc_get_adc1(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint16_t(msg, 0); |
} |
/** |
* @brief Get field adc2 from ap_adc message |
* |
* @return ADC output 2 |
*/ |
static inline uint16_t mavlink_msg_ap_adc_get_adc2(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint16_t(msg, 2); |
} |
/** |
* @brief Get field adc3 from ap_adc message |
* |
* @return ADC output 3 |
*/ |
static inline uint16_t mavlink_msg_ap_adc_get_adc3(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint16_t(msg, 4); |
} |
/** |
* @brief Get field adc4 from ap_adc message |
* |
* @return ADC output 4 |
*/ |
static inline uint16_t mavlink_msg_ap_adc_get_adc4(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint16_t(msg, 6); |
} |
/** |
* @brief Get field adc5 from ap_adc message |
* |
* @return ADC output 5 |
*/ |
static inline uint16_t mavlink_msg_ap_adc_get_adc5(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint16_t(msg, 8); |
} |
/** |
* @brief Get field adc6 from ap_adc message |
* |
* @return ADC output 6 |
*/ |
static inline uint16_t mavlink_msg_ap_adc_get_adc6(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint16_t(msg, 10); |
} |
/** |
* @brief Decode a ap_adc message into a struct |
* |
* @param msg The message to decode |
* @param ap_adc C-struct to decode the message contents into |
*/ |
static inline void mavlink_msg_ap_adc_decode(const mavlink_message_t* msg, mavlink_ap_adc_t* ap_adc) |
{ |
#if MAVLINK_NEED_BYTE_SWAP |
ap_adc->adc1 = mavlink_msg_ap_adc_get_adc1(msg); |
ap_adc->adc2 = mavlink_msg_ap_adc_get_adc2(msg); |
ap_adc->adc3 = mavlink_msg_ap_adc_get_adc3(msg); |
ap_adc->adc4 = mavlink_msg_ap_adc_get_adc4(msg); |
ap_adc->adc5 = mavlink_msg_ap_adc_get_adc5(msg); |
ap_adc->adc6 = mavlink_msg_ap_adc_get_adc6(msg); |
#else |
memcpy(ap_adc, _MAV_PAYLOAD(msg), 12); |
#endif |
} |
/C-OSD/arducam-osd/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_digicam_configure.h |
---|
0,0 → 1,364 |
// MESSAGE DIGICAM_CONFIGURE PACKING |
#define MAVLINK_MSG_ID_DIGICAM_CONFIGURE 154 |
typedef struct __mavlink_digicam_configure_t |
{ |
float extra_value; ///< Correspondent value to given extra_param |
uint16_t shutter_speed; ///< Divisor number //e.g. 1000 means 1/1000 (0 means ignore) |
uint8_t target_system; ///< System ID |
uint8_t target_component; ///< Component ID |
uint8_t mode; ///< Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore) |
uint8_t aperture; ///< F stop number x 10 //e.g. 28 means 2.8 (0 means ignore) |
uint8_t iso; ///< ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore) |
uint8_t exposure_type; ///< Exposure type enumeration from 1 to N (0 means ignore) |
uint8_t command_id; ///< Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once |
uint8_t engine_cut_off; ///< Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off) |
uint8_t extra_param; ///< Extra parameters enumeration (0 means ignore) |
} mavlink_digicam_configure_t; |
#define MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN 15 |
#define MAVLINK_MSG_ID_154_LEN 15 |
#define MAVLINK_MESSAGE_INFO_DIGICAM_CONFIGURE { \ |
"DIGICAM_CONFIGURE", \ |
11, \ |
{ { "extra_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_digicam_configure_t, extra_value) }, \ |
{ "shutter_speed", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_digicam_configure_t, shutter_speed) }, \ |
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_digicam_configure_t, target_system) }, \ |
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_digicam_configure_t, target_component) }, \ |
{ "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_digicam_configure_t, mode) }, \ |
{ "aperture", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_digicam_configure_t, aperture) }, \ |
{ "iso", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_digicam_configure_t, iso) }, \ |
{ "exposure_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_digicam_configure_t, exposure_type) }, \ |
{ "command_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_digicam_configure_t, command_id) }, \ |
{ "engine_cut_off", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_digicam_configure_t, engine_cut_off) }, \ |
{ "extra_param", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_digicam_configure_t, extra_param) }, \ |
} \ |
} |
/** |
* @brief Pack a digicam_configure 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 target_system System ID |
* @param target_component Component ID |
* @param mode Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore) |
* @param shutter_speed Divisor number //e.g. 1000 means 1/1000 (0 means ignore) |
* @param aperture F stop number x 10 //e.g. 28 means 2.8 (0 means ignore) |
* @param iso ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore) |
* @param exposure_type Exposure type enumeration from 1 to N (0 means ignore) |
* @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once |
* @param engine_cut_off Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off) |
* @param extra_param Extra parameters enumeration (0 means ignore) |
* @param extra_value Correspondent value to given extra_param |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_digicam_configure_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, |
uint8_t target_system, uint8_t target_component, uint8_t mode, uint16_t shutter_speed, uint8_t aperture, uint8_t iso, uint8_t exposure_type, uint8_t command_id, uint8_t engine_cut_off, uint8_t extra_param, float extra_value) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[15]; |
_mav_put_float(buf, 0, extra_value); |
_mav_put_uint16_t(buf, 4, shutter_speed); |
_mav_put_uint8_t(buf, 6, target_system); |
_mav_put_uint8_t(buf, 7, target_component); |
_mav_put_uint8_t(buf, 8, mode); |
_mav_put_uint8_t(buf, 9, aperture); |
_mav_put_uint8_t(buf, 10, iso); |
_mav_put_uint8_t(buf, 11, exposure_type); |
_mav_put_uint8_t(buf, 12, command_id); |
_mav_put_uint8_t(buf, 13, engine_cut_off); |
_mav_put_uint8_t(buf, 14, extra_param); |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15); |
#else |
mavlink_digicam_configure_t packet; |
packet.extra_value = extra_value; |
packet.shutter_speed = shutter_speed; |
packet.target_system = target_system; |
packet.target_component = target_component; |
packet.mode = mode; |
packet.aperture = aperture; |
packet.iso = iso; |
packet.exposure_type = exposure_type; |
packet.command_id = command_id; |
packet.engine_cut_off = engine_cut_off; |
packet.extra_param = extra_param; |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15); |
#endif |
msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONFIGURE; |
return mavlink_finalize_message(msg, system_id, component_id, 15, 84); |
} |
/** |
* @brief Pack a digicam_configure 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 target_system System ID |
* @param target_component Component ID |
* @param mode Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore) |
* @param shutter_speed Divisor number //e.g. 1000 means 1/1000 (0 means ignore) |
* @param aperture F stop number x 10 //e.g. 28 means 2.8 (0 means ignore) |
* @param iso ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore) |
* @param exposure_type Exposure type enumeration from 1 to N (0 means ignore) |
* @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once |
* @param engine_cut_off Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off) |
* @param extra_param Extra parameters enumeration (0 means ignore) |
* @param extra_value Correspondent value to given extra_param |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_digicam_configure_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, |
mavlink_message_t* msg, |
uint8_t target_system,uint8_t target_component,uint8_t mode,uint16_t shutter_speed,uint8_t aperture,uint8_t iso,uint8_t exposure_type,uint8_t command_id,uint8_t engine_cut_off,uint8_t extra_param,float extra_value) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[15]; |
_mav_put_float(buf, 0, extra_value); |
_mav_put_uint16_t(buf, 4, shutter_speed); |
_mav_put_uint8_t(buf, 6, target_system); |
_mav_put_uint8_t(buf, 7, target_component); |
_mav_put_uint8_t(buf, 8, mode); |
_mav_put_uint8_t(buf, 9, aperture); |
_mav_put_uint8_t(buf, 10, iso); |
_mav_put_uint8_t(buf, 11, exposure_type); |
_mav_put_uint8_t(buf, 12, command_id); |
_mav_put_uint8_t(buf, 13, engine_cut_off); |
_mav_put_uint8_t(buf, 14, extra_param); |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15); |
#else |
mavlink_digicam_configure_t packet; |
packet.extra_value = extra_value; |
packet.shutter_speed = shutter_speed; |
packet.target_system = target_system; |
packet.target_component = target_component; |
packet.mode = mode; |
packet.aperture = aperture; |
packet.iso = iso; |
packet.exposure_type = exposure_type; |
packet.command_id = command_id; |
packet.engine_cut_off = engine_cut_off; |
packet.extra_param = extra_param; |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15); |
#endif |
msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONFIGURE; |
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 15, 84); |
} |
/** |
* @brief Encode a digicam_configure 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 digicam_configure C-struct to read the message contents from |
*/ |
static inline uint16_t mavlink_msg_digicam_configure_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_digicam_configure_t* digicam_configure) |
{ |
return mavlink_msg_digicam_configure_pack(system_id, component_id, msg, digicam_configure->target_system, digicam_configure->target_component, digicam_configure->mode, digicam_configure->shutter_speed, digicam_configure->aperture, digicam_configure->iso, digicam_configure->exposure_type, digicam_configure->command_id, digicam_configure->engine_cut_off, digicam_configure->extra_param, digicam_configure->extra_value); |
} |
/** |
* @brief Send a digicam_configure message |
* @param chan MAVLink channel to send the message |
* |
* @param target_system System ID |
* @param target_component Component ID |
* @param mode Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore) |
* @param shutter_speed Divisor number //e.g. 1000 means 1/1000 (0 means ignore) |
* @param aperture F stop number x 10 //e.g. 28 means 2.8 (0 means ignore) |
* @param iso ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore) |
* @param exposure_type Exposure type enumeration from 1 to N (0 means ignore) |
* @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once |
* @param engine_cut_off Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off) |
* @param extra_param Extra parameters enumeration (0 means ignore) |
* @param extra_value Correspondent value to given extra_param |
*/ |
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS |
static inline void mavlink_msg_digicam_configure_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t mode, uint16_t shutter_speed, uint8_t aperture, uint8_t iso, uint8_t exposure_type, uint8_t command_id, uint8_t engine_cut_off, uint8_t extra_param, float extra_value) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[15]; |
_mav_put_float(buf, 0, extra_value); |
_mav_put_uint16_t(buf, 4, shutter_speed); |
_mav_put_uint8_t(buf, 6, target_system); |
_mav_put_uint8_t(buf, 7, target_component); |
_mav_put_uint8_t(buf, 8, mode); |
_mav_put_uint8_t(buf, 9, aperture); |
_mav_put_uint8_t(buf, 10, iso); |
_mav_put_uint8_t(buf, 11, exposure_type); |
_mav_put_uint8_t(buf, 12, command_id); |
_mav_put_uint8_t(buf, 13, engine_cut_off); |
_mav_put_uint8_t(buf, 14, extra_param); |
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE, buf, 15, 84); |
#else |
mavlink_digicam_configure_t packet; |
packet.extra_value = extra_value; |
packet.shutter_speed = shutter_speed; |
packet.target_system = target_system; |
packet.target_component = target_component; |
packet.mode = mode; |
packet.aperture = aperture; |
packet.iso = iso; |
packet.exposure_type = exposure_type; |
packet.command_id = command_id; |
packet.engine_cut_off = engine_cut_off; |
packet.extra_param = extra_param; |
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE, (const char *)&packet, 15, 84); |
#endif |
} |
#endif |
// MESSAGE DIGICAM_CONFIGURE UNPACKING |
/** |
* @brief Get field target_system from digicam_configure message |
* |
* @return System ID |
*/ |
static inline uint8_t mavlink_msg_digicam_configure_get_target_system(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 6); |
} |
/** |
* @brief Get field target_component from digicam_configure message |
* |
* @return Component ID |
*/ |
static inline uint8_t mavlink_msg_digicam_configure_get_target_component(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 7); |
} |
/** |
* @brief Get field mode from digicam_configure message |
* |
* @return Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore) |
*/ |
static inline uint8_t mavlink_msg_digicam_configure_get_mode(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 8); |
} |
/** |
* @brief Get field shutter_speed from digicam_configure message |
* |
* @return Divisor number //e.g. 1000 means 1/1000 (0 means ignore) |
*/ |
static inline uint16_t mavlink_msg_digicam_configure_get_shutter_speed(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint16_t(msg, 4); |
} |
/** |
* @brief Get field aperture from digicam_configure message |
* |
* @return F stop number x 10 //e.g. 28 means 2.8 (0 means ignore) |
*/ |
static inline uint8_t mavlink_msg_digicam_configure_get_aperture(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 9); |
} |
/** |
* @brief Get field iso from digicam_configure message |
* |
* @return ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore) |
*/ |
static inline uint8_t mavlink_msg_digicam_configure_get_iso(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 10); |
} |
/** |
* @brief Get field exposure_type from digicam_configure message |
* |
* @return Exposure type enumeration from 1 to N (0 means ignore) |
*/ |
static inline uint8_t mavlink_msg_digicam_configure_get_exposure_type(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 11); |
} |
/** |
* @brief Get field command_id from digicam_configure message |
* |
* @return Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once |
*/ |
static inline uint8_t mavlink_msg_digicam_configure_get_command_id(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 12); |
} |
/** |
* @brief Get field engine_cut_off from digicam_configure message |
* |
* @return Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off) |
*/ |
static inline uint8_t mavlink_msg_digicam_configure_get_engine_cut_off(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 13); |
} |
/** |
* @brief Get field extra_param from digicam_configure message |
* |
* @return Extra parameters enumeration (0 means ignore) |
*/ |
static inline uint8_t mavlink_msg_digicam_configure_get_extra_param(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 14); |
} |
/** |
* @brief Get field extra_value from digicam_configure message |
* |
* @return Correspondent value to given extra_param |
*/ |
static inline float mavlink_msg_digicam_configure_get_extra_value(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_float(msg, 0); |
} |
/** |
* @brief Decode a digicam_configure message into a struct |
* |
* @param msg The message to decode |
* @param digicam_configure C-struct to decode the message contents into |
*/ |
static inline void mavlink_msg_digicam_configure_decode(const mavlink_message_t* msg, mavlink_digicam_configure_t* digicam_configure) |
{ |
#if MAVLINK_NEED_BYTE_SWAP |
digicam_configure->extra_value = mavlink_msg_digicam_configure_get_extra_value(msg); |
digicam_configure->shutter_speed = mavlink_msg_digicam_configure_get_shutter_speed(msg); |
digicam_configure->target_system = mavlink_msg_digicam_configure_get_target_system(msg); |
digicam_configure->target_component = mavlink_msg_digicam_configure_get_target_component(msg); |
digicam_configure->mode = mavlink_msg_digicam_configure_get_mode(msg); |
digicam_configure->aperture = mavlink_msg_digicam_configure_get_aperture(msg); |
digicam_configure->iso = mavlink_msg_digicam_configure_get_iso(msg); |
digicam_configure->exposure_type = mavlink_msg_digicam_configure_get_exposure_type(msg); |
digicam_configure->command_id = mavlink_msg_digicam_configure_get_command_id(msg); |
digicam_configure->engine_cut_off = mavlink_msg_digicam_configure_get_engine_cut_off(msg); |
digicam_configure->extra_param = mavlink_msg_digicam_configure_get_extra_param(msg); |
#else |
memcpy(digicam_configure, _MAV_PAYLOAD(msg), 15); |
#endif |
} |
/C-OSD/arducam-osd/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_digicam_control.h |
---|
0,0 → 1,342 |
// MESSAGE DIGICAM_CONTROL PACKING |
#define MAVLINK_MSG_ID_DIGICAM_CONTROL 155 |
typedef struct __mavlink_digicam_control_t |
{ |
float extra_value; ///< Correspondent value to given extra_param |
uint8_t target_system; ///< System ID |
uint8_t target_component; ///< Component ID |
uint8_t session; ///< 0: stop, 1: start or keep it up //Session control e.g. show/hide lens |
uint8_t zoom_pos; ///< 1 to N //Zoom's absolute position (0 means ignore) |
int8_t zoom_step; ///< -100 to 100 //Zooming step value to offset zoom from the current position |
uint8_t focus_lock; ///< 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus |
uint8_t shot; ///< 0: ignore, 1: shot or start filming |
uint8_t command_id; ///< Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once |
uint8_t extra_param; ///< Extra parameters enumeration (0 means ignore) |
} mavlink_digicam_control_t; |
#define MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN 13 |
#define MAVLINK_MSG_ID_155_LEN 13 |
#define MAVLINK_MESSAGE_INFO_DIGICAM_CONTROL { \ |
"DIGICAM_CONTROL", \ |
10, \ |
{ { "extra_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_digicam_control_t, extra_value) }, \ |
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_digicam_control_t, target_system) }, \ |
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_digicam_control_t, target_component) }, \ |
{ "session", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_digicam_control_t, session) }, \ |
{ "zoom_pos", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_digicam_control_t, zoom_pos) }, \ |
{ "zoom_step", NULL, MAVLINK_TYPE_INT8_T, 0, 8, offsetof(mavlink_digicam_control_t, zoom_step) }, \ |
{ "focus_lock", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_digicam_control_t, focus_lock) }, \ |
{ "shot", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_digicam_control_t, shot) }, \ |
{ "command_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_digicam_control_t, command_id) }, \ |
{ "extra_param", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_digicam_control_t, extra_param) }, \ |
} \ |
} |
/** |
* @brief Pack a digicam_control 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 target_system System ID |
* @param target_component Component ID |
* @param session 0: stop, 1: start or keep it up //Session control e.g. show/hide lens |
* @param zoom_pos 1 to N //Zoom's absolute position (0 means ignore) |
* @param zoom_step -100 to 100 //Zooming step value to offset zoom from the current position |
* @param focus_lock 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus |
* @param shot 0: ignore, 1: shot or start filming |
* @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once |
* @param extra_param Extra parameters enumeration (0 means ignore) |
* @param extra_value Correspondent value to given extra_param |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_digicam_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, |
uint8_t target_system, uint8_t target_component, uint8_t session, uint8_t zoom_pos, int8_t zoom_step, uint8_t focus_lock, uint8_t shot, uint8_t command_id, uint8_t extra_param, float extra_value) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[13]; |
_mav_put_float(buf, 0, extra_value); |
_mav_put_uint8_t(buf, 4, target_system); |
_mav_put_uint8_t(buf, 5, target_component); |
_mav_put_uint8_t(buf, 6, session); |
_mav_put_uint8_t(buf, 7, zoom_pos); |
_mav_put_int8_t(buf, 8, zoom_step); |
_mav_put_uint8_t(buf, 9, focus_lock); |
_mav_put_uint8_t(buf, 10, shot); |
_mav_put_uint8_t(buf, 11, command_id); |
_mav_put_uint8_t(buf, 12, extra_param); |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 13); |
#else |
mavlink_digicam_control_t packet; |
packet.extra_value = extra_value; |
packet.target_system = target_system; |
packet.target_component = target_component; |
packet.session = session; |
packet.zoom_pos = zoom_pos; |
packet.zoom_step = zoom_step; |
packet.focus_lock = focus_lock; |
packet.shot = shot; |
packet.command_id = command_id; |
packet.extra_param = extra_param; |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 13); |
#endif |
msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONTROL; |
return mavlink_finalize_message(msg, system_id, component_id, 13, 22); |
} |
/** |
* @brief Pack a digicam_control 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 target_system System ID |
* @param target_component Component ID |
* @param session 0: stop, 1: start or keep it up //Session control e.g. show/hide lens |
* @param zoom_pos 1 to N //Zoom's absolute position (0 means ignore) |
* @param zoom_step -100 to 100 //Zooming step value to offset zoom from the current position |
* @param focus_lock 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus |
* @param shot 0: ignore, 1: shot or start filming |
* @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once |
* @param extra_param Extra parameters enumeration (0 means ignore) |
* @param extra_value Correspondent value to given extra_param |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_digicam_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, |
mavlink_message_t* msg, |
uint8_t target_system,uint8_t target_component,uint8_t session,uint8_t zoom_pos,int8_t zoom_step,uint8_t focus_lock,uint8_t shot,uint8_t command_id,uint8_t extra_param,float extra_value) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[13]; |
_mav_put_float(buf, 0, extra_value); |
_mav_put_uint8_t(buf, 4, target_system); |
_mav_put_uint8_t(buf, 5, target_component); |
_mav_put_uint8_t(buf, 6, session); |
_mav_put_uint8_t(buf, 7, zoom_pos); |
_mav_put_int8_t(buf, 8, zoom_step); |
_mav_put_uint8_t(buf, 9, focus_lock); |
_mav_put_uint8_t(buf, 10, shot); |
_mav_put_uint8_t(buf, 11, command_id); |
_mav_put_uint8_t(buf, 12, extra_param); |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 13); |
#else |
mavlink_digicam_control_t packet; |
packet.extra_value = extra_value; |
packet.target_system = target_system; |
packet.target_component = target_component; |
packet.session = session; |
packet.zoom_pos = zoom_pos; |
packet.zoom_step = zoom_step; |
packet.focus_lock = focus_lock; |
packet.shot = shot; |
packet.command_id = command_id; |
packet.extra_param = extra_param; |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 13); |
#endif |
msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONTROL; |
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 13, 22); |
} |
/** |
* @brief Encode a digicam_control 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 digicam_control C-struct to read the message contents from |
*/ |
static inline uint16_t mavlink_msg_digicam_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_digicam_control_t* digicam_control) |
{ |
return mavlink_msg_digicam_control_pack(system_id, component_id, msg, digicam_control->target_system, digicam_control->target_component, digicam_control->session, digicam_control->zoom_pos, digicam_control->zoom_step, digicam_control->focus_lock, digicam_control->shot, digicam_control->command_id, digicam_control->extra_param, digicam_control->extra_value); |
} |
/** |
* @brief Send a digicam_control message |
* @param chan MAVLink channel to send the message |
* |
* @param target_system System ID |
* @param target_component Component ID |
* @param session 0: stop, 1: start or keep it up //Session control e.g. show/hide lens |
* @param zoom_pos 1 to N //Zoom's absolute position (0 means ignore) |
* @param zoom_step -100 to 100 //Zooming step value to offset zoom from the current position |
* @param focus_lock 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus |
* @param shot 0: ignore, 1: shot or start filming |
* @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once |
* @param extra_param Extra parameters enumeration (0 means ignore) |
* @param extra_value Correspondent value to given extra_param |
*/ |
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS |
static inline void mavlink_msg_digicam_control_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t session, uint8_t zoom_pos, int8_t zoom_step, uint8_t focus_lock, uint8_t shot, uint8_t command_id, uint8_t extra_param, float extra_value) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[13]; |
_mav_put_float(buf, 0, extra_value); |
_mav_put_uint8_t(buf, 4, target_system); |
_mav_put_uint8_t(buf, 5, target_component); |
_mav_put_uint8_t(buf, 6, session); |
_mav_put_uint8_t(buf, 7, zoom_pos); |
_mav_put_int8_t(buf, 8, zoom_step); |
_mav_put_uint8_t(buf, 9, focus_lock); |
_mav_put_uint8_t(buf, 10, shot); |
_mav_put_uint8_t(buf, 11, command_id); |
_mav_put_uint8_t(buf, 12, extra_param); |
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONTROL, buf, 13, 22); |
#else |
mavlink_digicam_control_t packet; |
packet.extra_value = extra_value; |
packet.target_system = target_system; |
packet.target_component = target_component; |
packet.session = session; |
packet.zoom_pos = zoom_pos; |
packet.zoom_step = zoom_step; |
packet.focus_lock = focus_lock; |
packet.shot = shot; |
packet.command_id = command_id; |
packet.extra_param = extra_param; |
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONTROL, (const char *)&packet, 13, 22); |
#endif |
} |
#endif |
// MESSAGE DIGICAM_CONTROL UNPACKING |
/** |
* @brief Get field target_system from digicam_control message |
* |
* @return System ID |
*/ |
static inline uint8_t mavlink_msg_digicam_control_get_target_system(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 4); |
} |
/** |
* @brief Get field target_component from digicam_control message |
* |
* @return Component ID |
*/ |
static inline uint8_t mavlink_msg_digicam_control_get_target_component(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 5); |
} |
/** |
* @brief Get field session from digicam_control message |
* |
* @return 0: stop, 1: start or keep it up //Session control e.g. show/hide lens |
*/ |
static inline uint8_t mavlink_msg_digicam_control_get_session(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 6); |
} |
/** |
* @brief Get field zoom_pos from digicam_control message |
* |
* @return 1 to N //Zoom's absolute position (0 means ignore) |
*/ |
static inline uint8_t mavlink_msg_digicam_control_get_zoom_pos(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 7); |
} |
/** |
* @brief Get field zoom_step from digicam_control message |
* |
* @return -100 to 100 //Zooming step value to offset zoom from the current position |
*/ |
static inline int8_t mavlink_msg_digicam_control_get_zoom_step(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_int8_t(msg, 8); |
} |
/** |
* @brief Get field focus_lock from digicam_control message |
* |
* @return 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus |
*/ |
static inline uint8_t mavlink_msg_digicam_control_get_focus_lock(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 9); |
} |
/** |
* @brief Get field shot from digicam_control message |
* |
* @return 0: ignore, 1: shot or start filming |
*/ |
static inline uint8_t mavlink_msg_digicam_control_get_shot(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 10); |
} |
/** |
* @brief Get field command_id from digicam_control message |
* |
* @return Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once |
*/ |
static inline uint8_t mavlink_msg_digicam_control_get_command_id(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 11); |
} |
/** |
* @brief Get field extra_param from digicam_control message |
* |
* @return Extra parameters enumeration (0 means ignore) |
*/ |
static inline uint8_t mavlink_msg_digicam_control_get_extra_param(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 12); |
} |
/** |
* @brief Get field extra_value from digicam_control message |
* |
* @return Correspondent value to given extra_param |
*/ |
static inline float mavlink_msg_digicam_control_get_extra_value(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_float(msg, 0); |
} |
/** |
* @brief Decode a digicam_control message into a struct |
* |
* @param msg The message to decode |
* @param digicam_control C-struct to decode the message contents into |
*/ |
static inline void mavlink_msg_digicam_control_decode(const mavlink_message_t* msg, mavlink_digicam_control_t* digicam_control) |
{ |
#if MAVLINK_NEED_BYTE_SWAP |
digicam_control->extra_value = mavlink_msg_digicam_control_get_extra_value(msg); |
digicam_control->target_system = mavlink_msg_digicam_control_get_target_system(msg); |
digicam_control->target_component = mavlink_msg_digicam_control_get_target_component(msg); |
digicam_control->session = mavlink_msg_digicam_control_get_session(msg); |
digicam_control->zoom_pos = mavlink_msg_digicam_control_get_zoom_pos(msg); |
digicam_control->zoom_step = mavlink_msg_digicam_control_get_zoom_step(msg); |
digicam_control->focus_lock = mavlink_msg_digicam_control_get_focus_lock(msg); |
digicam_control->shot = mavlink_msg_digicam_control_get_shot(msg); |
digicam_control->command_id = mavlink_msg_digicam_control_get_command_id(msg); |
digicam_control->extra_param = mavlink_msg_digicam_control_get_extra_param(msg); |
#else |
memcpy(digicam_control, _MAV_PAYLOAD(msg), 13); |
#endif |
} |
/C-OSD/arducam-osd/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_fence_fetch_point.h |
---|
0,0 → 1,188 |
// MESSAGE FENCE_FETCH_POINT PACKING |
#define MAVLINK_MSG_ID_FENCE_FETCH_POINT 161 |
typedef struct __mavlink_fence_fetch_point_t |
{ |
uint8_t target_system; ///< System ID |
uint8_t target_component; ///< Component ID |
uint8_t idx; ///< point index (first point is 1, 0 is for return point) |
} mavlink_fence_fetch_point_t; |
#define MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN 3 |
#define MAVLINK_MSG_ID_161_LEN 3 |
#define MAVLINK_MESSAGE_INFO_FENCE_FETCH_POINT { \ |
"FENCE_FETCH_POINT", \ |
3, \ |
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_fence_fetch_point_t, target_system) }, \ |
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_fence_fetch_point_t, target_component) }, \ |
{ "idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_fence_fetch_point_t, idx) }, \ |
} \ |
} |
/** |
* @brief Pack a fence_fetch_point 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 target_system System ID |
* @param target_component Component ID |
* @param idx point index (first point is 1, 0 is for return point) |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_fence_fetch_point_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, |
uint8_t target_system, uint8_t target_component, uint8_t idx) |
{ |
#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, idx); |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); |
#else |
mavlink_fence_fetch_point_t packet; |
packet.target_system = target_system; |
packet.target_component = target_component; |
packet.idx = idx; |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); |
#endif |
msg->msgid = MAVLINK_MSG_ID_FENCE_FETCH_POINT; |
return mavlink_finalize_message(msg, system_id, component_id, 3, 68); |
} |
/** |
* @brief Pack a fence_fetch_point 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 target_system System ID |
* @param target_component Component ID |
* @param idx point index (first point is 1, 0 is for return point) |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_fence_fetch_point_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, |
mavlink_message_t* msg, |
uint8_t target_system,uint8_t target_component,uint8_t idx) |
{ |
#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, idx); |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); |
#else |
mavlink_fence_fetch_point_t packet; |
packet.target_system = target_system; |
packet.target_component = target_component; |
packet.idx = idx; |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); |
#endif |
msg->msgid = MAVLINK_MSG_ID_FENCE_FETCH_POINT; |
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3, 68); |
} |
/** |
* @brief Encode a fence_fetch_point 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 fence_fetch_point C-struct to read the message contents from |
*/ |
static inline uint16_t mavlink_msg_fence_fetch_point_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_fence_fetch_point_t* fence_fetch_point) |
{ |
return mavlink_msg_fence_fetch_point_pack(system_id, component_id, msg, fence_fetch_point->target_system, fence_fetch_point->target_component, fence_fetch_point->idx); |
} |
/** |
* @brief Send a fence_fetch_point message |
* @param chan MAVLink channel to send the message |
* |
* @param target_system System ID |
* @param target_component Component ID |
* @param idx point index (first point is 1, 0 is for return point) |
*/ |
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS |
static inline void mavlink_msg_fence_fetch_point_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t idx) |
{ |
#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, idx); |
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_FETCH_POINT, buf, 3, 68); |
#else |
mavlink_fence_fetch_point_t packet; |
packet.target_system = target_system; |
packet.target_component = target_component; |
packet.idx = idx; |
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_FETCH_POINT, (const char *)&packet, 3, 68); |
#endif |
} |
#endif |
// MESSAGE FENCE_FETCH_POINT UNPACKING |
/** |
* @brief Get field target_system from fence_fetch_point message |
* |
* @return System ID |
*/ |
static inline uint8_t mavlink_msg_fence_fetch_point_get_target_system(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 0); |
} |
/** |
* @brief Get field target_component from fence_fetch_point message |
* |
* @return Component ID |
*/ |
static inline uint8_t mavlink_msg_fence_fetch_point_get_target_component(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 1); |
} |
/** |
* @brief Get field idx from fence_fetch_point message |
* |
* @return point index (first point is 1, 0 is for return point) |
*/ |
static inline uint8_t mavlink_msg_fence_fetch_point_get_idx(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 2); |
} |
/** |
* @brief Decode a fence_fetch_point message into a struct |
* |
* @param msg The message to decode |
* @param fence_fetch_point C-struct to decode the message contents into |
*/ |
static inline void mavlink_msg_fence_fetch_point_decode(const mavlink_message_t* msg, mavlink_fence_fetch_point_t* fence_fetch_point) |
{ |
#if MAVLINK_NEED_BYTE_SWAP |
fence_fetch_point->target_system = mavlink_msg_fence_fetch_point_get_target_system(msg); |
fence_fetch_point->target_component = mavlink_msg_fence_fetch_point_get_target_component(msg); |
fence_fetch_point->idx = mavlink_msg_fence_fetch_point_get_idx(msg); |
#else |
memcpy(fence_fetch_point, _MAV_PAYLOAD(msg), 3); |
#endif |
} |
/C-OSD/arducam-osd/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_fence_point.h |
---|
0,0 → 1,254 |
// MESSAGE FENCE_POINT PACKING |
#define MAVLINK_MSG_ID_FENCE_POINT 160 |
typedef struct __mavlink_fence_point_t |
{ |
float lat; ///< Latitude of point |
float lng; ///< Longitude of point |
uint8_t target_system; ///< System ID |
uint8_t target_component; ///< Component ID |
uint8_t idx; ///< point index (first point is 1, 0 is for return point) |
uint8_t count; ///< total number of points (for sanity checking) |
} mavlink_fence_point_t; |
#define MAVLINK_MSG_ID_FENCE_POINT_LEN 12 |
#define MAVLINK_MSG_ID_160_LEN 12 |
#define MAVLINK_MESSAGE_INFO_FENCE_POINT { \ |
"FENCE_POINT", \ |
6, \ |
{ { "lat", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_fence_point_t, lat) }, \ |
{ "lng", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_fence_point_t, lng) }, \ |
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_fence_point_t, target_system) }, \ |
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_fence_point_t, target_component) }, \ |
{ "idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_fence_point_t, idx) }, \ |
{ "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_fence_point_t, count) }, \ |
} \ |
} |
/** |
* @brief Pack a fence_point 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 target_system System ID |
* @param target_component Component ID |
* @param idx point index (first point is 1, 0 is for return point) |
* @param count total number of points (for sanity checking) |
* @param lat Latitude of point |
* @param lng Longitude of point |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_fence_point_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, |
uint8_t target_system, uint8_t target_component, uint8_t idx, uint8_t count, float lat, float lng) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[12]; |
_mav_put_float(buf, 0, lat); |
_mav_put_float(buf, 4, lng); |
_mav_put_uint8_t(buf, 8, target_system); |
_mav_put_uint8_t(buf, 9, target_component); |
_mav_put_uint8_t(buf, 10, idx); |
_mav_put_uint8_t(buf, 11, count); |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); |
#else |
mavlink_fence_point_t packet; |
packet.lat = lat; |
packet.lng = lng; |
packet.target_system = target_system; |
packet.target_component = target_component; |
packet.idx = idx; |
packet.count = count; |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); |
#endif |
msg->msgid = MAVLINK_MSG_ID_FENCE_POINT; |
return mavlink_finalize_message(msg, system_id, component_id, 12, 78); |
} |
/** |
* @brief Pack a fence_point 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 target_system System ID |
* @param target_component Component ID |
* @param idx point index (first point is 1, 0 is for return point) |
* @param count total number of points (for sanity checking) |
* @param lat Latitude of point |
* @param lng Longitude of point |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_fence_point_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, |
mavlink_message_t* msg, |
uint8_t target_system,uint8_t target_component,uint8_t idx,uint8_t count,float lat,float lng) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[12]; |
_mav_put_float(buf, 0, lat); |
_mav_put_float(buf, 4, lng); |
_mav_put_uint8_t(buf, 8, target_system); |
_mav_put_uint8_t(buf, 9, target_component); |
_mav_put_uint8_t(buf, 10, idx); |
_mav_put_uint8_t(buf, 11, count); |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); |
#else |
mavlink_fence_point_t packet; |
packet.lat = lat; |
packet.lng = lng; |
packet.target_system = target_system; |
packet.target_component = target_component; |
packet.idx = idx; |
packet.count = count; |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); |
#endif |
msg->msgid = MAVLINK_MSG_ID_FENCE_POINT; |
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12, 78); |
} |
/** |
* @brief Encode a fence_point 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 fence_point C-struct to read the message contents from |
*/ |
static inline uint16_t mavlink_msg_fence_point_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_fence_point_t* fence_point) |
{ |
return mavlink_msg_fence_point_pack(system_id, component_id, msg, fence_point->target_system, fence_point->target_component, fence_point->idx, fence_point->count, fence_point->lat, fence_point->lng); |
} |
/** |
* @brief Send a fence_point message |
* @param chan MAVLink channel to send the message |
* |
* @param target_system System ID |
* @param target_component Component ID |
* @param idx point index (first point is 1, 0 is for return point) |
* @param count total number of points (for sanity checking) |
* @param lat Latitude of point |
* @param lng Longitude of point |
*/ |
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS |
static inline void mavlink_msg_fence_point_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t idx, uint8_t count, float lat, float lng) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[12]; |
_mav_put_float(buf, 0, lat); |
_mav_put_float(buf, 4, lng); |
_mav_put_uint8_t(buf, 8, target_system); |
_mav_put_uint8_t(buf, 9, target_component); |
_mav_put_uint8_t(buf, 10, idx); |
_mav_put_uint8_t(buf, 11, count); |
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_POINT, buf, 12, 78); |
#else |
mavlink_fence_point_t packet; |
packet.lat = lat; |
packet.lng = lng; |
packet.target_system = target_system; |
packet.target_component = target_component; |
packet.idx = idx; |
packet.count = count; |
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_POINT, (const char *)&packet, 12, 78); |
#endif |
} |
#endif |
// MESSAGE FENCE_POINT UNPACKING |
/** |
* @brief Get field target_system from fence_point message |
* |
* @return System ID |
*/ |
static inline uint8_t mavlink_msg_fence_point_get_target_system(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 8); |
} |
/** |
* @brief Get field target_component from fence_point message |
* |
* @return Component ID |
*/ |
static inline uint8_t mavlink_msg_fence_point_get_target_component(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 9); |
} |
/** |
* @brief Get field idx from fence_point message |
* |
* @return point index (first point is 1, 0 is for return point) |
*/ |
static inline uint8_t mavlink_msg_fence_point_get_idx(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 10); |
} |
/** |
* @brief Get field count from fence_point message |
* |
* @return total number of points (for sanity checking) |
*/ |
static inline uint8_t mavlink_msg_fence_point_get_count(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 11); |
} |
/** |
* @brief Get field lat from fence_point message |
* |
* @return Latitude of point |
*/ |
static inline float mavlink_msg_fence_point_get_lat(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_float(msg, 0); |
} |
/** |
* @brief Get field lng from fence_point message |
* |
* @return Longitude of point |
*/ |
static inline float mavlink_msg_fence_point_get_lng(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_float(msg, 4); |
} |
/** |
* @brief Decode a fence_point message into a struct |
* |
* @param msg The message to decode |
* @param fence_point C-struct to decode the message contents into |
*/ |
static inline void mavlink_msg_fence_point_decode(const mavlink_message_t* msg, mavlink_fence_point_t* fence_point) |
{ |
#if MAVLINK_NEED_BYTE_SWAP |
fence_point->lat = mavlink_msg_fence_point_get_lat(msg); |
fence_point->lng = mavlink_msg_fence_point_get_lng(msg); |
fence_point->target_system = mavlink_msg_fence_point_get_target_system(msg); |
fence_point->target_component = mavlink_msg_fence_point_get_target_component(msg); |
fence_point->idx = mavlink_msg_fence_point_get_idx(msg); |
fence_point->count = mavlink_msg_fence_point_get_count(msg); |
#else |
memcpy(fence_point, _MAV_PAYLOAD(msg), 12); |
#endif |
} |
/C-OSD/arducam-osd/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_fence_status.h |
---|
0,0 → 1,210 |
// MESSAGE FENCE_STATUS PACKING |
#define MAVLINK_MSG_ID_FENCE_STATUS 162 |
typedef struct __mavlink_fence_status_t |
{ |
uint32_t breach_time; ///< time of last breach in milliseconds since boot |
uint16_t breach_count; ///< number of fence breaches |
uint8_t breach_status; ///< 0 if currently inside fence, 1 if outside |
uint8_t breach_type; ///< last breach type (see FENCE_BREACH_* enum) |
} mavlink_fence_status_t; |
#define MAVLINK_MSG_ID_FENCE_STATUS_LEN 8 |
#define MAVLINK_MSG_ID_162_LEN 8 |
#define MAVLINK_MESSAGE_INFO_FENCE_STATUS { \ |
"FENCE_STATUS", \ |
4, \ |
{ { "breach_time", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_fence_status_t, breach_time) }, \ |
{ "breach_count", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_fence_status_t, breach_count) }, \ |
{ "breach_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_fence_status_t, breach_status) }, \ |
{ "breach_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_fence_status_t, breach_type) }, \ |
} \ |
} |
/** |
* @brief Pack a fence_status 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 breach_status 0 if currently inside fence, 1 if outside |
* @param breach_count number of fence breaches |
* @param breach_type last breach type (see FENCE_BREACH_* enum) |
* @param breach_time time of last breach in milliseconds since boot |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_fence_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, |
uint8_t breach_status, uint16_t breach_count, uint8_t breach_type, uint32_t breach_time) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[8]; |
_mav_put_uint32_t(buf, 0, breach_time); |
_mav_put_uint16_t(buf, 4, breach_count); |
_mav_put_uint8_t(buf, 6, breach_status); |
_mav_put_uint8_t(buf, 7, breach_type); |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8); |
#else |
mavlink_fence_status_t packet; |
packet.breach_time = breach_time; |
packet.breach_count = breach_count; |
packet.breach_status = breach_status; |
packet.breach_type = breach_type; |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8); |
#endif |
msg->msgid = MAVLINK_MSG_ID_FENCE_STATUS; |
return mavlink_finalize_message(msg, system_id, component_id, 8, 189); |
} |
/** |
* @brief Pack a fence_status 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 breach_status 0 if currently inside fence, 1 if outside |
* @param breach_count number of fence breaches |
* @param breach_type last breach type (see FENCE_BREACH_* enum) |
* @param breach_time time of last breach in milliseconds since boot |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_fence_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, |
mavlink_message_t* msg, |
uint8_t breach_status,uint16_t breach_count,uint8_t breach_type,uint32_t breach_time) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[8]; |
_mav_put_uint32_t(buf, 0, breach_time); |
_mav_put_uint16_t(buf, 4, breach_count); |
_mav_put_uint8_t(buf, 6, breach_status); |
_mav_put_uint8_t(buf, 7, breach_type); |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8); |
#else |
mavlink_fence_status_t packet; |
packet.breach_time = breach_time; |
packet.breach_count = breach_count; |
packet.breach_status = breach_status; |
packet.breach_type = breach_type; |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8); |
#endif |
msg->msgid = MAVLINK_MSG_ID_FENCE_STATUS; |
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 8, 189); |
} |
/** |
* @brief Encode a fence_status 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 fence_status C-struct to read the message contents from |
*/ |
static inline uint16_t mavlink_msg_fence_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_fence_status_t* fence_status) |
{ |
return mavlink_msg_fence_status_pack(system_id, component_id, msg, fence_status->breach_status, fence_status->breach_count, fence_status->breach_type, fence_status->breach_time); |
} |
/** |
* @brief Send a fence_status message |
* @param chan MAVLink channel to send the message |
* |
* @param breach_status 0 if currently inside fence, 1 if outside |
* @param breach_count number of fence breaches |
* @param breach_type last breach type (see FENCE_BREACH_* enum) |
* @param breach_time time of last breach in milliseconds since boot |
*/ |
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS |
static inline void mavlink_msg_fence_status_send(mavlink_channel_t chan, uint8_t breach_status, uint16_t breach_count, uint8_t breach_type, uint32_t breach_time) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[8]; |
_mav_put_uint32_t(buf, 0, breach_time); |
_mav_put_uint16_t(buf, 4, breach_count); |
_mav_put_uint8_t(buf, 6, breach_status); |
_mav_put_uint8_t(buf, 7, breach_type); |
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_STATUS, buf, 8, 189); |
#else |
mavlink_fence_status_t packet; |
packet.breach_time = breach_time; |
packet.breach_count = breach_count; |
packet.breach_status = breach_status; |
packet.breach_type = breach_type; |
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_STATUS, (const char *)&packet, 8, 189); |
#endif |
} |
#endif |
// MESSAGE FENCE_STATUS UNPACKING |
/** |
* @brief Get field breach_status from fence_status message |
* |
* @return 0 if currently inside fence, 1 if outside |
*/ |
static inline uint8_t mavlink_msg_fence_status_get_breach_status(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 6); |
} |
/** |
* @brief Get field breach_count from fence_status message |
* |
* @return number of fence breaches |
*/ |
static inline uint16_t mavlink_msg_fence_status_get_breach_count(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint16_t(msg, 4); |
} |
/** |
* @brief Get field breach_type from fence_status message |
* |
* @return last breach type (see FENCE_BREACH_* enum) |
*/ |
static inline uint8_t mavlink_msg_fence_status_get_breach_type(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 7); |
} |
/** |
* @brief Get field breach_time from fence_status message |
* |
* @return time of last breach in milliseconds since boot |
*/ |
static inline uint32_t mavlink_msg_fence_status_get_breach_time(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint32_t(msg, 0); |
} |
/** |
* @brief Decode a fence_status message into a struct |
* |
* @param msg The message to decode |
* @param fence_status C-struct to decode the message contents into |
*/ |
static inline void mavlink_msg_fence_status_decode(const mavlink_message_t* msg, mavlink_fence_status_t* fence_status) |
{ |
#if MAVLINK_NEED_BYTE_SWAP |
fence_status->breach_time = mavlink_msg_fence_status_get_breach_time(msg); |
fence_status->breach_count = mavlink_msg_fence_status_get_breach_count(msg); |
fence_status->breach_status = mavlink_msg_fence_status_get_breach_status(msg); |
fence_status->breach_type = mavlink_msg_fence_status_get_breach_type(msg); |
#else |
memcpy(fence_status, _MAV_PAYLOAD(msg), 8); |
#endif |
} |
/C-OSD/arducam-osd/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_hwstatus.h |
---|
0,0 → 1,166 |
// MESSAGE HWSTATUS PACKING |
#define MAVLINK_MSG_ID_HWSTATUS 165 |
typedef struct __mavlink_hwstatus_t |
{ |
uint16_t Vcc; ///< board voltage (mV) |
uint8_t I2Cerr; ///< I2C error count |
} mavlink_hwstatus_t; |
#define MAVLINK_MSG_ID_HWSTATUS_LEN 3 |
#define MAVLINK_MSG_ID_165_LEN 3 |
#define MAVLINK_MESSAGE_INFO_HWSTATUS { \ |
"HWSTATUS", \ |
2, \ |
{ { "Vcc", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_hwstatus_t, Vcc) }, \ |
{ "I2Cerr", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_hwstatus_t, I2Cerr) }, \ |
} \ |
} |
/** |
* @brief Pack a hwstatus 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 Vcc board voltage (mV) |
* @param I2Cerr I2C error count |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_hwstatus_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, |
uint16_t Vcc, uint8_t I2Cerr) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[3]; |
_mav_put_uint16_t(buf, 0, Vcc); |
_mav_put_uint8_t(buf, 2, I2Cerr); |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); |
#else |
mavlink_hwstatus_t packet; |
packet.Vcc = Vcc; |
packet.I2Cerr = I2Cerr; |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); |
#endif |
msg->msgid = MAVLINK_MSG_ID_HWSTATUS; |
return mavlink_finalize_message(msg, system_id, component_id, 3, 21); |
} |
/** |
* @brief Pack a hwstatus 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 Vcc board voltage (mV) |
* @param I2Cerr I2C error count |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_hwstatus_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, |
mavlink_message_t* msg, |
uint16_t Vcc,uint8_t I2Cerr) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[3]; |
_mav_put_uint16_t(buf, 0, Vcc); |
_mav_put_uint8_t(buf, 2, I2Cerr); |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); |
#else |
mavlink_hwstatus_t packet; |
packet.Vcc = Vcc; |
packet.I2Cerr = I2Cerr; |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); |
#endif |
msg->msgid = MAVLINK_MSG_ID_HWSTATUS; |
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3, 21); |
} |
/** |
* @brief Encode a hwstatus 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 hwstatus C-struct to read the message contents from |
*/ |
static inline uint16_t mavlink_msg_hwstatus_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hwstatus_t* hwstatus) |
{ |
return mavlink_msg_hwstatus_pack(system_id, component_id, msg, hwstatus->Vcc, hwstatus->I2Cerr); |
} |
/** |
* @brief Send a hwstatus message |
* @param chan MAVLink channel to send the message |
* |
* @param Vcc board voltage (mV) |
* @param I2Cerr I2C error count |
*/ |
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS |
static inline void mavlink_msg_hwstatus_send(mavlink_channel_t chan, uint16_t Vcc, uint8_t I2Cerr) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[3]; |
_mav_put_uint16_t(buf, 0, Vcc); |
_mav_put_uint8_t(buf, 2, I2Cerr); |
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HWSTATUS, buf, 3, 21); |
#else |
mavlink_hwstatus_t packet; |
packet.Vcc = Vcc; |
packet.I2Cerr = I2Cerr; |
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HWSTATUS, (const char *)&packet, 3, 21); |
#endif |
} |
#endif |
// MESSAGE HWSTATUS UNPACKING |
/** |
* @brief Get field Vcc from hwstatus message |
* |
* @return board voltage (mV) |
*/ |
static inline uint16_t mavlink_msg_hwstatus_get_Vcc(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint16_t(msg, 0); |
} |
/** |
* @brief Get field I2Cerr from hwstatus message |
* |
* @return I2C error count |
*/ |
static inline uint8_t mavlink_msg_hwstatus_get_I2Cerr(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 2); |
} |
/** |
* @brief Decode a hwstatus message into a struct |
* |
* @param msg The message to decode |
* @param hwstatus C-struct to decode the message contents into |
*/ |
static inline void mavlink_msg_hwstatus_decode(const mavlink_message_t* msg, mavlink_hwstatus_t* hwstatus) |
{ |
#if MAVLINK_NEED_BYTE_SWAP |
hwstatus->Vcc = mavlink_msg_hwstatus_get_Vcc(msg); |
hwstatus->I2Cerr = mavlink_msg_hwstatus_get_I2Cerr(msg); |
#else |
memcpy(hwstatus, _MAV_PAYLOAD(msg), 3); |
#endif |
} |
/C-OSD/arducam-osd/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_meminfo.h |
---|
0,0 → 1,166 |
// MESSAGE MEMINFO PACKING |
#define MAVLINK_MSG_ID_MEMINFO 152 |
typedef struct __mavlink_meminfo_t |
{ |
uint16_t brkval; ///< heap top |
uint16_t freemem; ///< free memory |
} mavlink_meminfo_t; |
#define MAVLINK_MSG_ID_MEMINFO_LEN 4 |
#define MAVLINK_MSG_ID_152_LEN 4 |
#define MAVLINK_MESSAGE_INFO_MEMINFO { \ |
"MEMINFO", \ |
2, \ |
{ { "brkval", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_meminfo_t, brkval) }, \ |
{ "freemem", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_meminfo_t, freemem) }, \ |
} \ |
} |
/** |
* @brief Pack a meminfo 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 brkval heap top |
* @param freemem free memory |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_meminfo_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, |
uint16_t brkval, uint16_t freemem) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[4]; |
_mav_put_uint16_t(buf, 0, brkval); |
_mav_put_uint16_t(buf, 2, freemem); |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); |
#else |
mavlink_meminfo_t packet; |
packet.brkval = brkval; |
packet.freemem = freemem; |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); |
#endif |
msg->msgid = MAVLINK_MSG_ID_MEMINFO; |
return mavlink_finalize_message(msg, system_id, component_id, 4, 208); |
} |
/** |
* @brief Pack a meminfo 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 brkval heap top |
* @param freemem free memory |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_meminfo_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, |
mavlink_message_t* msg, |
uint16_t brkval,uint16_t freemem) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[4]; |
_mav_put_uint16_t(buf, 0, brkval); |
_mav_put_uint16_t(buf, 2, freemem); |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); |
#else |
mavlink_meminfo_t packet; |
packet.brkval = brkval; |
packet.freemem = freemem; |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); |
#endif |
msg->msgid = MAVLINK_MSG_ID_MEMINFO; |
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4, 208); |
} |
/** |
* @brief Encode a meminfo 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 meminfo C-struct to read the message contents from |
*/ |
static inline uint16_t mavlink_msg_meminfo_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_meminfo_t* meminfo) |
{ |
return mavlink_msg_meminfo_pack(system_id, component_id, msg, meminfo->brkval, meminfo->freemem); |
} |
/** |
* @brief Send a meminfo message |
* @param chan MAVLink channel to send the message |
* |
* @param brkval heap top |
* @param freemem free memory |
*/ |
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS |
static inline void mavlink_msg_meminfo_send(mavlink_channel_t chan, uint16_t brkval, uint16_t freemem) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[4]; |
_mav_put_uint16_t(buf, 0, brkval); |
_mav_put_uint16_t(buf, 2, freemem); |
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMINFO, buf, 4, 208); |
#else |
mavlink_meminfo_t packet; |
packet.brkval = brkval; |
packet.freemem = freemem; |
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMINFO, (const char *)&packet, 4, 208); |
#endif |
} |
#endif |
// MESSAGE MEMINFO UNPACKING |
/** |
* @brief Get field brkval from meminfo message |
* |
* @return heap top |
*/ |
static inline uint16_t mavlink_msg_meminfo_get_brkval(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint16_t(msg, 0); |
} |
/** |
* @brief Get field freemem from meminfo message |
* |
* @return free memory |
*/ |
static inline uint16_t mavlink_msg_meminfo_get_freemem(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint16_t(msg, 2); |
} |
/** |
* @brief Decode a meminfo message into a struct |
* |
* @param msg The message to decode |
* @param meminfo C-struct to decode the message contents into |
*/ |
static inline void mavlink_msg_meminfo_decode(const mavlink_message_t* msg, mavlink_meminfo_t* meminfo) |
{ |
#if MAVLINK_NEED_BYTE_SWAP |
meminfo->brkval = mavlink_msg_meminfo_get_brkval(msg); |
meminfo->freemem = mavlink_msg_meminfo_get_freemem(msg); |
#else |
memcpy(meminfo, _MAV_PAYLOAD(msg), 4); |
#endif |
} |
/C-OSD/arducam-osd/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_mount_configure.h |
---|
0,0 → 1,254 |
// MESSAGE MOUNT_CONFIGURE PACKING |
#define MAVLINK_MSG_ID_MOUNT_CONFIGURE 156 |
typedef struct __mavlink_mount_configure_t |
{ |
uint8_t target_system; ///< System ID |
uint8_t target_component; ///< Component ID |
uint8_t mount_mode; ///< mount operating mode (see MAV_MOUNT_MODE enum) |
uint8_t stab_roll; ///< (1 = yes, 0 = no) |
uint8_t stab_pitch; ///< (1 = yes, 0 = no) |
uint8_t stab_yaw; ///< (1 = yes, 0 = no) |
} mavlink_mount_configure_t; |
#define MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN 6 |
#define MAVLINK_MSG_ID_156_LEN 6 |
#define MAVLINK_MESSAGE_INFO_MOUNT_CONFIGURE { \ |
"MOUNT_CONFIGURE", \ |
6, \ |
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mount_configure_t, target_system) }, \ |
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mount_configure_t, target_component) }, \ |
{ "mount_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mount_configure_t, mount_mode) }, \ |
{ "stab_roll", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mount_configure_t, stab_roll) }, \ |
{ "stab_pitch", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mount_configure_t, stab_pitch) }, \ |
{ "stab_yaw", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mount_configure_t, stab_yaw) }, \ |
} \ |
} |
/** |
* @brief Pack a mount_configure 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 target_system System ID |
* @param target_component Component ID |
* @param mount_mode mount operating mode (see MAV_MOUNT_MODE enum) |
* @param stab_roll (1 = yes, 0 = no) |
* @param stab_pitch (1 = yes, 0 = no) |
* @param stab_yaw (1 = yes, 0 = no) |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_mount_configure_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, |
uint8_t target_system, uint8_t target_component, uint8_t mount_mode, uint8_t stab_roll, uint8_t stab_pitch, uint8_t stab_yaw) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[6]; |
_mav_put_uint8_t(buf, 0, target_system); |
_mav_put_uint8_t(buf, 1, target_component); |
_mav_put_uint8_t(buf, 2, mount_mode); |
_mav_put_uint8_t(buf, 3, stab_roll); |
_mav_put_uint8_t(buf, 4, stab_pitch); |
_mav_put_uint8_t(buf, 5, stab_yaw); |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); |
#else |
mavlink_mount_configure_t packet; |
packet.target_system = target_system; |
packet.target_component = target_component; |
packet.mount_mode = mount_mode; |
packet.stab_roll = stab_roll; |
packet.stab_pitch = stab_pitch; |
packet.stab_yaw = stab_yaw; |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); |
#endif |
msg->msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE; |
return mavlink_finalize_message(msg, system_id, component_id, 6, 19); |
} |
/** |
* @brief Pack a mount_configure 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 target_system System ID |
* @param target_component Component ID |
* @param mount_mode mount operating mode (see MAV_MOUNT_MODE enum) |
* @param stab_roll (1 = yes, 0 = no) |
* @param stab_pitch (1 = yes, 0 = no) |
* @param stab_yaw (1 = yes, 0 = no) |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_mount_configure_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, |
mavlink_message_t* msg, |
uint8_t target_system,uint8_t target_component,uint8_t mount_mode,uint8_t stab_roll,uint8_t stab_pitch,uint8_t stab_yaw) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[6]; |
_mav_put_uint8_t(buf, 0, target_system); |
_mav_put_uint8_t(buf, 1, target_component); |
_mav_put_uint8_t(buf, 2, mount_mode); |
_mav_put_uint8_t(buf, 3, stab_roll); |
_mav_put_uint8_t(buf, 4, stab_pitch); |
_mav_put_uint8_t(buf, 5, stab_yaw); |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); |
#else |
mavlink_mount_configure_t packet; |
packet.target_system = target_system; |
packet.target_component = target_component; |
packet.mount_mode = mount_mode; |
packet.stab_roll = stab_roll; |
packet.stab_pitch = stab_pitch; |
packet.stab_yaw = stab_yaw; |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); |
#endif |
msg->msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE; |
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 6, 19); |
} |
/** |
* @brief Encode a mount_configure 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 mount_configure C-struct to read the message contents from |
*/ |
static inline uint16_t mavlink_msg_mount_configure_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mount_configure_t* mount_configure) |
{ |
return mavlink_msg_mount_configure_pack(system_id, component_id, msg, mount_configure->target_system, mount_configure->target_component, mount_configure->mount_mode, mount_configure->stab_roll, mount_configure->stab_pitch, mount_configure->stab_yaw); |
} |
/** |
* @brief Send a mount_configure message |
* @param chan MAVLink channel to send the message |
* |
* @param target_system System ID |
* @param target_component Component ID |
* @param mount_mode mount operating mode (see MAV_MOUNT_MODE enum) |
* @param stab_roll (1 = yes, 0 = no) |
* @param stab_pitch (1 = yes, 0 = no) |
* @param stab_yaw (1 = yes, 0 = no) |
*/ |
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS |
static inline void mavlink_msg_mount_configure_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t mount_mode, uint8_t stab_roll, uint8_t stab_pitch, uint8_t stab_yaw) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[6]; |
_mav_put_uint8_t(buf, 0, target_system); |
_mav_put_uint8_t(buf, 1, target_component); |
_mav_put_uint8_t(buf, 2, mount_mode); |
_mav_put_uint8_t(buf, 3, stab_roll); |
_mav_put_uint8_t(buf, 4, stab_pitch); |
_mav_put_uint8_t(buf, 5, stab_yaw); |
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE, buf, 6, 19); |
#else |
mavlink_mount_configure_t packet; |
packet.target_system = target_system; |
packet.target_component = target_component; |
packet.mount_mode = mount_mode; |
packet.stab_roll = stab_roll; |
packet.stab_pitch = stab_pitch; |
packet.stab_yaw = stab_yaw; |
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE, (const char *)&packet, 6, 19); |
#endif |
} |
#endif |
// MESSAGE MOUNT_CONFIGURE UNPACKING |
/** |
* @brief Get field target_system from mount_configure message |
* |
* @return System ID |
*/ |
static inline uint8_t mavlink_msg_mount_configure_get_target_system(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 0); |
} |
/** |
* @brief Get field target_component from mount_configure message |
* |
* @return Component ID |
*/ |
static inline uint8_t mavlink_msg_mount_configure_get_target_component(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 1); |
} |
/** |
* @brief Get field mount_mode from mount_configure message |
* |
* @return mount operating mode (see MAV_MOUNT_MODE enum) |
*/ |
static inline uint8_t mavlink_msg_mount_configure_get_mount_mode(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 2); |
} |
/** |
* @brief Get field stab_roll from mount_configure message |
* |
* @return (1 = yes, 0 = no) |
*/ |
static inline uint8_t mavlink_msg_mount_configure_get_stab_roll(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 3); |
} |
/** |
* @brief Get field stab_pitch from mount_configure message |
* |
* @return (1 = yes, 0 = no) |
*/ |
static inline uint8_t mavlink_msg_mount_configure_get_stab_pitch(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 4); |
} |
/** |
* @brief Get field stab_yaw from mount_configure message |
* |
* @return (1 = yes, 0 = no) |
*/ |
static inline uint8_t mavlink_msg_mount_configure_get_stab_yaw(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 5); |
} |
/** |
* @brief Decode a mount_configure message into a struct |
* |
* @param msg The message to decode |
* @param mount_configure C-struct to decode the message contents into |
*/ |
static inline void mavlink_msg_mount_configure_decode(const mavlink_message_t* msg, mavlink_mount_configure_t* mount_configure) |
{ |
#if MAVLINK_NEED_BYTE_SWAP |
mount_configure->target_system = mavlink_msg_mount_configure_get_target_system(msg); |
mount_configure->target_component = mavlink_msg_mount_configure_get_target_component(msg); |
mount_configure->mount_mode = mavlink_msg_mount_configure_get_mount_mode(msg); |
mount_configure->stab_roll = mavlink_msg_mount_configure_get_stab_roll(msg); |
mount_configure->stab_pitch = mavlink_msg_mount_configure_get_stab_pitch(msg); |
mount_configure->stab_yaw = mavlink_msg_mount_configure_get_stab_yaw(msg); |
#else |
memcpy(mount_configure, _MAV_PAYLOAD(msg), 6); |
#endif |
} |
/C-OSD/arducam-osd/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_mount_control.h |
---|
0,0 → 1,254 |
// MESSAGE MOUNT_CONTROL PACKING |
#define MAVLINK_MSG_ID_MOUNT_CONTROL 157 |
typedef struct __mavlink_mount_control_t |
{ |
int32_t input_a; ///< pitch(deg*100) or lat, depending on mount mode |
int32_t input_b; ///< roll(deg*100) or lon depending on mount mode |
int32_t input_c; ///< yaw(deg*100) or alt (in cm) depending on mount mode |
uint8_t target_system; ///< System ID |
uint8_t target_component; ///< Component ID |
uint8_t save_position; ///< if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING) |
} mavlink_mount_control_t; |
#define MAVLINK_MSG_ID_MOUNT_CONTROL_LEN 15 |
#define MAVLINK_MSG_ID_157_LEN 15 |
#define MAVLINK_MESSAGE_INFO_MOUNT_CONTROL { \ |
"MOUNT_CONTROL", \ |
6, \ |
{ { "input_a", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_mount_control_t, input_a) }, \ |
{ "input_b", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_mount_control_t, input_b) }, \ |
{ "input_c", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_mount_control_t, input_c) }, \ |
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_mount_control_t, target_system) }, \ |
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_mount_control_t, target_component) }, \ |
{ "save_position", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_mount_control_t, save_position) }, \ |
} \ |
} |
/** |
* @brief Pack a mount_control 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 target_system System ID |
* @param target_component Component ID |
* @param input_a pitch(deg*100) or lat, depending on mount mode |
* @param input_b roll(deg*100) or lon depending on mount mode |
* @param input_c yaw(deg*100) or alt (in cm) depending on mount mode |
* @param save_position if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING) |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_mount_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, |
uint8_t target_system, uint8_t target_component, int32_t input_a, int32_t input_b, int32_t input_c, uint8_t save_position) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[15]; |
_mav_put_int32_t(buf, 0, input_a); |
_mav_put_int32_t(buf, 4, input_b); |
_mav_put_int32_t(buf, 8, input_c); |
_mav_put_uint8_t(buf, 12, target_system); |
_mav_put_uint8_t(buf, 13, target_component); |
_mav_put_uint8_t(buf, 14, save_position); |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15); |
#else |
mavlink_mount_control_t packet; |
packet.input_a = input_a; |
packet.input_b = input_b; |
packet.input_c = input_c; |
packet.target_system = target_system; |
packet.target_component = target_component; |
packet.save_position = save_position; |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15); |
#endif |
msg->msgid = MAVLINK_MSG_ID_MOUNT_CONTROL; |
return mavlink_finalize_message(msg, system_id, component_id, 15, 21); |
} |
/** |
* @brief Pack a mount_control 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 target_system System ID |
* @param target_component Component ID |
* @param input_a pitch(deg*100) or lat, depending on mount mode |
* @param input_b roll(deg*100) or lon depending on mount mode |
* @param input_c yaw(deg*100) or alt (in cm) depending on mount mode |
* @param save_position if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING) |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_mount_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, |
mavlink_message_t* msg, |
uint8_t target_system,uint8_t target_component,int32_t input_a,int32_t input_b,int32_t input_c,uint8_t save_position) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[15]; |
_mav_put_int32_t(buf, 0, input_a); |
_mav_put_int32_t(buf, 4, input_b); |
_mav_put_int32_t(buf, 8, input_c); |
_mav_put_uint8_t(buf, 12, target_system); |
_mav_put_uint8_t(buf, 13, target_component); |
_mav_put_uint8_t(buf, 14, save_position); |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15); |
#else |
mavlink_mount_control_t packet; |
packet.input_a = input_a; |
packet.input_b = input_b; |
packet.input_c = input_c; |
packet.target_system = target_system; |
packet.target_component = target_component; |
packet.save_position = save_position; |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15); |
#endif |
msg->msgid = MAVLINK_MSG_ID_MOUNT_CONTROL; |
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 15, 21); |
} |
/** |
* @brief Encode a mount_control 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 mount_control C-struct to read the message contents from |
*/ |
static inline uint16_t mavlink_msg_mount_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mount_control_t* mount_control) |
{ |
return mavlink_msg_mount_control_pack(system_id, component_id, msg, mount_control->target_system, mount_control->target_component, mount_control->input_a, mount_control->input_b, mount_control->input_c, mount_control->save_position); |
} |
/** |
* @brief Send a mount_control message |
* @param chan MAVLink channel to send the message |
* |
* @param target_system System ID |
* @param target_component Component ID |
* @param input_a pitch(deg*100) or lat, depending on mount mode |
* @param input_b roll(deg*100) or lon depending on mount mode |
* @param input_c yaw(deg*100) or alt (in cm) depending on mount mode |
* @param save_position if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING) |
*/ |
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS |
static inline void mavlink_msg_mount_control_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int32_t input_a, int32_t input_b, int32_t input_c, uint8_t save_position) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[15]; |
_mav_put_int32_t(buf, 0, input_a); |
_mav_put_int32_t(buf, 4, input_b); |
_mav_put_int32_t(buf, 8, input_c); |
_mav_put_uint8_t(buf, 12, target_system); |
_mav_put_uint8_t(buf, 13, target_component); |
_mav_put_uint8_t(buf, 14, save_position); |
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONTROL, buf, 15, 21); |
#else |
mavlink_mount_control_t packet; |
packet.input_a = input_a; |
packet.input_b = input_b; |
packet.input_c = input_c; |
packet.target_system = target_system; |
packet.target_component = target_component; |
packet.save_position = save_position; |
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONTROL, (const char *)&packet, 15, 21); |
#endif |
} |
#endif |
// MESSAGE MOUNT_CONTROL UNPACKING |
/** |
* @brief Get field target_system from mount_control message |
* |
* @return System ID |
*/ |
static inline uint8_t mavlink_msg_mount_control_get_target_system(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 12); |
} |
/** |
* @brief Get field target_component from mount_control message |
* |
* @return Component ID |
*/ |
static inline uint8_t mavlink_msg_mount_control_get_target_component(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 13); |
} |
/** |
* @brief Get field input_a from mount_control message |
* |
* @return pitch(deg*100) or lat, depending on mount mode |
*/ |
static inline int32_t mavlink_msg_mount_control_get_input_a(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_int32_t(msg, 0); |
} |
/** |
* @brief Get field input_b from mount_control message |
* |
* @return roll(deg*100) or lon depending on mount mode |
*/ |
static inline int32_t mavlink_msg_mount_control_get_input_b(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_int32_t(msg, 4); |
} |
/** |
* @brief Get field input_c from mount_control message |
* |
* @return yaw(deg*100) or alt (in cm) depending on mount mode |
*/ |
static inline int32_t mavlink_msg_mount_control_get_input_c(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_int32_t(msg, 8); |
} |
/** |
* @brief Get field save_position from mount_control message |
* |
* @return if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING) |
*/ |
static inline uint8_t mavlink_msg_mount_control_get_save_position(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 14); |
} |
/** |
* @brief Decode a mount_control message into a struct |
* |
* @param msg The message to decode |
* @param mount_control C-struct to decode the message contents into |
*/ |
static inline void mavlink_msg_mount_control_decode(const mavlink_message_t* msg, mavlink_mount_control_t* mount_control) |
{ |
#if MAVLINK_NEED_BYTE_SWAP |
mount_control->input_a = mavlink_msg_mount_control_get_input_a(msg); |
mount_control->input_b = mavlink_msg_mount_control_get_input_b(msg); |
mount_control->input_c = mavlink_msg_mount_control_get_input_c(msg); |
mount_control->target_system = mavlink_msg_mount_control_get_target_system(msg); |
mount_control->target_component = mavlink_msg_mount_control_get_target_component(msg); |
mount_control->save_position = mavlink_msg_mount_control_get_save_position(msg); |
#else |
memcpy(mount_control, _MAV_PAYLOAD(msg), 15); |
#endif |
} |
/C-OSD/arducam-osd/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_mount_status.h |
---|
0,0 → 1,232 |
// MESSAGE MOUNT_STATUS PACKING |
#define MAVLINK_MSG_ID_MOUNT_STATUS 158 |
typedef struct __mavlink_mount_status_t |
{ |
int32_t pointing_a; ///< pitch(deg*100) or lat, depending on mount mode |
int32_t pointing_b; ///< roll(deg*100) or lon depending on mount mode |
int32_t pointing_c; ///< yaw(deg*100) or alt (in cm) depending on mount mode |
uint8_t target_system; ///< System ID |
uint8_t target_component; ///< Component ID |
} mavlink_mount_status_t; |
#define MAVLINK_MSG_ID_MOUNT_STATUS_LEN 14 |
#define MAVLINK_MSG_ID_158_LEN 14 |
#define MAVLINK_MESSAGE_INFO_MOUNT_STATUS { \ |
"MOUNT_STATUS", \ |
5, \ |
{ { "pointing_a", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_mount_status_t, pointing_a) }, \ |
{ "pointing_b", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_mount_status_t, pointing_b) }, \ |
{ "pointing_c", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_mount_status_t, pointing_c) }, \ |
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_mount_status_t, target_system) }, \ |
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_mount_status_t, target_component) }, \ |
} \ |
} |
/** |
* @brief Pack a mount_status 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 target_system System ID |
* @param target_component Component ID |
* @param pointing_a pitch(deg*100) or lat, depending on mount mode |
* @param pointing_b roll(deg*100) or lon depending on mount mode |
* @param pointing_c yaw(deg*100) or alt (in cm) depending on mount mode |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_mount_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, |
uint8_t target_system, uint8_t target_component, int32_t pointing_a, int32_t pointing_b, int32_t pointing_c) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[14]; |
_mav_put_int32_t(buf, 0, pointing_a); |
_mav_put_int32_t(buf, 4, pointing_b); |
_mav_put_int32_t(buf, 8, pointing_c); |
_mav_put_uint8_t(buf, 12, target_system); |
_mav_put_uint8_t(buf, 13, target_component); |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14); |
#else |
mavlink_mount_status_t packet; |
packet.pointing_a = pointing_a; |
packet.pointing_b = pointing_b; |
packet.pointing_c = pointing_c; |
packet.target_system = target_system; |
packet.target_component = target_component; |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14); |
#endif |
msg->msgid = MAVLINK_MSG_ID_MOUNT_STATUS; |
return mavlink_finalize_message(msg, system_id, component_id, 14, 134); |
} |
/** |
* @brief Pack a mount_status 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 target_system System ID |
* @param target_component Component ID |
* @param pointing_a pitch(deg*100) or lat, depending on mount mode |
* @param pointing_b roll(deg*100) or lon depending on mount mode |
* @param pointing_c yaw(deg*100) or alt (in cm) depending on mount mode |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_mount_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, |
mavlink_message_t* msg, |
uint8_t target_system,uint8_t target_component,int32_t pointing_a,int32_t pointing_b,int32_t pointing_c) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[14]; |
_mav_put_int32_t(buf, 0, pointing_a); |
_mav_put_int32_t(buf, 4, pointing_b); |
_mav_put_int32_t(buf, 8, pointing_c); |
_mav_put_uint8_t(buf, 12, target_system); |
_mav_put_uint8_t(buf, 13, target_component); |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 14); |
#else |
mavlink_mount_status_t packet; |
packet.pointing_a = pointing_a; |
packet.pointing_b = pointing_b; |
packet.pointing_c = pointing_c; |
packet.target_system = target_system; |
packet.target_component = target_component; |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 14); |
#endif |
msg->msgid = MAVLINK_MSG_ID_MOUNT_STATUS; |
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 14, 134); |
} |
/** |
* @brief Encode a mount_status 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 mount_status C-struct to read the message contents from |
*/ |
static inline uint16_t mavlink_msg_mount_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mount_status_t* mount_status) |
{ |
return mavlink_msg_mount_status_pack(system_id, component_id, msg, mount_status->target_system, mount_status->target_component, mount_status->pointing_a, mount_status->pointing_b, mount_status->pointing_c); |
} |
/** |
* @brief Send a mount_status message |
* @param chan MAVLink channel to send the message |
* |
* @param target_system System ID |
* @param target_component Component ID |
* @param pointing_a pitch(deg*100) or lat, depending on mount mode |
* @param pointing_b roll(deg*100) or lon depending on mount mode |
* @param pointing_c yaw(deg*100) or alt (in cm) depending on mount mode |
*/ |
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS |
static inline void mavlink_msg_mount_status_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int32_t pointing_a, int32_t pointing_b, int32_t pointing_c) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[14]; |
_mav_put_int32_t(buf, 0, pointing_a); |
_mav_put_int32_t(buf, 4, pointing_b); |
_mav_put_int32_t(buf, 8, pointing_c); |
_mav_put_uint8_t(buf, 12, target_system); |
_mav_put_uint8_t(buf, 13, target_component); |
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_STATUS, buf, 14, 134); |
#else |
mavlink_mount_status_t packet; |
packet.pointing_a = pointing_a; |
packet.pointing_b = pointing_b; |
packet.pointing_c = pointing_c; |
packet.target_system = target_system; |
packet.target_component = target_component; |
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_STATUS, (const char *)&packet, 14, 134); |
#endif |
} |
#endif |
// MESSAGE MOUNT_STATUS UNPACKING |
/** |
* @brief Get field target_system from mount_status message |
* |
* @return System ID |
*/ |
static inline uint8_t mavlink_msg_mount_status_get_target_system(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 12); |
} |
/** |
* @brief Get field target_component from mount_status message |
* |
* @return Component ID |
*/ |
static inline uint8_t mavlink_msg_mount_status_get_target_component(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 13); |
} |
/** |
* @brief Get field pointing_a from mount_status message |
* |
* @return pitch(deg*100) or lat, depending on mount mode |
*/ |
static inline int32_t mavlink_msg_mount_status_get_pointing_a(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_int32_t(msg, 0); |
} |
/** |
* @brief Get field pointing_b from mount_status message |
* |
* @return roll(deg*100) or lon depending on mount mode |
*/ |
static inline int32_t mavlink_msg_mount_status_get_pointing_b(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_int32_t(msg, 4); |
} |
/** |
* @brief Get field pointing_c from mount_status message |
* |
* @return yaw(deg*100) or alt (in cm) depending on mount mode |
*/ |
static inline int32_t mavlink_msg_mount_status_get_pointing_c(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_int32_t(msg, 8); |
} |
/** |
* @brief Decode a mount_status message into a struct |
* |
* @param msg The message to decode |
* @param mount_status C-struct to decode the message contents into |
*/ |
static inline void mavlink_msg_mount_status_decode(const mavlink_message_t* msg, mavlink_mount_status_t* mount_status) |
{ |
#if MAVLINK_NEED_BYTE_SWAP |
mount_status->pointing_a = mavlink_msg_mount_status_get_pointing_a(msg); |
mount_status->pointing_b = mavlink_msg_mount_status_get_pointing_b(msg); |
mount_status->pointing_c = mavlink_msg_mount_status_get_pointing_c(msg); |
mount_status->target_system = mavlink_msg_mount_status_get_target_system(msg); |
mount_status->target_component = mavlink_msg_mount_status_get_target_component(msg); |
#else |
memcpy(mount_status, _MAV_PAYLOAD(msg), 14); |
#endif |
} |
/C-OSD/arducam-osd/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_radio.h |
---|
0,0 → 1,276 |
// MESSAGE RADIO PACKING |
#define MAVLINK_MSG_ID_RADIO 166 |
typedef struct __mavlink_radio_t |
{ |
uint16_t rxerrors; ///< receive errors |
uint16_t fixed; ///< count of error corrected packets |
uint8_t rssi; ///< local signal strength |
uint8_t remrssi; ///< remote signal strength |
uint8_t txbuf; ///< how full the tx buffer is as a percentage |
uint8_t noise; ///< background noise level |
uint8_t remnoise; ///< remote background noise level |
} mavlink_radio_t; |
#define MAVLINK_MSG_ID_RADIO_LEN 9 |
#define MAVLINK_MSG_ID_166_LEN 9 |
#define MAVLINK_MESSAGE_INFO_RADIO { \ |
"RADIO", \ |
7, \ |
{ { "rxerrors", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_radio_t, rxerrors) }, \ |
{ "fixed", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_radio_t, fixed) }, \ |
{ "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_radio_t, rssi) }, \ |
{ "remrssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_radio_t, remrssi) }, \ |
{ "txbuf", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_radio_t, txbuf) }, \ |
{ "noise", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_radio_t, noise) }, \ |
{ "remnoise", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_radio_t, remnoise) }, \ |
} \ |
} |
/** |
* @brief Pack a radio 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 rssi local signal strength |
* @param remrssi remote signal strength |
* @param txbuf how full the tx buffer is as a percentage |
* @param noise background noise level |
* @param remnoise remote background noise level |
* @param rxerrors receive errors |
* @param fixed count of error corrected packets |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_radio_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, |
uint8_t rssi, uint8_t remrssi, uint8_t txbuf, uint8_t noise, uint8_t remnoise, uint16_t rxerrors, uint16_t fixed) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[9]; |
_mav_put_uint16_t(buf, 0, rxerrors); |
_mav_put_uint16_t(buf, 2, fixed); |
_mav_put_uint8_t(buf, 4, rssi); |
_mav_put_uint8_t(buf, 5, remrssi); |
_mav_put_uint8_t(buf, 6, txbuf); |
_mav_put_uint8_t(buf, 7, noise); |
_mav_put_uint8_t(buf, 8, remnoise); |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9); |
#else |
mavlink_radio_t packet; |
packet.rxerrors = rxerrors; |
packet.fixed = fixed; |
packet.rssi = rssi; |
packet.remrssi = remrssi; |
packet.txbuf = txbuf; |
packet.noise = noise; |
packet.remnoise = remnoise; |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9); |
#endif |
msg->msgid = MAVLINK_MSG_ID_RADIO; |
return mavlink_finalize_message(msg, system_id, component_id, 9, 21); |
} |
/** |
* @brief Pack a radio 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 rssi local signal strength |
* @param remrssi remote signal strength |
* @param txbuf how full the tx buffer is as a percentage |
* @param noise background noise level |
* @param remnoise remote background noise level |
* @param rxerrors receive errors |
* @param fixed count of error corrected packets |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_radio_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, |
mavlink_message_t* msg, |
uint8_t rssi,uint8_t remrssi,uint8_t txbuf,uint8_t noise,uint8_t remnoise,uint16_t rxerrors,uint16_t fixed) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[9]; |
_mav_put_uint16_t(buf, 0, rxerrors); |
_mav_put_uint16_t(buf, 2, fixed); |
_mav_put_uint8_t(buf, 4, rssi); |
_mav_put_uint8_t(buf, 5, remrssi); |
_mav_put_uint8_t(buf, 6, txbuf); |
_mav_put_uint8_t(buf, 7, noise); |
_mav_put_uint8_t(buf, 8, remnoise); |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9); |
#else |
mavlink_radio_t packet; |
packet.rxerrors = rxerrors; |
packet.fixed = fixed; |
packet.rssi = rssi; |
packet.remrssi = remrssi; |
packet.txbuf = txbuf; |
packet.noise = noise; |
packet.remnoise = remnoise; |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9); |
#endif |
msg->msgid = MAVLINK_MSG_ID_RADIO; |
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 9, 21); |
} |
/** |
* @brief Encode a radio 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 radio C-struct to read the message contents from |
*/ |
static inline uint16_t mavlink_msg_radio_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_radio_t* radio) |
{ |
return mavlink_msg_radio_pack(system_id, component_id, msg, radio->rssi, radio->remrssi, radio->txbuf, radio->noise, radio->remnoise, radio->rxerrors, radio->fixed); |
} |
/** |
* @brief Send a radio message |
* @param chan MAVLink channel to send the message |
* |
* @param rssi local signal strength |
* @param remrssi remote signal strength |
* @param txbuf how full the tx buffer is as a percentage |
* @param noise background noise level |
* @param remnoise remote background noise level |
* @param rxerrors receive errors |
* @param fixed count of error corrected packets |
*/ |
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS |
static inline void mavlink_msg_radio_send(mavlink_channel_t chan, uint8_t rssi, uint8_t remrssi, uint8_t txbuf, uint8_t noise, uint8_t remnoise, uint16_t rxerrors, uint16_t fixed) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[9]; |
_mav_put_uint16_t(buf, 0, rxerrors); |
_mav_put_uint16_t(buf, 2, fixed); |
_mav_put_uint8_t(buf, 4, rssi); |
_mav_put_uint8_t(buf, 5, remrssi); |
_mav_put_uint8_t(buf, 6, txbuf); |
_mav_put_uint8_t(buf, 7, noise); |
_mav_put_uint8_t(buf, 8, remnoise); |
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO, buf, 9, 21); |
#else |
mavlink_radio_t packet; |
packet.rxerrors = rxerrors; |
packet.fixed = fixed; |
packet.rssi = rssi; |
packet.remrssi = remrssi; |
packet.txbuf = txbuf; |
packet.noise = noise; |
packet.remnoise = remnoise; |
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RADIO, (const char *)&packet, 9, 21); |
#endif |
} |
#endif |
// MESSAGE RADIO UNPACKING |
/** |
* @brief Get field rssi from radio message |
* |
* @return local signal strength |
*/ |
static inline uint8_t mavlink_msg_radio_get_rssi(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 4); |
} |
/** |
* @brief Get field remrssi from radio message |
* |
* @return remote signal strength |
*/ |
static inline uint8_t mavlink_msg_radio_get_remrssi(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 5); |
} |
/** |
* @brief Get field txbuf from radio message |
* |
* @return how full the tx buffer is as a percentage |
*/ |
static inline uint8_t mavlink_msg_radio_get_txbuf(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 6); |
} |
/** |
* @brief Get field noise from radio message |
* |
* @return background noise level |
*/ |
static inline uint8_t mavlink_msg_radio_get_noise(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 7); |
} |
/** |
* @brief Get field remnoise from radio message |
* |
* @return remote background noise level |
*/ |
static inline uint8_t mavlink_msg_radio_get_remnoise(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 8); |
} |
/** |
* @brief Get field rxerrors from radio message |
* |
* @return receive errors |
*/ |
static inline uint16_t mavlink_msg_radio_get_rxerrors(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint16_t(msg, 0); |
} |
/** |
* @brief Get field fixed from radio message |
* |
* @return count of error corrected packets |
*/ |
static inline uint16_t mavlink_msg_radio_get_fixed(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint16_t(msg, 2); |
} |
/** |
* @brief Decode a radio message into a struct |
* |
* @param msg The message to decode |
* @param radio C-struct to decode the message contents into |
*/ |
static inline void mavlink_msg_radio_decode(const mavlink_message_t* msg, mavlink_radio_t* radio) |
{ |
#if MAVLINK_NEED_BYTE_SWAP |
radio->rxerrors = mavlink_msg_radio_get_rxerrors(msg); |
radio->fixed = mavlink_msg_radio_get_fixed(msg); |
radio->rssi = mavlink_msg_radio_get_rssi(msg); |
radio->remrssi = mavlink_msg_radio_get_remrssi(msg); |
radio->txbuf = mavlink_msg_radio_get_txbuf(msg); |
radio->noise = mavlink_msg_radio_get_noise(msg); |
radio->remnoise = mavlink_msg_radio_get_remnoise(msg); |
#else |
memcpy(radio, _MAV_PAYLOAD(msg), 9); |
#endif |
} |
/C-OSD/arducam-osd/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_sensor_offsets.h |
---|
0,0 → 1,386 |
// MESSAGE SENSOR_OFFSETS PACKING |
#define MAVLINK_MSG_ID_SENSOR_OFFSETS 150 |
typedef struct __mavlink_sensor_offsets_t |
{ |
float mag_declination; ///< magnetic declination (radians) |
int32_t raw_press; ///< raw pressure from barometer |
int32_t raw_temp; ///< raw temperature from barometer |
float gyro_cal_x; ///< gyro X calibration |
float gyro_cal_y; ///< gyro Y calibration |
float gyro_cal_z; ///< gyro Z calibration |
float accel_cal_x; ///< accel X calibration |
float accel_cal_y; ///< accel Y calibration |
float accel_cal_z; ///< accel Z calibration |
int16_t mag_ofs_x; ///< magnetometer X offset |
int16_t mag_ofs_y; ///< magnetometer Y offset |
int16_t mag_ofs_z; ///< magnetometer Z offset |
} mavlink_sensor_offsets_t; |
#define MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN 42 |
#define MAVLINK_MSG_ID_150_LEN 42 |
#define MAVLINK_MESSAGE_INFO_SENSOR_OFFSETS { \ |
"SENSOR_OFFSETS", \ |
12, \ |
{ { "mag_declination", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_sensor_offsets_t, mag_declination) }, \ |
{ "raw_press", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_sensor_offsets_t, raw_press) }, \ |
{ "raw_temp", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_sensor_offsets_t, raw_temp) }, \ |
{ "gyro_cal_x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_sensor_offsets_t, gyro_cal_x) }, \ |
{ "gyro_cal_y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_sensor_offsets_t, gyro_cal_y) }, \ |
{ "gyro_cal_z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_sensor_offsets_t, gyro_cal_z) }, \ |
{ "accel_cal_x", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_sensor_offsets_t, accel_cal_x) }, \ |
{ "accel_cal_y", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_sensor_offsets_t, accel_cal_y) }, \ |
{ "accel_cal_z", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_sensor_offsets_t, accel_cal_z) }, \ |
{ "mag_ofs_x", NULL, MAVLINK_TYPE_INT16_T, 0, 36, offsetof(mavlink_sensor_offsets_t, mag_ofs_x) }, \ |
{ "mag_ofs_y", NULL, MAVLINK_TYPE_INT16_T, 0, 38, offsetof(mavlink_sensor_offsets_t, mag_ofs_y) }, \ |
{ "mag_ofs_z", NULL, MAVLINK_TYPE_INT16_T, 0, 40, offsetof(mavlink_sensor_offsets_t, mag_ofs_z) }, \ |
} \ |
} |
/** |
* @brief Pack a sensor_offsets 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 mag_ofs_x magnetometer X offset |
* @param mag_ofs_y magnetometer Y offset |
* @param mag_ofs_z magnetometer Z offset |
* @param mag_declination magnetic declination (radians) |
* @param raw_press raw pressure from barometer |
* @param raw_temp raw temperature from barometer |
* @param gyro_cal_x gyro X calibration |
* @param gyro_cal_y gyro Y calibration |
* @param gyro_cal_z gyro Z calibration |
* @param accel_cal_x accel X calibration |
* @param accel_cal_y accel Y calibration |
* @param accel_cal_z accel Z calibration |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
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) |
{ |
#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_NON_CONST(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_NON_CONST(msg), &packet, 42); |
#endif |
msg->msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS; |
return mavlink_finalize_message(msg, system_id, component_id, 42, 134); |
} |
/** |
* @brief Pack a sensor_offsets 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 mag_ofs_x magnetometer X offset |
* @param mag_ofs_y magnetometer Y offset |
* @param mag_ofs_z magnetometer Z offset |
* @param mag_declination magnetic declination (radians) |
* @param raw_press raw pressure from barometer |
* @param raw_temp raw temperature from barometer |
* @param gyro_cal_x gyro X calibration |
* @param gyro_cal_y gyro Y calibration |
* @param gyro_cal_z gyro Z calibration |
* @param accel_cal_x accel X calibration |
* @param accel_cal_y accel Y calibration |
* @param accel_cal_z accel Z calibration |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_sensor_offsets_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, |
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) |
{ |
#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_NON_CONST(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_NON_CONST(msg), &packet, 42); |
#endif |
msg->msgid = MAVLINK_MSG_ID_SENSOR_OFFSETS; |
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 42, 134); |
} |
/** |
* @brief Encode a sensor_offsets 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 sensor_offsets C-struct to read the message contents from |
*/ |
static inline uint16_t mavlink_msg_sensor_offsets_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_sensor_offsets_t* sensor_offsets) |
{ |
return mavlink_msg_sensor_offsets_pack(system_id, component_id, msg, sensor_offsets->mag_ofs_x, sensor_offsets->mag_ofs_y, sensor_offsets->mag_ofs_z, sensor_offsets->mag_declination, sensor_offsets->raw_press, sensor_offsets->raw_temp, sensor_offsets->gyro_cal_x, sensor_offsets->gyro_cal_y, sensor_offsets->gyro_cal_z, sensor_offsets->accel_cal_x, sensor_offsets->accel_cal_y, sensor_offsets->accel_cal_z); |
} |
/** |
* @brief Send a sensor_offsets message |
* @param chan MAVLink channel to send the message |
* |
* @param mag_ofs_x magnetometer X offset |
* @param mag_ofs_y magnetometer Y offset |
* @param mag_ofs_z magnetometer Z offset |
* @param mag_declination magnetic declination (radians) |
* @param raw_press raw pressure from barometer |
* @param raw_temp raw temperature from barometer |
* @param gyro_cal_x gyro X calibration |
* @param gyro_cal_y gyro Y calibration |
* @param gyro_cal_z gyro Z calibration |
* @param accel_cal_x accel X calibration |
* @param accel_cal_y accel Y calibration |
* @param accel_cal_z accel Z calibration |
*/ |
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS |
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) |
{ |
#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 |
// MESSAGE SENSOR_OFFSETS UNPACKING |
/** |
* @brief Get field mag_ofs_x from sensor_offsets message |
* |
* @return magnetometer X offset |
*/ |
static inline int16_t mavlink_msg_sensor_offsets_get_mag_ofs_x(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_int16_t(msg, 36); |
} |
/** |
* @brief Get field mag_ofs_y from sensor_offsets message |
* |
* @return magnetometer Y offset |
*/ |
static inline int16_t mavlink_msg_sensor_offsets_get_mag_ofs_y(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_int16_t(msg, 38); |
} |
/** |
* @brief Get field mag_ofs_z from sensor_offsets message |
* |
* @return magnetometer Z offset |
*/ |
static inline int16_t mavlink_msg_sensor_offsets_get_mag_ofs_z(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_int16_t(msg, 40); |
} |
/** |
* @brief Get field mag_declination from sensor_offsets message |
* |
* @return magnetic declination (radians) |
*/ |
static inline float mavlink_msg_sensor_offsets_get_mag_declination(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_float(msg, 0); |
} |
/** |
* @brief Get field raw_press from sensor_offsets message |
* |
* @return raw pressure from barometer |
*/ |
static inline int32_t mavlink_msg_sensor_offsets_get_raw_press(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_int32_t(msg, 4); |
} |
/** |
* @brief Get field raw_temp from sensor_offsets message |
* |
* @return raw temperature from barometer |
*/ |
static inline int32_t mavlink_msg_sensor_offsets_get_raw_temp(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_int32_t(msg, 8); |
} |
/** |
* @brief Get field gyro_cal_x from sensor_offsets message |
* |
* @return gyro X calibration |
*/ |
static inline float mavlink_msg_sensor_offsets_get_gyro_cal_x(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_float(msg, 12); |
} |
/** |
* @brief Get field gyro_cal_y from sensor_offsets message |
* |
* @return gyro Y calibration |
*/ |
static inline float mavlink_msg_sensor_offsets_get_gyro_cal_y(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_float(msg, 16); |
} |
/** |
* @brief Get field gyro_cal_z from sensor_offsets message |
* |
* @return gyro Z calibration |
*/ |
static inline float mavlink_msg_sensor_offsets_get_gyro_cal_z(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_float(msg, 20); |
} |
/** |
* @brief Get field accel_cal_x from sensor_offsets message |
* |
* @return accel X calibration |
*/ |
static inline float mavlink_msg_sensor_offsets_get_accel_cal_x(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_float(msg, 24); |
} |
/** |
* @brief Get field accel_cal_y from sensor_offsets message |
* |
* @return accel Y calibration |
*/ |
static inline float mavlink_msg_sensor_offsets_get_accel_cal_y(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_float(msg, 28); |
} |
/** |
* @brief Get field accel_cal_z from sensor_offsets message |
* |
* @return accel Z calibration |
*/ |
static inline float mavlink_msg_sensor_offsets_get_accel_cal_z(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_float(msg, 32); |
} |
/** |
* @brief Decode a sensor_offsets message into a struct |
* |
* @param msg The message to decode |
* @param sensor_offsets C-struct to decode the message contents into |
*/ |
static inline void mavlink_msg_sensor_offsets_decode(const mavlink_message_t* msg, mavlink_sensor_offsets_t* sensor_offsets) |
{ |
#if MAVLINK_NEED_BYTE_SWAP |
sensor_offsets->mag_declination = mavlink_msg_sensor_offsets_get_mag_declination(msg); |
sensor_offsets->raw_press = mavlink_msg_sensor_offsets_get_raw_press(msg); |
sensor_offsets->raw_temp = mavlink_msg_sensor_offsets_get_raw_temp(msg); |
sensor_offsets->gyro_cal_x = mavlink_msg_sensor_offsets_get_gyro_cal_x(msg); |
sensor_offsets->gyro_cal_y = mavlink_msg_sensor_offsets_get_gyro_cal_y(msg); |
sensor_offsets->gyro_cal_z = mavlink_msg_sensor_offsets_get_gyro_cal_z(msg); |
sensor_offsets->accel_cal_x = mavlink_msg_sensor_offsets_get_accel_cal_x(msg); |
sensor_offsets->accel_cal_y = mavlink_msg_sensor_offsets_get_accel_cal_y(msg); |
sensor_offsets->accel_cal_z = mavlink_msg_sensor_offsets_get_accel_cal_z(msg); |
sensor_offsets->mag_ofs_x = mavlink_msg_sensor_offsets_get_mag_ofs_x(msg); |
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, _MAV_PAYLOAD(msg), 42); |
#endif |
} |
/C-OSD/arducam-osd/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_set_mag_offsets.h |
---|
0,0 → 1,232 |
// MESSAGE SET_MAG_OFFSETS PACKING |
#define MAVLINK_MSG_ID_SET_MAG_OFFSETS 151 |
typedef struct __mavlink_set_mag_offsets_t |
{ |
int16_t mag_ofs_x; ///< magnetometer X offset |
int16_t mag_ofs_y; ///< magnetometer Y offset |
int16_t mag_ofs_z; ///< magnetometer Z offset |
uint8_t target_system; ///< System ID |
uint8_t target_component; ///< Component ID |
} mavlink_set_mag_offsets_t; |
#define MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN 8 |
#define MAVLINK_MSG_ID_151_LEN 8 |
#define MAVLINK_MESSAGE_INFO_SET_MAG_OFFSETS { \ |
"SET_MAG_OFFSETS", \ |
5, \ |
{ { "mag_ofs_x", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_set_mag_offsets_t, mag_ofs_x) }, \ |
{ "mag_ofs_y", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_set_mag_offsets_t, mag_ofs_y) }, \ |
{ "mag_ofs_z", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_set_mag_offsets_t, mag_ofs_z) }, \ |
{ "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_set_mag_offsets_t, target_system) }, \ |
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_set_mag_offsets_t, target_component) }, \ |
} \ |
} |
/** |
* @brief Pack a set_mag_offsets 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 target_system System ID |
* @param target_component Component ID |
* @param mag_ofs_x magnetometer X offset |
* @param mag_ofs_y magnetometer Y offset |
* @param mag_ofs_z magnetometer Z offset |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
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) |
{ |
#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_NON_CONST(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_NON_CONST(msg), &packet, 8); |
#endif |
msg->msgid = MAVLINK_MSG_ID_SET_MAG_OFFSETS; |
return mavlink_finalize_message(msg, system_id, component_id, 8, 219); |
} |
/** |
* @brief Pack a set_mag_offsets 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 target_system System ID |
* @param target_component Component ID |
* @param mag_ofs_x magnetometer X offset |
* @param mag_ofs_y magnetometer Y offset |
* @param mag_ofs_z magnetometer Z offset |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_set_mag_offsets_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, |
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) |
{ |
#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_NON_CONST(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_NON_CONST(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); |
} |
/** |
* @brief Encode a set_mag_offsets 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 set_mag_offsets C-struct to read the message contents from |
*/ |
static inline uint16_t mavlink_msg_set_mag_offsets_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_mag_offsets_t* set_mag_offsets) |
{ |
return mavlink_msg_set_mag_offsets_pack(system_id, component_id, msg, set_mag_offsets->target_system, set_mag_offsets->target_component, set_mag_offsets->mag_ofs_x, set_mag_offsets->mag_ofs_y, set_mag_offsets->mag_ofs_z); |
} |
/** |
* @brief Send a set_mag_offsets message |
* @param chan MAVLink channel to send the message |
* |
* @param target_system System ID |
* @param target_component Component ID |
* @param mag_ofs_x magnetometer X offset |
* @param mag_ofs_y magnetometer Y offset |
* @param mag_ofs_z magnetometer Z offset |
*/ |
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS |
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) |
{ |
#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 |
// MESSAGE SET_MAG_OFFSETS UNPACKING |
/** |
* @brief Get field target_system from set_mag_offsets message |
* |
* @return System ID |
*/ |
static inline uint8_t mavlink_msg_set_mag_offsets_get_target_system(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 6); |
} |
/** |
* @brief Get field target_component from set_mag_offsets message |
* |
* @return Component ID |
*/ |
static inline uint8_t mavlink_msg_set_mag_offsets_get_target_component(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_uint8_t(msg, 7); |
} |
/** |
* @brief Get field mag_ofs_x from set_mag_offsets message |
* |
* @return magnetometer X offset |
*/ |
static inline int16_t mavlink_msg_set_mag_offsets_get_mag_ofs_x(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_int16_t(msg, 0); |
} |
/** |
* @brief Get field mag_ofs_y from set_mag_offsets message |
* |
* @return magnetometer Y offset |
*/ |
static inline int16_t mavlink_msg_set_mag_offsets_get_mag_ofs_y(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_int16_t(msg, 2); |
} |
/** |
* @brief Get field mag_ofs_z from set_mag_offsets message |
* |
* @return magnetometer Z offset |
*/ |
static inline int16_t mavlink_msg_set_mag_offsets_get_mag_ofs_z(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_int16_t(msg, 4); |
} |
/** |
* @brief Decode a set_mag_offsets message into a struct |
* |
* @param msg The message to decode |
* @param set_mag_offsets C-struct to decode the message contents into |
*/ |
static inline void mavlink_msg_set_mag_offsets_decode(const mavlink_message_t* msg, mavlink_set_mag_offsets_t* set_mag_offsets) |
{ |
#if MAVLINK_NEED_BYTE_SWAP |
set_mag_offsets->mag_ofs_x = mavlink_msg_set_mag_offsets_get_mag_ofs_x(msg); |
set_mag_offsets->mag_ofs_y = mavlink_msg_set_mag_offsets_get_mag_ofs_y(msg); |
set_mag_offsets->mag_ofs_z = mavlink_msg_set_mag_offsets_get_mag_ofs_z(msg); |
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, _MAV_PAYLOAD(msg), 8); |
#endif |
} |
/C-OSD/arducam-osd/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_simstate.h |
---|
0,0 → 1,320 |
// MESSAGE SIMSTATE PACKING |
#define MAVLINK_MSG_ID_SIMSTATE 164 |
typedef struct __mavlink_simstate_t |
{ |
float roll; ///< Roll angle (rad) |
float pitch; ///< Pitch angle (rad) |
float yaw; ///< Yaw angle (rad) |
float xacc; ///< X acceleration m/s/s |
float yacc; ///< Y acceleration m/s/s |
float zacc; ///< Z acceleration m/s/s |
float xgyro; ///< Angular speed around X axis rad/s |
float ygyro; ///< Angular speed around Y axis rad/s |
float zgyro; ///< Angular speed around Z axis rad/s |
} mavlink_simstate_t; |
#define MAVLINK_MSG_ID_SIMSTATE_LEN 36 |
#define MAVLINK_MSG_ID_164_LEN 36 |
#define MAVLINK_MESSAGE_INFO_SIMSTATE { \ |
"SIMSTATE", \ |
9, \ |
{ { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_simstate_t, roll) }, \ |
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_simstate_t, pitch) }, \ |
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_simstate_t, yaw) }, \ |
{ "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_simstate_t, xacc) }, \ |
{ "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_simstate_t, yacc) }, \ |
{ "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_simstate_t, zacc) }, \ |
{ "xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_simstate_t, xgyro) }, \ |
{ "ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_simstate_t, ygyro) }, \ |
{ "zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_simstate_t, zgyro) }, \ |
} \ |
} |
/** |
* @brief Pack a simstate 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 roll Roll angle (rad) |
* @param pitch Pitch angle (rad) |
* @param yaw Yaw angle (rad) |
* @param xacc X acceleration m/s/s |
* @param yacc Y acceleration m/s/s |
* @param zacc Z acceleration m/s/s |
* @param xgyro Angular speed around X axis rad/s |
* @param ygyro Angular speed around Y axis rad/s |
* @param zgyro Angular speed around Z axis rad/s |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_simstate_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, |
float roll, float pitch, float yaw, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[36]; |
_mav_put_float(buf, 0, roll); |
_mav_put_float(buf, 4, pitch); |
_mav_put_float(buf, 8, yaw); |
_mav_put_float(buf, 12, xacc); |
_mav_put_float(buf, 16, yacc); |
_mav_put_float(buf, 20, zacc); |
_mav_put_float(buf, 24, xgyro); |
_mav_put_float(buf, 28, ygyro); |
_mav_put_float(buf, 32, zgyro); |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 36); |
#else |
mavlink_simstate_t packet; |
packet.roll = roll; |
packet.pitch = pitch; |
packet.yaw = yaw; |
packet.xacc = xacc; |
packet.yacc = yacc; |
packet.zacc = zacc; |
packet.xgyro = xgyro; |
packet.ygyro = ygyro; |
packet.zgyro = zgyro; |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 36); |
#endif |
msg->msgid = MAVLINK_MSG_ID_SIMSTATE; |
return mavlink_finalize_message(msg, system_id, component_id, 36, 42); |
} |
/** |
* @brief Pack a simstate 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 roll Roll angle (rad) |
* @param pitch Pitch angle (rad) |
* @param yaw Yaw angle (rad) |
* @param xacc X acceleration m/s/s |
* @param yacc Y acceleration m/s/s |
* @param zacc Z acceleration m/s/s |
* @param xgyro Angular speed around X axis rad/s |
* @param ygyro Angular speed around Y axis rad/s |
* @param zgyro Angular speed around Z axis rad/s |
* @return length of the message in bytes (excluding serial stream start sign) |
*/ |
static inline uint16_t mavlink_msg_simstate_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, |
mavlink_message_t* msg, |
float roll,float pitch,float yaw,float xacc,float yacc,float zacc,float xgyro,float ygyro,float zgyro) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[36]; |
_mav_put_float(buf, 0, roll); |
_mav_put_float(buf, 4, pitch); |
_mav_put_float(buf, 8, yaw); |
_mav_put_float(buf, 12, xacc); |
_mav_put_float(buf, 16, yacc); |
_mav_put_float(buf, 20, zacc); |
_mav_put_float(buf, 24, xgyro); |
_mav_put_float(buf, 28, ygyro); |
_mav_put_float(buf, 32, zgyro); |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 36); |
#else |
mavlink_simstate_t packet; |
packet.roll = roll; |
packet.pitch = pitch; |
packet.yaw = yaw; |
packet.xacc = xacc; |
packet.yacc = yacc; |
packet.zacc = zacc; |
packet.xgyro = xgyro; |
packet.ygyro = ygyro; |
packet.zgyro = zgyro; |
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 36); |
#endif |
msg->msgid = MAVLINK_MSG_ID_SIMSTATE; |
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 36, 42); |
} |
/** |
* @brief Encode a simstate 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 simstate C-struct to read the message contents from |
*/ |
static inline uint16_t mavlink_msg_simstate_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_simstate_t* simstate) |
{ |
return mavlink_msg_simstate_pack(system_id, component_id, msg, simstate->roll, simstate->pitch, simstate->yaw, simstate->xacc, simstate->yacc, simstate->zacc, simstate->xgyro, simstate->ygyro, simstate->zgyro); |
} |
/** |
* @brief Send a simstate message |
* @param chan MAVLink channel to send the message |
* |
* @param roll Roll angle (rad) |
* @param pitch Pitch angle (rad) |
* @param yaw Yaw angle (rad) |
* @param xacc X acceleration m/s/s |
* @param yacc Y acceleration m/s/s |
* @param zacc Z acceleration m/s/s |
* @param xgyro Angular speed around X axis rad/s |
* @param ygyro Angular speed around Y axis rad/s |
* @param zgyro Angular speed around Z axis rad/s |
*/ |
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS |
static inline void mavlink_msg_simstate_send(mavlink_channel_t chan, float roll, float pitch, float yaw, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro) |
{ |
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
char buf[36]; |
_mav_put_float(buf, 0, roll); |
_mav_put_float(buf, 4, pitch); |
_mav_put_float(buf, 8, yaw); |
_mav_put_float(buf, 12, xacc); |
_mav_put_float(buf, 16, yacc); |
_mav_put_float(buf, 20, zacc); |
_mav_put_float(buf, 24, xgyro); |
_mav_put_float(buf, 28, ygyro); |
_mav_put_float(buf, 32, zgyro); |
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIMSTATE, buf, 36, 42); |
#else |
mavlink_simstate_t packet; |
packet.roll = roll; |
packet.pitch = pitch; |
packet.yaw = yaw; |
packet.xacc = xacc; |
packet.yacc = yacc; |
packet.zacc = zacc; |
packet.xgyro = xgyro; |
packet.ygyro = ygyro; |
packet.zgyro = zgyro; |
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SIMSTATE, (const char *)&packet, 36, 42); |
#endif |
} |
#endif |
// MESSAGE SIMSTATE UNPACKING |
/** |
* @brief Get field roll from simstate message |
* |
* @return Roll angle (rad) |
*/ |
static inline float mavlink_msg_simstate_get_roll(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_float(msg, 0); |
} |
/** |
* @brief Get field pitch from simstate message |
* |
* @return Pitch angle (rad) |
*/ |
static inline float mavlink_msg_simstate_get_pitch(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_float(msg, 4); |
} |
/** |
* @brief Get field yaw from simstate message |
* |
* @return Yaw angle (rad) |
*/ |
static inline float mavlink_msg_simstate_get_yaw(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_float(msg, 8); |
} |
/** |
* @brief Get field xacc from simstate message |
* |
* @return X acceleration m/s/s |
*/ |
static inline float mavlink_msg_simstate_get_xacc(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_float(msg, 12); |
} |
/** |
* @brief Get field yacc from simstate message |
* |
* @return Y acceleration m/s/s |
*/ |
static inline float mavlink_msg_simstate_get_yacc(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_float(msg, 16); |
} |
/** |
* @brief Get field zacc from simstate message |
* |
* @return Z acceleration m/s/s |
*/ |
static inline float mavlink_msg_simstate_get_zacc(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_float(msg, 20); |
} |
/** |
* @brief Get field xgyro from simstate message |
* |
* @return Angular speed around X axis rad/s |
*/ |
static inline float mavlink_msg_simstate_get_xgyro(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_float(msg, 24); |
} |
/** |
* @brief Get field ygyro from simstate message |
* |
* @return Angular speed around Y axis rad/s |
*/ |
static inline float mavlink_msg_simstate_get_ygyro(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_float(msg, 28); |
} |
/** |
* @brief Get field zgyro from simstate message |
* |
* @return Angular speed around Z axis rad/s |
*/ |
static inline float mavlink_msg_simstate_get_zgyro(const mavlink_message_t* msg) |
{ |
return _MAV_RETURN_float(msg, 32); |
} |
/** |
* @brief Decode a simstate message into a struct |
* |
* @param msg The message to decode |
* @param simstate C-struct to decode the message contents into |
*/ |
static inline void mavlink_msg_simstate_decode(const mavlink_message_t* msg, mavlink_simstate_t* simstate) |
{ |
#if MAVLINK_NEED_BYTE_SWAP |
simstate->roll = mavlink_msg_simstate_get_roll(msg); |
simstate->pitch = mavlink_msg_simstate_get_pitch(msg); |
simstate->yaw = mavlink_msg_simstate_get_yaw(msg); |
simstate->xacc = mavlink_msg_simstate_get_xacc(msg); |
simstate->yacc = mavlink_msg_simstate_get_yacc(msg); |
simstate->zacc = mavlink_msg_simstate_get_zacc(msg); |
simstate->xgyro = mavlink_msg_simstate_get_xgyro(msg); |
simstate->ygyro = mavlink_msg_simstate_get_ygyro(msg); |
simstate->zgyro = mavlink_msg_simstate_get_zgyro(msg); |
#else |
memcpy(simstate, _MAV_PAYLOAD(msg), 36); |
#endif |
} |
/C-OSD/arducam-osd/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/testsuite.h |
---|
0,0 → 1,908 |
/** @file |
* @brief MAVLink comm protocol testsuite generated from ardupilotmega.xml |
* @see http://qgroundcontrol.org/mavlink/ |
*/ |
#ifndef ARDUPILOTMEGA_TESTSUITE_H |
#define ARDUPILOTMEGA_TESTSUITE_H |
#ifdef __cplusplus |
extern "C" { |
#endif |
#ifndef MAVLINK_TEST_ALL |
#define MAVLINK_TEST_ALL |
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, mavlink_message_t *last_msg) |
{ |
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, mavlink_message_t *last_msg) |
{ |
mavlink_message_t msg; |
uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; |
uint16_t i; |
mavlink_sensor_offsets_t packet_in = { |
17.0, |
963497672, |
963497880, |
101.0, |
129.0, |
157.0, |
185.0, |
213.0, |
241.0, |
19107, |
19211, |
19315, |
}; |
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, mavlink_message_t *last_msg) |
{ |
mavlink_message_t msg; |
uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; |
uint16_t i; |
mavlink_set_mag_offsets_t packet_in = { |
17235, |
17339, |
17443, |
151, |
218, |
}; |
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_meminfo(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_meminfo_t packet_in = { |
17235, |
17339, |
}; |
mavlink_meminfo_t packet1, packet2; |
memset(&packet1, 0, sizeof(packet1)); |
packet1.brkval = packet_in.brkval; |
packet1.freemem = packet_in.freemem; |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_meminfo_encode(system_id, component_id, &msg, &packet1); |
mavlink_msg_meminfo_decode(&msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_meminfo_pack(system_id, component_id, &msg , packet1.brkval , packet1.freemem ); |
mavlink_msg_meminfo_decode(&msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_meminfo_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.brkval , packet1.freemem ); |
mavlink_msg_meminfo_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_meminfo_decode(last_msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_meminfo_send(MAVLINK_COMM_1 , packet1.brkval , packet1.freemem ); |
mavlink_msg_meminfo_decode(last_msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
} |
static void mavlink_test_ap_adc(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_ap_adc_t packet_in = { |
17235, |
17339, |
17443, |
17547, |
17651, |
17755, |
}; |
mavlink_ap_adc_t packet1, packet2; |
memset(&packet1, 0, sizeof(packet1)); |
packet1.adc1 = packet_in.adc1; |
packet1.adc2 = packet_in.adc2; |
packet1.adc3 = packet_in.adc3; |
packet1.adc4 = packet_in.adc4; |
packet1.adc5 = packet_in.adc5; |
packet1.adc6 = packet_in.adc6; |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_ap_adc_encode(system_id, component_id, &msg, &packet1); |
mavlink_msg_ap_adc_decode(&msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_ap_adc_pack(system_id, component_id, &msg , packet1.adc1 , packet1.adc2 , packet1.adc3 , packet1.adc4 , packet1.adc5 , packet1.adc6 ); |
mavlink_msg_ap_adc_decode(&msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_ap_adc_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.adc1 , packet1.adc2 , packet1.adc3 , packet1.adc4 , packet1.adc5 , packet1.adc6 ); |
mavlink_msg_ap_adc_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_ap_adc_decode(last_msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_ap_adc_send(MAVLINK_COMM_1 , packet1.adc1 , packet1.adc2 , packet1.adc3 , packet1.adc4 , packet1.adc5 , packet1.adc6 ); |
mavlink_msg_ap_adc_decode(last_msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
} |
static void mavlink_test_digicam_configure(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_digicam_configure_t packet_in = { |
17.0, |
17443, |
151, |
218, |
29, |
96, |
163, |
230, |
41, |
108, |
175, |
}; |
mavlink_digicam_configure_t packet1, packet2; |
memset(&packet1, 0, sizeof(packet1)); |
packet1.extra_value = packet_in.extra_value; |
packet1.shutter_speed = packet_in.shutter_speed; |
packet1.target_system = packet_in.target_system; |
packet1.target_component = packet_in.target_component; |
packet1.mode = packet_in.mode; |
packet1.aperture = packet_in.aperture; |
packet1.iso = packet_in.iso; |
packet1.exposure_type = packet_in.exposure_type; |
packet1.command_id = packet_in.command_id; |
packet1.engine_cut_off = packet_in.engine_cut_off; |
packet1.extra_param = packet_in.extra_param; |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_digicam_configure_encode(system_id, component_id, &msg, &packet1); |
mavlink_msg_digicam_configure_decode(&msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_digicam_configure_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.mode , packet1.shutter_speed , packet1.aperture , packet1.iso , packet1.exposure_type , packet1.command_id , packet1.engine_cut_off , packet1.extra_param , packet1.extra_value ); |
mavlink_msg_digicam_configure_decode(&msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_digicam_configure_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.mode , packet1.shutter_speed , packet1.aperture , packet1.iso , packet1.exposure_type , packet1.command_id , packet1.engine_cut_off , packet1.extra_param , packet1.extra_value ); |
mavlink_msg_digicam_configure_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_digicam_configure_decode(last_msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_digicam_configure_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.mode , packet1.shutter_speed , packet1.aperture , packet1.iso , packet1.exposure_type , packet1.command_id , packet1.engine_cut_off , packet1.extra_param , packet1.extra_value ); |
mavlink_msg_digicam_configure_decode(last_msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
} |
static void mavlink_test_digicam_control(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_digicam_control_t packet_in = { |
17.0, |
17, |
84, |
151, |
218, |
29, |
96, |
163, |
230, |
41, |
}; |
mavlink_digicam_control_t packet1, packet2; |
memset(&packet1, 0, sizeof(packet1)); |
packet1.extra_value = packet_in.extra_value; |
packet1.target_system = packet_in.target_system; |
packet1.target_component = packet_in.target_component; |
packet1.session = packet_in.session; |
packet1.zoom_pos = packet_in.zoom_pos; |
packet1.zoom_step = packet_in.zoom_step; |
packet1.focus_lock = packet_in.focus_lock; |
packet1.shot = packet_in.shot; |
packet1.command_id = packet_in.command_id; |
packet1.extra_param = packet_in.extra_param; |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_digicam_control_encode(system_id, component_id, &msg, &packet1); |
mavlink_msg_digicam_control_decode(&msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_digicam_control_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.session , packet1.zoom_pos , packet1.zoom_step , packet1.focus_lock , packet1.shot , packet1.command_id , packet1.extra_param , packet1.extra_value ); |
mavlink_msg_digicam_control_decode(&msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_digicam_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.session , packet1.zoom_pos , packet1.zoom_step , packet1.focus_lock , packet1.shot , packet1.command_id , packet1.extra_param , packet1.extra_value ); |
mavlink_msg_digicam_control_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_digicam_control_decode(last_msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_digicam_control_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.session , packet1.zoom_pos , packet1.zoom_step , packet1.focus_lock , packet1.shot , packet1.command_id , packet1.extra_param , packet1.extra_value ); |
mavlink_msg_digicam_control_decode(last_msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
} |
static void mavlink_test_mount_configure(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_mount_configure_t packet_in = { |
5, |
72, |
139, |
206, |
17, |
84, |
}; |
mavlink_mount_configure_t packet1, packet2; |
memset(&packet1, 0, sizeof(packet1)); |
packet1.target_system = packet_in.target_system; |
packet1.target_component = packet_in.target_component; |
packet1.mount_mode = packet_in.mount_mode; |
packet1.stab_roll = packet_in.stab_roll; |
packet1.stab_pitch = packet_in.stab_pitch; |
packet1.stab_yaw = packet_in.stab_yaw; |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_mount_configure_encode(system_id, component_id, &msg, &packet1); |
mavlink_msg_mount_configure_decode(&msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_mount_configure_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.mount_mode , packet1.stab_roll , packet1.stab_pitch , packet1.stab_yaw ); |
mavlink_msg_mount_configure_decode(&msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_mount_configure_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.mount_mode , packet1.stab_roll , packet1.stab_pitch , packet1.stab_yaw ); |
mavlink_msg_mount_configure_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_mount_configure_decode(last_msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_mount_configure_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.mount_mode , packet1.stab_roll , packet1.stab_pitch , packet1.stab_yaw ); |
mavlink_msg_mount_configure_decode(last_msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
} |
static void mavlink_test_mount_control(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_mount_control_t packet_in = { |
963497464, |
963497672, |
963497880, |
41, |
108, |
175, |
}; |
mavlink_mount_control_t packet1, packet2; |
memset(&packet1, 0, sizeof(packet1)); |
packet1.input_a = packet_in.input_a; |
packet1.input_b = packet_in.input_b; |
packet1.input_c = packet_in.input_c; |
packet1.target_system = packet_in.target_system; |
packet1.target_component = packet_in.target_component; |
packet1.save_position = packet_in.save_position; |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_mount_control_encode(system_id, component_id, &msg, &packet1); |
mavlink_msg_mount_control_decode(&msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_mount_control_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.input_a , packet1.input_b , packet1.input_c , packet1.save_position ); |
mavlink_msg_mount_control_decode(&msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_mount_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.input_a , packet1.input_b , packet1.input_c , packet1.save_position ); |
mavlink_msg_mount_control_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_mount_control_decode(last_msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_mount_control_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.input_a , packet1.input_b , packet1.input_c , packet1.save_position ); |
mavlink_msg_mount_control_decode(last_msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
} |
static void mavlink_test_mount_status(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_mount_status_t packet_in = { |
963497464, |
963497672, |
963497880, |
41, |
108, |
}; |
mavlink_mount_status_t packet1, packet2; |
memset(&packet1, 0, sizeof(packet1)); |
packet1.pointing_a = packet_in.pointing_a; |
packet1.pointing_b = packet_in.pointing_b; |
packet1.pointing_c = packet_in.pointing_c; |
packet1.target_system = packet_in.target_system; |
packet1.target_component = packet_in.target_component; |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_mount_status_encode(system_id, component_id, &msg, &packet1); |
mavlink_msg_mount_status_decode(&msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_mount_status_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.pointing_a , packet1.pointing_b , packet1.pointing_c ); |
mavlink_msg_mount_status_decode(&msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_mount_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.pointing_a , packet1.pointing_b , packet1.pointing_c ); |
mavlink_msg_mount_status_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_mount_status_decode(last_msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_mount_status_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.pointing_a , packet1.pointing_b , packet1.pointing_c ); |
mavlink_msg_mount_status_decode(last_msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
} |
static void mavlink_test_fence_point(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_fence_point_t packet_in = { |
17.0, |
45.0, |
29, |
96, |
163, |
230, |
}; |
mavlink_fence_point_t packet1, packet2; |
memset(&packet1, 0, sizeof(packet1)); |
packet1.lat = packet_in.lat; |
packet1.lng = packet_in.lng; |
packet1.target_system = packet_in.target_system; |
packet1.target_component = packet_in.target_component; |
packet1.idx = packet_in.idx; |
packet1.count = packet_in.count; |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_fence_point_encode(system_id, component_id, &msg, &packet1); |
mavlink_msg_fence_point_decode(&msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_fence_point_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.idx , packet1.count , packet1.lat , packet1.lng ); |
mavlink_msg_fence_point_decode(&msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_fence_point_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.idx , packet1.count , packet1.lat , packet1.lng ); |
mavlink_msg_fence_point_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_fence_point_decode(last_msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_fence_point_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.idx , packet1.count , packet1.lat , packet1.lng ); |
mavlink_msg_fence_point_decode(last_msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
} |
static void mavlink_test_fence_fetch_point(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_fence_fetch_point_t packet_in = { |
5, |
72, |
139, |
}; |
mavlink_fence_fetch_point_t packet1, packet2; |
memset(&packet1, 0, sizeof(packet1)); |
packet1.target_system = packet_in.target_system; |
packet1.target_component = packet_in.target_component; |
packet1.idx = packet_in.idx; |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_fence_fetch_point_encode(system_id, component_id, &msg, &packet1); |
mavlink_msg_fence_fetch_point_decode(&msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_fence_fetch_point_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.idx ); |
mavlink_msg_fence_fetch_point_decode(&msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_fence_fetch_point_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.idx ); |
mavlink_msg_fence_fetch_point_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_fence_fetch_point_decode(last_msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_fence_fetch_point_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.idx ); |
mavlink_msg_fence_fetch_point_decode(last_msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
} |
static void mavlink_test_fence_status(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_fence_status_t packet_in = { |
963497464, |
17443, |
151, |
218, |
}; |
mavlink_fence_status_t packet1, packet2; |
memset(&packet1, 0, sizeof(packet1)); |
packet1.breach_time = packet_in.breach_time; |
packet1.breach_count = packet_in.breach_count; |
packet1.breach_status = packet_in.breach_status; |
packet1.breach_type = packet_in.breach_type; |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_fence_status_encode(system_id, component_id, &msg, &packet1); |
mavlink_msg_fence_status_decode(&msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_fence_status_pack(system_id, component_id, &msg , packet1.breach_status , packet1.breach_count , packet1.breach_type , packet1.breach_time ); |
mavlink_msg_fence_status_decode(&msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_fence_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.breach_status , packet1.breach_count , packet1.breach_type , packet1.breach_time ); |
mavlink_msg_fence_status_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_fence_status_decode(last_msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_fence_status_send(MAVLINK_COMM_1 , packet1.breach_status , packet1.breach_count , packet1.breach_type , packet1.breach_time ); |
mavlink_msg_fence_status_decode(last_msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
} |
static void mavlink_test_ahrs(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_ahrs_t packet_in = { |
17.0, |
45.0, |
73.0, |
101.0, |
129.0, |
157.0, |
185.0, |
}; |
mavlink_ahrs_t packet1, packet2; |
memset(&packet1, 0, sizeof(packet1)); |
packet1.omegaIx = packet_in.omegaIx; |
packet1.omegaIy = packet_in.omegaIy; |
packet1.omegaIz = packet_in.omegaIz; |
packet1.accel_weight = packet_in.accel_weight; |
packet1.renorm_val = packet_in.renorm_val; |
packet1.error_rp = packet_in.error_rp; |
packet1.error_yaw = packet_in.error_yaw; |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_ahrs_encode(system_id, component_id, &msg, &packet1); |
mavlink_msg_ahrs_decode(&msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_ahrs_pack(system_id, component_id, &msg , packet1.omegaIx , packet1.omegaIy , packet1.omegaIz , packet1.accel_weight , packet1.renorm_val , packet1.error_rp , packet1.error_yaw ); |
mavlink_msg_ahrs_decode(&msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_ahrs_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.omegaIx , packet1.omegaIy , packet1.omegaIz , packet1.accel_weight , packet1.renorm_val , packet1.error_rp , packet1.error_yaw ); |
mavlink_msg_ahrs_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_ahrs_decode(last_msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_ahrs_send(MAVLINK_COMM_1 , packet1.omegaIx , packet1.omegaIy , packet1.omegaIz , packet1.accel_weight , packet1.renorm_val , packet1.error_rp , packet1.error_yaw ); |
mavlink_msg_ahrs_decode(last_msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
} |
static void mavlink_test_simstate(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_simstate_t packet_in = { |
17.0, |
45.0, |
73.0, |
101.0, |
129.0, |
157.0, |
185.0, |
213.0, |
241.0, |
}; |
mavlink_simstate_t packet1, packet2; |
memset(&packet1, 0, sizeof(packet1)); |
packet1.roll = packet_in.roll; |
packet1.pitch = packet_in.pitch; |
packet1.yaw = packet_in.yaw; |
packet1.xacc = packet_in.xacc; |
packet1.yacc = packet_in.yacc; |
packet1.zacc = packet_in.zacc; |
packet1.xgyro = packet_in.xgyro; |
packet1.ygyro = packet_in.ygyro; |
packet1.zgyro = packet_in.zgyro; |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_simstate_encode(system_id, component_id, &msg, &packet1); |
mavlink_msg_simstate_decode(&msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_simstate_pack(system_id, component_id, &msg , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro ); |
mavlink_msg_simstate_decode(&msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_simstate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro ); |
mavlink_msg_simstate_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_simstate_decode(last_msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_simstate_send(MAVLINK_COMM_1 , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro ); |
mavlink_msg_simstate_decode(last_msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
} |
static void mavlink_test_hwstatus(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_hwstatus_t packet_in = { |
17235, |
139, |
}; |
mavlink_hwstatus_t packet1, packet2; |
memset(&packet1, 0, sizeof(packet1)); |
packet1.Vcc = packet_in.Vcc; |
packet1.I2Cerr = packet_in.I2Cerr; |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_hwstatus_encode(system_id, component_id, &msg, &packet1); |
mavlink_msg_hwstatus_decode(&msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_hwstatus_pack(system_id, component_id, &msg , packet1.Vcc , packet1.I2Cerr ); |
mavlink_msg_hwstatus_decode(&msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_hwstatus_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.Vcc , packet1.I2Cerr ); |
mavlink_msg_hwstatus_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_hwstatus_decode(last_msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_hwstatus_send(MAVLINK_COMM_1 , packet1.Vcc , packet1.I2Cerr ); |
mavlink_msg_hwstatus_decode(last_msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
} |
static void mavlink_test_radio(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_radio_t packet_in = { |
17235, |
17339, |
17, |
84, |
151, |
218, |
29, |
}; |
mavlink_radio_t packet1, packet2; |
memset(&packet1, 0, sizeof(packet1)); |
packet1.rxerrors = packet_in.rxerrors; |
packet1.fixed = packet_in.fixed; |
packet1.rssi = packet_in.rssi; |
packet1.remrssi = packet_in.remrssi; |
packet1.txbuf = packet_in.txbuf; |
packet1.noise = packet_in.noise; |
packet1.remnoise = packet_in.remnoise; |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_radio_encode(system_id, component_id, &msg, &packet1); |
mavlink_msg_radio_decode(&msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_radio_pack(system_id, component_id, &msg , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed ); |
mavlink_msg_radio_decode(&msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_radio_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed ); |
mavlink_msg_radio_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_radio_decode(last_msg, &packet2); |
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); |
memset(&packet2, 0, sizeof(packet2)); |
mavlink_msg_radio_send(MAVLINK_COMM_1 , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed ); |
mavlink_msg_radio_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, mavlink_message_t *last_msg) |
{ |
mavlink_test_sensor_offsets(system_id, component_id, last_msg); |
mavlink_test_set_mag_offsets(system_id, component_id, last_msg); |
mavlink_test_meminfo(system_id, component_id, last_msg); |
mavlink_test_ap_adc(system_id, component_id, last_msg); |
mavlink_test_digicam_configure(system_id, component_id, last_msg); |
mavlink_test_digicam_control(system_id, component_id, last_msg); |
mavlink_test_mount_configure(system_id, component_id, last_msg); |
mavlink_test_mount_control(system_id, component_id, last_msg); |
mavlink_test_mount_status(system_id, component_id, last_msg); |
mavlink_test_fence_point(system_id, component_id, last_msg); |
mavlink_test_fence_fetch_point(system_id, component_id, last_msg); |
mavlink_test_fence_status(system_id, component_id, last_msg); |
mavlink_test_ahrs(system_id, component_id, last_msg); |
mavlink_test_simstate(system_id, component_id, last_msg); |
mavlink_test_hwstatus(system_id, component_id, last_msg); |
mavlink_test_radio(system_id, component_id, last_msg); |
} |
#ifdef __cplusplus |
} |
#endif // __cplusplus |
#endif // ARDUPILOTMEGA_TESTSUITE_H |
/C-OSD/arducam-osd/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/version.h |
---|
0,0 → 1,12 |
/** @file |
* @brief MAVLink comm protocol built from ardupilotmega.xml |
* @see http://pixhawk.ethz.ch/software/mavlink |
*/ |
#ifndef MAVLINK_VERSION_H |
#define MAVLINK_VERSION_H |
#define MAVLINK_BUILD_DATE "Mon Apr 30 11:40:12 2012" |
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0" |
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 101 |
#endif // MAVLINK_VERSION_H |