├── branch ├── libraries ├── readme.txt └── GCS_MAVLink │ ├── include │ └── mavlink │ │ └── v1.0 │ │ ├── common │ │ ├── version.h │ │ ├── mavlink.h │ │ ├── mavlink_msg_auth_key.h │ │ ├── mavlink_msg_mission_current.h │ │ ├── mavlink_msg_mission_item_reached.h │ │ ├── mavlink_msg_command_ack.h │ │ ├── mavlink_msg_mission_clear_all.h │ │ ├── mavlink_msg_param_request_list.h │ │ ├── mavlink_msg_statustext.h │ │ ├── mavlink_msg_mission_request_list.h │ │ ├── mavlink_msg_debug.h │ │ ├── mavlink_msg_system_time.h │ │ ├── mavlink_msg_mission_ack.h │ │ ├── mavlink_msg_mission_request.h │ │ ├── mavlink_msg_mission_count.h │ │ ├── mavlink_msg_set_mode.h │ │ ├── mavlink_msg_data_stream.h │ │ ├── mavlink_msg_mission_set_current.h │ │ ├── mavlink_msg_named_value_int.h │ │ ├── mavlink_msg_named_value_float.h │ │ ├── mavlink_msg_gps_global_origin.h │ │ └── mavlink_msg_vision_speed_estimate.h │ │ ├── ardupilotmega │ │ ├── version.h │ │ ├── mavlink.h │ │ ├── mavlink_msg_meminfo.h │ │ ├── mavlink_msg_hwstatus.h │ │ ├── mavlink_msg_wind.h │ │ └── mavlink_msg_fence_fetch_point.h │ │ ├── checksum.h │ │ └── mavlink_types.h │ ├── message_definitions │ ├── matrixpilot.xml │ ├── test.xml │ ├── ualberta.xml │ └── sensesoar.xml │ ├── generate.sh │ ├── GCS_MAVLink.cpp │ └── GCS_MAVLink.h ├── Lua_Telemetry ├── ApmSounds │ ├── SOUNDS │ │ └── en │ │ │ ├── fm_0.wav │ │ │ ├── fm_1.wav │ │ │ ├── fm_2.wav │ │ │ ├── fm_3.wav │ │ │ ├── fm_4.wav │ │ │ ├── fm_5.wav │ │ │ ├── fm_6.wav │ │ │ ├── fm_7.wav │ │ │ ├── fm_9.wav │ │ │ ├── fm_10.wav │ │ │ ├── fm_11.wav │ │ │ ├── fm_13.wav │ │ │ ├── fm_15.wav │ │ │ ├── fm_16.wav │ │ │ ├── apm_failed_arm.wav │ │ │ ├── apm_cmd_reached.wav │ │ │ ├── apm_autotune_done.wav │ │ │ ├── apm_autotune_fail.wav │ │ │ ├── apm_autotune_start.wav │ │ │ ├── apm_autotune_stop.wav │ │ │ ├── apm_failed_prearm.wav │ │ │ ├── apm_flightplan_rej.wav │ │ │ └── apm_flightplan_upd.wav │ └── SCRIPTS │ │ └── MIXES │ │ └── ApmSounds.lua ├── DisplayApmStatus │ └── SCRIPTS │ │ ├── BMP │ │ ├── gps3d.bmp │ │ ├── gpsno.bmp │ │ ├── arrow0.bmp │ │ ├── arrow1.bmp │ │ ├── arrow10.bmp │ │ ├── arrow11.bmp │ │ ├── arrow12.bmp │ │ ├── arrow13.bmp │ │ ├── arrow14.bmp │ │ ├── arrow15.bmp │ │ ├── arrow2.bmp │ │ ├── arrow3.bmp │ │ ├── arrow4.bmp │ │ ├── arrow5.bmp │ │ ├── arrow6.bmp │ │ ├── arrow7.bmp │ │ ├── arrow8.bmp │ │ ├── arrow9.bmp │ │ ├── severity0.bmp │ │ ├── severity1.bmp │ │ ├── severity2.bmp │ │ ├── severity3.bmp │ │ ├── severity4.bmp │ │ ├── severity5.bmp │ │ ├── severity6.bmp │ │ └── severity7.bmp │ │ └── _modelname_ │ │ ├── telem2.lua │ │ └── telem1.lua ├── Storm32 │ └── SCRIPTS │ │ └── _modelname_ │ │ └── telem5.lua └── ApmTelem │ └── SCRIPTS │ └── MIXES │ └── ApmTextCop.lua ├── .gitignore ├── README.md └── MavLink_FrSkySPort └── FrSkySPort.h /branch: -------------------------------------------------------------------------------- 1 | merge 2 | -------------------------------------------------------------------------------- /libraries/readme.txt: -------------------------------------------------------------------------------- 1 | For information on installing libraries, see: http://arduino.cc/en/Guide/Libraries 2 | -------------------------------------------------------------------------------- /Lua_Telemetry/ApmSounds/SOUNDS/en/fm_0.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/ApmSounds/SOUNDS/en/fm_0.wav -------------------------------------------------------------------------------- /Lua_Telemetry/ApmSounds/SOUNDS/en/fm_1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/ApmSounds/SOUNDS/en/fm_1.wav -------------------------------------------------------------------------------- /Lua_Telemetry/ApmSounds/SOUNDS/en/fm_2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/ApmSounds/SOUNDS/en/fm_2.wav -------------------------------------------------------------------------------- /Lua_Telemetry/ApmSounds/SOUNDS/en/fm_3.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/ApmSounds/SOUNDS/en/fm_3.wav -------------------------------------------------------------------------------- /Lua_Telemetry/ApmSounds/SOUNDS/en/fm_4.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/ApmSounds/SOUNDS/en/fm_4.wav -------------------------------------------------------------------------------- /Lua_Telemetry/ApmSounds/SOUNDS/en/fm_5.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/ApmSounds/SOUNDS/en/fm_5.wav -------------------------------------------------------------------------------- /Lua_Telemetry/ApmSounds/SOUNDS/en/fm_6.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/ApmSounds/SOUNDS/en/fm_6.wav -------------------------------------------------------------------------------- /Lua_Telemetry/ApmSounds/SOUNDS/en/fm_7.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/ApmSounds/SOUNDS/en/fm_7.wav -------------------------------------------------------------------------------- /Lua_Telemetry/ApmSounds/SOUNDS/en/fm_9.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/ApmSounds/SOUNDS/en/fm_9.wav -------------------------------------------------------------------------------- /Lua_Telemetry/ApmSounds/SOUNDS/en/fm_10.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/ApmSounds/SOUNDS/en/fm_10.wav -------------------------------------------------------------------------------- /Lua_Telemetry/ApmSounds/SOUNDS/en/fm_11.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/ApmSounds/SOUNDS/en/fm_11.wav -------------------------------------------------------------------------------- /Lua_Telemetry/ApmSounds/SOUNDS/en/fm_13.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/ApmSounds/SOUNDS/en/fm_13.wav -------------------------------------------------------------------------------- /Lua_Telemetry/ApmSounds/SOUNDS/en/fm_15.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/ApmSounds/SOUNDS/en/fm_15.wav -------------------------------------------------------------------------------- /Lua_Telemetry/ApmSounds/SOUNDS/en/fm_16.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/ApmSounds/SOUNDS/en/fm_16.wav -------------------------------------------------------------------------------- /Lua_Telemetry/ApmSounds/SOUNDS/en/apm_failed_arm.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/ApmSounds/SOUNDS/en/apm_failed_arm.wav -------------------------------------------------------------------------------- /Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/gps3d.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/gps3d.bmp -------------------------------------------------------------------------------- /Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/gpsno.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/gpsno.bmp -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | MavLink_FrSkySPort/FrSkySPort.h.bak 2 | MavLink_FrSkySPort/MavLink_FrSkySPort.ino.bak 3 | Lua_Telemetry/Arducopter_Status/SCRIPTS/_modelname_/telem1.lua.bak -------------------------------------------------------------------------------- /Lua_Telemetry/ApmSounds/SOUNDS/en/apm_cmd_reached.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/ApmSounds/SOUNDS/en/apm_cmd_reached.wav -------------------------------------------------------------------------------- /Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow0.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow0.bmp -------------------------------------------------------------------------------- /Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow1.bmp -------------------------------------------------------------------------------- /Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow10.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow10.bmp -------------------------------------------------------------------------------- /Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow11.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow11.bmp -------------------------------------------------------------------------------- /Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow12.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow12.bmp -------------------------------------------------------------------------------- /Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow13.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow13.bmp -------------------------------------------------------------------------------- /Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow14.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow14.bmp -------------------------------------------------------------------------------- /Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow15.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow15.bmp -------------------------------------------------------------------------------- /Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow2.bmp -------------------------------------------------------------------------------- /Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow3.bmp -------------------------------------------------------------------------------- /Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow4.bmp -------------------------------------------------------------------------------- /Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow5.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow5.bmp -------------------------------------------------------------------------------- /Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow6.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow6.bmp -------------------------------------------------------------------------------- /Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow7.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow7.bmp -------------------------------------------------------------------------------- /Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow8.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow8.bmp -------------------------------------------------------------------------------- /Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow9.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/arrow9.bmp -------------------------------------------------------------------------------- /Lua_Telemetry/ApmSounds/SOUNDS/en/apm_autotune_done.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/ApmSounds/SOUNDS/en/apm_autotune_done.wav -------------------------------------------------------------------------------- /Lua_Telemetry/ApmSounds/SOUNDS/en/apm_autotune_fail.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/ApmSounds/SOUNDS/en/apm_autotune_fail.wav -------------------------------------------------------------------------------- /Lua_Telemetry/ApmSounds/SOUNDS/en/apm_autotune_start.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/ApmSounds/SOUNDS/en/apm_autotune_start.wav -------------------------------------------------------------------------------- /Lua_Telemetry/ApmSounds/SOUNDS/en/apm_autotune_stop.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/ApmSounds/SOUNDS/en/apm_autotune_stop.wav -------------------------------------------------------------------------------- /Lua_Telemetry/ApmSounds/SOUNDS/en/apm_failed_prearm.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/ApmSounds/SOUNDS/en/apm_failed_prearm.wav -------------------------------------------------------------------------------- /Lua_Telemetry/ApmSounds/SOUNDS/en/apm_flightplan_rej.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/ApmSounds/SOUNDS/en/apm_flightplan_rej.wav -------------------------------------------------------------------------------- /Lua_Telemetry/ApmSounds/SOUNDS/en/apm_flightplan_upd.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/ApmSounds/SOUNDS/en/apm_flightplan_upd.wav -------------------------------------------------------------------------------- /Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/severity0.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/severity0.bmp -------------------------------------------------------------------------------- /Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/severity1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/severity1.bmp -------------------------------------------------------------------------------- /Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/severity2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/severity2.bmp -------------------------------------------------------------------------------- /Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/severity3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/severity3.bmp -------------------------------------------------------------------------------- /Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/severity4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/severity4.bmp -------------------------------------------------------------------------------- /Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/severity5.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/severity5.bmp -------------------------------------------------------------------------------- /Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/severity6.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/severity6.bmp -------------------------------------------------------------------------------- /Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/severity7.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chsw/MavLink_FrSkySPort/HEAD/Lua_Telemetry/DisplayApmStatus/SCRIPTS/BMP/severity7.bmp -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/include/mavlink/v1.0/common/version.h: -------------------------------------------------------------------------------- 1 | /** @file 2 | * @brief MAVLink comm protocol built from common.xml 3 | * @see http://pixhawk.ethz.ch/software/mavlink 4 | */ 5 | #ifndef MAVLINK_VERSION_H 6 | #define MAVLINK_VERSION_H 7 | 8 | #define MAVLINK_BUILD_DATE "Sat Aug 11 14:26:42 2012" 9 | #define MAVLINK_WIRE_PROTOCOL_VERSION "1.0" 10 | #define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 101 11 | 12 | #endif // MAVLINK_VERSION_H 13 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/version.h: -------------------------------------------------------------------------------- 1 | /** @file 2 | * @brief MAVLink comm protocol built from ardupilotmega.xml 3 | * @see http://pixhawk.ethz.ch/software/mavlink 4 | */ 5 | #ifndef MAVLINK_VERSION_H 6 | #define MAVLINK_VERSION_H 7 | 8 | #define MAVLINK_BUILD_DATE "Sat Aug 11 14:26:42 2012" 9 | #define MAVLINK_WIRE_PROTOCOL_VERSION "1.0" 10 | #define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 101 11 | 12 | #endif // MAVLINK_VERSION_H 13 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/message_definitions/matrixpilot.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | common.xml 4 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink.h: -------------------------------------------------------------------------------- 1 | /** @file 2 | * @brief MAVLink comm protocol built from common.xml 3 | * @see http://pixhawk.ethz.ch/software/mavlink 4 | */ 5 | #ifndef MAVLINK_H 6 | #define MAVLINK_H 7 | 8 | #ifndef MAVLINK_STX 9 | #define MAVLINK_STX 254 10 | #endif 11 | 12 | #ifndef MAVLINK_ENDIAN 13 | #define MAVLINK_ENDIAN MAVLINK_LITTLE_ENDIAN 14 | #endif 15 | 16 | #ifndef MAVLINK_ALIGNED_FIELDS 17 | #define MAVLINK_ALIGNED_FIELDS 1 18 | #endif 19 | 20 | #ifndef MAVLINK_CRC_EXTRA 21 | #define MAVLINK_CRC_EXTRA 0 22 | #endif 23 | 24 | #include "version.h" 25 | #include "common.h" 26 | 27 | #endif // MAVLINK_H 28 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink.h: -------------------------------------------------------------------------------- 1 | /** @file 2 | * @brief MAVLink comm protocol built from ardupilotmega.xml 3 | * @see http://pixhawk.ethz.ch/software/mavlink 4 | */ 5 | #ifndef MAVLINK_H 6 | #define MAVLINK_H 7 | 8 | #ifndef MAVLINK_STX 9 | #define MAVLINK_STX 254 10 | #endif 11 | 12 | #ifndef MAVLINK_ENDIAN 13 | #define MAVLINK_ENDIAN MAVLINK_LITTLE_ENDIAN 14 | #endif 15 | 16 | #ifndef MAVLINK_ALIGNED_FIELDS 17 | #define MAVLINK_ALIGNED_FIELDS 1 18 | #endif 19 | 20 | #ifndef MAVLINK_CRC_EXTRA 21 | #define MAVLINK_CRC_EXTRA 1 22 | #endif 23 | 24 | #include "version.h" 25 | #include "ardupilotmega.h" 26 | 27 | #endif // MAVLINK_H 28 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/generate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # script to re-generate mavlink C code for APM 3 | 4 | mavdir="$(dirname $0)" 5 | dname="$(basename $mavdir)" 6 | [ "$dname" = "GCS_MAVLink" ] || { 7 | echo "This script should be run from the libraries/GCS_MAVLink directory" 8 | exit 1 9 | } 10 | 11 | if ! which mavgen.py > /dev/null; then 12 | echo "mavgen.py must be in your PATH. Get it from http://github.com/mavlink/mavlink in the pymavlink/generator directory" 13 | exit 1 14 | fi 15 | 16 | echo "Removing old includes" 17 | rm -rf "$mavdir/include/*" 18 | 19 | echo "Generating C code" 20 | mavgen.py --lang=C --wire-protocol=1.0 --output=$mavdir/include/mavlink/v1.0 $mavdir/message_definitions/ardupilotmega.xml 21 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/GCS_MAVLink.cpp: -------------------------------------------------------------------------------- 1 | // -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*- 2 | 3 | /// @file GCS_MAVLink.cpp 4 | 5 | /* 6 | This provides some support code and variables for MAVLink enabled sketches 7 | 8 | This firmware is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation; either 11 | version 2.1 of the License, or (at your option) any later version. 12 | */ 13 | 14 | //#include 15 | //#include 16 | #include 17 | 18 | 19 | Stream *mavlink_comm_0_port; 20 | Stream *mavlink_comm_1_port; 21 | 22 | mavlink_system_t mavlink_system = {12,1,0,0}; //modified 23 | 24 | uint8_t mavlink_check_target(uint8_t sysid, uint8_t compid) 25 | { 26 | if (sysid != mavlink_system.sysid) 27 | return 1; 28 | // Currently we are not checking for correct compid since APM is not passing mavlink info to any subsystem 29 | // If it is addressed to our system ID we assume it is for us 30 | return 0; // no error 31 | } 32 | 33 | /* 34 | // return a MAVLink variable type given a AP_Param type 35 | uint8_t mav_var_type(enum ap_var_type t) 36 | { 37 | if (t == AP_PARAM_INT8) { 38 | return MAVLINK_TYPE_INT8_T; 39 | } 40 | if (t == AP_PARAM_INT16) { 41 | return MAVLINK_TYPE_INT16_T; 42 | } 43 | if (t == AP_PARAM_INT32) { 44 | return MAVLINK_TYPE_INT32_T; 45 | } 46 | // treat any others as float 47 | return MAVLINK_TYPE_FLOAT; 48 | } 49 | 50 | */ 51 | -------------------------------------------------------------------------------- /Lua_Telemetry/ApmSounds/SCRIPTS/MIXES/ApmSounds.lua: -------------------------------------------------------------------------------- 1 | local soundfile_base = "/SOUNDS/en/fm_" 2 | 3 | -- Internal 4 | local last_flight_mode = 0 5 | local last_flight_mode_play = 0 6 | local received_telemetry = false 7 | local first_telemetry = -1 8 | 9 | function playApmMessage(message) 10 | if message.soundfile == nil 11 | then 12 | return 13 | end 14 | local soundfile_base = "/SOUNDS/en/" 15 | playFile(soundfile_base .. message.soundfile) 16 | end 17 | 18 | local function nextRepeatFlightmode(mode) 19 | if last_flight_mode_play < 1 then 20 | return 0 21 | end 22 | -- Auto or guided (every 15 sec) 23 | if mode == 3 or mode == 4 then 24 | return last_flight_mode_play + 15*100 25 | -- Return to launch or land (every 5 sec) 26 | elseif mode == 6 or mode == 9 then 27 | return last_flight_mode_play + 5*100 28 | end 29 | -- All others (every hour) 30 | return last_flight_mode_play + 3600*100 31 | end 32 | 33 | local function playFlightmode() 34 | if received_telemetry == false 35 | then 36 | local rssi = getValue("rssi") 37 | if rssi < 1 38 | then 39 | return 40 | end 41 | if first_telemetry < 0 42 | then 43 | first_telemetry = getTime() 44 | end 45 | if (first_telemetry + 150) > getTime() 46 | then 47 | return 48 | end 49 | received_telemetry = true 50 | end 51 | local mode=getValue("fuel") 52 | if (mode ~= last_flight_mode) or (nextRepeatFlightmode(mode) < getTime()) 53 | then 54 | last_flight_mode_play = getTime() 55 | playFile(soundfile_base .. mode .. ".wav") 56 | last_flight_mode = mode 57 | end 58 | end 59 | 60 | local function run_func() 61 | playFlightmode() 62 | end 63 | 64 | return {init=init, run=run_func} -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/message_definitions/test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 3 4 | 5 | 6 | Test all field types 7 | char 8 | string 9 | uint8_t 10 | uint16_t 11 | uint32_t 12 | uint64_t 13 | int8_t 14 | int16_t 15 | int32_t 16 | int64_t 17 | float 18 | double 19 | uint8_t_array 20 | uint16_t_array 21 | uint32_t_array 22 | uint64_t_array 23 | int8_t_array 24 | int16_t_array 25 | int32_t_array 26 | int64_t_array 27 | float_array 28 | double_array 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/include/mavlink/v1.0/checksum.h: -------------------------------------------------------------------------------- 1 | #ifdef __cplusplus 2 | extern "C" { 3 | #endif 4 | 5 | #ifndef _CHECKSUM_H_ 6 | #define _CHECKSUM_H_ 7 | 8 | 9 | /** 10 | * 11 | * CALCULATE THE CHECKSUM 12 | * 13 | */ 14 | 15 | #define X25_INIT_CRC 0xffff 16 | #define X25_VALIDATE_CRC 0xf0b8 17 | 18 | /** 19 | * @brief Accumulate the X.25 CRC by adding one char at a time. 20 | * 21 | * The checksum function adds the hash of one char at a time to the 22 | * 16 bit checksum (uint16_t). 23 | * 24 | * @param data new char to hash 25 | * @param crcAccum the already accumulated checksum 26 | **/ 27 | static inline void crc_accumulate(uint8_t data, uint16_t *crcAccum) 28 | { 29 | /*Accumulate one byte of data into the CRC*/ 30 | uint8_t tmp; 31 | 32 | tmp = data ^ (uint8_t)(*crcAccum &0xff); 33 | tmp ^= (tmp<<4); 34 | *crcAccum = (*crcAccum>>8) ^ (tmp<<8) ^ (tmp <<3) ^ (tmp>>4); 35 | } 36 | 37 | /** 38 | * @brief Initiliaze the buffer for the X.25 CRC 39 | * 40 | * @param crcAccum the 16 bit X.25 CRC 41 | */ 42 | static inline void crc_init(uint16_t* crcAccum) 43 | { 44 | *crcAccum = X25_INIT_CRC; 45 | } 46 | 47 | 48 | /** 49 | * @brief Calculates the X.25 checksum on a byte buffer 50 | * 51 | * @param pBuffer buffer containing the byte array to hash 52 | * @param length length of the byte array 53 | * @return the checksum over the buffer bytes 54 | **/ 55 | static inline uint16_t crc_calculate(const uint8_t* pBuffer, uint16_t length) 56 | { 57 | uint16_t crcTmp; 58 | crc_init(&crcTmp); 59 | while (length--) { 60 | crc_accumulate(*pBuffer++, &crcTmp); 61 | } 62 | return crcTmp; 63 | } 64 | 65 | /** 66 | * @brief Accumulate the X.25 CRC by adding an array of bytes 67 | * 68 | * The checksum function adds the hash of one char at a time to the 69 | * 16 bit checksum (uint16_t). 70 | * 71 | * @param data new bytes to hash 72 | * @param crcAccum the already accumulated checksum 73 | **/ 74 | static inline void crc_accumulate_buffer(uint16_t *crcAccum, const char *pBuffer, uint8_t length) 75 | { 76 | const uint8_t *p = (const uint8_t *)pBuffer; 77 | while (length--) { 78 | crc_accumulate(*p++, crcAccum); 79 | } 80 | } 81 | 82 | 83 | 84 | 85 | #endif /* _CHECKSUM_H_ */ 86 | 87 | #ifdef __cplusplus 88 | } 89 | #endif 90 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | MavLink_FrSkySPort 2 | ================== 3 | This is a modified version of the mavlink to frsky s.port code found here: 4 | http://diydrones.com/forum/topics/amp-to-frsky-x8r-sport-converter 5 | 6 | It's based on the official 1.3 version. 7 | 8 | Changes: 9 | 10 | - Acc X/Y/Z reports the average vibrations (difference between max/min) instead of actual accelerometer values. 11 | - Reports gps-speed instead of hud-speed. 12 | - Change how the code responds to tx telemetry requests. This fixes the missing cell/cells in the latest open-tx versions. 13 | - Updated the cell detection to minimize the risk of detecting to many cells (unless the battery is low upon connection) and changing the cell count inflight when the battery voltage drops. 14 | - Changed the averaging for voltage/current to be more accurate to the voltage/current fluctuations. Hoping of increasing the accuracy of the mAh-counter. Use FAS as both voltage/current source. 15 | - Delays sending the voltage/current until the voltage reading through mavlink has stabilized. This should minimize the false low battery-warnings upon model powerup. 16 | - GPS hdop on A2 17 | - Temp2 contains both arming status (armed if the value is uneven) and status message number if the text received through mavlink was recognized. 18 | 19 | Lua scripts. 20 | 21 | Make sure your transmitter has lua enabled firmware. If you use OpenTX Companion, open Settings->Settings->Radio Profile and make you have lua selected under build options. 22 | 23 | Mixer scripts. These scripts need to be activated under the "Custom scripts" page on your transmitter. 24 | 25 | ApmTelem: 26 | ApmTelem.lua: This script configures A2, A3 and A4 for hdop, roll and pitch. It also exports arming-status as an output. This status can be used to for example control a timer. 27 | It also publishes a set of methods that can be used by other scripts. 28 | 29 | ApmTextCop.lua: This script needs to be installed as a mixer-script to enable flightmode texts for copter, and enable texts for the copter-related status-texts. 30 | 31 | ApmSounds: 32 | This script announces (plays a soundfile) the current flightmode reported by the flight controller. Some flightmodes (auto-modes) will be repeated at a given intervall. 33 | 34 | 35 | Lua telemetry screens: 36 | 37 | 38 | DisplayApmStatus, telem1.lua: 39 | Shows status of different parameters received through mavlink. 40 | Some of this parameters are current flightmode, gps status, battery status, current consumption and power usage. 41 | It also displays (briefly) any status messages received from ardupilot. 42 | 43 | DisplayApmStatus, telem2.lua: 44 | Shows a log with received status messages from ardupilot. 45 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/message_definitions/ualberta.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | common.xml 4 | 5 | 6 | Available autopilot modes for ualberta uav 7 | Raw input pulse widts sent to output 8 | Inputs are normalized using calibration, the converted back to raw pulse widths for output 9 | dfsdfs 10 | dfsfds 11 | dfsdfsdfs 12 | 13 | 14 | Navigation filter mode 15 | 16 | AHRS mode 17 | INS/GPS initialization mode 18 | INS/GPS mode 19 | 20 | 21 | Mode currently commanded by pilot 22 | sdf 23 | dfs 24 | Rotomotion mode 25 | 26 | 27 | 28 | 29 | Accelerometer and Gyro biases from the navigation filter 30 | Timestamp (microseconds) 31 | b_f[0] 32 | b_f[1] 33 | b_f[2] 34 | b_f[0] 35 | b_f[1] 36 | b_f[2] 37 | 38 | 39 | Complete set of calibration parameters for the radio 40 | Aileron setpoints: left, center, right 41 | Elevator setpoints: nose down, center, nose up 42 | Rudder setpoints: nose left, center, nose right 43 | Tail gyro mode/gain setpoints: heading hold, rate mode 44 | Pitch curve setpoints (every 25%) 45 | Throttle curve setpoints (every 25%) 46 | 47 | 48 | System status specific to ualberta uav 49 | System mode, see UALBERTA_AUTOPILOT_MODE ENUM 50 | Navigation mode, see UALBERTA_NAV_MODE ENUM 51 | Pilot mode, see UALBERTA_PILOT_MODE 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/GCS_MAVLink.h: -------------------------------------------------------------------------------- 1 | // -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*- 2 | 3 | /// @file GCS_MAVLink.h 4 | /// @brief One size fits all header for MAVLink integration. 5 | 6 | #ifndef GCS_MAVLink_h 7 | #define GCS_MAVLink_h 8 | 9 | #include 10 | 11 | 12 | //#include 13 | 14 | // we have separate helpers disabled to make it possible 15 | // to select MAVLink 1.0 in the arduino GUI build 16 | //#define MAVLINK_SEPARATE_HELPERS 17 | 18 | #include "include/mavlink/v1.0/ardupilotmega/version.h" 19 | 20 | // this allows us to make mavlink_message_t much smaller 21 | #define MAVLINK_MAX_PAYLOAD_LEN MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 22 | 23 | #define MAVLINK_COMM_NUM_BUFFERS 1 24 | #include "include/mavlink/v1.0/mavlink_types.h" 25 | 26 | /// MAVLink stream used for HIL interaction 27 | extern Stream *mavlink_comm_0_port; 28 | 29 | /// MAVLink stream used for ground control communication 30 | extern Stream *mavlink_comm_1_port; 31 | 32 | /// MAVLink system definition 33 | extern mavlink_system_t mavlink_system; 34 | 35 | /// Send a byte to the nominated MAVLink channel 36 | /// 37 | /// @param chan Channel to send to 38 | /// @param ch Byte to send 39 | /// 40 | static inline void comm_send_ch(mavlink_channel_t chan, uint8_t ch) 41 | { 42 | switch(chan) { 43 | case MAVLINK_COMM_0: 44 | mavlink_comm_0_port->write(ch); 45 | break; 46 | case MAVLINK_COMM_1: 47 | mavlink_comm_1_port->write(ch); 48 | break; 49 | default: 50 | break; 51 | } 52 | } 53 | 54 | /// Read a byte from the nominated MAVLink channel 55 | /// 56 | /// @param chan Channel to receive on 57 | /// @returns Byte read 58 | /// 59 | static inline uint8_t comm_receive_ch(mavlink_channel_t chan) 60 | { 61 | uint8_t data = 0; 62 | 63 | switch(chan) { 64 | case MAVLINK_COMM_0: 65 | data = mavlink_comm_0_port->read(); 66 | break; 67 | case MAVLINK_COMM_1: 68 | data = mavlink_comm_1_port->read(); 69 | break; 70 | default: 71 | break; 72 | } 73 | return data; 74 | } 75 | 76 | /// Check for available data on the nominated MAVLink channel 77 | /// 78 | /// @param chan Channel to check 79 | /// @returns Number of bytes available 80 | static inline uint16_t comm_get_available(mavlink_channel_t chan) 81 | { 82 | uint16_t bytes = 0; 83 | switch(chan) { 84 | case MAVLINK_COMM_0: 85 | bytes = mavlink_comm_0_port->available(); 86 | break; 87 | case MAVLINK_COMM_1: 88 | bytes = mavlink_comm_1_port->available(); 89 | break; 90 | default: 91 | break; 92 | } 93 | return bytes; 94 | } 95 | 96 | 97 | /// Check for available transmit space on the nominated MAVLink channel 98 | /// 99 | /// @param chan Channel to check 100 | /// @returns Number of bytes available, -1 for error 101 | static inline int comm_get_txspace(mavlink_channel_t chan) 102 | { 103 | switch(chan) { 104 | case MAVLINK_COMM_0: 105 | // return mavlink_comm_0_port->txspace(); 106 | return 65535; 107 | break; 108 | case MAVLINK_COMM_1: 109 | //return mavlink_comm_1_port->txspace(); 110 | return 65535; 111 | break; 112 | default: 113 | break; 114 | } 115 | return -1; 116 | } 117 | 118 | #define MAVLINK_USE_CONVENIENCE_FUNCTIONS 119 | #include "include/mavlink/v1.0/ardupilotmega/mavlink.h" 120 | 121 | uint8_t mavlink_check_target(uint8_t sysid, uint8_t compid); 122 | 123 | // return a MAVLink variable type given a AP_Param type 124 | //uint8_t mav_var_type(enum ap_var_type t); 125 | 126 | #endif // GCS_MAVLink_h 127 | -------------------------------------------------------------------------------- /Lua_Telemetry/DisplayApmStatus/SCRIPTS/_modelname_/telem2.lua: -------------------------------------------------------------------------------- 1 | -- Don't change these 2 | local apiMajor = 2 3 | local apiMinor = 1 4 | 5 | local amsg = {} 6 | local amsgsize = 0 7 | local lmsg = nil 8 | local i 9 | global_new_messages = false 10 | 11 | local dt=lcd.drawText 12 | local ApmTelem = nil 13 | 14 | local function init() 15 | ApmTelem = getApmTelem() 16 | end 17 | 18 | local function chkVer() 19 | if ApmTelem == nil then 20 | dt(20, 25, "Please install ApmTelem.lua", 0) 21 | dt(20, 35, "on the \"Custom Scripts\" page!", 0) 22 | elseif ApmTelem.VER_MAJOR > apiMajor then 23 | dt(10, 20, "This telemetry screen is to old for", 0) 24 | dt(10, 30, "the installed version of ApmTelem.lua", 0) 25 | dt(10, 40, "Please upgrade", 0) 26 | elseif ApmTelem.VER_MAJOR < apiMajor or ApmTelem.VER_MINOR < apiMinor then 27 | dt(20, 25, "Please upgrade ApmTelem.lua", 0) 28 | dt(20, 35, "on the \"Custom Scripts\" page!", 0) 29 | else 30 | return 0 31 | end 32 | return 1 33 | end 34 | 35 | --function overrideApmStatusMessage(message) 36 | -- if message.id == 93 then 37 | -- message.message = "New Text" 38 | -- message.soundfile = "apm_autotune_start.wav" 39 | -- message.silent = true 40 | -- message.enabled = true 41 | -- end 42 | -- return message 43 | --end 44 | 45 | -- Format a number to a string with 2 digits. 46 | local function toTwoDigit(number) 47 | if number < 10 48 | then 49 | return "0"..number 50 | end 51 | return number 52 | end 53 | 54 | -- Takes a time (10 msec resolution) and formats as min:sec 55 | local function fmtTime(timestamp) 56 | local iDiff, fDiff = math.modf((getTime() - timestamp)/100) 57 | local sec = iDiff%60 58 | local min = (iDiff-sec)/60 59 | local ret = toTwoDigit(min)..":"..toTwoDigit(sec) 60 | return ret 61 | end 62 | 63 | -- Looks for new messages and builds a list of messages 64 | local function scanMsg() 65 | -- Fetch message 66 | local m = ApmTelem.getActiveStatus() 67 | if m ~= nil and (lmsg == nil or m.timestamp ~= lmsg.timestamp) 68 | then 69 | -- If message is marked as silent - don't activte global flag 70 | if not m.silent 71 | then 72 | global_new_messages = true 73 | end 74 | -- Store message as last message 75 | lmsg = m 76 | amsgsize = math.max(amsgsize+1, 7) 77 | -- Move all stored messages back in array 78 | for i=amsgsize, 2, -1 79 | do 80 | amsg[i] = amsg[i-1] 81 | end 82 | -- Put the last message first 83 | amsg[1] = {text = m.message, timestamp = m.timestamp, severity = m.severity } 84 | end 85 | end 86 | 87 | -- Scan for messages when not visible 88 | local function background() 89 | if chkVer() > 0 then return end 90 | scanMsg() 91 | end 92 | 93 | local function run(event) 94 | if chkVer() > 0 then return end 95 | 96 | -- Scan for new messages 97 | scanMsg() 98 | 99 | -- Reset global flag since we now have shown any new messages 100 | global_new_messages = false 101 | 102 | -- Loop through messages 103 | if amsgsize > 0 then 104 | for i=1, 7, 1 105 | do 106 | if amsg[i] ~= nil 107 | then 108 | lcd.drawPixmap(1, 1+8* (i-1), "/SCRIPTS/BMP/severity" .. amsg[i].severity .. ".bmp") 109 | dt(10, 1 + 8* (i-1) , fmtTime(amsg[i].timestamp).." "..amsg[i].text, 0) 110 | empty = false 111 | end 112 | end 113 | -- No messages received - show text 114 | else 115 | lcd.drawFilledRectangle(10, 10, 190, 45, GREY_DEFAULT) 116 | dt(40, 30, "No warnings received", 0) 117 | end 118 | end 119 | 120 | return { init=init, run=run, background=background} -------------------------------------------------------------------------------- /MavLink_FrSkySPort/FrSkySPort.h: -------------------------------------------------------------------------------- 1 | // Frsky Sensor-ID to use. 2 | // ID of sensor. Must be something that is polled by FrSky RX 3 | 4 | /* These were used on v1.3 but don't match any with the current (v2.08) OpenTX sources so are being removed 5 | 6 | #define SENSOR_ID1 0x1B // sensor hub data id 7 | #define SENSOR_ID2 0x0D // sensor hub data id 8 | #define SENSOR_ID3 0x34 // sensor hub data id 9 | #define SENSOR_ID4 0x67 // sensor hub data id 10 | 11 | */ 12 | 13 | // To disable a specific sensor, just comment out the sensor_id define (place // first on the line defining the sensor id) 14 | #define SENSOR_ID_VARIO 0x00 // 0 15 | #define SENSOR_ID_FLVSS 0xA1 // 1 16 | #define SENSOR_ID_FAS 0x22 // 2 17 | #define SENSOR_ID_GPS 0x83 // 3 18 | #define SENSOR_ID_RPM 0xE4 // 4 19 | #define SENSOR_ID_SP2UH 0x45 // 5 20 | #define SENSOR_ID_SP2UR 0xC6 // 6 21 | 22 | // We'll use some undefined SENSOR_ID's so expect things to break if OpenTX changes 23 | 24 | // Frsky-specific 25 | #define START_STOP 0x7e 26 | #define DATA_FRAME 0x10 27 | 28 | 29 | //Frsky DATA ID's 30 | #define FR_ID_ALTITUDE 0x0100 //ALT_FIRST_ID 31 | #define FR_ID_VARIO 0x0110 //VARIO_FIRST_ID 32 | #define FR_ID_VFAS 0x0210 //VFAS_FIRST_ID 33 | #define FR_ID_CURRENT 0x0200 //CURR_FIRST_ID 34 | #define FR_ID_CELLS 0x0300 //CELLS_FIRST_ID 35 | #define FR_ID_CELLS_LAST 0x030F //CELLS_LAST_ID 36 | #define FR_ID_T1 0x0400 //T1_FIRST_ID 37 | #define FR_ID_T2 0x0410 //T2_FIRST_ID 38 | #define FR_ID_RPM 0x0500 //RPM_FIRST_ID 39 | #define FR_ID_FUEL 0x0600 //FUEL_FIRST_ID 40 | #define FR_ID_ACCX 0x0700 //ACCX_FIRST_ID 41 | #define FR_ID_ACCY 0x0710 //ACCY_FIRST_ID 42 | #define FR_ID_ACCZ 0x0720 //ACCZ_FIRST_ID 43 | #define FR_ID_LATLONG 0x0800 //GPS_LONG_LATI_FIRST_ID 44 | #define FR_ID_GPS_ALT 0x0820 //GPS_ALT_FIRST_ID 45 | #define FR_ID_SPEED 0x0830 //GPS_SPEED_FIRST_ID 46 | #define FR_ID_GPS_COURSE 0x0840 //GPS_COURS_FIRST_ID 47 | #define FR_ID_GPS_TIME_DATE 0x0850 //GPS_TIME_DATE_FIRST_ID 48 | #define FR_ID_A3_FIRST 0x0900 //A3_FIRST_ID 49 | #define FR_ID_A4_FIRST 0x0910 //A4_FIRST_ID 50 | #define FR_ID_AIR_SPEED_FIRST 0x0A00 //AIR_SPEED_FIRST_ID 51 | #define FR_ID_RSSI 0xF101 // used by the radio system 52 | #define FR_ID_ADC1 0xF102 //ADC1_ID 53 | #define FR_ID_ADC2 0xF103 //ADC2_ID 54 | #define FR_ID_BATT 0xF104 // used by the radio system 55 | #define FR_ID_SWR 0xF105 // used by the radio system 56 | 57 | 58 | 59 | /* The following are defined at frsky_sport.cpp (v2.08) but not used here 60 | 61 | #define ALT_LAST_ID 0x010f 62 | #define VARIO_LAST_ID 0x011f 63 | #define CURR_LAST_ID 0x020f 64 | #define VFAS_LAST_ID 0x021f 65 | #define T1_LAST_ID 0x040f 66 | #define T2_LAST_ID 0x041f 67 | #define RPM_LAST_ID 0x050f 68 | #define ACCX_LAST_ID 0x070f 69 | #define ACCY_LAST_ID 0x071f 70 | #define ACCZ_LAST_ID 0x072f 71 | #define GPS_LONG_LATI_LAST_ID 0x080f 72 | #define GPS_ALT_LAST_ID 0x082f 73 | #define GPS_SPEED_LAST_ID 0x083f 74 | #define GPS_COURS_LAST_ID 0x084f 75 | #define GPS_TIME_DATE_LAST_ID 0x085f 76 | #define A3_LAST_ID 0x090f 77 | #define A4_LAST_ID 0x091f 78 | #define AIR_SPEED_LAST_ID 0x0a0f 79 | */ 80 | -------------------------------------------------------------------------------- /Lua_Telemetry/DisplayApmStatus/SCRIPTS/_modelname_/telem1.lua: -------------------------------------------------------------------------------- 1 | -- Set by user 2 | local capacity_max = 4000 3 | 4 | -- Don't change these 5 | local API_LEVEL_MAJOR = 2 6 | local API_LEVEL_MINOR = 1 7 | 8 | local ApmTelem = nil 9 | local function init() 10 | if getApmTelem ~= nil 11 | then 12 | ApmTelem = getApmTelem() 13 | end 14 | end 15 | 16 | local function background() 17 | 18 | end 19 | 20 | local function checkVersionVersion() 21 | if ApmTelem == nil then 22 | lcd.drawText(20, 25, "Please install ApmTelem.lua", 0) 23 | lcd.drawText(20, 35, "on the \"Custom Scripts\" page!", 0) 24 | elseif ApmTelem.VER_MAJOR > API_LEVEL_MAJOR then 25 | lcd.drawText(10, 20, "This telemetry screen is to old for", 0) 26 | lcd.drawText(10, 30, "the installed version of ApmTelem.lua", 0) 27 | lcd.drawText(10, 40, "Please upgrade", 0) 28 | elseif ApmTelem.VER_MAJOR < API_LEVEL_MAJOR or ApmTelem.VER_MINOR < API_LEVEL_MINOR then 29 | lcd.drawText(20, 25, "Please upgrade ApmTelem.lua", 0) 30 | lcd.drawText(20, 35, "on the \"Custom Scripts\" page!", 0) 31 | else 32 | return 0 33 | end 34 | return 1 35 | end 36 | 37 | local function run(event) 38 | if checkVersionVersion() > 0 then 39 | return 40 | end 41 | 42 | -- Fetch current status 43 | local status = ApmTelem.getActiveStatus() 44 | -- If we have a status - display the message 45 | if status ~= nil 46 | then 47 | lcd.drawText(1, 55, status.message, 0) 48 | -- Ohterwise show the battery gauge 49 | else 50 | -- Battery gauge 51 | local telem_mah = ApmTelem.getValueCached(218) 52 | lcd.drawGauge(1, 55, 90, 8, capacity_max - telem_mah, capacity_max) 53 | lcd.drawText(90+4, 55, telem_mah.."mAh", 0) 54 | end 55 | 56 | -- Model name && status 57 | lcd.drawText(2,1, model.getInfo().name, MIDSIZE) 58 | if ApmTelem.isArmed() 59 | then 60 | lcd.drawText(lcd.getLastPos()+3, 1, "ARMED", MIDSIZE) 61 | else 62 | lcd.drawText(lcd.getLastPos()+3, 1, "SAFE", MIDSIZE) 63 | end 64 | 65 | -- Timer 66 | local timer = model.getTimer(0) 67 | local pos = 155 --lcd.getLastPos()+10 68 | lcd.drawText(pos, 1, "Timer", SMLSIZE) 69 | lcd.drawTimer(pos,7, timer.value, MIDSIZE) 70 | -- Current altitude 71 | lcd.drawText(145, 30, getValue("altitude") .. "m", MIDSIZE) 72 | 73 | -- gps status 74 | local gpsHdop = ApmTelem.getGpsHdop() 75 | if ApmTelem.getGpsLock() >= 3.0 76 | then 77 | lcd.drawPixmap(190, 1, "/SCRIPTS/BMP/gps3d.bmp") 78 | else 79 | lcd.drawPixmap(190, 1, "/SCRIPTS/BMP/gpsno.bmp") 80 | end 81 | if gpsHdop == 0.0 then 82 | lcd.drawText(190, 30, "---", BLINK) 83 | elseif gpsHdop == 10.24 then 84 | lcd.drawText(190, 30, "HIGH", BLINK) 85 | elseif gpsHdop <= 2.0 86 | then 87 | lcd.drawText(190, 30, gpsHdop, 0) 88 | else 89 | lcd.drawText(190, 30, gpsHdop, BLINK) 90 | end 91 | 92 | -- Line 2 93 | lcd.drawText(1, 15, ApmTelem.getCurrentFlightmode(), 0); 94 | -- Line 3 95 | lcd.drawText(1, 25, "Speed: "..(getValue("gps-speed")*1.852).."km/h Heading: "..getValue("heading").."@", 0) 96 | -- Line 4 97 | lcd.drawText(1, 35, "Power: "..ApmTelem.getValueActive(216).."V ("..ApmTelem.getValueActive(214).."V) "..ApmTelem.getValueActive(217).."A "..ApmTelem.getValueActive(219).."W", 0) 98 | -- Line 5 99 | lcd.drawText(1, 45, "Peaks: "..ApmTelem.getValueCached(246).."V ("..ApmTelem.getValueCached(244).."V) "..ApmTelem.getValueCached(247).."A "..ApmTelem.getValueCached(248).."W", 0) 100 | -- Right column: 101 | 102 | 103 | -- Home position 104 | local relativeHeadingHome = ApmTelem.getRelativeHeadingHome() 105 | local integHead, fracHead = math.modf(relativeHeadingHome/22.5+.5) 106 | lcd.drawPixmap(190,42,"/SCRIPTS/BMP/arrow"..(integHead%16)..".bmp") 107 | lcd.drawText(145, 45, "To Home", 0) 108 | lcd.drawText(145, 55, getValue("distance").."m", 0) 109 | 110 | -- Inform if there are unread messages 111 | if global_new_messages ~= nil and global_new_messages == true 112 | then 113 | lcd.drawText(145, 20, "New Msg", BLINK) 114 | end 115 | end 116 | 117 | return { init=init, run=run, background=background} 118 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/message_definitions/sensesoar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | common.xml 4 | 5 | 6 | Different flight modes 7 | Gliding mode with motors off 8 | Autonomous flight 9 | RC controlled 10 | 11 | 12 | 13 | 14 | Position estimate of the observer in global frame 15 | Longitude expressed in 1E7 16 | Latitude expressed in 1E7 17 | Altitude expressed in milimeters 18 | 19 | 20 | velocity estimate of the observer in NED inertial frame 21 | Velocity 22 | 23 | 24 | attitude estimate of the observer 25 | Quaternion re;im 26 | 27 | 28 | Wind estimate in NED inertial frame 29 | Wind 30 | 31 | 32 | Estimate of the air velocity 33 | Air speed 34 | angle of attack 35 | slip angle 36 | 37 | 38 | IMU biases 39 | accelerometer bias 40 | gyroscope bias 41 | 42 | 43 | estimate of the pressure at sea level 44 | Wind 45 | 46 | 47 | ambient air temperature 48 | Air Temperatur 49 | 50 | 51 | filtered rotational velocity 52 | rotational velocity 53 | 54 | 55 | low level control output 56 | Servo signal 57 | motor signal 58 | 59 | 60 | Power managment 61 | current power consumption 62 | battery status 63 | Power generation from each module 64 | 65 | 66 | system status 67 | gps status 68 | actuator status 69 | module status 70 | module status 71 | 72 | 73 | change commanded air speed 74 | Target ID 75 | commanded airspeed 76 | 77 | 78 | accept change of airspeed 79 | commanded airspeed 80 | 0:ack, 1:nack 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /Lua_Telemetry/Storm32/SCRIPTS/_modelname_/telem5.lua: -------------------------------------------------------------------------------- 1 | local menu={} 2 | menu[0] = {label = "Pan Mode Control", channel=16, cases={[0]="hold hold pan", [1]="hold hold hold", [2]="pan pan pan"}} 3 | menu[1] = {label = "Pitch control", channel=12, cases={[0]="Apm", [1]="offline", [2]="User pitch"}} 4 | menu[2] = {label = "Recenter camera", channel=15, cases={[0]="Normal", [1]="Recenter"}} 5 | 6 | local menu_index = 0 7 | local display_rows = 6 8 | 9 | local __it = nil 10 | local function getIt() if __it == nil then return {next=nil, data=nil} end return {next=__it, data=nil} end 11 | local function addLI(data) if __it == nil then __it = {next=nil, data=data} else local __t = __it while __t.next ~=nil do __t = __t.next end __t.next = {next=nil, data=data} end end 12 | local function removeLI(item) if __it == nil or item==nil then return getIt() end if __it == item then __it = item.next return {next=__it, data=nil} end local __t = getIt() while __t.next ~= nil and __t.next ~= item do __t = __t.next end if __t.next ~= nil then __t.next = __t.next.next end return __t end 13 | 14 | local function parseValue(item) 15 | if item == nil or item.channel == nil then 16 | return "" 17 | end 18 | local value = getValue(147+item.channel) 19 | if item.cases[1] ~= nil 20 | then 21 | if value > 900 then 22 | return 1 23 | end 24 | if item.cases[2] ~= nil 25 | then 26 | if value < -900 then 27 | return 2 28 | end 29 | if item.cases[3] ~= nil 30 | then 31 | if value > 600 then 32 | return 3 33 | end 34 | end 35 | end 36 | end 37 | if item.cases[0] ~= nil then 38 | return 0 39 | end 40 | return 0 41 | end 42 | 43 | local function parseValueStr(item) 44 | local case = parseValue(item) 45 | if(case == nil or item == nil or item.cases == nil) then 46 | return "" 47 | elseif case == 1 then 48 | return item.cases[1] 49 | elseif case == 2 then 50 | return item.cases[2] 51 | elseif case == 3 then 52 | return item.cases[3] 53 | elseif item.cases[0] ~= nil then 54 | return item.cases[0] 55 | end 56 | return "Default" 57 | end 58 | 59 | local function ternary(value, first, second) 60 | if value then 61 | return first 62 | end 63 | return second 64 | end 65 | 66 | local function updateChannel(channel, case) 67 | local mixLine = model.getMix(channel-1, 0) 68 | if mixLine.source ~= 84 then -- MAX 69 | return 70 | end 71 | if case == 0 then mixLine.weight=0 72 | elseif case == 1 then mixLine.weight=100 73 | elseif case == 2 then mixLine.weight=-100 74 | elseif case == 3 then mixLine.weight=70 75 | end 76 | 77 | model.insertMix(channel-1, 0, mixLine) 78 | model.deleteMix(channel-1, 1) 79 | end 80 | 81 | local function doBgWork() 82 | local t = getIt() 83 | while t.next ~= nil 84 | do 85 | t = t.next 86 | if t.data.timeoutmsgid = MAVLINK_MSG_ID_AUTH_KEY; 48 | return mavlink_finalize_message(msg, system_id, component_id, 32, 119); 49 | } 50 | 51 | /** 52 | * @brief Pack a auth_key message on a channel 53 | * @param system_id ID of this system 54 | * @param component_id ID of this component (e.g. 200 for IMU) 55 | * @param chan The MAVLink channel this message was sent over 56 | * @param msg The MAVLink message to compress the data into 57 | * @param key key 58 | * @return length of the message in bytes (excluding serial stream start sign) 59 | */ 60 | static inline uint16_t mavlink_msg_auth_key_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, 61 | mavlink_message_t* msg, 62 | const char *key) 63 | { 64 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 65 | char buf[32]; 66 | 67 | _mav_put_char_array(buf, 0, key, 32); 68 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 32); 69 | #else 70 | mavlink_auth_key_t packet; 71 | 72 | mav_array_memcpy(packet.key, key, sizeof(char)*32); 73 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 32); 74 | #endif 75 | 76 | msg->msgid = MAVLINK_MSG_ID_AUTH_KEY; 77 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 32, 119); 78 | } 79 | 80 | /** 81 | * @brief Encode a auth_key struct into a message 82 | * 83 | * @param system_id ID of this system 84 | * @param component_id ID of this component (e.g. 200 for IMU) 85 | * @param msg The MAVLink message to compress the data into 86 | * @param auth_key C-struct to read the message contents from 87 | */ 88 | static inline uint16_t mavlink_msg_auth_key_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_auth_key_t* auth_key) 89 | { 90 | return mavlink_msg_auth_key_pack(system_id, component_id, msg, auth_key->key); 91 | } 92 | 93 | /** 94 | * @brief Send a auth_key message 95 | * @param chan MAVLink channel to send the message 96 | * 97 | * @param key key 98 | */ 99 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS 100 | 101 | static inline void mavlink_msg_auth_key_send(mavlink_channel_t chan, const char *key) 102 | { 103 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 104 | char buf[32]; 105 | 106 | _mav_put_char_array(buf, 0, key, 32); 107 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, buf, 32, 119); 108 | #else 109 | mavlink_auth_key_t packet; 110 | 111 | mav_array_memcpy(packet.key, key, sizeof(char)*32); 112 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, (const char *)&packet, 32, 119); 113 | #endif 114 | } 115 | 116 | #endif 117 | 118 | // MESSAGE AUTH_KEY UNPACKING 119 | 120 | 121 | /** 122 | * @brief Get field key from auth_key message 123 | * 124 | * @return key 125 | */ 126 | static inline uint16_t mavlink_msg_auth_key_get_key(const mavlink_message_t* msg, char *key) 127 | { 128 | return _MAV_RETURN_char_array(msg, key, 32, 0); 129 | } 130 | 131 | /** 132 | * @brief Decode a auth_key message into a struct 133 | * 134 | * @param msg The message to decode 135 | * @param auth_key C-struct to decode the message contents into 136 | */ 137 | static inline void mavlink_msg_auth_key_decode(const mavlink_message_t* msg, mavlink_auth_key_t* auth_key) 138 | { 139 | #if MAVLINK_NEED_BYTE_SWAP 140 | mavlink_msg_auth_key_get_key(msg, auth_key->key); 141 | #else 142 | memcpy(auth_key, _MAV_PAYLOAD(msg), 32); 143 | #endif 144 | } 145 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_current.h: -------------------------------------------------------------------------------- 1 | // MESSAGE MISSION_CURRENT PACKING 2 | 3 | #define MAVLINK_MSG_ID_MISSION_CURRENT 42 4 | 5 | typedef struct __mavlink_mission_current_t 6 | { 7 | uint16_t seq; ///< Sequence 8 | } mavlink_mission_current_t; 9 | 10 | #define MAVLINK_MSG_ID_MISSION_CURRENT_LEN 2 11 | #define MAVLINK_MSG_ID_42_LEN 2 12 | 13 | 14 | 15 | #define MAVLINK_MESSAGE_INFO_MISSION_CURRENT { \ 16 | "MISSION_CURRENT", \ 17 | 1, \ 18 | { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_current_t, seq) }, \ 19 | } \ 20 | } 21 | 22 | 23 | /** 24 | * @brief Pack a mission_current message 25 | * @param system_id ID of this system 26 | * @param component_id ID of this component (e.g. 200 for IMU) 27 | * @param msg The MAVLink message to compress the data into 28 | * 29 | * @param seq Sequence 30 | * @return length of the message in bytes (excluding serial stream start sign) 31 | */ 32 | static inline uint16_t mavlink_msg_mission_current_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, 33 | uint16_t seq) 34 | { 35 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 36 | char buf[2]; 37 | _mav_put_uint16_t(buf, 0, seq); 38 | 39 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); 40 | #else 41 | mavlink_mission_current_t packet; 42 | packet.seq = seq; 43 | 44 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); 45 | #endif 46 | 47 | msg->msgid = MAVLINK_MSG_ID_MISSION_CURRENT; 48 | return mavlink_finalize_message(msg, system_id, component_id, 2, 28); 49 | } 50 | 51 | /** 52 | * @brief Pack a mission_current message on a channel 53 | * @param system_id ID of this system 54 | * @param component_id ID of this component (e.g. 200 for IMU) 55 | * @param chan The MAVLink channel this message was sent over 56 | * @param msg The MAVLink message to compress the data into 57 | * @param seq Sequence 58 | * @return length of the message in bytes (excluding serial stream start sign) 59 | */ 60 | static inline uint16_t mavlink_msg_mission_current_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, 61 | mavlink_message_t* msg, 62 | uint16_t seq) 63 | { 64 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 65 | char buf[2]; 66 | _mav_put_uint16_t(buf, 0, seq); 67 | 68 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); 69 | #else 70 | mavlink_mission_current_t packet; 71 | packet.seq = seq; 72 | 73 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); 74 | #endif 75 | 76 | msg->msgid = MAVLINK_MSG_ID_MISSION_CURRENT; 77 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 2, 28); 78 | } 79 | 80 | /** 81 | * @brief Encode a mission_current struct into a message 82 | * 83 | * @param system_id ID of this system 84 | * @param component_id ID of this component (e.g. 200 for IMU) 85 | * @param msg The MAVLink message to compress the data into 86 | * @param mission_current C-struct to read the message contents from 87 | */ 88 | static inline uint16_t mavlink_msg_mission_current_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_current_t* mission_current) 89 | { 90 | return mavlink_msg_mission_current_pack(system_id, component_id, msg, mission_current->seq); 91 | } 92 | 93 | /** 94 | * @brief Send a mission_current message 95 | * @param chan MAVLink channel to send the message 96 | * 97 | * @param seq Sequence 98 | */ 99 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS 100 | 101 | static inline void mavlink_msg_mission_current_send(mavlink_channel_t chan, uint16_t seq) 102 | { 103 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 104 | char buf[2]; 105 | _mav_put_uint16_t(buf, 0, seq); 106 | 107 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, buf, 2, 28); 108 | #else 109 | mavlink_mission_current_t packet; 110 | packet.seq = seq; 111 | 112 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, (const char *)&packet, 2, 28); 113 | #endif 114 | } 115 | 116 | #endif 117 | 118 | // MESSAGE MISSION_CURRENT UNPACKING 119 | 120 | 121 | /** 122 | * @brief Get field seq from mission_current message 123 | * 124 | * @return Sequence 125 | */ 126 | static inline uint16_t mavlink_msg_mission_current_get_seq(const mavlink_message_t* msg) 127 | { 128 | return _MAV_RETURN_uint16_t(msg, 0); 129 | } 130 | 131 | /** 132 | * @brief Decode a mission_current message into a struct 133 | * 134 | * @param msg The message to decode 135 | * @param mission_current C-struct to decode the message contents into 136 | */ 137 | static inline void mavlink_msg_mission_current_decode(const mavlink_message_t* msg, mavlink_mission_current_t* mission_current) 138 | { 139 | #if MAVLINK_NEED_BYTE_SWAP 140 | mission_current->seq = mavlink_msg_mission_current_get_seq(msg); 141 | #else 142 | memcpy(mission_current, _MAV_PAYLOAD(msg), 2); 143 | #endif 144 | } 145 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_item_reached.h: -------------------------------------------------------------------------------- 1 | // MESSAGE MISSION_ITEM_REACHED PACKING 2 | 3 | #define MAVLINK_MSG_ID_MISSION_ITEM_REACHED 46 4 | 5 | typedef struct __mavlink_mission_item_reached_t 6 | { 7 | uint16_t seq; ///< Sequence 8 | } mavlink_mission_item_reached_t; 9 | 10 | #define MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN 2 11 | #define MAVLINK_MSG_ID_46_LEN 2 12 | 13 | 14 | 15 | #define MAVLINK_MESSAGE_INFO_MISSION_ITEM_REACHED { \ 16 | "MISSION_ITEM_REACHED", \ 17 | 1, \ 18 | { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_item_reached_t, seq) }, \ 19 | } \ 20 | } 21 | 22 | 23 | /** 24 | * @brief Pack a mission_item_reached message 25 | * @param system_id ID of this system 26 | * @param component_id ID of this component (e.g. 200 for IMU) 27 | * @param msg The MAVLink message to compress the data into 28 | * 29 | * @param seq Sequence 30 | * @return length of the message in bytes (excluding serial stream start sign) 31 | */ 32 | static inline uint16_t mavlink_msg_mission_item_reached_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, 33 | uint16_t seq) 34 | { 35 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 36 | char buf[2]; 37 | _mav_put_uint16_t(buf, 0, seq); 38 | 39 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); 40 | #else 41 | mavlink_mission_item_reached_t packet; 42 | packet.seq = seq; 43 | 44 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); 45 | #endif 46 | 47 | msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM_REACHED; 48 | return mavlink_finalize_message(msg, system_id, component_id, 2, 11); 49 | } 50 | 51 | /** 52 | * @brief Pack a mission_item_reached message on a channel 53 | * @param system_id ID of this system 54 | * @param component_id ID of this component (e.g. 200 for IMU) 55 | * @param chan The MAVLink channel this message was sent over 56 | * @param msg The MAVLink message to compress the data into 57 | * @param seq Sequence 58 | * @return length of the message in bytes (excluding serial stream start sign) 59 | */ 60 | static inline uint16_t mavlink_msg_mission_item_reached_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, 61 | mavlink_message_t* msg, 62 | uint16_t seq) 63 | { 64 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 65 | char buf[2]; 66 | _mav_put_uint16_t(buf, 0, seq); 67 | 68 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); 69 | #else 70 | mavlink_mission_item_reached_t packet; 71 | packet.seq = seq; 72 | 73 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); 74 | #endif 75 | 76 | msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM_REACHED; 77 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 2, 11); 78 | } 79 | 80 | /** 81 | * @brief Encode a mission_item_reached struct into a message 82 | * 83 | * @param system_id ID of this system 84 | * @param component_id ID of this component (e.g. 200 for IMU) 85 | * @param msg The MAVLink message to compress the data into 86 | * @param mission_item_reached C-struct to read the message contents from 87 | */ 88 | static inline uint16_t mavlink_msg_mission_item_reached_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_item_reached_t* mission_item_reached) 89 | { 90 | return mavlink_msg_mission_item_reached_pack(system_id, component_id, msg, mission_item_reached->seq); 91 | } 92 | 93 | /** 94 | * @brief Send a mission_item_reached message 95 | * @param chan MAVLink channel to send the message 96 | * 97 | * @param seq Sequence 98 | */ 99 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS 100 | 101 | static inline void mavlink_msg_mission_item_reached_send(mavlink_channel_t chan, uint16_t seq) 102 | { 103 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 104 | char buf[2]; 105 | _mav_put_uint16_t(buf, 0, seq); 106 | 107 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, buf, 2, 11); 108 | #else 109 | mavlink_mission_item_reached_t packet; 110 | packet.seq = seq; 111 | 112 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, (const char *)&packet, 2, 11); 113 | #endif 114 | } 115 | 116 | #endif 117 | 118 | // MESSAGE MISSION_ITEM_REACHED UNPACKING 119 | 120 | 121 | /** 122 | * @brief Get field seq from mission_item_reached message 123 | * 124 | * @return Sequence 125 | */ 126 | static inline uint16_t mavlink_msg_mission_item_reached_get_seq(const mavlink_message_t* msg) 127 | { 128 | return _MAV_RETURN_uint16_t(msg, 0); 129 | } 130 | 131 | /** 132 | * @brief Decode a mission_item_reached message into a struct 133 | * 134 | * @param msg The message to decode 135 | * @param mission_item_reached C-struct to decode the message contents into 136 | */ 137 | static inline void mavlink_msg_mission_item_reached_decode(const mavlink_message_t* msg, mavlink_mission_item_reached_t* mission_item_reached) 138 | { 139 | #if MAVLINK_NEED_BYTE_SWAP 140 | mission_item_reached->seq = mavlink_msg_mission_item_reached_get_seq(msg); 141 | #else 142 | memcpy(mission_item_reached, _MAV_PAYLOAD(msg), 2); 143 | #endif 144 | } 145 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_meminfo.h: -------------------------------------------------------------------------------- 1 | // MESSAGE MEMINFO PACKING 2 | 3 | #define MAVLINK_MSG_ID_MEMINFO 152 4 | 5 | typedef struct __mavlink_meminfo_t 6 | { 7 | uint16_t brkval; ///< heap top 8 | uint16_t freemem; ///< free memory 9 | } mavlink_meminfo_t; 10 | 11 | #define MAVLINK_MSG_ID_MEMINFO_LEN 4 12 | #define MAVLINK_MSG_ID_152_LEN 4 13 | 14 | 15 | 16 | #define MAVLINK_MESSAGE_INFO_MEMINFO { \ 17 | "MEMINFO", \ 18 | 2, \ 19 | { { "brkval", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_meminfo_t, brkval) }, \ 20 | { "freemem", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_meminfo_t, freemem) }, \ 21 | } \ 22 | } 23 | 24 | 25 | /** 26 | * @brief Pack a meminfo message 27 | * @param system_id ID of this system 28 | * @param component_id ID of this component (e.g. 200 for IMU) 29 | * @param msg The MAVLink message to compress the data into 30 | * 31 | * @param brkval heap top 32 | * @param freemem free memory 33 | * @return length of the message in bytes (excluding serial stream start sign) 34 | */ 35 | static inline uint16_t mavlink_msg_meminfo_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, 36 | uint16_t brkval, uint16_t freemem) 37 | { 38 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 39 | char buf[4]; 40 | _mav_put_uint16_t(buf, 0, brkval); 41 | _mav_put_uint16_t(buf, 2, freemem); 42 | 43 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); 44 | #else 45 | mavlink_meminfo_t packet; 46 | packet.brkval = brkval; 47 | packet.freemem = freemem; 48 | 49 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); 50 | #endif 51 | 52 | msg->msgid = MAVLINK_MSG_ID_MEMINFO; 53 | return mavlink_finalize_message(msg, system_id, component_id, 4, 208); 54 | } 55 | 56 | /** 57 | * @brief Pack a meminfo message on a channel 58 | * @param system_id ID of this system 59 | * @param component_id ID of this component (e.g. 200 for IMU) 60 | * @param chan The MAVLink channel this message was sent over 61 | * @param msg The MAVLink message to compress the data into 62 | * @param brkval heap top 63 | * @param freemem free memory 64 | * @return length of the message in bytes (excluding serial stream start sign) 65 | */ 66 | static inline uint16_t mavlink_msg_meminfo_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, 67 | mavlink_message_t* msg, 68 | uint16_t brkval,uint16_t freemem) 69 | { 70 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 71 | char buf[4]; 72 | _mav_put_uint16_t(buf, 0, brkval); 73 | _mav_put_uint16_t(buf, 2, freemem); 74 | 75 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); 76 | #else 77 | mavlink_meminfo_t packet; 78 | packet.brkval = brkval; 79 | packet.freemem = freemem; 80 | 81 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); 82 | #endif 83 | 84 | msg->msgid = MAVLINK_MSG_ID_MEMINFO; 85 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4, 208); 86 | } 87 | 88 | /** 89 | * @brief Encode a meminfo struct into a message 90 | * 91 | * @param system_id ID of this system 92 | * @param component_id ID of this component (e.g. 200 for IMU) 93 | * @param msg The MAVLink message to compress the data into 94 | * @param meminfo C-struct to read the message contents from 95 | */ 96 | 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) 97 | { 98 | return mavlink_msg_meminfo_pack(system_id, component_id, msg, meminfo->brkval, meminfo->freemem); 99 | } 100 | 101 | /** 102 | * @brief Send a meminfo message 103 | * @param chan MAVLink channel to send the message 104 | * 105 | * @param brkval heap top 106 | * @param freemem free memory 107 | */ 108 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS 109 | 110 | static inline void mavlink_msg_meminfo_send(mavlink_channel_t chan, uint16_t brkval, uint16_t freemem) 111 | { 112 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 113 | char buf[4]; 114 | _mav_put_uint16_t(buf, 0, brkval); 115 | _mav_put_uint16_t(buf, 2, freemem); 116 | 117 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMINFO, buf, 4, 208); 118 | #else 119 | mavlink_meminfo_t packet; 120 | packet.brkval = brkval; 121 | packet.freemem = freemem; 122 | 123 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MEMINFO, (const char *)&packet, 4, 208); 124 | #endif 125 | } 126 | 127 | #endif 128 | 129 | // MESSAGE MEMINFO UNPACKING 130 | 131 | 132 | /** 133 | * @brief Get field brkval from meminfo message 134 | * 135 | * @return heap top 136 | */ 137 | static inline uint16_t mavlink_msg_meminfo_get_brkval(const mavlink_message_t* msg) 138 | { 139 | return _MAV_RETURN_uint16_t(msg, 0); 140 | } 141 | 142 | /** 143 | * @brief Get field freemem from meminfo message 144 | * 145 | * @return free memory 146 | */ 147 | static inline uint16_t mavlink_msg_meminfo_get_freemem(const mavlink_message_t* msg) 148 | { 149 | return _MAV_RETURN_uint16_t(msg, 2); 150 | } 151 | 152 | /** 153 | * @brief Decode a meminfo message into a struct 154 | * 155 | * @param msg The message to decode 156 | * @param meminfo C-struct to decode the message contents into 157 | */ 158 | static inline void mavlink_msg_meminfo_decode(const mavlink_message_t* msg, mavlink_meminfo_t* meminfo) 159 | { 160 | #if MAVLINK_NEED_BYTE_SWAP 161 | meminfo->brkval = mavlink_msg_meminfo_get_brkval(msg); 162 | meminfo->freemem = mavlink_msg_meminfo_get_freemem(msg); 163 | #else 164 | memcpy(meminfo, _MAV_PAYLOAD(msg), 4); 165 | #endif 166 | } 167 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_hwstatus.h: -------------------------------------------------------------------------------- 1 | // MESSAGE HWSTATUS PACKING 2 | 3 | #define MAVLINK_MSG_ID_HWSTATUS 165 4 | 5 | typedef struct __mavlink_hwstatus_t 6 | { 7 | uint16_t Vcc; ///< board voltage (mV) 8 | uint8_t I2Cerr; ///< I2C error count 9 | } mavlink_hwstatus_t; 10 | 11 | #define MAVLINK_MSG_ID_HWSTATUS_LEN 3 12 | #define MAVLINK_MSG_ID_165_LEN 3 13 | 14 | 15 | 16 | #define MAVLINK_MESSAGE_INFO_HWSTATUS { \ 17 | "HWSTATUS", \ 18 | 2, \ 19 | { { "Vcc", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_hwstatus_t, Vcc) }, \ 20 | { "I2Cerr", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_hwstatus_t, I2Cerr) }, \ 21 | } \ 22 | } 23 | 24 | 25 | /** 26 | * @brief Pack a hwstatus message 27 | * @param system_id ID of this system 28 | * @param component_id ID of this component (e.g. 200 for IMU) 29 | * @param msg The MAVLink message to compress the data into 30 | * 31 | * @param Vcc board voltage (mV) 32 | * @param I2Cerr I2C error count 33 | * @return length of the message in bytes (excluding serial stream start sign) 34 | */ 35 | static inline uint16_t mavlink_msg_hwstatus_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, 36 | uint16_t Vcc, uint8_t I2Cerr) 37 | { 38 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 39 | char buf[3]; 40 | _mav_put_uint16_t(buf, 0, Vcc); 41 | _mav_put_uint8_t(buf, 2, I2Cerr); 42 | 43 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); 44 | #else 45 | mavlink_hwstatus_t packet; 46 | packet.Vcc = Vcc; 47 | packet.I2Cerr = I2Cerr; 48 | 49 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); 50 | #endif 51 | 52 | msg->msgid = MAVLINK_MSG_ID_HWSTATUS; 53 | return mavlink_finalize_message(msg, system_id, component_id, 3, 21); 54 | } 55 | 56 | /** 57 | * @brief Pack a hwstatus message on a channel 58 | * @param system_id ID of this system 59 | * @param component_id ID of this component (e.g. 200 for IMU) 60 | * @param chan The MAVLink channel this message was sent over 61 | * @param msg The MAVLink message to compress the data into 62 | * @param Vcc board voltage (mV) 63 | * @param I2Cerr I2C error count 64 | * @return length of the message in bytes (excluding serial stream start sign) 65 | */ 66 | static inline uint16_t mavlink_msg_hwstatus_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, 67 | mavlink_message_t* msg, 68 | uint16_t Vcc,uint8_t I2Cerr) 69 | { 70 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 71 | char buf[3]; 72 | _mav_put_uint16_t(buf, 0, Vcc); 73 | _mav_put_uint8_t(buf, 2, I2Cerr); 74 | 75 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); 76 | #else 77 | mavlink_hwstatus_t packet; 78 | packet.Vcc = Vcc; 79 | packet.I2Cerr = I2Cerr; 80 | 81 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); 82 | #endif 83 | 84 | msg->msgid = MAVLINK_MSG_ID_HWSTATUS; 85 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3, 21); 86 | } 87 | 88 | /** 89 | * @brief Encode a hwstatus struct into a message 90 | * 91 | * @param system_id ID of this system 92 | * @param component_id ID of this component (e.g. 200 for IMU) 93 | * @param msg The MAVLink message to compress the data into 94 | * @param hwstatus C-struct to read the message contents from 95 | */ 96 | 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) 97 | { 98 | return mavlink_msg_hwstatus_pack(system_id, component_id, msg, hwstatus->Vcc, hwstatus->I2Cerr); 99 | } 100 | 101 | /** 102 | * @brief Send a hwstatus message 103 | * @param chan MAVLink channel to send the message 104 | * 105 | * @param Vcc board voltage (mV) 106 | * @param I2Cerr I2C error count 107 | */ 108 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS 109 | 110 | static inline void mavlink_msg_hwstatus_send(mavlink_channel_t chan, uint16_t Vcc, uint8_t I2Cerr) 111 | { 112 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 113 | char buf[3]; 114 | _mav_put_uint16_t(buf, 0, Vcc); 115 | _mav_put_uint8_t(buf, 2, I2Cerr); 116 | 117 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HWSTATUS, buf, 3, 21); 118 | #else 119 | mavlink_hwstatus_t packet; 120 | packet.Vcc = Vcc; 121 | packet.I2Cerr = I2Cerr; 122 | 123 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HWSTATUS, (const char *)&packet, 3, 21); 124 | #endif 125 | } 126 | 127 | #endif 128 | 129 | // MESSAGE HWSTATUS UNPACKING 130 | 131 | 132 | /** 133 | * @brief Get field Vcc from hwstatus message 134 | * 135 | * @return board voltage (mV) 136 | */ 137 | static inline uint16_t mavlink_msg_hwstatus_get_Vcc(const mavlink_message_t* msg) 138 | { 139 | return _MAV_RETURN_uint16_t(msg, 0); 140 | } 141 | 142 | /** 143 | * @brief Get field I2Cerr from hwstatus message 144 | * 145 | * @return I2C error count 146 | */ 147 | static inline uint8_t mavlink_msg_hwstatus_get_I2Cerr(const mavlink_message_t* msg) 148 | { 149 | return _MAV_RETURN_uint8_t(msg, 2); 150 | } 151 | 152 | /** 153 | * @brief Decode a hwstatus message into a struct 154 | * 155 | * @param msg The message to decode 156 | * @param hwstatus C-struct to decode the message contents into 157 | */ 158 | static inline void mavlink_msg_hwstatus_decode(const mavlink_message_t* msg, mavlink_hwstatus_t* hwstatus) 159 | { 160 | #if MAVLINK_NEED_BYTE_SWAP 161 | hwstatus->Vcc = mavlink_msg_hwstatus_get_Vcc(msg); 162 | hwstatus->I2Cerr = mavlink_msg_hwstatus_get_I2Cerr(msg); 163 | #else 164 | memcpy(hwstatus, _MAV_PAYLOAD(msg), 3); 165 | #endif 166 | } 167 | -------------------------------------------------------------------------------- /Lua_Telemetry/ApmTelem/SCRIPTS/MIXES/ApmTextCop.lua: -------------------------------------------------------------------------------- 1 | local msg={} 2 | local sound={} 3 | msg[2]="PreArm: RC not calibrated" 4 | msg[3]="PreArm: Baro not healthy" 5 | msg[4]="PreArm: Alt disparity" 6 | msg[5]="PreArm: Compass not healthy" 7 | msg[6]="PreArm: Compass not calibrated" 8 | msg[7]="PreArm: Compass offsets too high" 9 | msg[8]="PreArm: Check mag field" 10 | msg[9]="PreArm: INS not calibrated" 11 | msg[10]="PreArm: INS not healthy" 12 | msg[11]="PreArm: Check Board Voltage" 13 | msg[12]="PreArm: Ch7&Ch8 Opt cannot be same" 14 | msg[13]="PreArm: Check FS_THR_VALUE" 15 | msg[14]="PreArm: Check ANGLE_MAX" 16 | msg[15]="PreArm: ACRO_BAL_ROLL/PITCH" 17 | msg[16]="PreArm: GPS Glitch" 18 | msg[17]="PreArm: Need 3D Fix" 19 | msg[18]="PreArm: Bad Velocity" 20 | msg[19]="PreArm: High GPS HDOP" 21 | msg[111]="PreArm: Accels inconsistent" 22 | msg[112]="PreArm: Accels not healthy" 23 | msg[113]="PreArm: Bad GPS Pos" 24 | msg[114]="PreArm: Battery failsafe on" 25 | msg[115]="PreArm: compasses inconsistent" 26 | msg[116]="PreArm: Gyro cal failed" 27 | msg[117]="PreArm: Gyros inconsistent" 28 | msg[118]="PreArm: Gyros not healthy" 29 | msg[119]="PreArm: Radio failsafe on" 30 | 31 | -- Check for arm failures 32 | msg[20]="Arm: Alt disparity" 33 | msg[21]="Arm: Thr below FS" 34 | msg[22]="Arm: Leaning" 35 | msg[23]="Arm: Safety Switch" 36 | msg[100]="Arm: Mode not armable" 37 | msg[101]="Arm: Rotor not spinning" 38 | msg[102]="Arm: Thr too high" 39 | 40 | -- Check all other statuses 41 | msg[120]="Throttle armed!" 42 | msg[121]="Throttle disarmed!" 43 | 44 | msg[24]="AutoTune: Started"; sound[24]="apm_autotune_start.wav" 45 | msg[25]="AutoTune: Stopped"; sound[25]="apm_autotune_stop.wav" 46 | msg[26]="AutoTune: Success"; sound[26]="apm_autotune_done.wav" 47 | msg[27]="AutoTune: Failed"; sound[27]="apm_autotune_fail.wav" 48 | 49 | msg[28]="Crash: Disarming" 50 | msg[29]="Parachute: Released!" 51 | msg[30]="Parachute: Too Low" 52 | 53 | msg[31]="EKF variance" 54 | msg[125]="DCM bad heading" 55 | 56 | msg[32]="Low Battery!" 57 | msg[33]="Lost GPS!" 58 | 59 | msg[34]="Trim saved" 60 | -- Compassmot.pde 61 | msg[35]="compass disabled" 62 | msg[36]="check compass" 63 | msg[37]="RC not calibrated" 64 | msg[38]="thr not zero" 65 | msg[39]="Not landed" 66 | msg[40]="STARTING CALIBRATION" 67 | msg[41]="CURRENT" 68 | msg[42]="THROTTLE" 69 | msg[43]="Calibration Successful!" 70 | msg[44]="Failed!" 71 | 72 | msg[45]="bad rally point message ID" 73 | msg[46]="bad rally point message count" 74 | msg[47]="error setting rally point" 75 | msg[48]="bad rally point index" 76 | msg[49]="failed to set rally point" 77 | 78 | msg[50]="Erasing logs" 79 | msg[51]="Log erase complete" 80 | 81 | msg[52]="Motor Test: RC not calibrated" 82 | msg[53]="Motor Test: vehicle not landed" 83 | msg[54]="Motor Test: Safety Switch" 84 | 85 | msg[55]="No dataflash inserted" 86 | msg[56]="ERASING LOGS" 87 | msg[57]="Waiting for first HIL_STATE message" 88 | msg[61]="Ready to FLY." 89 | msg[97]="Beginning INS calibration; do not move plane" 90 | 91 | 92 | 93 | msg[105]="ESC Cal: auto calibration" 94 | msg[106]="ESC Cal: passing pilot thr to ESCs" 95 | msg[107]="ESC Cal: push safety switch" 96 | msg[108]="ESC Cal: restart board" 97 | 98 | msg[88]="Reached Command"; sound[88]="apm_cmd_reached.wav" 99 | 100 | msg[86]="flight plan update rejected"; sound[86]="apm_flightplan_rej.wav" 101 | msg[87]="flight plan received"; sound[87]="apm_flightplan_upd.wav" 102 | 103 | local function ds(s) 104 | local t="Unknown" 105 | if s==nil then return "" 106 | elseif s==0 then t="Emergency" 107 | elseif s==1 then t="Alert" 108 | elseif s==2 then t="Critical" 109 | elseif s==3 then t="Error" 110 | elseif s==4 then t="Warning" 111 | elseif s==5 then t="Notice" 112 | elseif s==6 then t="Info" 113 | elseif s==7 then t="Debug" 114 | end 115 | return t 116 | end 117 | local function decodeText(n) 118 | -- Default disabled status 119 | local ret = {enabled=false, silent=false, text="", soundfile=strDefault} 120 | -- Send nothing for disabled ids 121 | if n == 1 -- "ARMING MOTORS" 122 | or n == 89 -- "DISARMING MOTORS" 123 | or n == 90 -- "Calibrating barometer" 124 | or n == 91 -- "barometer calibration complete" 125 | or n == 92 -- "zero airspeed calibrated" 126 | or n == 94 -- "GROUND START" 127 | or n == 93 -- "Initialising APM..." 128 | or n == 95 -- " GROUND START" 129 | or n == 96 -- " With Delay" 130 | then 131 | return ret 132 | end 133 | -- Set status-message as enabled 134 | ret.enabled = true 135 | ret.text = msg[n] 136 | 137 | if ret.text == nil then return nil end 138 | -- if str.find(ret.text, "Prearm:") ~= nil then ret.sound="apm_failed_prearm.wav" 139 | -- elseif strfind(ret.text, "Arm:") ~= nil then ret.sound="apm_failed_arm.wav" 140 | -- else ret.sound = sound[n] 141 | --end 142 | 143 | --if true then return ""..n end 144 | 145 | return ret 146 | end 147 | 148 | local function df(m) 149 | local t="Flightmode "..m 150 | if m==0 then t="Stabilize" 151 | elseif m==1 then t="Acro" 152 | elseif m==2 then t="Altitude Hold" 153 | elseif m==3 then t="Auto" 154 | elseif m==4 then t="Guided" 155 | elseif m==5 then t="Loiter" 156 | elseif m==6 then t="Return to launch" 157 | elseif m==7 then t="Circle" 158 | elseif m==9 then t="Land" 159 | elseif m==10 then t="Optical Flow Loiter" 160 | elseif m==11 then t="Drift" 161 | elseif m==13 then t="Sport" 162 | elseif m==15 then t="Autotune" 163 | elseif m==16 then t="Position Hold" 164 | end 165 | return t 166 | end 167 | local initCount = 0 168 | 169 | function getApmTexts() 170 | initCount = initCount+1 171 | return { 172 | decodeStatusText=decodeText, 173 | decodeFlightmode=df, 174 | decodeSeverity=ds 175 | } 176 | end 177 | local function run() 178 | return 0 179 | end 180 | return {run=run} -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_command_ack.h: -------------------------------------------------------------------------------- 1 | // MESSAGE COMMAND_ACK PACKING 2 | 3 | #define MAVLINK_MSG_ID_COMMAND_ACK 77 4 | 5 | typedef struct __mavlink_command_ack_t 6 | { 7 | uint16_t command; ///< Command ID, as defined by MAV_CMD enum. 8 | uint8_t result; ///< See MAV_RESULT enum 9 | } mavlink_command_ack_t; 10 | 11 | #define MAVLINK_MSG_ID_COMMAND_ACK_LEN 3 12 | #define MAVLINK_MSG_ID_77_LEN 3 13 | 14 | 15 | 16 | #define MAVLINK_MESSAGE_INFO_COMMAND_ACK { \ 17 | "COMMAND_ACK", \ 18 | 2, \ 19 | { { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_command_ack_t, command) }, \ 20 | { "result", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_command_ack_t, result) }, \ 21 | } \ 22 | } 23 | 24 | 25 | /** 26 | * @brief Pack a command_ack message 27 | * @param system_id ID of this system 28 | * @param component_id ID of this component (e.g. 200 for IMU) 29 | * @param msg The MAVLink message to compress the data into 30 | * 31 | * @param command Command ID, as defined by MAV_CMD enum. 32 | * @param result See MAV_RESULT enum 33 | * @return length of the message in bytes (excluding serial stream start sign) 34 | */ 35 | static inline uint16_t mavlink_msg_command_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, 36 | uint16_t command, uint8_t result) 37 | { 38 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 39 | char buf[3]; 40 | _mav_put_uint16_t(buf, 0, command); 41 | _mav_put_uint8_t(buf, 2, result); 42 | 43 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); 44 | #else 45 | mavlink_command_ack_t packet; 46 | packet.command = command; 47 | packet.result = result; 48 | 49 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); 50 | #endif 51 | 52 | msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK; 53 | return mavlink_finalize_message(msg, system_id, component_id, 3, 143); 54 | } 55 | 56 | /** 57 | * @brief Pack a command_ack message on a channel 58 | * @param system_id ID of this system 59 | * @param component_id ID of this component (e.g. 200 for IMU) 60 | * @param chan The MAVLink channel this message was sent over 61 | * @param msg The MAVLink message to compress the data into 62 | * @param command Command ID, as defined by MAV_CMD enum. 63 | * @param result See MAV_RESULT enum 64 | * @return length of the message in bytes (excluding serial stream start sign) 65 | */ 66 | static inline uint16_t mavlink_msg_command_ack_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, 67 | mavlink_message_t* msg, 68 | uint16_t command,uint8_t result) 69 | { 70 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 71 | char buf[3]; 72 | _mav_put_uint16_t(buf, 0, command); 73 | _mav_put_uint8_t(buf, 2, result); 74 | 75 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); 76 | #else 77 | mavlink_command_ack_t packet; 78 | packet.command = command; 79 | packet.result = result; 80 | 81 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); 82 | #endif 83 | 84 | msg->msgid = MAVLINK_MSG_ID_COMMAND_ACK; 85 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3, 143); 86 | } 87 | 88 | /** 89 | * @brief Encode a command_ack struct into a message 90 | * 91 | * @param system_id ID of this system 92 | * @param component_id ID of this component (e.g. 200 for IMU) 93 | * @param msg The MAVLink message to compress the data into 94 | * @param command_ack C-struct to read the message contents from 95 | */ 96 | static inline uint16_t mavlink_msg_command_ack_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_command_ack_t* command_ack) 97 | { 98 | return mavlink_msg_command_ack_pack(system_id, component_id, msg, command_ack->command, command_ack->result); 99 | } 100 | 101 | /** 102 | * @brief Send a command_ack message 103 | * @param chan MAVLink channel to send the message 104 | * 105 | * @param command Command ID, as defined by MAV_CMD enum. 106 | * @param result See MAV_RESULT enum 107 | */ 108 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS 109 | 110 | static inline void mavlink_msg_command_ack_send(mavlink_channel_t chan, uint16_t command, uint8_t result) 111 | { 112 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 113 | char buf[3]; 114 | _mav_put_uint16_t(buf, 0, command); 115 | _mav_put_uint8_t(buf, 2, result); 116 | 117 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, buf, 3, 143); 118 | #else 119 | mavlink_command_ack_t packet; 120 | packet.command = command; 121 | packet.result = result; 122 | 123 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_ACK, (const char *)&packet, 3, 143); 124 | #endif 125 | } 126 | 127 | #endif 128 | 129 | // MESSAGE COMMAND_ACK UNPACKING 130 | 131 | 132 | /** 133 | * @brief Get field command from command_ack message 134 | * 135 | * @return Command ID, as defined by MAV_CMD enum. 136 | */ 137 | static inline uint16_t mavlink_msg_command_ack_get_command(const mavlink_message_t* msg) 138 | { 139 | return _MAV_RETURN_uint16_t(msg, 0); 140 | } 141 | 142 | /** 143 | * @brief Get field result from command_ack message 144 | * 145 | * @return See MAV_RESULT enum 146 | */ 147 | static inline uint8_t mavlink_msg_command_ack_get_result(const mavlink_message_t* msg) 148 | { 149 | return _MAV_RETURN_uint8_t(msg, 2); 150 | } 151 | 152 | /** 153 | * @brief Decode a command_ack message into a struct 154 | * 155 | * @param msg The message to decode 156 | * @param command_ack C-struct to decode the message contents into 157 | */ 158 | static inline void mavlink_msg_command_ack_decode(const mavlink_message_t* msg, mavlink_command_ack_t* command_ack) 159 | { 160 | #if MAVLINK_NEED_BYTE_SWAP 161 | command_ack->command = mavlink_msg_command_ack_get_command(msg); 162 | command_ack->result = mavlink_msg_command_ack_get_result(msg); 163 | #else 164 | memcpy(command_ack, _MAV_PAYLOAD(msg), 3); 165 | #endif 166 | } 167 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_clear_all.h: -------------------------------------------------------------------------------- 1 | // MESSAGE MISSION_CLEAR_ALL PACKING 2 | 3 | #define MAVLINK_MSG_ID_MISSION_CLEAR_ALL 45 4 | 5 | typedef struct __mavlink_mission_clear_all_t 6 | { 7 | uint8_t target_system; ///< System ID 8 | uint8_t target_component; ///< Component ID 9 | } mavlink_mission_clear_all_t; 10 | 11 | #define MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN 2 12 | #define MAVLINK_MSG_ID_45_LEN 2 13 | 14 | 15 | 16 | #define MAVLINK_MESSAGE_INFO_MISSION_CLEAR_ALL { \ 17 | "MISSION_CLEAR_ALL", \ 18 | 2, \ 19 | { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mission_clear_all_t, target_system) }, \ 20 | { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mission_clear_all_t, target_component) }, \ 21 | } \ 22 | } 23 | 24 | 25 | /** 26 | * @brief Pack a mission_clear_all message 27 | * @param system_id ID of this system 28 | * @param component_id ID of this component (e.g. 200 for IMU) 29 | * @param msg The MAVLink message to compress the data into 30 | * 31 | * @param target_system System ID 32 | * @param target_component Component ID 33 | * @return length of the message in bytes (excluding serial stream start sign) 34 | */ 35 | static inline uint16_t mavlink_msg_mission_clear_all_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, 36 | uint8_t target_system, uint8_t target_component) 37 | { 38 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 39 | char buf[2]; 40 | _mav_put_uint8_t(buf, 0, target_system); 41 | _mav_put_uint8_t(buf, 1, target_component); 42 | 43 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); 44 | #else 45 | mavlink_mission_clear_all_t packet; 46 | packet.target_system = target_system; 47 | packet.target_component = target_component; 48 | 49 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); 50 | #endif 51 | 52 | msg->msgid = MAVLINK_MSG_ID_MISSION_CLEAR_ALL; 53 | return mavlink_finalize_message(msg, system_id, component_id, 2, 232); 54 | } 55 | 56 | /** 57 | * @brief Pack a mission_clear_all message on a channel 58 | * @param system_id ID of this system 59 | * @param component_id ID of this component (e.g. 200 for IMU) 60 | * @param chan The MAVLink channel this message was sent over 61 | * @param msg The MAVLink message to compress the data into 62 | * @param target_system System ID 63 | * @param target_component Component ID 64 | * @return length of the message in bytes (excluding serial stream start sign) 65 | */ 66 | static inline uint16_t mavlink_msg_mission_clear_all_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, 67 | mavlink_message_t* msg, 68 | uint8_t target_system,uint8_t target_component) 69 | { 70 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 71 | char buf[2]; 72 | _mav_put_uint8_t(buf, 0, target_system); 73 | _mav_put_uint8_t(buf, 1, target_component); 74 | 75 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); 76 | #else 77 | mavlink_mission_clear_all_t packet; 78 | packet.target_system = target_system; 79 | packet.target_component = target_component; 80 | 81 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); 82 | #endif 83 | 84 | msg->msgid = MAVLINK_MSG_ID_MISSION_CLEAR_ALL; 85 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 2, 232); 86 | } 87 | 88 | /** 89 | * @brief Encode a mission_clear_all struct into a message 90 | * 91 | * @param system_id ID of this system 92 | * @param component_id ID of this component (e.g. 200 for IMU) 93 | * @param msg The MAVLink message to compress the data into 94 | * @param mission_clear_all C-struct to read the message contents from 95 | */ 96 | static inline uint16_t mavlink_msg_mission_clear_all_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_clear_all_t* mission_clear_all) 97 | { 98 | return mavlink_msg_mission_clear_all_pack(system_id, component_id, msg, mission_clear_all->target_system, mission_clear_all->target_component); 99 | } 100 | 101 | /** 102 | * @brief Send a mission_clear_all message 103 | * @param chan MAVLink channel to send the message 104 | * 105 | * @param target_system System ID 106 | * @param target_component Component ID 107 | */ 108 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS 109 | 110 | static inline void mavlink_msg_mission_clear_all_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component) 111 | { 112 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 113 | char buf[2]; 114 | _mav_put_uint8_t(buf, 0, target_system); 115 | _mav_put_uint8_t(buf, 1, target_component); 116 | 117 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, buf, 2, 232); 118 | #else 119 | mavlink_mission_clear_all_t packet; 120 | packet.target_system = target_system; 121 | packet.target_component = target_component; 122 | 123 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, (const char *)&packet, 2, 232); 124 | #endif 125 | } 126 | 127 | #endif 128 | 129 | // MESSAGE MISSION_CLEAR_ALL UNPACKING 130 | 131 | 132 | /** 133 | * @brief Get field target_system from mission_clear_all message 134 | * 135 | * @return System ID 136 | */ 137 | static inline uint8_t mavlink_msg_mission_clear_all_get_target_system(const mavlink_message_t* msg) 138 | { 139 | return _MAV_RETURN_uint8_t(msg, 0); 140 | } 141 | 142 | /** 143 | * @brief Get field target_component from mission_clear_all message 144 | * 145 | * @return Component ID 146 | */ 147 | static inline uint8_t mavlink_msg_mission_clear_all_get_target_component(const mavlink_message_t* msg) 148 | { 149 | return _MAV_RETURN_uint8_t(msg, 1); 150 | } 151 | 152 | /** 153 | * @brief Decode a mission_clear_all message into a struct 154 | * 155 | * @param msg The message to decode 156 | * @param mission_clear_all C-struct to decode the message contents into 157 | */ 158 | static inline void mavlink_msg_mission_clear_all_decode(const mavlink_message_t* msg, mavlink_mission_clear_all_t* mission_clear_all) 159 | { 160 | #if MAVLINK_NEED_BYTE_SWAP 161 | mission_clear_all->target_system = mavlink_msg_mission_clear_all_get_target_system(msg); 162 | mission_clear_all->target_component = mavlink_msg_mission_clear_all_get_target_component(msg); 163 | #else 164 | memcpy(mission_clear_all, _MAV_PAYLOAD(msg), 2); 165 | #endif 166 | } 167 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_param_request_list.h: -------------------------------------------------------------------------------- 1 | // MESSAGE PARAM_REQUEST_LIST PACKING 2 | 3 | #define MAVLINK_MSG_ID_PARAM_REQUEST_LIST 21 4 | 5 | typedef struct __mavlink_param_request_list_t 6 | { 7 | uint8_t target_system; ///< System ID 8 | uint8_t target_component; ///< Component ID 9 | } mavlink_param_request_list_t; 10 | 11 | #define MAVLINK_MSG_ID_PARAM_REQUEST_LIST_LEN 2 12 | #define MAVLINK_MSG_ID_21_LEN 2 13 | 14 | 15 | 16 | #define MAVLINK_MESSAGE_INFO_PARAM_REQUEST_LIST { \ 17 | "PARAM_REQUEST_LIST", \ 18 | 2, \ 19 | { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_param_request_list_t, target_system) }, \ 20 | { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_param_request_list_t, target_component) }, \ 21 | } \ 22 | } 23 | 24 | 25 | /** 26 | * @brief Pack a param_request_list message 27 | * @param system_id ID of this system 28 | * @param component_id ID of this component (e.g. 200 for IMU) 29 | * @param msg The MAVLink message to compress the data into 30 | * 31 | * @param target_system System ID 32 | * @param target_component Component ID 33 | * @return length of the message in bytes (excluding serial stream start sign) 34 | */ 35 | static inline uint16_t mavlink_msg_param_request_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, 36 | uint8_t target_system, uint8_t target_component) 37 | { 38 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 39 | char buf[2]; 40 | _mav_put_uint8_t(buf, 0, target_system); 41 | _mav_put_uint8_t(buf, 1, target_component); 42 | 43 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); 44 | #else 45 | mavlink_param_request_list_t packet; 46 | packet.target_system = target_system; 47 | packet.target_component = target_component; 48 | 49 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); 50 | #endif 51 | 52 | msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_LIST; 53 | return mavlink_finalize_message(msg, system_id, component_id, 2, 159); 54 | } 55 | 56 | /** 57 | * @brief Pack a param_request_list message on a channel 58 | * @param system_id ID of this system 59 | * @param component_id ID of this component (e.g. 200 for IMU) 60 | * @param chan The MAVLink channel this message was sent over 61 | * @param msg The MAVLink message to compress the data into 62 | * @param target_system System ID 63 | * @param target_component Component ID 64 | * @return length of the message in bytes (excluding serial stream start sign) 65 | */ 66 | static inline uint16_t mavlink_msg_param_request_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, 67 | mavlink_message_t* msg, 68 | uint8_t target_system,uint8_t target_component) 69 | { 70 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 71 | char buf[2]; 72 | _mav_put_uint8_t(buf, 0, target_system); 73 | _mav_put_uint8_t(buf, 1, target_component); 74 | 75 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); 76 | #else 77 | mavlink_param_request_list_t packet; 78 | packet.target_system = target_system; 79 | packet.target_component = target_component; 80 | 81 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); 82 | #endif 83 | 84 | msg->msgid = MAVLINK_MSG_ID_PARAM_REQUEST_LIST; 85 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 2, 159); 86 | } 87 | 88 | /** 89 | * @brief Encode a param_request_list struct into a message 90 | * 91 | * @param system_id ID of this system 92 | * @param component_id ID of this component (e.g. 200 for IMU) 93 | * @param msg The MAVLink message to compress the data into 94 | * @param param_request_list C-struct to read the message contents from 95 | */ 96 | static inline uint16_t mavlink_msg_param_request_list_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_param_request_list_t* param_request_list) 97 | { 98 | return mavlink_msg_param_request_list_pack(system_id, component_id, msg, param_request_list->target_system, param_request_list->target_component); 99 | } 100 | 101 | /** 102 | * @brief Send a param_request_list message 103 | * @param chan MAVLink channel to send the message 104 | * 105 | * @param target_system System ID 106 | * @param target_component Component ID 107 | */ 108 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS 109 | 110 | static inline void mavlink_msg_param_request_list_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component) 111 | { 112 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 113 | char buf[2]; 114 | _mav_put_uint8_t(buf, 0, target_system); 115 | _mav_put_uint8_t(buf, 1, target_component); 116 | 117 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, buf, 2, 159); 118 | #else 119 | mavlink_param_request_list_t packet; 120 | packet.target_system = target_system; 121 | packet.target_component = target_component; 122 | 123 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_REQUEST_LIST, (const char *)&packet, 2, 159); 124 | #endif 125 | } 126 | 127 | #endif 128 | 129 | // MESSAGE PARAM_REQUEST_LIST UNPACKING 130 | 131 | 132 | /** 133 | * @brief Get field target_system from param_request_list message 134 | * 135 | * @return System ID 136 | */ 137 | static inline uint8_t mavlink_msg_param_request_list_get_target_system(const mavlink_message_t* msg) 138 | { 139 | return _MAV_RETURN_uint8_t(msg, 0); 140 | } 141 | 142 | /** 143 | * @brief Get field target_component from param_request_list message 144 | * 145 | * @return Component ID 146 | */ 147 | static inline uint8_t mavlink_msg_param_request_list_get_target_component(const mavlink_message_t* msg) 148 | { 149 | return _MAV_RETURN_uint8_t(msg, 1); 150 | } 151 | 152 | /** 153 | * @brief Decode a param_request_list message into a struct 154 | * 155 | * @param msg The message to decode 156 | * @param param_request_list C-struct to decode the message contents into 157 | */ 158 | static inline void mavlink_msg_param_request_list_decode(const mavlink_message_t* msg, mavlink_param_request_list_t* param_request_list) 159 | { 160 | #if MAVLINK_NEED_BYTE_SWAP 161 | param_request_list->target_system = mavlink_msg_param_request_list_get_target_system(msg); 162 | param_request_list->target_component = mavlink_msg_param_request_list_get_target_component(msg); 163 | #else 164 | memcpy(param_request_list, _MAV_PAYLOAD(msg), 2); 165 | #endif 166 | } 167 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_statustext.h: -------------------------------------------------------------------------------- 1 | // MESSAGE STATUSTEXT PACKING 2 | 3 | #define MAVLINK_MSG_ID_STATUSTEXT 253 4 | 5 | typedef struct __mavlink_statustext_t 6 | { 7 | uint8_t severity; ///< Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY. 8 | char text[50]; ///< Status text message, without null termination character 9 | } mavlink_statustext_t; 10 | 11 | #define MAVLINK_MSG_ID_STATUSTEXT_LEN 51 12 | #define MAVLINK_MSG_ID_253_LEN 51 13 | 14 | #define MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN 50 15 | 16 | #define MAVLINK_MESSAGE_INFO_STATUSTEXT { \ 17 | "STATUSTEXT", \ 18 | 2, \ 19 | { { "severity", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_statustext_t, severity) }, \ 20 | { "text", NULL, MAVLINK_TYPE_CHAR, 50, 1, offsetof(mavlink_statustext_t, text) }, \ 21 | } \ 22 | } 23 | 24 | 25 | /** 26 | * @brief Pack a statustext message 27 | * @param system_id ID of this system 28 | * @param component_id ID of this component (e.g. 200 for IMU) 29 | * @param msg The MAVLink message to compress the data into 30 | * 31 | * @param severity Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY. 32 | * @param text Status text message, without null termination character 33 | * @return length of the message in bytes (excluding serial stream start sign) 34 | */ 35 | static inline uint16_t mavlink_msg_statustext_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, 36 | uint8_t severity, const char *text) 37 | { 38 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 39 | char buf[51]; 40 | _mav_put_uint8_t(buf, 0, severity); 41 | _mav_put_char_array(buf, 1, text, 50); 42 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 51); 43 | #else 44 | mavlink_statustext_t packet; 45 | packet.severity = severity; 46 | mav_array_memcpy(packet.text, text, sizeof(char)*50); 47 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 51); 48 | #endif 49 | 50 | msg->msgid = MAVLINK_MSG_ID_STATUSTEXT; 51 | return mavlink_finalize_message(msg, system_id, component_id, 51, 83); 52 | } 53 | 54 | /** 55 | * @brief Pack a statustext message on a channel 56 | * @param system_id ID of this system 57 | * @param component_id ID of this component (e.g. 200 for IMU) 58 | * @param chan The MAVLink channel this message was sent over 59 | * @param msg The MAVLink message to compress the data into 60 | * @param severity Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY. 61 | * @param text Status text message, without null termination character 62 | * @return length of the message in bytes (excluding serial stream start sign) 63 | */ 64 | static inline uint16_t mavlink_msg_statustext_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, 65 | mavlink_message_t* msg, 66 | uint8_t severity,const char *text) 67 | { 68 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 69 | char buf[51]; 70 | _mav_put_uint8_t(buf, 0, severity); 71 | _mav_put_char_array(buf, 1, text, 50); 72 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 51); 73 | #else 74 | mavlink_statustext_t packet; 75 | packet.severity = severity; 76 | mav_array_memcpy(packet.text, text, sizeof(char)*50); 77 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 51); 78 | #endif 79 | 80 | msg->msgid = MAVLINK_MSG_ID_STATUSTEXT; 81 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 51, 83); 82 | } 83 | 84 | /** 85 | * @brief Encode a statustext struct into a message 86 | * 87 | * @param system_id ID of this system 88 | * @param component_id ID of this component (e.g. 200 for IMU) 89 | * @param msg The MAVLink message to compress the data into 90 | * @param statustext C-struct to read the message contents from 91 | */ 92 | static inline uint16_t mavlink_msg_statustext_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_statustext_t* statustext) 93 | { 94 | return mavlink_msg_statustext_pack(system_id, component_id, msg, statustext->severity, statustext->text); 95 | } 96 | 97 | /** 98 | * @brief Send a statustext message 99 | * @param chan MAVLink channel to send the message 100 | * 101 | * @param severity Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY. 102 | * @param text Status text message, without null termination character 103 | */ 104 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS 105 | 106 | static inline void mavlink_msg_statustext_send(mavlink_channel_t chan, uint8_t severity, const char *text) 107 | { 108 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 109 | char buf[51]; 110 | _mav_put_uint8_t(buf, 0, severity); 111 | _mav_put_char_array(buf, 1, text, 50); 112 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, buf, 51, 83); 113 | #else 114 | mavlink_statustext_t packet; 115 | packet.severity = severity; 116 | mav_array_memcpy(packet.text, text, sizeof(char)*50); 117 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, (const char *)&packet, 51, 83); 118 | #endif 119 | } 120 | 121 | #endif 122 | 123 | // MESSAGE STATUSTEXT UNPACKING 124 | 125 | 126 | /** 127 | * @brief Get field severity from statustext message 128 | * 129 | * @return Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY. 130 | */ 131 | static inline uint8_t mavlink_msg_statustext_get_severity(const mavlink_message_t* msg) 132 | { 133 | return _MAV_RETURN_uint8_t(msg, 0); 134 | } 135 | 136 | /** 137 | * @brief Get field text from statustext message 138 | * 139 | * @return Status text message, without null termination character 140 | */ 141 | static inline uint16_t mavlink_msg_statustext_get_text(const mavlink_message_t* msg, char *text) 142 | { 143 | return _MAV_RETURN_char_array(msg, text, 50, 1); 144 | } 145 | 146 | /** 147 | * @brief Decode a statustext message into a struct 148 | * 149 | * @param msg The message to decode 150 | * @param statustext C-struct to decode the message contents into 151 | */ 152 | static inline void mavlink_msg_statustext_decode(const mavlink_message_t* msg, mavlink_statustext_t* statustext) 153 | { 154 | #if MAVLINK_NEED_BYTE_SWAP 155 | statustext->severity = mavlink_msg_statustext_get_severity(msg); 156 | mavlink_msg_statustext_get_text(msg, statustext->text); 157 | #else 158 | memcpy(statustext, _MAV_PAYLOAD(msg), 51); 159 | #endif 160 | } 161 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_wind.h: -------------------------------------------------------------------------------- 1 | // MESSAGE WIND PACKING 2 | 3 | #define MAVLINK_MSG_ID_WIND 168 4 | 5 | typedef struct __mavlink_wind_t 6 | { 7 | float direction; ///< wind direction (degrees) 8 | float speed; ///< wind speed in ground plane (m/s) 9 | float speed_z; ///< vertical wind speed (m/s) 10 | } mavlink_wind_t; 11 | 12 | #define MAVLINK_MSG_ID_WIND_LEN 12 13 | #define MAVLINK_MSG_ID_168_LEN 12 14 | 15 | 16 | 17 | #define MAVLINK_MESSAGE_INFO_WIND { \ 18 | "WIND", \ 19 | 3, \ 20 | { { "direction", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_wind_t, direction) }, \ 21 | { "speed", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_wind_t, speed) }, \ 22 | { "speed_z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_wind_t, speed_z) }, \ 23 | } \ 24 | } 25 | 26 | 27 | /** 28 | * @brief Pack a wind message 29 | * @param system_id ID of this system 30 | * @param component_id ID of this component (e.g. 200 for IMU) 31 | * @param msg The MAVLink message to compress the data into 32 | * 33 | * @param direction wind direction (degrees) 34 | * @param speed wind speed in ground plane (m/s) 35 | * @param speed_z vertical wind speed (m/s) 36 | * @return length of the message in bytes (excluding serial stream start sign) 37 | */ 38 | static inline uint16_t mavlink_msg_wind_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, 39 | float direction, float speed, float speed_z) 40 | { 41 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 42 | char buf[12]; 43 | _mav_put_float(buf, 0, direction); 44 | _mav_put_float(buf, 4, speed); 45 | _mav_put_float(buf, 8, speed_z); 46 | 47 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); 48 | #else 49 | mavlink_wind_t packet; 50 | packet.direction = direction; 51 | packet.speed = speed; 52 | packet.speed_z = speed_z; 53 | 54 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); 55 | #endif 56 | 57 | msg->msgid = MAVLINK_MSG_ID_WIND; 58 | return mavlink_finalize_message(msg, system_id, component_id, 12, 1); 59 | } 60 | 61 | /** 62 | * @brief Pack a wind message on a channel 63 | * @param system_id ID of this system 64 | * @param component_id ID of this component (e.g. 200 for IMU) 65 | * @param chan The MAVLink channel this message was sent over 66 | * @param msg The MAVLink message to compress the data into 67 | * @param direction wind direction (degrees) 68 | * @param speed wind speed in ground plane (m/s) 69 | * @param speed_z vertical wind speed (m/s) 70 | * @return length of the message in bytes (excluding serial stream start sign) 71 | */ 72 | static inline uint16_t mavlink_msg_wind_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, 73 | mavlink_message_t* msg, 74 | float direction,float speed,float speed_z) 75 | { 76 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 77 | char buf[12]; 78 | _mav_put_float(buf, 0, direction); 79 | _mav_put_float(buf, 4, speed); 80 | _mav_put_float(buf, 8, speed_z); 81 | 82 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); 83 | #else 84 | mavlink_wind_t packet; 85 | packet.direction = direction; 86 | packet.speed = speed; 87 | packet.speed_z = speed_z; 88 | 89 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); 90 | #endif 91 | 92 | msg->msgid = MAVLINK_MSG_ID_WIND; 93 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12, 1); 94 | } 95 | 96 | /** 97 | * @brief Encode a wind struct into a message 98 | * 99 | * @param system_id ID of this system 100 | * @param component_id ID of this component (e.g. 200 for IMU) 101 | * @param msg The MAVLink message to compress the data into 102 | * @param wind C-struct to read the message contents from 103 | */ 104 | static inline uint16_t mavlink_msg_wind_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_wind_t* wind) 105 | { 106 | return mavlink_msg_wind_pack(system_id, component_id, msg, wind->direction, wind->speed, wind->speed_z); 107 | } 108 | 109 | /** 110 | * @brief Send a wind message 111 | * @param chan MAVLink channel to send the message 112 | * 113 | * @param direction wind direction (degrees) 114 | * @param speed wind speed in ground plane (m/s) 115 | * @param speed_z vertical wind speed (m/s) 116 | */ 117 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS 118 | 119 | static inline void mavlink_msg_wind_send(mavlink_channel_t chan, float direction, float speed, float speed_z) 120 | { 121 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 122 | char buf[12]; 123 | _mav_put_float(buf, 0, direction); 124 | _mav_put_float(buf, 4, speed); 125 | _mav_put_float(buf, 8, speed_z); 126 | 127 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND, buf, 12, 1); 128 | #else 129 | mavlink_wind_t packet; 130 | packet.direction = direction; 131 | packet.speed = speed; 132 | packet.speed_z = speed_z; 133 | 134 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND, (const char *)&packet, 12, 1); 135 | #endif 136 | } 137 | 138 | #endif 139 | 140 | // MESSAGE WIND UNPACKING 141 | 142 | 143 | /** 144 | * @brief Get field direction from wind message 145 | * 146 | * @return wind direction (degrees) 147 | */ 148 | static inline float mavlink_msg_wind_get_direction(const mavlink_message_t* msg) 149 | { 150 | return _MAV_RETURN_float(msg, 0); 151 | } 152 | 153 | /** 154 | * @brief Get field speed from wind message 155 | * 156 | * @return wind speed in ground plane (m/s) 157 | */ 158 | static inline float mavlink_msg_wind_get_speed(const mavlink_message_t* msg) 159 | { 160 | return _MAV_RETURN_float(msg, 4); 161 | } 162 | 163 | /** 164 | * @brief Get field speed_z from wind message 165 | * 166 | * @return vertical wind speed (m/s) 167 | */ 168 | static inline float mavlink_msg_wind_get_speed_z(const mavlink_message_t* msg) 169 | { 170 | return _MAV_RETURN_float(msg, 8); 171 | } 172 | 173 | /** 174 | * @brief Decode a wind message into a struct 175 | * 176 | * @param msg The message to decode 177 | * @param wind C-struct to decode the message contents into 178 | */ 179 | static inline void mavlink_msg_wind_decode(const mavlink_message_t* msg, mavlink_wind_t* wind) 180 | { 181 | #if MAVLINK_NEED_BYTE_SWAP 182 | wind->direction = mavlink_msg_wind_get_direction(msg); 183 | wind->speed = mavlink_msg_wind_get_speed(msg); 184 | wind->speed_z = mavlink_msg_wind_get_speed_z(msg); 185 | #else 186 | memcpy(wind, _MAV_PAYLOAD(msg), 12); 187 | #endif 188 | } 189 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_request_list.h: -------------------------------------------------------------------------------- 1 | // MESSAGE MISSION_REQUEST_LIST PACKING 2 | 3 | #define MAVLINK_MSG_ID_MISSION_REQUEST_LIST 43 4 | 5 | typedef struct __mavlink_mission_request_list_t 6 | { 7 | uint8_t target_system; ///< System ID 8 | uint8_t target_component; ///< Component ID 9 | } mavlink_mission_request_list_t; 10 | 11 | #define MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN 2 12 | #define MAVLINK_MSG_ID_43_LEN 2 13 | 14 | 15 | 16 | #define MAVLINK_MESSAGE_INFO_MISSION_REQUEST_LIST { \ 17 | "MISSION_REQUEST_LIST", \ 18 | 2, \ 19 | { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mission_request_list_t, target_system) }, \ 20 | { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mission_request_list_t, target_component) }, \ 21 | } \ 22 | } 23 | 24 | 25 | /** 26 | * @brief Pack a mission_request_list message 27 | * @param system_id ID of this system 28 | * @param component_id ID of this component (e.g. 200 for IMU) 29 | * @param msg The MAVLink message to compress the data into 30 | * 31 | * @param target_system System ID 32 | * @param target_component Component ID 33 | * @return length of the message in bytes (excluding serial stream start sign) 34 | */ 35 | static inline uint16_t mavlink_msg_mission_request_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, 36 | uint8_t target_system, uint8_t target_component) 37 | { 38 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 39 | char buf[2]; 40 | _mav_put_uint8_t(buf, 0, target_system); 41 | _mav_put_uint8_t(buf, 1, target_component); 42 | 43 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); 44 | #else 45 | mavlink_mission_request_list_t packet; 46 | packet.target_system = target_system; 47 | packet.target_component = target_component; 48 | 49 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); 50 | #endif 51 | 52 | msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_LIST; 53 | return mavlink_finalize_message(msg, system_id, component_id, 2, 132); 54 | } 55 | 56 | /** 57 | * @brief Pack a mission_request_list message on a channel 58 | * @param system_id ID of this system 59 | * @param component_id ID of this component (e.g. 200 for IMU) 60 | * @param chan The MAVLink channel this message was sent over 61 | * @param msg The MAVLink message to compress the data into 62 | * @param target_system System ID 63 | * @param target_component Component ID 64 | * @return length of the message in bytes (excluding serial stream start sign) 65 | */ 66 | static inline uint16_t mavlink_msg_mission_request_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, 67 | mavlink_message_t* msg, 68 | uint8_t target_system,uint8_t target_component) 69 | { 70 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 71 | char buf[2]; 72 | _mav_put_uint8_t(buf, 0, target_system); 73 | _mav_put_uint8_t(buf, 1, target_component); 74 | 75 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2); 76 | #else 77 | mavlink_mission_request_list_t packet; 78 | packet.target_system = target_system; 79 | packet.target_component = target_component; 80 | 81 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2); 82 | #endif 83 | 84 | msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_LIST; 85 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 2, 132); 86 | } 87 | 88 | /** 89 | * @brief Encode a mission_request_list struct into a message 90 | * 91 | * @param system_id ID of this system 92 | * @param component_id ID of this component (e.g. 200 for IMU) 93 | * @param msg The MAVLink message to compress the data into 94 | * @param mission_request_list C-struct to read the message contents from 95 | */ 96 | static inline uint16_t mavlink_msg_mission_request_list_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_request_list_t* mission_request_list) 97 | { 98 | return mavlink_msg_mission_request_list_pack(system_id, component_id, msg, mission_request_list->target_system, mission_request_list->target_component); 99 | } 100 | 101 | /** 102 | * @brief Send a mission_request_list message 103 | * @param chan MAVLink channel to send the message 104 | * 105 | * @param target_system System ID 106 | * @param target_component Component ID 107 | */ 108 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS 109 | 110 | static inline void mavlink_msg_mission_request_list_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component) 111 | { 112 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 113 | char buf[2]; 114 | _mav_put_uint8_t(buf, 0, target_system); 115 | _mav_put_uint8_t(buf, 1, target_component); 116 | 117 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, buf, 2, 132); 118 | #else 119 | mavlink_mission_request_list_t packet; 120 | packet.target_system = target_system; 121 | packet.target_component = target_component; 122 | 123 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, (const char *)&packet, 2, 132); 124 | #endif 125 | } 126 | 127 | #endif 128 | 129 | // MESSAGE MISSION_REQUEST_LIST UNPACKING 130 | 131 | 132 | /** 133 | * @brief Get field target_system from mission_request_list message 134 | * 135 | * @return System ID 136 | */ 137 | static inline uint8_t mavlink_msg_mission_request_list_get_target_system(const mavlink_message_t* msg) 138 | { 139 | return _MAV_RETURN_uint8_t(msg, 0); 140 | } 141 | 142 | /** 143 | * @brief Get field target_component from mission_request_list message 144 | * 145 | * @return Component ID 146 | */ 147 | static inline uint8_t mavlink_msg_mission_request_list_get_target_component(const mavlink_message_t* msg) 148 | { 149 | return _MAV_RETURN_uint8_t(msg, 1); 150 | } 151 | 152 | /** 153 | * @brief Decode a mission_request_list message into a struct 154 | * 155 | * @param msg The message to decode 156 | * @param mission_request_list C-struct to decode the message contents into 157 | */ 158 | static inline void mavlink_msg_mission_request_list_decode(const mavlink_message_t* msg, mavlink_mission_request_list_t* mission_request_list) 159 | { 160 | #if MAVLINK_NEED_BYTE_SWAP 161 | mission_request_list->target_system = mavlink_msg_mission_request_list_get_target_system(msg); 162 | mission_request_list->target_component = mavlink_msg_mission_request_list_get_target_component(msg); 163 | #else 164 | memcpy(mission_request_list, _MAV_PAYLOAD(msg), 2); 165 | #endif 166 | } 167 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_debug.h: -------------------------------------------------------------------------------- 1 | // MESSAGE DEBUG PACKING 2 | 3 | #define MAVLINK_MSG_ID_DEBUG 254 4 | 5 | typedef struct __mavlink_debug_t 6 | { 7 | uint32_t time_boot_ms; ///< Timestamp (milliseconds since system boot) 8 | float value; ///< DEBUG value 9 | uint8_t ind; ///< index of debug variable 10 | } mavlink_debug_t; 11 | 12 | #define MAVLINK_MSG_ID_DEBUG_LEN 9 13 | #define MAVLINK_MSG_ID_254_LEN 9 14 | 15 | 16 | 17 | #define MAVLINK_MESSAGE_INFO_DEBUG { \ 18 | "DEBUG", \ 19 | 3, \ 20 | { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_debug_t, time_boot_ms) }, \ 21 | { "value", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_debug_t, value) }, \ 22 | { "ind", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_debug_t, ind) }, \ 23 | } \ 24 | } 25 | 26 | 27 | /** 28 | * @brief Pack a debug message 29 | * @param system_id ID of this system 30 | * @param component_id ID of this component (e.g. 200 for IMU) 31 | * @param msg The MAVLink message to compress the data into 32 | * 33 | * @param time_boot_ms Timestamp (milliseconds since system boot) 34 | * @param ind index of debug variable 35 | * @param value DEBUG value 36 | * @return length of the message in bytes (excluding serial stream start sign) 37 | */ 38 | static inline uint16_t mavlink_msg_debug_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, 39 | uint32_t time_boot_ms, uint8_t ind, float value) 40 | { 41 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 42 | char buf[9]; 43 | _mav_put_uint32_t(buf, 0, time_boot_ms); 44 | _mav_put_float(buf, 4, value); 45 | _mav_put_uint8_t(buf, 8, ind); 46 | 47 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9); 48 | #else 49 | mavlink_debug_t packet; 50 | packet.time_boot_ms = time_boot_ms; 51 | packet.value = value; 52 | packet.ind = ind; 53 | 54 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9); 55 | #endif 56 | 57 | msg->msgid = MAVLINK_MSG_ID_DEBUG; 58 | return mavlink_finalize_message(msg, system_id, component_id, 9, 46); 59 | } 60 | 61 | /** 62 | * @brief Pack a debug message on a channel 63 | * @param system_id ID of this system 64 | * @param component_id ID of this component (e.g. 200 for IMU) 65 | * @param chan The MAVLink channel this message was sent over 66 | * @param msg The MAVLink message to compress the data into 67 | * @param time_boot_ms Timestamp (milliseconds since system boot) 68 | * @param ind index of debug variable 69 | * @param value DEBUG value 70 | * @return length of the message in bytes (excluding serial stream start sign) 71 | */ 72 | static inline uint16_t mavlink_msg_debug_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, 73 | mavlink_message_t* msg, 74 | uint32_t time_boot_ms,uint8_t ind,float value) 75 | { 76 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 77 | char buf[9]; 78 | _mav_put_uint32_t(buf, 0, time_boot_ms); 79 | _mav_put_float(buf, 4, value); 80 | _mav_put_uint8_t(buf, 8, ind); 81 | 82 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 9); 83 | #else 84 | mavlink_debug_t packet; 85 | packet.time_boot_ms = time_boot_ms; 86 | packet.value = value; 87 | packet.ind = ind; 88 | 89 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 9); 90 | #endif 91 | 92 | msg->msgid = MAVLINK_MSG_ID_DEBUG; 93 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 9, 46); 94 | } 95 | 96 | /** 97 | * @brief Encode a debug struct into a message 98 | * 99 | * @param system_id ID of this system 100 | * @param component_id ID of this component (e.g. 200 for IMU) 101 | * @param msg The MAVLink message to compress the data into 102 | * @param debug C-struct to read the message contents from 103 | */ 104 | static inline uint16_t mavlink_msg_debug_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_debug_t* debug) 105 | { 106 | return mavlink_msg_debug_pack(system_id, component_id, msg, debug->time_boot_ms, debug->ind, debug->value); 107 | } 108 | 109 | /** 110 | * @brief Send a debug message 111 | * @param chan MAVLink channel to send the message 112 | * 113 | * @param time_boot_ms Timestamp (milliseconds since system boot) 114 | * @param ind index of debug variable 115 | * @param value DEBUG value 116 | */ 117 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS 118 | 119 | static inline void mavlink_msg_debug_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t ind, float value) 120 | { 121 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 122 | char buf[9]; 123 | _mav_put_uint32_t(buf, 0, time_boot_ms); 124 | _mav_put_float(buf, 4, value); 125 | _mav_put_uint8_t(buf, 8, ind); 126 | 127 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, buf, 9, 46); 128 | #else 129 | mavlink_debug_t packet; 130 | packet.time_boot_ms = time_boot_ms; 131 | packet.value = value; 132 | packet.ind = ind; 133 | 134 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEBUG, (const char *)&packet, 9, 46); 135 | #endif 136 | } 137 | 138 | #endif 139 | 140 | // MESSAGE DEBUG UNPACKING 141 | 142 | 143 | /** 144 | * @brief Get field time_boot_ms from debug message 145 | * 146 | * @return Timestamp (milliseconds since system boot) 147 | */ 148 | static inline uint32_t mavlink_msg_debug_get_time_boot_ms(const mavlink_message_t* msg) 149 | { 150 | return _MAV_RETURN_uint32_t(msg, 0); 151 | } 152 | 153 | /** 154 | * @brief Get field ind from debug message 155 | * 156 | * @return index of debug variable 157 | */ 158 | static inline uint8_t mavlink_msg_debug_get_ind(const mavlink_message_t* msg) 159 | { 160 | return _MAV_RETURN_uint8_t(msg, 8); 161 | } 162 | 163 | /** 164 | * @brief Get field value from debug message 165 | * 166 | * @return DEBUG value 167 | */ 168 | static inline float mavlink_msg_debug_get_value(const mavlink_message_t* msg) 169 | { 170 | return _MAV_RETURN_float(msg, 4); 171 | } 172 | 173 | /** 174 | * @brief Decode a debug message into a struct 175 | * 176 | * @param msg The message to decode 177 | * @param debug C-struct to decode the message contents into 178 | */ 179 | static inline void mavlink_msg_debug_decode(const mavlink_message_t* msg, mavlink_debug_t* debug) 180 | { 181 | #if MAVLINK_NEED_BYTE_SWAP 182 | debug->time_boot_ms = mavlink_msg_debug_get_time_boot_ms(msg); 183 | debug->value = mavlink_msg_debug_get_value(msg); 184 | debug->ind = mavlink_msg_debug_get_ind(msg); 185 | #else 186 | memcpy(debug, _MAV_PAYLOAD(msg), 9); 187 | #endif 188 | } 189 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_system_time.h: -------------------------------------------------------------------------------- 1 | // MESSAGE SYSTEM_TIME PACKING 2 | 3 | #define MAVLINK_MSG_ID_SYSTEM_TIME 2 4 | 5 | typedef struct __mavlink_system_time_t 6 | { 7 | uint64_t time_unix_usec; ///< Timestamp of the master clock in microseconds since UNIX epoch. 8 | uint32_t time_boot_ms; ///< Timestamp of the component clock since boot time in milliseconds. 9 | } mavlink_system_time_t; 10 | 11 | #define MAVLINK_MSG_ID_SYSTEM_TIME_LEN 12 12 | #define MAVLINK_MSG_ID_2_LEN 12 13 | 14 | 15 | 16 | #define MAVLINK_MESSAGE_INFO_SYSTEM_TIME { \ 17 | "SYSTEM_TIME", \ 18 | 2, \ 19 | { { "time_unix_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_system_time_t, time_unix_usec) }, \ 20 | { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_system_time_t, time_boot_ms) }, \ 21 | } \ 22 | } 23 | 24 | 25 | /** 26 | * @brief Pack a system_time message 27 | * @param system_id ID of this system 28 | * @param component_id ID of this component (e.g. 200 for IMU) 29 | * @param msg The MAVLink message to compress the data into 30 | * 31 | * @param time_unix_usec Timestamp of the master clock in microseconds since UNIX epoch. 32 | * @param time_boot_ms Timestamp of the component clock since boot time in milliseconds. 33 | * @return length of the message in bytes (excluding serial stream start sign) 34 | */ 35 | static inline uint16_t mavlink_msg_system_time_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, 36 | uint64_t time_unix_usec, uint32_t time_boot_ms) 37 | { 38 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 39 | char buf[12]; 40 | _mav_put_uint64_t(buf, 0, time_unix_usec); 41 | _mav_put_uint32_t(buf, 8, time_boot_ms); 42 | 43 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); 44 | #else 45 | mavlink_system_time_t packet; 46 | packet.time_unix_usec = time_unix_usec; 47 | packet.time_boot_ms = time_boot_ms; 48 | 49 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); 50 | #endif 51 | 52 | msg->msgid = MAVLINK_MSG_ID_SYSTEM_TIME; 53 | return mavlink_finalize_message(msg, system_id, component_id, 12, 137); 54 | } 55 | 56 | /** 57 | * @brief Pack a system_time message on a channel 58 | * @param system_id ID of this system 59 | * @param component_id ID of this component (e.g. 200 for IMU) 60 | * @param chan The MAVLink channel this message was sent over 61 | * @param msg The MAVLink message to compress the data into 62 | * @param time_unix_usec Timestamp of the master clock in microseconds since UNIX epoch. 63 | * @param time_boot_ms Timestamp of the component clock since boot time in milliseconds. 64 | * @return length of the message in bytes (excluding serial stream start sign) 65 | */ 66 | static inline uint16_t mavlink_msg_system_time_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, 67 | mavlink_message_t* msg, 68 | uint64_t time_unix_usec,uint32_t time_boot_ms) 69 | { 70 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 71 | char buf[12]; 72 | _mav_put_uint64_t(buf, 0, time_unix_usec); 73 | _mav_put_uint32_t(buf, 8, time_boot_ms); 74 | 75 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); 76 | #else 77 | mavlink_system_time_t packet; 78 | packet.time_unix_usec = time_unix_usec; 79 | packet.time_boot_ms = time_boot_ms; 80 | 81 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); 82 | #endif 83 | 84 | msg->msgid = MAVLINK_MSG_ID_SYSTEM_TIME; 85 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12, 137); 86 | } 87 | 88 | /** 89 | * @brief Encode a system_time struct into a message 90 | * 91 | * @param system_id ID of this system 92 | * @param component_id ID of this component (e.g. 200 for IMU) 93 | * @param msg The MAVLink message to compress the data into 94 | * @param system_time C-struct to read the message contents from 95 | */ 96 | static inline uint16_t mavlink_msg_system_time_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_system_time_t* system_time) 97 | { 98 | return mavlink_msg_system_time_pack(system_id, component_id, msg, system_time->time_unix_usec, system_time->time_boot_ms); 99 | } 100 | 101 | /** 102 | * @brief Send a system_time message 103 | * @param chan MAVLink channel to send the message 104 | * 105 | * @param time_unix_usec Timestamp of the master clock in microseconds since UNIX epoch. 106 | * @param time_boot_ms Timestamp of the component clock since boot time in milliseconds. 107 | */ 108 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS 109 | 110 | static inline void mavlink_msg_system_time_send(mavlink_channel_t chan, uint64_t time_unix_usec, uint32_t time_boot_ms) 111 | { 112 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 113 | char buf[12]; 114 | _mav_put_uint64_t(buf, 0, time_unix_usec); 115 | _mav_put_uint32_t(buf, 8, time_boot_ms); 116 | 117 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, buf, 12, 137); 118 | #else 119 | mavlink_system_time_t packet; 120 | packet.time_unix_usec = time_unix_usec; 121 | packet.time_boot_ms = time_boot_ms; 122 | 123 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME, (const char *)&packet, 12, 137); 124 | #endif 125 | } 126 | 127 | #endif 128 | 129 | // MESSAGE SYSTEM_TIME UNPACKING 130 | 131 | 132 | /** 133 | * @brief Get field time_unix_usec from system_time message 134 | * 135 | * @return Timestamp of the master clock in microseconds since UNIX epoch. 136 | */ 137 | static inline uint64_t mavlink_msg_system_time_get_time_unix_usec(const mavlink_message_t* msg) 138 | { 139 | return _MAV_RETURN_uint64_t(msg, 0); 140 | } 141 | 142 | /** 143 | * @brief Get field time_boot_ms from system_time message 144 | * 145 | * @return Timestamp of the component clock since boot time in milliseconds. 146 | */ 147 | static inline uint32_t mavlink_msg_system_time_get_time_boot_ms(const mavlink_message_t* msg) 148 | { 149 | return _MAV_RETURN_uint32_t(msg, 8); 150 | } 151 | 152 | /** 153 | * @brief Decode a system_time message into a struct 154 | * 155 | * @param msg The message to decode 156 | * @param system_time C-struct to decode the message contents into 157 | */ 158 | static inline void mavlink_msg_system_time_decode(const mavlink_message_t* msg, mavlink_system_time_t* system_time) 159 | { 160 | #if MAVLINK_NEED_BYTE_SWAP 161 | system_time->time_unix_usec = mavlink_msg_system_time_get_time_unix_usec(msg); 162 | system_time->time_boot_ms = mavlink_msg_system_time_get_time_boot_ms(msg); 163 | #else 164 | memcpy(system_time, _MAV_PAYLOAD(msg), 12); 165 | #endif 166 | } 167 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/include/mavlink/v1.0/mavlink_types.h: -------------------------------------------------------------------------------- 1 | #ifndef MAVLINK_TYPES_H_ 2 | #define MAVLINK_TYPES_H_ 3 | 4 | #include 5 | 6 | #ifndef MAVLINK_MAX_PAYLOAD_LEN 7 | // it is possible to override this, but be careful! 8 | #define MAVLINK_MAX_PAYLOAD_LEN 255 ///< Maximum payload length 9 | #endif 10 | 11 | #define MAVLINK_CORE_HEADER_LEN 5 ///< Length of core header (of the comm. layer): message length (1 byte) + message sequence (1 byte) + message system id (1 byte) + message component id (1 byte) + message type id (1 byte) 12 | #define MAVLINK_NUM_HEADER_BYTES (MAVLINK_CORE_HEADER_LEN + 1) ///< Length of all header bytes, including core and checksum 13 | #define MAVLINK_NUM_CHECKSUM_BYTES 2 14 | #define MAVLINK_NUM_NON_PAYLOAD_BYTES (MAVLINK_NUM_HEADER_BYTES + MAVLINK_NUM_CHECKSUM_BYTES) 15 | 16 | #define MAVLINK_MAX_PACKET_LEN (MAVLINK_MAX_PAYLOAD_LEN + MAVLINK_NUM_NON_PAYLOAD_BYTES) ///< Maximum packet length 17 | 18 | #define MAVLINK_MSG_ID_EXTENDED_MESSAGE 255 19 | #define MAVLINK_EXTENDED_HEADER_LEN 14 20 | 21 | #if (defined _MSC_VER) | ((defined __APPLE__) & (defined __MACH__)) | (defined __linux__) 22 | /* full fledged 32bit++ OS */ 23 | #define MAVLINK_MAX_EXTENDED_PACKET_LEN 65507 24 | #else 25 | /* small microcontrollers */ 26 | #define MAVLINK_MAX_EXTENDED_PACKET_LEN 2048 27 | #endif 28 | 29 | #define MAVLINK_MAX_EXTENDED_PAYLOAD_LEN (MAVLINK_MAX_EXTENDED_PACKET_LEN - MAVLINK_EXTENDED_HEADER_LEN - MAVLINK_NUM_NON_PAYLOAD_BYTES) 30 | 31 | typedef struct param_union { 32 | union { 33 | float param_float; 34 | int32_t param_int32; 35 | uint32_t param_uint32; 36 | uint8_t param_uint8; 37 | uint8_t bytes[4]; 38 | }; 39 | uint8_t type; 40 | } mavlink_param_union_t; 41 | 42 | typedef struct __mavlink_system { 43 | uint8_t sysid; ///< Used by the MAVLink message_xx_send() convenience function 44 | uint8_t compid; ///< Used by the MAVLink message_xx_send() convenience function 45 | uint8_t type; ///< Unused, can be used by user to store the system's type 46 | uint8_t state; ///< Unused, can be used by user to store the system's state 47 | uint8_t mode; ///< Unused, can be used by user to store the system's mode 48 | uint8_t nav_mode; ///< Unused, can be used by user to store the system's navigation mode 49 | } mavlink_system_t; 50 | 51 | typedef struct __mavlink_message { 52 | uint16_t checksum; /// sent at end of packet 53 | uint8_t magic; ///< protocol magic marker 54 | uint8_t len; ///< Length of payload 55 | uint8_t seq; ///< Sequence of packet 56 | uint8_t sysid; ///< ID of message sender system/aircraft 57 | uint8_t compid; ///< ID of the message sender component 58 | uint8_t msgid; ///< ID of message in payload 59 | uint64_t payload64[(MAVLINK_MAX_PAYLOAD_LEN+MAVLINK_NUM_CHECKSUM_BYTES+7)/8]; 60 | } mavlink_message_t; 61 | 62 | 63 | typedef struct __mavlink_extended_message { 64 | mavlink_message_t base_msg; 65 | int32_t extended_payload_len; ///< Length of extended payload if any 66 | uint8_t extended_payload[MAVLINK_MAX_EXTENDED_PAYLOAD_LEN]; 67 | } mavlink_extended_message_t; 68 | 69 | 70 | typedef enum { 71 | MAVLINK_TYPE_CHAR = 0, 72 | MAVLINK_TYPE_UINT8_T = 1, 73 | MAVLINK_TYPE_INT8_T = 2, 74 | MAVLINK_TYPE_UINT16_T = 3, 75 | MAVLINK_TYPE_INT16_T = 4, 76 | MAVLINK_TYPE_UINT32_T = 5, 77 | MAVLINK_TYPE_INT32_T = 6, 78 | MAVLINK_TYPE_UINT64_T = 7, 79 | MAVLINK_TYPE_INT64_T = 8, 80 | MAVLINK_TYPE_FLOAT = 9, 81 | MAVLINK_TYPE_DOUBLE = 10 82 | } mavlink_message_type_t; 83 | 84 | #define MAVLINK_MAX_FIELDS 64 85 | 86 | typedef struct __mavlink_field_info { 87 | const char *name; // name of this field 88 | const char *print_format; // printing format hint, or NULL 89 | mavlink_message_type_t type; // type of this field 90 | unsigned int array_length; // if non-zero, field is an array 91 | unsigned int wire_offset; // offset of each field in the payload 92 | unsigned int structure_offset; // offset in a C structure 93 | } mavlink_field_info_t; 94 | 95 | // note that in this structure the order of fields is the order 96 | // in the XML file, not necessary the wire order 97 | typedef struct __mavlink_message_info { 98 | const char *name; // name of the message 99 | unsigned num_fields; // how many fields in this message 100 | mavlink_field_info_t fields[MAVLINK_MAX_FIELDS]; // field information 101 | } mavlink_message_info_t; 102 | 103 | #define _MAV_PAYLOAD(msg) ((const char *)(&((msg)->payload64[0]))) 104 | #define _MAV_PAYLOAD_NON_CONST(msg) ((char *)(&((msg)->payload64[0]))) 105 | 106 | // checksum is immediately after the payload bytes 107 | #define mavlink_ck_a(msg) *((msg)->len + (uint8_t *)_MAV_PAYLOAD_NON_CONST(msg)) 108 | #define mavlink_ck_b(msg) *(((msg)->len+(uint16_t)1) + (uint8_t *)_MAV_PAYLOAD_NON_CONST(msg)) 109 | 110 | typedef enum { 111 | MAVLINK_COMM_0, 112 | MAVLINK_COMM_1, 113 | MAVLINK_COMM_2, 114 | MAVLINK_COMM_3 115 | } mavlink_channel_t; 116 | 117 | /* 118 | * applications can set MAVLINK_COMM_NUM_BUFFERS to the maximum number 119 | * of buffers they will use. If more are used, then the result will be 120 | * a stack overrun 121 | */ 122 | #ifndef MAVLINK_COMM_NUM_BUFFERS 123 | #if (defined linux) | (defined __linux) | (defined __MACH__) | (defined _WIN32) 124 | # define MAVLINK_COMM_NUM_BUFFERS 16 125 | #else 126 | # define MAVLINK_COMM_NUM_BUFFERS 4 127 | #endif 128 | #endif 129 | 130 | typedef enum { 131 | MAVLINK_PARSE_STATE_UNINIT=0, 132 | MAVLINK_PARSE_STATE_IDLE, 133 | MAVLINK_PARSE_STATE_GOT_STX, 134 | MAVLINK_PARSE_STATE_GOT_SEQ, 135 | MAVLINK_PARSE_STATE_GOT_LENGTH, 136 | MAVLINK_PARSE_STATE_GOT_SYSID, 137 | MAVLINK_PARSE_STATE_GOT_COMPID, 138 | MAVLINK_PARSE_STATE_GOT_MSGID, 139 | MAVLINK_PARSE_STATE_GOT_PAYLOAD, 140 | MAVLINK_PARSE_STATE_GOT_CRC1 141 | } mavlink_parse_state_t; ///< The state machine for the comm parser 142 | 143 | typedef struct __mavlink_status { 144 | uint8_t msg_received; ///< Number of received messages 145 | uint8_t buffer_overrun; ///< Number of buffer overruns 146 | uint8_t parse_error; ///< Number of parse errors 147 | mavlink_parse_state_t parse_state; ///< Parsing state machine 148 | uint8_t packet_idx; ///< Index in current packet 149 | uint8_t current_rx_seq; ///< Sequence number of last packet received 150 | uint8_t current_tx_seq; ///< Sequence number of last packet sent 151 | uint16_t packet_rx_success_count; ///< Received packets 152 | uint16_t packet_rx_drop_count; ///< Number of packet drops 153 | } mavlink_status_t; 154 | 155 | #define MAVLINK_BIG_ENDIAN 0 156 | #define MAVLINK_LITTLE_ENDIAN 1 157 | 158 | #endif /* MAVLINK_TYPES_H_ */ 159 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_ack.h: -------------------------------------------------------------------------------- 1 | // MESSAGE MISSION_ACK PACKING 2 | 3 | #define MAVLINK_MSG_ID_MISSION_ACK 47 4 | 5 | typedef struct __mavlink_mission_ack_t 6 | { 7 | uint8_t target_system; ///< System ID 8 | uint8_t target_component; ///< Component ID 9 | uint8_t type; ///< See MAV_MISSION_RESULT enum 10 | } mavlink_mission_ack_t; 11 | 12 | #define MAVLINK_MSG_ID_MISSION_ACK_LEN 3 13 | #define MAVLINK_MSG_ID_47_LEN 3 14 | 15 | 16 | 17 | #define MAVLINK_MESSAGE_INFO_MISSION_ACK { \ 18 | "MISSION_ACK", \ 19 | 3, \ 20 | { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mission_ack_t, target_system) }, \ 21 | { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mission_ack_t, target_component) }, \ 22 | { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_ack_t, type) }, \ 23 | } \ 24 | } 25 | 26 | 27 | /** 28 | * @brief Pack a mission_ack message 29 | * @param system_id ID of this system 30 | * @param component_id ID of this component (e.g. 200 for IMU) 31 | * @param msg The MAVLink message to compress the data into 32 | * 33 | * @param target_system System ID 34 | * @param target_component Component ID 35 | * @param type See MAV_MISSION_RESULT enum 36 | * @return length of the message in bytes (excluding serial stream start sign) 37 | */ 38 | static inline uint16_t mavlink_msg_mission_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, 39 | uint8_t target_system, uint8_t target_component, uint8_t type) 40 | { 41 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 42 | char buf[3]; 43 | _mav_put_uint8_t(buf, 0, target_system); 44 | _mav_put_uint8_t(buf, 1, target_component); 45 | _mav_put_uint8_t(buf, 2, type); 46 | 47 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); 48 | #else 49 | mavlink_mission_ack_t packet; 50 | packet.target_system = target_system; 51 | packet.target_component = target_component; 52 | packet.type = type; 53 | 54 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); 55 | #endif 56 | 57 | msg->msgid = MAVLINK_MSG_ID_MISSION_ACK; 58 | return mavlink_finalize_message(msg, system_id, component_id, 3, 153); 59 | } 60 | 61 | /** 62 | * @brief Pack a mission_ack message on a channel 63 | * @param system_id ID of this system 64 | * @param component_id ID of this component (e.g. 200 for IMU) 65 | * @param chan The MAVLink channel this message was sent over 66 | * @param msg The MAVLink message to compress the data into 67 | * @param target_system System ID 68 | * @param target_component Component ID 69 | * @param type See MAV_MISSION_RESULT enum 70 | * @return length of the message in bytes (excluding serial stream start sign) 71 | */ 72 | static inline uint16_t mavlink_msg_mission_ack_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, 73 | mavlink_message_t* msg, 74 | uint8_t target_system,uint8_t target_component,uint8_t type) 75 | { 76 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 77 | char buf[3]; 78 | _mav_put_uint8_t(buf, 0, target_system); 79 | _mav_put_uint8_t(buf, 1, target_component); 80 | _mav_put_uint8_t(buf, 2, type); 81 | 82 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); 83 | #else 84 | mavlink_mission_ack_t packet; 85 | packet.target_system = target_system; 86 | packet.target_component = target_component; 87 | packet.type = type; 88 | 89 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); 90 | #endif 91 | 92 | msg->msgid = MAVLINK_MSG_ID_MISSION_ACK; 93 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3, 153); 94 | } 95 | 96 | /** 97 | * @brief Encode a mission_ack struct into a message 98 | * 99 | * @param system_id ID of this system 100 | * @param component_id ID of this component (e.g. 200 for IMU) 101 | * @param msg The MAVLink message to compress the data into 102 | * @param mission_ack C-struct to read the message contents from 103 | */ 104 | static inline uint16_t mavlink_msg_mission_ack_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_ack_t* mission_ack) 105 | { 106 | return mavlink_msg_mission_ack_pack(system_id, component_id, msg, mission_ack->target_system, mission_ack->target_component, mission_ack->type); 107 | } 108 | 109 | /** 110 | * @brief Send a mission_ack message 111 | * @param chan MAVLink channel to send the message 112 | * 113 | * @param target_system System ID 114 | * @param target_component Component ID 115 | * @param type See MAV_MISSION_RESULT enum 116 | */ 117 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS 118 | 119 | static inline void mavlink_msg_mission_ack_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t type) 120 | { 121 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 122 | char buf[3]; 123 | _mav_put_uint8_t(buf, 0, target_system); 124 | _mav_put_uint8_t(buf, 1, target_component); 125 | _mav_put_uint8_t(buf, 2, type); 126 | 127 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, buf, 3, 153); 128 | #else 129 | mavlink_mission_ack_t packet; 130 | packet.target_system = target_system; 131 | packet.target_component = target_component; 132 | packet.type = type; 133 | 134 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ACK, (const char *)&packet, 3, 153); 135 | #endif 136 | } 137 | 138 | #endif 139 | 140 | // MESSAGE MISSION_ACK UNPACKING 141 | 142 | 143 | /** 144 | * @brief Get field target_system from mission_ack message 145 | * 146 | * @return System ID 147 | */ 148 | static inline uint8_t mavlink_msg_mission_ack_get_target_system(const mavlink_message_t* msg) 149 | { 150 | return _MAV_RETURN_uint8_t(msg, 0); 151 | } 152 | 153 | /** 154 | * @brief Get field target_component from mission_ack message 155 | * 156 | * @return Component ID 157 | */ 158 | static inline uint8_t mavlink_msg_mission_ack_get_target_component(const mavlink_message_t* msg) 159 | { 160 | return _MAV_RETURN_uint8_t(msg, 1); 161 | } 162 | 163 | /** 164 | * @brief Get field type from mission_ack message 165 | * 166 | * @return See MAV_MISSION_RESULT enum 167 | */ 168 | static inline uint8_t mavlink_msg_mission_ack_get_type(const mavlink_message_t* msg) 169 | { 170 | return _MAV_RETURN_uint8_t(msg, 2); 171 | } 172 | 173 | /** 174 | * @brief Decode a mission_ack message into a struct 175 | * 176 | * @param msg The message to decode 177 | * @param mission_ack C-struct to decode the message contents into 178 | */ 179 | static inline void mavlink_msg_mission_ack_decode(const mavlink_message_t* msg, mavlink_mission_ack_t* mission_ack) 180 | { 181 | #if MAVLINK_NEED_BYTE_SWAP 182 | mission_ack->target_system = mavlink_msg_mission_ack_get_target_system(msg); 183 | mission_ack->target_component = mavlink_msg_mission_ack_get_target_component(msg); 184 | mission_ack->type = mavlink_msg_mission_ack_get_type(msg); 185 | #else 186 | memcpy(mission_ack, _MAV_PAYLOAD(msg), 3); 187 | #endif 188 | } 189 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_request.h: -------------------------------------------------------------------------------- 1 | // MESSAGE MISSION_REQUEST PACKING 2 | 3 | #define MAVLINK_MSG_ID_MISSION_REQUEST 40 4 | 5 | typedef struct __mavlink_mission_request_t 6 | { 7 | uint16_t seq; ///< Sequence 8 | uint8_t target_system; ///< System ID 9 | uint8_t target_component; ///< Component ID 10 | } mavlink_mission_request_t; 11 | 12 | #define MAVLINK_MSG_ID_MISSION_REQUEST_LEN 4 13 | #define MAVLINK_MSG_ID_40_LEN 4 14 | 15 | 16 | 17 | #define MAVLINK_MESSAGE_INFO_MISSION_REQUEST { \ 18 | "MISSION_REQUEST", \ 19 | 3, \ 20 | { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_request_t, seq) }, \ 21 | { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_request_t, target_system) }, \ 22 | { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_request_t, target_component) }, \ 23 | } \ 24 | } 25 | 26 | 27 | /** 28 | * @brief Pack a mission_request message 29 | * @param system_id ID of this system 30 | * @param component_id ID of this component (e.g. 200 for IMU) 31 | * @param msg The MAVLink message to compress the data into 32 | * 33 | * @param target_system System ID 34 | * @param target_component Component ID 35 | * @param seq Sequence 36 | * @return length of the message in bytes (excluding serial stream start sign) 37 | */ 38 | static inline uint16_t mavlink_msg_mission_request_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, 39 | uint8_t target_system, uint8_t target_component, uint16_t seq) 40 | { 41 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 42 | char buf[4]; 43 | _mav_put_uint16_t(buf, 0, seq); 44 | _mav_put_uint8_t(buf, 2, target_system); 45 | _mav_put_uint8_t(buf, 3, target_component); 46 | 47 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); 48 | #else 49 | mavlink_mission_request_t packet; 50 | packet.seq = seq; 51 | packet.target_system = target_system; 52 | packet.target_component = target_component; 53 | 54 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); 55 | #endif 56 | 57 | msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST; 58 | return mavlink_finalize_message(msg, system_id, component_id, 4, 230); 59 | } 60 | 61 | /** 62 | * @brief Pack a mission_request message on a channel 63 | * @param system_id ID of this system 64 | * @param component_id ID of this component (e.g. 200 for IMU) 65 | * @param chan The MAVLink channel this message was sent over 66 | * @param msg The MAVLink message to compress the data into 67 | * @param target_system System ID 68 | * @param target_component Component ID 69 | * @param seq Sequence 70 | * @return length of the message in bytes (excluding serial stream start sign) 71 | */ 72 | static inline uint16_t mavlink_msg_mission_request_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, 73 | mavlink_message_t* msg, 74 | uint8_t target_system,uint8_t target_component,uint16_t seq) 75 | { 76 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 77 | char buf[4]; 78 | _mav_put_uint16_t(buf, 0, seq); 79 | _mav_put_uint8_t(buf, 2, target_system); 80 | _mav_put_uint8_t(buf, 3, target_component); 81 | 82 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); 83 | #else 84 | mavlink_mission_request_t packet; 85 | packet.seq = seq; 86 | packet.target_system = target_system; 87 | packet.target_component = target_component; 88 | 89 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); 90 | #endif 91 | 92 | msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST; 93 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4, 230); 94 | } 95 | 96 | /** 97 | * @brief Encode a mission_request struct into a message 98 | * 99 | * @param system_id ID of this system 100 | * @param component_id ID of this component (e.g. 200 for IMU) 101 | * @param msg The MAVLink message to compress the data into 102 | * @param mission_request C-struct to read the message contents from 103 | */ 104 | static inline uint16_t mavlink_msg_mission_request_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_request_t* mission_request) 105 | { 106 | return mavlink_msg_mission_request_pack(system_id, component_id, msg, mission_request->target_system, mission_request->target_component, mission_request->seq); 107 | } 108 | 109 | /** 110 | * @brief Send a mission_request message 111 | * @param chan MAVLink channel to send the message 112 | * 113 | * @param target_system System ID 114 | * @param target_component Component ID 115 | * @param seq Sequence 116 | */ 117 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS 118 | 119 | static inline void mavlink_msg_mission_request_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq) 120 | { 121 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 122 | char buf[4]; 123 | _mav_put_uint16_t(buf, 0, seq); 124 | _mav_put_uint8_t(buf, 2, target_system); 125 | _mav_put_uint8_t(buf, 3, target_component); 126 | 127 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, buf, 4, 230); 128 | #else 129 | mavlink_mission_request_t packet; 130 | packet.seq = seq; 131 | packet.target_system = target_system; 132 | packet.target_component = target_component; 133 | 134 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST, (const char *)&packet, 4, 230); 135 | #endif 136 | } 137 | 138 | #endif 139 | 140 | // MESSAGE MISSION_REQUEST UNPACKING 141 | 142 | 143 | /** 144 | * @brief Get field target_system from mission_request message 145 | * 146 | * @return System ID 147 | */ 148 | static inline uint8_t mavlink_msg_mission_request_get_target_system(const mavlink_message_t* msg) 149 | { 150 | return _MAV_RETURN_uint8_t(msg, 2); 151 | } 152 | 153 | /** 154 | * @brief Get field target_component from mission_request message 155 | * 156 | * @return Component ID 157 | */ 158 | static inline uint8_t mavlink_msg_mission_request_get_target_component(const mavlink_message_t* msg) 159 | { 160 | return _MAV_RETURN_uint8_t(msg, 3); 161 | } 162 | 163 | /** 164 | * @brief Get field seq from mission_request message 165 | * 166 | * @return Sequence 167 | */ 168 | static inline uint16_t mavlink_msg_mission_request_get_seq(const mavlink_message_t* msg) 169 | { 170 | return _MAV_RETURN_uint16_t(msg, 0); 171 | } 172 | 173 | /** 174 | * @brief Decode a mission_request message into a struct 175 | * 176 | * @param msg The message to decode 177 | * @param mission_request C-struct to decode the message contents into 178 | */ 179 | static inline void mavlink_msg_mission_request_decode(const mavlink_message_t* msg, mavlink_mission_request_t* mission_request) 180 | { 181 | #if MAVLINK_NEED_BYTE_SWAP 182 | mission_request->seq = mavlink_msg_mission_request_get_seq(msg); 183 | mission_request->target_system = mavlink_msg_mission_request_get_target_system(msg); 184 | mission_request->target_component = mavlink_msg_mission_request_get_target_component(msg); 185 | #else 186 | memcpy(mission_request, _MAV_PAYLOAD(msg), 4); 187 | #endif 188 | } 189 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_count.h: -------------------------------------------------------------------------------- 1 | // MESSAGE MISSION_COUNT PACKING 2 | 3 | #define MAVLINK_MSG_ID_MISSION_COUNT 44 4 | 5 | typedef struct __mavlink_mission_count_t 6 | { 7 | uint16_t count; ///< Number of mission items in the sequence 8 | uint8_t target_system; ///< System ID 9 | uint8_t target_component; ///< Component ID 10 | } mavlink_mission_count_t; 11 | 12 | #define MAVLINK_MSG_ID_MISSION_COUNT_LEN 4 13 | #define MAVLINK_MSG_ID_44_LEN 4 14 | 15 | 16 | 17 | #define MAVLINK_MESSAGE_INFO_MISSION_COUNT { \ 18 | "MISSION_COUNT", \ 19 | 3, \ 20 | { { "count", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_count_t, count) }, \ 21 | { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_count_t, target_system) }, \ 22 | { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_count_t, target_component) }, \ 23 | } \ 24 | } 25 | 26 | 27 | /** 28 | * @brief Pack a mission_count message 29 | * @param system_id ID of this system 30 | * @param component_id ID of this component (e.g. 200 for IMU) 31 | * @param msg The MAVLink message to compress the data into 32 | * 33 | * @param target_system System ID 34 | * @param target_component Component ID 35 | * @param count Number of mission items in the sequence 36 | * @return length of the message in bytes (excluding serial stream start sign) 37 | */ 38 | static inline uint16_t mavlink_msg_mission_count_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, 39 | uint8_t target_system, uint8_t target_component, uint16_t count) 40 | { 41 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 42 | char buf[4]; 43 | _mav_put_uint16_t(buf, 0, count); 44 | _mav_put_uint8_t(buf, 2, target_system); 45 | _mav_put_uint8_t(buf, 3, target_component); 46 | 47 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); 48 | #else 49 | mavlink_mission_count_t packet; 50 | packet.count = count; 51 | packet.target_system = target_system; 52 | packet.target_component = target_component; 53 | 54 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); 55 | #endif 56 | 57 | msg->msgid = MAVLINK_MSG_ID_MISSION_COUNT; 58 | return mavlink_finalize_message(msg, system_id, component_id, 4, 221); 59 | } 60 | 61 | /** 62 | * @brief Pack a mission_count message on a channel 63 | * @param system_id ID of this system 64 | * @param component_id ID of this component (e.g. 200 for IMU) 65 | * @param chan The MAVLink channel this message was sent over 66 | * @param msg The MAVLink message to compress the data into 67 | * @param target_system System ID 68 | * @param target_component Component ID 69 | * @param count Number of mission items in the sequence 70 | * @return length of the message in bytes (excluding serial stream start sign) 71 | */ 72 | static inline uint16_t mavlink_msg_mission_count_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, 73 | mavlink_message_t* msg, 74 | uint8_t target_system,uint8_t target_component,uint16_t count) 75 | { 76 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 77 | char buf[4]; 78 | _mav_put_uint16_t(buf, 0, count); 79 | _mav_put_uint8_t(buf, 2, target_system); 80 | _mav_put_uint8_t(buf, 3, target_component); 81 | 82 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); 83 | #else 84 | mavlink_mission_count_t packet; 85 | packet.count = count; 86 | packet.target_system = target_system; 87 | packet.target_component = target_component; 88 | 89 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); 90 | #endif 91 | 92 | msg->msgid = MAVLINK_MSG_ID_MISSION_COUNT; 93 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4, 221); 94 | } 95 | 96 | /** 97 | * @brief Encode a mission_count struct into a message 98 | * 99 | * @param system_id ID of this system 100 | * @param component_id ID of this component (e.g. 200 for IMU) 101 | * @param msg The MAVLink message to compress the data into 102 | * @param mission_count C-struct to read the message contents from 103 | */ 104 | static inline uint16_t mavlink_msg_mission_count_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_count_t* mission_count) 105 | { 106 | return mavlink_msg_mission_count_pack(system_id, component_id, msg, mission_count->target_system, mission_count->target_component, mission_count->count); 107 | } 108 | 109 | /** 110 | * @brief Send a mission_count message 111 | * @param chan MAVLink channel to send the message 112 | * 113 | * @param target_system System ID 114 | * @param target_component Component ID 115 | * @param count Number of mission items in the sequence 116 | */ 117 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS 118 | 119 | static inline void mavlink_msg_mission_count_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t count) 120 | { 121 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 122 | char buf[4]; 123 | _mav_put_uint16_t(buf, 0, count); 124 | _mav_put_uint8_t(buf, 2, target_system); 125 | _mav_put_uint8_t(buf, 3, target_component); 126 | 127 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, buf, 4, 221); 128 | #else 129 | mavlink_mission_count_t packet; 130 | packet.count = count; 131 | packet.target_system = target_system; 132 | packet.target_component = target_component; 133 | 134 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_COUNT, (const char *)&packet, 4, 221); 135 | #endif 136 | } 137 | 138 | #endif 139 | 140 | // MESSAGE MISSION_COUNT UNPACKING 141 | 142 | 143 | /** 144 | * @brief Get field target_system from mission_count message 145 | * 146 | * @return System ID 147 | */ 148 | static inline uint8_t mavlink_msg_mission_count_get_target_system(const mavlink_message_t* msg) 149 | { 150 | return _MAV_RETURN_uint8_t(msg, 2); 151 | } 152 | 153 | /** 154 | * @brief Get field target_component from mission_count message 155 | * 156 | * @return Component ID 157 | */ 158 | static inline uint8_t mavlink_msg_mission_count_get_target_component(const mavlink_message_t* msg) 159 | { 160 | return _MAV_RETURN_uint8_t(msg, 3); 161 | } 162 | 163 | /** 164 | * @brief Get field count from mission_count message 165 | * 166 | * @return Number of mission items in the sequence 167 | */ 168 | static inline uint16_t mavlink_msg_mission_count_get_count(const mavlink_message_t* msg) 169 | { 170 | return _MAV_RETURN_uint16_t(msg, 0); 171 | } 172 | 173 | /** 174 | * @brief Decode a mission_count message into a struct 175 | * 176 | * @param msg The message to decode 177 | * @param mission_count C-struct to decode the message contents into 178 | */ 179 | static inline void mavlink_msg_mission_count_decode(const mavlink_message_t* msg, mavlink_mission_count_t* mission_count) 180 | { 181 | #if MAVLINK_NEED_BYTE_SWAP 182 | mission_count->count = mavlink_msg_mission_count_get_count(msg); 183 | mission_count->target_system = mavlink_msg_mission_count_get_target_system(msg); 184 | mission_count->target_component = mavlink_msg_mission_count_get_target_component(msg); 185 | #else 186 | memcpy(mission_count, _MAV_PAYLOAD(msg), 4); 187 | #endif 188 | } 189 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_set_mode.h: -------------------------------------------------------------------------------- 1 | // MESSAGE SET_MODE PACKING 2 | 3 | #define MAVLINK_MSG_ID_SET_MODE 11 4 | 5 | typedef struct __mavlink_set_mode_t 6 | { 7 | uint32_t custom_mode; ///< The new autopilot-specific mode. This field can be ignored by an autopilot. 8 | uint8_t target_system; ///< The system setting the mode 9 | uint8_t base_mode; ///< The new base mode 10 | } mavlink_set_mode_t; 11 | 12 | #define MAVLINK_MSG_ID_SET_MODE_LEN 6 13 | #define MAVLINK_MSG_ID_11_LEN 6 14 | 15 | 16 | 17 | #define MAVLINK_MESSAGE_INFO_SET_MODE { \ 18 | "SET_MODE", \ 19 | 3, \ 20 | { { "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_mode_t, custom_mode) }, \ 21 | { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_set_mode_t, target_system) }, \ 22 | { "base_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_set_mode_t, base_mode) }, \ 23 | } \ 24 | } 25 | 26 | 27 | /** 28 | * @brief Pack a set_mode message 29 | * @param system_id ID of this system 30 | * @param component_id ID of this component (e.g. 200 for IMU) 31 | * @param msg The MAVLink message to compress the data into 32 | * 33 | * @param target_system The system setting the mode 34 | * @param base_mode The new base mode 35 | * @param custom_mode The new autopilot-specific mode. This field can be ignored by an autopilot. 36 | * @return length of the message in bytes (excluding serial stream start sign) 37 | */ 38 | static inline uint16_t mavlink_msg_set_mode_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, 39 | uint8_t target_system, uint8_t base_mode, uint32_t custom_mode) 40 | { 41 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 42 | char buf[6]; 43 | _mav_put_uint32_t(buf, 0, custom_mode); 44 | _mav_put_uint8_t(buf, 4, target_system); 45 | _mav_put_uint8_t(buf, 5, base_mode); 46 | 47 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); 48 | #else 49 | mavlink_set_mode_t packet; 50 | packet.custom_mode = custom_mode; 51 | packet.target_system = target_system; 52 | packet.base_mode = base_mode; 53 | 54 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); 55 | #endif 56 | 57 | msg->msgid = MAVLINK_MSG_ID_SET_MODE; 58 | return mavlink_finalize_message(msg, system_id, component_id, 6, 89); 59 | } 60 | 61 | /** 62 | * @brief Pack a set_mode message on a channel 63 | * @param system_id ID of this system 64 | * @param component_id ID of this component (e.g. 200 for IMU) 65 | * @param chan The MAVLink channel this message was sent over 66 | * @param msg The MAVLink message to compress the data into 67 | * @param target_system The system setting the mode 68 | * @param base_mode The new base mode 69 | * @param custom_mode The new autopilot-specific mode. This field can be ignored by an autopilot. 70 | * @return length of the message in bytes (excluding serial stream start sign) 71 | */ 72 | static inline uint16_t mavlink_msg_set_mode_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, 73 | mavlink_message_t* msg, 74 | uint8_t target_system,uint8_t base_mode,uint32_t custom_mode) 75 | { 76 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 77 | char buf[6]; 78 | _mav_put_uint32_t(buf, 0, custom_mode); 79 | _mav_put_uint8_t(buf, 4, target_system); 80 | _mav_put_uint8_t(buf, 5, base_mode); 81 | 82 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); 83 | #else 84 | mavlink_set_mode_t packet; 85 | packet.custom_mode = custom_mode; 86 | packet.target_system = target_system; 87 | packet.base_mode = base_mode; 88 | 89 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); 90 | #endif 91 | 92 | msg->msgid = MAVLINK_MSG_ID_SET_MODE; 93 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 6, 89); 94 | } 95 | 96 | /** 97 | * @brief Encode a set_mode struct into a message 98 | * 99 | * @param system_id ID of this system 100 | * @param component_id ID of this component (e.g. 200 for IMU) 101 | * @param msg The MAVLink message to compress the data into 102 | * @param set_mode C-struct to read the message contents from 103 | */ 104 | static inline uint16_t mavlink_msg_set_mode_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_mode_t* set_mode) 105 | { 106 | return mavlink_msg_set_mode_pack(system_id, component_id, msg, set_mode->target_system, set_mode->base_mode, set_mode->custom_mode); 107 | } 108 | 109 | /** 110 | * @brief Send a set_mode message 111 | * @param chan MAVLink channel to send the message 112 | * 113 | * @param target_system The system setting the mode 114 | * @param base_mode The new base mode 115 | * @param custom_mode The new autopilot-specific mode. This field can be ignored by an autopilot. 116 | */ 117 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS 118 | 119 | static inline void mavlink_msg_set_mode_send(mavlink_channel_t chan, uint8_t target_system, uint8_t base_mode, uint32_t custom_mode) 120 | { 121 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 122 | char buf[6]; 123 | _mav_put_uint32_t(buf, 0, custom_mode); 124 | _mav_put_uint8_t(buf, 4, target_system); 125 | _mav_put_uint8_t(buf, 5, base_mode); 126 | 127 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MODE, buf, 6, 89); 128 | #else 129 | mavlink_set_mode_t packet; 130 | packet.custom_mode = custom_mode; 131 | packet.target_system = target_system; 132 | packet.base_mode = base_mode; 133 | 134 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_MODE, (const char *)&packet, 6, 89); 135 | #endif 136 | } 137 | 138 | #endif 139 | 140 | // MESSAGE SET_MODE UNPACKING 141 | 142 | 143 | /** 144 | * @brief Get field target_system from set_mode message 145 | * 146 | * @return The system setting the mode 147 | */ 148 | static inline uint8_t mavlink_msg_set_mode_get_target_system(const mavlink_message_t* msg) 149 | { 150 | return _MAV_RETURN_uint8_t(msg, 4); 151 | } 152 | 153 | /** 154 | * @brief Get field base_mode from set_mode message 155 | * 156 | * @return The new base mode 157 | */ 158 | static inline uint8_t mavlink_msg_set_mode_get_base_mode(const mavlink_message_t* msg) 159 | { 160 | return _MAV_RETURN_uint8_t(msg, 5); 161 | } 162 | 163 | /** 164 | * @brief Get field custom_mode from set_mode message 165 | * 166 | * @return The new autopilot-specific mode. This field can be ignored by an autopilot. 167 | */ 168 | static inline uint32_t mavlink_msg_set_mode_get_custom_mode(const mavlink_message_t* msg) 169 | { 170 | return _MAV_RETURN_uint32_t(msg, 0); 171 | } 172 | 173 | /** 174 | * @brief Decode a set_mode message into a struct 175 | * 176 | * @param msg The message to decode 177 | * @param set_mode C-struct to decode the message contents into 178 | */ 179 | static inline void mavlink_msg_set_mode_decode(const mavlink_message_t* msg, mavlink_set_mode_t* set_mode) 180 | { 181 | #if MAVLINK_NEED_BYTE_SWAP 182 | set_mode->custom_mode = mavlink_msg_set_mode_get_custom_mode(msg); 183 | set_mode->target_system = mavlink_msg_set_mode_get_target_system(msg); 184 | set_mode->base_mode = mavlink_msg_set_mode_get_base_mode(msg); 185 | #else 186 | memcpy(set_mode, _MAV_PAYLOAD(msg), 6); 187 | #endif 188 | } 189 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_data_stream.h: -------------------------------------------------------------------------------- 1 | // MESSAGE DATA_STREAM PACKING 2 | 3 | #define MAVLINK_MSG_ID_DATA_STREAM 67 4 | 5 | typedef struct __mavlink_data_stream_t 6 | { 7 | uint16_t message_rate; ///< The requested interval between two messages of this type 8 | uint8_t stream_id; ///< The ID of the requested data stream 9 | uint8_t on_off; ///< 1 stream is enabled, 0 stream is stopped. 10 | } mavlink_data_stream_t; 11 | 12 | #define MAVLINK_MSG_ID_DATA_STREAM_LEN 4 13 | #define MAVLINK_MSG_ID_67_LEN 4 14 | 15 | 16 | 17 | #define MAVLINK_MESSAGE_INFO_DATA_STREAM { \ 18 | "DATA_STREAM", \ 19 | 3, \ 20 | { { "message_rate", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_data_stream_t, message_rate) }, \ 21 | { "stream_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_data_stream_t, stream_id) }, \ 22 | { "on_off", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_data_stream_t, on_off) }, \ 23 | } \ 24 | } 25 | 26 | 27 | /** 28 | * @brief Pack a data_stream message 29 | * @param system_id ID of this system 30 | * @param component_id ID of this component (e.g. 200 for IMU) 31 | * @param msg The MAVLink message to compress the data into 32 | * 33 | * @param stream_id The ID of the requested data stream 34 | * @param message_rate The requested interval between two messages of this type 35 | * @param on_off 1 stream is enabled, 0 stream is stopped. 36 | * @return length of the message in bytes (excluding serial stream start sign) 37 | */ 38 | static inline uint16_t mavlink_msg_data_stream_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, 39 | uint8_t stream_id, uint16_t message_rate, uint8_t on_off) 40 | { 41 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 42 | char buf[4]; 43 | _mav_put_uint16_t(buf, 0, message_rate); 44 | _mav_put_uint8_t(buf, 2, stream_id); 45 | _mav_put_uint8_t(buf, 3, on_off); 46 | 47 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); 48 | #else 49 | mavlink_data_stream_t packet; 50 | packet.message_rate = message_rate; 51 | packet.stream_id = stream_id; 52 | packet.on_off = on_off; 53 | 54 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); 55 | #endif 56 | 57 | msg->msgid = MAVLINK_MSG_ID_DATA_STREAM; 58 | return mavlink_finalize_message(msg, system_id, component_id, 4, 21); 59 | } 60 | 61 | /** 62 | * @brief Pack a data_stream message on a channel 63 | * @param system_id ID of this system 64 | * @param component_id ID of this component (e.g. 200 for IMU) 65 | * @param chan The MAVLink channel this message was sent over 66 | * @param msg The MAVLink message to compress the data into 67 | * @param stream_id The ID of the requested data stream 68 | * @param message_rate The requested interval between two messages of this type 69 | * @param on_off 1 stream is enabled, 0 stream is stopped. 70 | * @return length of the message in bytes (excluding serial stream start sign) 71 | */ 72 | static inline uint16_t mavlink_msg_data_stream_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, 73 | mavlink_message_t* msg, 74 | uint8_t stream_id,uint16_t message_rate,uint8_t on_off) 75 | { 76 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 77 | char buf[4]; 78 | _mav_put_uint16_t(buf, 0, message_rate); 79 | _mav_put_uint8_t(buf, 2, stream_id); 80 | _mav_put_uint8_t(buf, 3, on_off); 81 | 82 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); 83 | #else 84 | mavlink_data_stream_t packet; 85 | packet.message_rate = message_rate; 86 | packet.stream_id = stream_id; 87 | packet.on_off = on_off; 88 | 89 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); 90 | #endif 91 | 92 | msg->msgid = MAVLINK_MSG_ID_DATA_STREAM; 93 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4, 21); 94 | } 95 | 96 | /** 97 | * @brief Encode a data_stream struct into a message 98 | * 99 | * @param system_id ID of this system 100 | * @param component_id ID of this component (e.g. 200 for IMU) 101 | * @param msg The MAVLink message to compress the data into 102 | * @param data_stream C-struct to read the message contents from 103 | */ 104 | static inline uint16_t mavlink_msg_data_stream_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_data_stream_t* data_stream) 105 | { 106 | return mavlink_msg_data_stream_pack(system_id, component_id, msg, data_stream->stream_id, data_stream->message_rate, data_stream->on_off); 107 | } 108 | 109 | /** 110 | * @brief Send a data_stream message 111 | * @param chan MAVLink channel to send the message 112 | * 113 | * @param stream_id The ID of the requested data stream 114 | * @param message_rate The requested interval between two messages of this type 115 | * @param on_off 1 stream is enabled, 0 stream is stopped. 116 | */ 117 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS 118 | 119 | static inline void mavlink_msg_data_stream_send(mavlink_channel_t chan, uint8_t stream_id, uint16_t message_rate, uint8_t on_off) 120 | { 121 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 122 | char buf[4]; 123 | _mav_put_uint16_t(buf, 0, message_rate); 124 | _mav_put_uint8_t(buf, 2, stream_id); 125 | _mav_put_uint8_t(buf, 3, on_off); 126 | 127 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, buf, 4, 21); 128 | #else 129 | mavlink_data_stream_t packet; 130 | packet.message_rate = message_rate; 131 | packet.stream_id = stream_id; 132 | packet.on_off = on_off; 133 | 134 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, (const char *)&packet, 4, 21); 135 | #endif 136 | } 137 | 138 | #endif 139 | 140 | // MESSAGE DATA_STREAM UNPACKING 141 | 142 | 143 | /** 144 | * @brief Get field stream_id from data_stream message 145 | * 146 | * @return The ID of the requested data stream 147 | */ 148 | static inline uint8_t mavlink_msg_data_stream_get_stream_id(const mavlink_message_t* msg) 149 | { 150 | return _MAV_RETURN_uint8_t(msg, 2); 151 | } 152 | 153 | /** 154 | * @brief Get field message_rate from data_stream message 155 | * 156 | * @return The requested interval between two messages of this type 157 | */ 158 | static inline uint16_t mavlink_msg_data_stream_get_message_rate(const mavlink_message_t* msg) 159 | { 160 | return _MAV_RETURN_uint16_t(msg, 0); 161 | } 162 | 163 | /** 164 | * @brief Get field on_off from data_stream message 165 | * 166 | * @return 1 stream is enabled, 0 stream is stopped. 167 | */ 168 | static inline uint8_t mavlink_msg_data_stream_get_on_off(const mavlink_message_t* msg) 169 | { 170 | return _MAV_RETURN_uint8_t(msg, 3); 171 | } 172 | 173 | /** 174 | * @brief Decode a data_stream message into a struct 175 | * 176 | * @param msg The message to decode 177 | * @param data_stream C-struct to decode the message contents into 178 | */ 179 | static inline void mavlink_msg_data_stream_decode(const mavlink_message_t* msg, mavlink_data_stream_t* data_stream) 180 | { 181 | #if MAVLINK_NEED_BYTE_SWAP 182 | data_stream->message_rate = mavlink_msg_data_stream_get_message_rate(msg); 183 | data_stream->stream_id = mavlink_msg_data_stream_get_stream_id(msg); 184 | data_stream->on_off = mavlink_msg_data_stream_get_on_off(msg); 185 | #else 186 | memcpy(data_stream, _MAV_PAYLOAD(msg), 4); 187 | #endif 188 | } 189 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_mission_set_current.h: -------------------------------------------------------------------------------- 1 | // MESSAGE MISSION_SET_CURRENT PACKING 2 | 3 | #define MAVLINK_MSG_ID_MISSION_SET_CURRENT 41 4 | 5 | typedef struct __mavlink_mission_set_current_t 6 | { 7 | uint16_t seq; ///< Sequence 8 | uint8_t target_system; ///< System ID 9 | uint8_t target_component; ///< Component ID 10 | } mavlink_mission_set_current_t; 11 | 12 | #define MAVLINK_MSG_ID_MISSION_SET_CURRENT_LEN 4 13 | #define MAVLINK_MSG_ID_41_LEN 4 14 | 15 | 16 | 17 | #define MAVLINK_MESSAGE_INFO_MISSION_SET_CURRENT { \ 18 | "MISSION_SET_CURRENT", \ 19 | 3, \ 20 | { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_set_current_t, seq) }, \ 21 | { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_set_current_t, target_system) }, \ 22 | { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mission_set_current_t, target_component) }, \ 23 | } \ 24 | } 25 | 26 | 27 | /** 28 | * @brief Pack a mission_set_current message 29 | * @param system_id ID of this system 30 | * @param component_id ID of this component (e.g. 200 for IMU) 31 | * @param msg The MAVLink message to compress the data into 32 | * 33 | * @param target_system System ID 34 | * @param target_component Component ID 35 | * @param seq Sequence 36 | * @return length of the message in bytes (excluding serial stream start sign) 37 | */ 38 | static inline uint16_t mavlink_msg_mission_set_current_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, 39 | uint8_t target_system, uint8_t target_component, uint16_t seq) 40 | { 41 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 42 | char buf[4]; 43 | _mav_put_uint16_t(buf, 0, seq); 44 | _mav_put_uint8_t(buf, 2, target_system); 45 | _mav_put_uint8_t(buf, 3, target_component); 46 | 47 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); 48 | #else 49 | mavlink_mission_set_current_t packet; 50 | packet.seq = seq; 51 | packet.target_system = target_system; 52 | packet.target_component = target_component; 53 | 54 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); 55 | #endif 56 | 57 | msg->msgid = MAVLINK_MSG_ID_MISSION_SET_CURRENT; 58 | return mavlink_finalize_message(msg, system_id, component_id, 4, 28); 59 | } 60 | 61 | /** 62 | * @brief Pack a mission_set_current message on a channel 63 | * @param system_id ID of this system 64 | * @param component_id ID of this component (e.g. 200 for IMU) 65 | * @param chan The MAVLink channel this message was sent over 66 | * @param msg The MAVLink message to compress the data into 67 | * @param target_system System ID 68 | * @param target_component Component ID 69 | * @param seq Sequence 70 | * @return length of the message in bytes (excluding serial stream start sign) 71 | */ 72 | static inline uint16_t mavlink_msg_mission_set_current_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, 73 | mavlink_message_t* msg, 74 | uint8_t target_system,uint8_t target_component,uint16_t seq) 75 | { 76 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 77 | char buf[4]; 78 | _mav_put_uint16_t(buf, 0, seq); 79 | _mav_put_uint8_t(buf, 2, target_system); 80 | _mav_put_uint8_t(buf, 3, target_component); 81 | 82 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 4); 83 | #else 84 | mavlink_mission_set_current_t packet; 85 | packet.seq = seq; 86 | packet.target_system = target_system; 87 | packet.target_component = target_component; 88 | 89 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 4); 90 | #endif 91 | 92 | msg->msgid = MAVLINK_MSG_ID_MISSION_SET_CURRENT; 93 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 4, 28); 94 | } 95 | 96 | /** 97 | * @brief Encode a mission_set_current struct into a message 98 | * 99 | * @param system_id ID of this system 100 | * @param component_id ID of this component (e.g. 200 for IMU) 101 | * @param msg The MAVLink message to compress the data into 102 | * @param mission_set_current C-struct to read the message contents from 103 | */ 104 | static inline uint16_t mavlink_msg_mission_set_current_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_set_current_t* mission_set_current) 105 | { 106 | return mavlink_msg_mission_set_current_pack(system_id, component_id, msg, mission_set_current->target_system, mission_set_current->target_component, mission_set_current->seq); 107 | } 108 | 109 | /** 110 | * @brief Send a mission_set_current message 111 | * @param chan MAVLink channel to send the message 112 | * 113 | * @param target_system System ID 114 | * @param target_component Component ID 115 | * @param seq Sequence 116 | */ 117 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS 118 | 119 | static inline void mavlink_msg_mission_set_current_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t seq) 120 | { 121 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 122 | char buf[4]; 123 | _mav_put_uint16_t(buf, 0, seq); 124 | _mav_put_uint8_t(buf, 2, target_system); 125 | _mav_put_uint8_t(buf, 3, target_component); 126 | 127 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, buf, 4, 28); 128 | #else 129 | mavlink_mission_set_current_t packet; 130 | packet.seq = seq; 131 | packet.target_system = target_system; 132 | packet.target_component = target_component; 133 | 134 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_SET_CURRENT, (const char *)&packet, 4, 28); 135 | #endif 136 | } 137 | 138 | #endif 139 | 140 | // MESSAGE MISSION_SET_CURRENT UNPACKING 141 | 142 | 143 | /** 144 | * @brief Get field target_system from mission_set_current message 145 | * 146 | * @return System ID 147 | */ 148 | static inline uint8_t mavlink_msg_mission_set_current_get_target_system(const mavlink_message_t* msg) 149 | { 150 | return _MAV_RETURN_uint8_t(msg, 2); 151 | } 152 | 153 | /** 154 | * @brief Get field target_component from mission_set_current message 155 | * 156 | * @return Component ID 157 | */ 158 | static inline uint8_t mavlink_msg_mission_set_current_get_target_component(const mavlink_message_t* msg) 159 | { 160 | return _MAV_RETURN_uint8_t(msg, 3); 161 | } 162 | 163 | /** 164 | * @brief Get field seq from mission_set_current message 165 | * 166 | * @return Sequence 167 | */ 168 | static inline uint16_t mavlink_msg_mission_set_current_get_seq(const mavlink_message_t* msg) 169 | { 170 | return _MAV_RETURN_uint16_t(msg, 0); 171 | } 172 | 173 | /** 174 | * @brief Decode a mission_set_current message into a struct 175 | * 176 | * @param msg The message to decode 177 | * @param mission_set_current C-struct to decode the message contents into 178 | */ 179 | static inline void mavlink_msg_mission_set_current_decode(const mavlink_message_t* msg, mavlink_mission_set_current_t* mission_set_current) 180 | { 181 | #if MAVLINK_NEED_BYTE_SWAP 182 | mission_set_current->seq = mavlink_msg_mission_set_current_get_seq(msg); 183 | mission_set_current->target_system = mavlink_msg_mission_set_current_get_target_system(msg); 184 | mission_set_current->target_component = mavlink_msg_mission_set_current_get_target_component(msg); 185 | #else 186 | memcpy(mission_set_current, _MAV_PAYLOAD(msg), 4); 187 | #endif 188 | } 189 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_named_value_int.h: -------------------------------------------------------------------------------- 1 | // MESSAGE NAMED_VALUE_INT PACKING 2 | 3 | #define MAVLINK_MSG_ID_NAMED_VALUE_INT 252 4 | 5 | typedef struct __mavlink_named_value_int_t 6 | { 7 | uint32_t time_boot_ms; ///< Timestamp (milliseconds since system boot) 8 | int32_t value; ///< Signed integer value 9 | char name[10]; ///< Name of the debug variable 10 | } mavlink_named_value_int_t; 11 | 12 | #define MAVLINK_MSG_ID_NAMED_VALUE_INT_LEN 18 13 | #define MAVLINK_MSG_ID_252_LEN 18 14 | 15 | #define MAVLINK_MSG_NAMED_VALUE_INT_FIELD_NAME_LEN 10 16 | 17 | #define MAVLINK_MESSAGE_INFO_NAMED_VALUE_INT { \ 18 | "NAMED_VALUE_INT", \ 19 | 3, \ 20 | { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_named_value_int_t, time_boot_ms) }, \ 21 | { "value", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_named_value_int_t, value) }, \ 22 | { "name", NULL, MAVLINK_TYPE_CHAR, 10, 8, offsetof(mavlink_named_value_int_t, name) }, \ 23 | } \ 24 | } 25 | 26 | 27 | /** 28 | * @brief Pack a named_value_int message 29 | * @param system_id ID of this system 30 | * @param component_id ID of this component (e.g. 200 for IMU) 31 | * @param msg The MAVLink message to compress the data into 32 | * 33 | * @param time_boot_ms Timestamp (milliseconds since system boot) 34 | * @param name Name of the debug variable 35 | * @param value Signed integer value 36 | * @return length of the message in bytes (excluding serial stream start sign) 37 | */ 38 | static inline uint16_t mavlink_msg_named_value_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, 39 | uint32_t time_boot_ms, const char *name, int32_t value) 40 | { 41 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 42 | char buf[18]; 43 | _mav_put_uint32_t(buf, 0, time_boot_ms); 44 | _mav_put_int32_t(buf, 4, value); 45 | _mav_put_char_array(buf, 8, name, 10); 46 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); 47 | #else 48 | mavlink_named_value_int_t packet; 49 | packet.time_boot_ms = time_boot_ms; 50 | packet.value = value; 51 | mav_array_memcpy(packet.name, name, sizeof(char)*10); 52 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); 53 | #endif 54 | 55 | msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_INT; 56 | return mavlink_finalize_message(msg, system_id, component_id, 18, 44); 57 | } 58 | 59 | /** 60 | * @brief Pack a named_value_int message on a channel 61 | * @param system_id ID of this system 62 | * @param component_id ID of this component (e.g. 200 for IMU) 63 | * @param chan The MAVLink channel this message was sent over 64 | * @param msg The MAVLink message to compress the data into 65 | * @param time_boot_ms Timestamp (milliseconds since system boot) 66 | * @param name Name of the debug variable 67 | * @param value Signed integer value 68 | * @return length of the message in bytes (excluding serial stream start sign) 69 | */ 70 | static inline uint16_t mavlink_msg_named_value_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, 71 | mavlink_message_t* msg, 72 | uint32_t time_boot_ms,const char *name,int32_t value) 73 | { 74 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 75 | char buf[18]; 76 | _mav_put_uint32_t(buf, 0, time_boot_ms); 77 | _mav_put_int32_t(buf, 4, value); 78 | _mav_put_char_array(buf, 8, name, 10); 79 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); 80 | #else 81 | mavlink_named_value_int_t packet; 82 | packet.time_boot_ms = time_boot_ms; 83 | packet.value = value; 84 | mav_array_memcpy(packet.name, name, sizeof(char)*10); 85 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); 86 | #endif 87 | 88 | msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_INT; 89 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 18, 44); 90 | } 91 | 92 | /** 93 | * @brief Encode a named_value_int struct into a message 94 | * 95 | * @param system_id ID of this system 96 | * @param component_id ID of this component (e.g. 200 for IMU) 97 | * @param msg The MAVLink message to compress the data into 98 | * @param named_value_int C-struct to read the message contents from 99 | */ 100 | static inline uint16_t mavlink_msg_named_value_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_named_value_int_t* named_value_int) 101 | { 102 | return mavlink_msg_named_value_int_pack(system_id, component_id, msg, named_value_int->time_boot_ms, named_value_int->name, named_value_int->value); 103 | } 104 | 105 | /** 106 | * @brief Send a named_value_int message 107 | * @param chan MAVLink channel to send the message 108 | * 109 | * @param time_boot_ms Timestamp (milliseconds since system boot) 110 | * @param name Name of the debug variable 111 | * @param value Signed integer value 112 | */ 113 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS 114 | 115 | static inline void mavlink_msg_named_value_int_send(mavlink_channel_t chan, uint32_t time_boot_ms, const char *name, int32_t value) 116 | { 117 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 118 | char buf[18]; 119 | _mav_put_uint32_t(buf, 0, time_boot_ms); 120 | _mav_put_int32_t(buf, 4, value); 121 | _mav_put_char_array(buf, 8, name, 10); 122 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, buf, 18, 44); 123 | #else 124 | mavlink_named_value_int_t packet; 125 | packet.time_boot_ms = time_boot_ms; 126 | packet.value = value; 127 | mav_array_memcpy(packet.name, name, sizeof(char)*10); 128 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_INT, (const char *)&packet, 18, 44); 129 | #endif 130 | } 131 | 132 | #endif 133 | 134 | // MESSAGE NAMED_VALUE_INT UNPACKING 135 | 136 | 137 | /** 138 | * @brief Get field time_boot_ms from named_value_int message 139 | * 140 | * @return Timestamp (milliseconds since system boot) 141 | */ 142 | static inline uint32_t mavlink_msg_named_value_int_get_time_boot_ms(const mavlink_message_t* msg) 143 | { 144 | return _MAV_RETURN_uint32_t(msg, 0); 145 | } 146 | 147 | /** 148 | * @brief Get field name from named_value_int message 149 | * 150 | * @return Name of the debug variable 151 | */ 152 | static inline uint16_t mavlink_msg_named_value_int_get_name(const mavlink_message_t* msg, char *name) 153 | { 154 | return _MAV_RETURN_char_array(msg, name, 10, 8); 155 | } 156 | 157 | /** 158 | * @brief Get field value from named_value_int message 159 | * 160 | * @return Signed integer value 161 | */ 162 | static inline int32_t mavlink_msg_named_value_int_get_value(const mavlink_message_t* msg) 163 | { 164 | return _MAV_RETURN_int32_t(msg, 4); 165 | } 166 | 167 | /** 168 | * @brief Decode a named_value_int message into a struct 169 | * 170 | * @param msg The message to decode 171 | * @param named_value_int C-struct to decode the message contents into 172 | */ 173 | static inline void mavlink_msg_named_value_int_decode(const mavlink_message_t* msg, mavlink_named_value_int_t* named_value_int) 174 | { 175 | #if MAVLINK_NEED_BYTE_SWAP 176 | named_value_int->time_boot_ms = mavlink_msg_named_value_int_get_time_boot_ms(msg); 177 | named_value_int->value = mavlink_msg_named_value_int_get_value(msg); 178 | mavlink_msg_named_value_int_get_name(msg, named_value_int->name); 179 | #else 180 | memcpy(named_value_int, _MAV_PAYLOAD(msg), 18); 181 | #endif 182 | } 183 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_named_value_float.h: -------------------------------------------------------------------------------- 1 | // MESSAGE NAMED_VALUE_FLOAT PACKING 2 | 3 | #define MAVLINK_MSG_ID_NAMED_VALUE_FLOAT 251 4 | 5 | typedef struct __mavlink_named_value_float_t 6 | { 7 | uint32_t time_boot_ms; ///< Timestamp (milliseconds since system boot) 8 | float value; ///< Floating point value 9 | char name[10]; ///< Name of the debug variable 10 | } mavlink_named_value_float_t; 11 | 12 | #define MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_LEN 18 13 | #define MAVLINK_MSG_ID_251_LEN 18 14 | 15 | #define MAVLINK_MSG_NAMED_VALUE_FLOAT_FIELD_NAME_LEN 10 16 | 17 | #define MAVLINK_MESSAGE_INFO_NAMED_VALUE_FLOAT { \ 18 | "NAMED_VALUE_FLOAT", \ 19 | 3, \ 20 | { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_named_value_float_t, time_boot_ms) }, \ 21 | { "value", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_named_value_float_t, value) }, \ 22 | { "name", NULL, MAVLINK_TYPE_CHAR, 10, 8, offsetof(mavlink_named_value_float_t, name) }, \ 23 | } \ 24 | } 25 | 26 | 27 | /** 28 | * @brief Pack a named_value_float message 29 | * @param system_id ID of this system 30 | * @param component_id ID of this component (e.g. 200 for IMU) 31 | * @param msg The MAVLink message to compress the data into 32 | * 33 | * @param time_boot_ms Timestamp (milliseconds since system boot) 34 | * @param name Name of the debug variable 35 | * @param value Floating point value 36 | * @return length of the message in bytes (excluding serial stream start sign) 37 | */ 38 | static inline uint16_t mavlink_msg_named_value_float_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, 39 | uint32_t time_boot_ms, const char *name, float value) 40 | { 41 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 42 | char buf[18]; 43 | _mav_put_uint32_t(buf, 0, time_boot_ms); 44 | _mav_put_float(buf, 4, value); 45 | _mav_put_char_array(buf, 8, name, 10); 46 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); 47 | #else 48 | mavlink_named_value_float_t packet; 49 | packet.time_boot_ms = time_boot_ms; 50 | packet.value = value; 51 | mav_array_memcpy(packet.name, name, sizeof(char)*10); 52 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); 53 | #endif 54 | 55 | msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_FLOAT; 56 | return mavlink_finalize_message(msg, system_id, component_id, 18, 170); 57 | } 58 | 59 | /** 60 | * @brief Pack a named_value_float message on a channel 61 | * @param system_id ID of this system 62 | * @param component_id ID of this component (e.g. 200 for IMU) 63 | * @param chan The MAVLink channel this message was sent over 64 | * @param msg The MAVLink message to compress the data into 65 | * @param time_boot_ms Timestamp (milliseconds since system boot) 66 | * @param name Name of the debug variable 67 | * @param value Floating point value 68 | * @return length of the message in bytes (excluding serial stream start sign) 69 | */ 70 | static inline uint16_t mavlink_msg_named_value_float_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, 71 | mavlink_message_t* msg, 72 | uint32_t time_boot_ms,const char *name,float value) 73 | { 74 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 75 | char buf[18]; 76 | _mav_put_uint32_t(buf, 0, time_boot_ms); 77 | _mav_put_float(buf, 4, value); 78 | _mav_put_char_array(buf, 8, name, 10); 79 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 18); 80 | #else 81 | mavlink_named_value_float_t packet; 82 | packet.time_boot_ms = time_boot_ms; 83 | packet.value = value; 84 | mav_array_memcpy(packet.name, name, sizeof(char)*10); 85 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 18); 86 | #endif 87 | 88 | msg->msgid = MAVLINK_MSG_ID_NAMED_VALUE_FLOAT; 89 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 18, 170); 90 | } 91 | 92 | /** 93 | * @brief Encode a named_value_float struct into a message 94 | * 95 | * @param system_id ID of this system 96 | * @param component_id ID of this component (e.g. 200 for IMU) 97 | * @param msg The MAVLink message to compress the data into 98 | * @param named_value_float C-struct to read the message contents from 99 | */ 100 | static inline uint16_t mavlink_msg_named_value_float_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_named_value_float_t* named_value_float) 101 | { 102 | return mavlink_msg_named_value_float_pack(system_id, component_id, msg, named_value_float->time_boot_ms, named_value_float->name, named_value_float->value); 103 | } 104 | 105 | /** 106 | * @brief Send a named_value_float message 107 | * @param chan MAVLink channel to send the message 108 | * 109 | * @param time_boot_ms Timestamp (milliseconds since system boot) 110 | * @param name Name of the debug variable 111 | * @param value Floating point value 112 | */ 113 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS 114 | 115 | static inline void mavlink_msg_named_value_float_send(mavlink_channel_t chan, uint32_t time_boot_ms, const char *name, float value) 116 | { 117 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 118 | char buf[18]; 119 | _mav_put_uint32_t(buf, 0, time_boot_ms); 120 | _mav_put_float(buf, 4, value); 121 | _mav_put_char_array(buf, 8, name, 10); 122 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, buf, 18, 170); 123 | #else 124 | mavlink_named_value_float_t packet; 125 | packet.time_boot_ms = time_boot_ms; 126 | packet.value = value; 127 | mav_array_memcpy(packet.name, name, sizeof(char)*10); 128 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, (const char *)&packet, 18, 170); 129 | #endif 130 | } 131 | 132 | #endif 133 | 134 | // MESSAGE NAMED_VALUE_FLOAT UNPACKING 135 | 136 | 137 | /** 138 | * @brief Get field time_boot_ms from named_value_float message 139 | * 140 | * @return Timestamp (milliseconds since system boot) 141 | */ 142 | static inline uint32_t mavlink_msg_named_value_float_get_time_boot_ms(const mavlink_message_t* msg) 143 | { 144 | return _MAV_RETURN_uint32_t(msg, 0); 145 | } 146 | 147 | /** 148 | * @brief Get field name from named_value_float message 149 | * 150 | * @return Name of the debug variable 151 | */ 152 | static inline uint16_t mavlink_msg_named_value_float_get_name(const mavlink_message_t* msg, char *name) 153 | { 154 | return _MAV_RETURN_char_array(msg, name, 10, 8); 155 | } 156 | 157 | /** 158 | * @brief Get field value from named_value_float message 159 | * 160 | * @return Floating point value 161 | */ 162 | static inline float mavlink_msg_named_value_float_get_value(const mavlink_message_t* msg) 163 | { 164 | return _MAV_RETURN_float(msg, 4); 165 | } 166 | 167 | /** 168 | * @brief Decode a named_value_float message into a struct 169 | * 170 | * @param msg The message to decode 171 | * @param named_value_float C-struct to decode the message contents into 172 | */ 173 | static inline void mavlink_msg_named_value_float_decode(const mavlink_message_t* msg, mavlink_named_value_float_t* named_value_float) 174 | { 175 | #if MAVLINK_NEED_BYTE_SWAP 176 | named_value_float->time_boot_ms = mavlink_msg_named_value_float_get_time_boot_ms(msg); 177 | named_value_float->value = mavlink_msg_named_value_float_get_value(msg); 178 | mavlink_msg_named_value_float_get_name(msg, named_value_float->name); 179 | #else 180 | memcpy(named_value_float, _MAV_PAYLOAD(msg), 18); 181 | #endif 182 | } 183 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/mavlink_msg_fence_fetch_point.h: -------------------------------------------------------------------------------- 1 | // MESSAGE FENCE_FETCH_POINT PACKING 2 | 3 | #define MAVLINK_MSG_ID_FENCE_FETCH_POINT 161 4 | 5 | typedef struct __mavlink_fence_fetch_point_t 6 | { 7 | uint8_t target_system; ///< System ID 8 | uint8_t target_component; ///< Component ID 9 | uint8_t idx; ///< point index (first point is 1, 0 is for return point) 10 | } mavlink_fence_fetch_point_t; 11 | 12 | #define MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN 3 13 | #define MAVLINK_MSG_ID_161_LEN 3 14 | 15 | 16 | 17 | #define MAVLINK_MESSAGE_INFO_FENCE_FETCH_POINT { \ 18 | "FENCE_FETCH_POINT", \ 19 | 3, \ 20 | { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_fence_fetch_point_t, target_system) }, \ 21 | { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_fence_fetch_point_t, target_component) }, \ 22 | { "idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_fence_fetch_point_t, idx) }, \ 23 | } \ 24 | } 25 | 26 | 27 | /** 28 | * @brief Pack a fence_fetch_point message 29 | * @param system_id ID of this system 30 | * @param component_id ID of this component (e.g. 200 for IMU) 31 | * @param msg The MAVLink message to compress the data into 32 | * 33 | * @param target_system System ID 34 | * @param target_component Component ID 35 | * @param idx point index (first point is 1, 0 is for return point) 36 | * @return length of the message in bytes (excluding serial stream start sign) 37 | */ 38 | static inline uint16_t mavlink_msg_fence_fetch_point_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, 39 | uint8_t target_system, uint8_t target_component, uint8_t idx) 40 | { 41 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 42 | char buf[3]; 43 | _mav_put_uint8_t(buf, 0, target_system); 44 | _mav_put_uint8_t(buf, 1, target_component); 45 | _mav_put_uint8_t(buf, 2, idx); 46 | 47 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); 48 | #else 49 | mavlink_fence_fetch_point_t packet; 50 | packet.target_system = target_system; 51 | packet.target_component = target_component; 52 | packet.idx = idx; 53 | 54 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); 55 | #endif 56 | 57 | msg->msgid = MAVLINK_MSG_ID_FENCE_FETCH_POINT; 58 | return mavlink_finalize_message(msg, system_id, component_id, 3, 68); 59 | } 60 | 61 | /** 62 | * @brief Pack a fence_fetch_point message on a channel 63 | * @param system_id ID of this system 64 | * @param component_id ID of this component (e.g. 200 for IMU) 65 | * @param chan The MAVLink channel this message was sent over 66 | * @param msg The MAVLink message to compress the data into 67 | * @param target_system System ID 68 | * @param target_component Component ID 69 | * @param idx point index (first point is 1, 0 is for return point) 70 | * @return length of the message in bytes (excluding serial stream start sign) 71 | */ 72 | static inline uint16_t mavlink_msg_fence_fetch_point_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, 73 | mavlink_message_t* msg, 74 | uint8_t target_system,uint8_t target_component,uint8_t idx) 75 | { 76 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 77 | char buf[3]; 78 | _mav_put_uint8_t(buf, 0, target_system); 79 | _mav_put_uint8_t(buf, 1, target_component); 80 | _mav_put_uint8_t(buf, 2, idx); 81 | 82 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 3); 83 | #else 84 | mavlink_fence_fetch_point_t packet; 85 | packet.target_system = target_system; 86 | packet.target_component = target_component; 87 | packet.idx = idx; 88 | 89 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 3); 90 | #endif 91 | 92 | msg->msgid = MAVLINK_MSG_ID_FENCE_FETCH_POINT; 93 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 3, 68); 94 | } 95 | 96 | /** 97 | * @brief Encode a fence_fetch_point struct into a message 98 | * 99 | * @param system_id ID of this system 100 | * @param component_id ID of this component (e.g. 200 for IMU) 101 | * @param msg The MAVLink message to compress the data into 102 | * @param fence_fetch_point C-struct to read the message contents from 103 | */ 104 | 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) 105 | { 106 | 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); 107 | } 108 | 109 | /** 110 | * @brief Send a fence_fetch_point message 111 | * @param chan MAVLink channel to send the message 112 | * 113 | * @param target_system System ID 114 | * @param target_component Component ID 115 | * @param idx point index (first point is 1, 0 is for return point) 116 | */ 117 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS 118 | 119 | static inline void mavlink_msg_fence_fetch_point_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t idx) 120 | { 121 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 122 | char buf[3]; 123 | _mav_put_uint8_t(buf, 0, target_system); 124 | _mav_put_uint8_t(buf, 1, target_component); 125 | _mav_put_uint8_t(buf, 2, idx); 126 | 127 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_FETCH_POINT, buf, 3, 68); 128 | #else 129 | mavlink_fence_fetch_point_t packet; 130 | packet.target_system = target_system; 131 | packet.target_component = target_component; 132 | packet.idx = idx; 133 | 134 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FENCE_FETCH_POINT, (const char *)&packet, 3, 68); 135 | #endif 136 | } 137 | 138 | #endif 139 | 140 | // MESSAGE FENCE_FETCH_POINT UNPACKING 141 | 142 | 143 | /** 144 | * @brief Get field target_system from fence_fetch_point message 145 | * 146 | * @return System ID 147 | */ 148 | static inline uint8_t mavlink_msg_fence_fetch_point_get_target_system(const mavlink_message_t* msg) 149 | { 150 | return _MAV_RETURN_uint8_t(msg, 0); 151 | } 152 | 153 | /** 154 | * @brief Get field target_component from fence_fetch_point message 155 | * 156 | * @return Component ID 157 | */ 158 | static inline uint8_t mavlink_msg_fence_fetch_point_get_target_component(const mavlink_message_t* msg) 159 | { 160 | return _MAV_RETURN_uint8_t(msg, 1); 161 | } 162 | 163 | /** 164 | * @brief Get field idx from fence_fetch_point message 165 | * 166 | * @return point index (first point is 1, 0 is for return point) 167 | */ 168 | static inline uint8_t mavlink_msg_fence_fetch_point_get_idx(const mavlink_message_t* msg) 169 | { 170 | return _MAV_RETURN_uint8_t(msg, 2); 171 | } 172 | 173 | /** 174 | * @brief Decode a fence_fetch_point message into a struct 175 | * 176 | * @param msg The message to decode 177 | * @param fence_fetch_point C-struct to decode the message contents into 178 | */ 179 | static inline void mavlink_msg_fence_fetch_point_decode(const mavlink_message_t* msg, mavlink_fence_fetch_point_t* fence_fetch_point) 180 | { 181 | #if MAVLINK_NEED_BYTE_SWAP 182 | fence_fetch_point->target_system = mavlink_msg_fence_fetch_point_get_target_system(msg); 183 | fence_fetch_point->target_component = mavlink_msg_fence_fetch_point_get_target_component(msg); 184 | fence_fetch_point->idx = mavlink_msg_fence_fetch_point_get_idx(msg); 185 | #else 186 | memcpy(fence_fetch_point, _MAV_PAYLOAD(msg), 3); 187 | #endif 188 | } 189 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_gps_global_origin.h: -------------------------------------------------------------------------------- 1 | // MESSAGE GPS_GLOBAL_ORIGIN PACKING 2 | 3 | #define MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN 49 4 | 5 | typedef struct __mavlink_gps_global_origin_t 6 | { 7 | int32_t latitude; ///< Latitude (WGS84), expressed as * 1E7 8 | int32_t longitude; ///< Longitude (WGS84), expressed as * 1E7 9 | int32_t altitude; ///< Altitude(WGS84), expressed as * 1000 10 | } mavlink_gps_global_origin_t; 11 | 12 | #define MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_LEN 12 13 | #define MAVLINK_MSG_ID_49_LEN 12 14 | 15 | 16 | 17 | #define MAVLINK_MESSAGE_INFO_GPS_GLOBAL_ORIGIN { \ 18 | "GPS_GLOBAL_ORIGIN", \ 19 | 3, \ 20 | { { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_gps_global_origin_t, latitude) }, \ 21 | { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_gps_global_origin_t, longitude) }, \ 22 | { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_global_origin_t, altitude) }, \ 23 | } \ 24 | } 25 | 26 | 27 | /** 28 | * @brief Pack a gps_global_origin message 29 | * @param system_id ID of this system 30 | * @param component_id ID of this component (e.g. 200 for IMU) 31 | * @param msg The MAVLink message to compress the data into 32 | * 33 | * @param latitude Latitude (WGS84), expressed as * 1E7 34 | * @param longitude Longitude (WGS84), expressed as * 1E7 35 | * @param altitude Altitude(WGS84), expressed as * 1000 36 | * @return length of the message in bytes (excluding serial stream start sign) 37 | */ 38 | static inline uint16_t mavlink_msg_gps_global_origin_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, 39 | int32_t latitude, int32_t longitude, int32_t altitude) 40 | { 41 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 42 | char buf[12]; 43 | _mav_put_int32_t(buf, 0, latitude); 44 | _mav_put_int32_t(buf, 4, longitude); 45 | _mav_put_int32_t(buf, 8, altitude); 46 | 47 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); 48 | #else 49 | mavlink_gps_global_origin_t packet; 50 | packet.latitude = latitude; 51 | packet.longitude = longitude; 52 | packet.altitude = altitude; 53 | 54 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); 55 | #endif 56 | 57 | msg->msgid = MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN; 58 | return mavlink_finalize_message(msg, system_id, component_id, 12, 39); 59 | } 60 | 61 | /** 62 | * @brief Pack a gps_global_origin message on a channel 63 | * @param system_id ID of this system 64 | * @param component_id ID of this component (e.g. 200 for IMU) 65 | * @param chan The MAVLink channel this message was sent over 66 | * @param msg The MAVLink message to compress the data into 67 | * @param latitude Latitude (WGS84), expressed as * 1E7 68 | * @param longitude Longitude (WGS84), expressed as * 1E7 69 | * @param altitude Altitude(WGS84), expressed as * 1000 70 | * @return length of the message in bytes (excluding serial stream start sign) 71 | */ 72 | static inline uint16_t mavlink_msg_gps_global_origin_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, 73 | mavlink_message_t* msg, 74 | int32_t latitude,int32_t longitude,int32_t altitude) 75 | { 76 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 77 | char buf[12]; 78 | _mav_put_int32_t(buf, 0, latitude); 79 | _mav_put_int32_t(buf, 4, longitude); 80 | _mav_put_int32_t(buf, 8, altitude); 81 | 82 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 12); 83 | #else 84 | mavlink_gps_global_origin_t packet; 85 | packet.latitude = latitude; 86 | packet.longitude = longitude; 87 | packet.altitude = altitude; 88 | 89 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 12); 90 | #endif 91 | 92 | msg->msgid = MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN; 93 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 12, 39); 94 | } 95 | 96 | /** 97 | * @brief Encode a gps_global_origin struct into a message 98 | * 99 | * @param system_id ID of this system 100 | * @param component_id ID of this component (e.g. 200 for IMU) 101 | * @param msg The MAVLink message to compress the data into 102 | * @param gps_global_origin C-struct to read the message contents from 103 | */ 104 | static inline uint16_t mavlink_msg_gps_global_origin_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_global_origin_t* gps_global_origin) 105 | { 106 | return mavlink_msg_gps_global_origin_pack(system_id, component_id, msg, gps_global_origin->latitude, gps_global_origin->longitude, gps_global_origin->altitude); 107 | } 108 | 109 | /** 110 | * @brief Send a gps_global_origin message 111 | * @param chan MAVLink channel to send the message 112 | * 113 | * @param latitude Latitude (WGS84), expressed as * 1E7 114 | * @param longitude Longitude (WGS84), expressed as * 1E7 115 | * @param altitude Altitude(WGS84), expressed as * 1000 116 | */ 117 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS 118 | 119 | static inline void mavlink_msg_gps_global_origin_send(mavlink_channel_t chan, int32_t latitude, int32_t longitude, int32_t altitude) 120 | { 121 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 122 | char buf[12]; 123 | _mav_put_int32_t(buf, 0, latitude); 124 | _mav_put_int32_t(buf, 4, longitude); 125 | _mav_put_int32_t(buf, 8, altitude); 126 | 127 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, buf, 12, 39); 128 | #else 129 | mavlink_gps_global_origin_t packet; 130 | packet.latitude = latitude; 131 | packet.longitude = longitude; 132 | packet.altitude = altitude; 133 | 134 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN, (const char *)&packet, 12, 39); 135 | #endif 136 | } 137 | 138 | #endif 139 | 140 | // MESSAGE GPS_GLOBAL_ORIGIN UNPACKING 141 | 142 | 143 | /** 144 | * @brief Get field latitude from gps_global_origin message 145 | * 146 | * @return Latitude (WGS84), expressed as * 1E7 147 | */ 148 | static inline int32_t mavlink_msg_gps_global_origin_get_latitude(const mavlink_message_t* msg) 149 | { 150 | return _MAV_RETURN_int32_t(msg, 0); 151 | } 152 | 153 | /** 154 | * @brief Get field longitude from gps_global_origin message 155 | * 156 | * @return Longitude (WGS84), expressed as * 1E7 157 | */ 158 | static inline int32_t mavlink_msg_gps_global_origin_get_longitude(const mavlink_message_t* msg) 159 | { 160 | return _MAV_RETURN_int32_t(msg, 4); 161 | } 162 | 163 | /** 164 | * @brief Get field altitude from gps_global_origin message 165 | * 166 | * @return Altitude(WGS84), expressed as * 1000 167 | */ 168 | static inline int32_t mavlink_msg_gps_global_origin_get_altitude(const mavlink_message_t* msg) 169 | { 170 | return _MAV_RETURN_int32_t(msg, 8); 171 | } 172 | 173 | /** 174 | * @brief Decode a gps_global_origin message into a struct 175 | * 176 | * @param msg The message to decode 177 | * @param gps_global_origin C-struct to decode the message contents into 178 | */ 179 | static inline void mavlink_msg_gps_global_origin_decode(const mavlink_message_t* msg, mavlink_gps_global_origin_t* gps_global_origin) 180 | { 181 | #if MAVLINK_NEED_BYTE_SWAP 182 | gps_global_origin->latitude = mavlink_msg_gps_global_origin_get_latitude(msg); 183 | gps_global_origin->longitude = mavlink_msg_gps_global_origin_get_longitude(msg); 184 | gps_global_origin->altitude = mavlink_msg_gps_global_origin_get_altitude(msg); 185 | #else 186 | memcpy(gps_global_origin, _MAV_PAYLOAD(msg), 12); 187 | #endif 188 | } 189 | -------------------------------------------------------------------------------- /libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_vision_speed_estimate.h: -------------------------------------------------------------------------------- 1 | // MESSAGE VISION_SPEED_ESTIMATE PACKING 2 | 3 | #define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE 103 4 | 5 | typedef struct __mavlink_vision_speed_estimate_t 6 | { 7 | uint64_t usec; ///< Timestamp (milliseconds) 8 | float x; ///< Global X speed 9 | float y; ///< Global Y speed 10 | float z; ///< Global Z speed 11 | } mavlink_vision_speed_estimate_t; 12 | 13 | #define MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_LEN 20 14 | #define MAVLINK_MSG_ID_103_LEN 20 15 | 16 | 17 | 18 | #define MAVLINK_MESSAGE_INFO_VISION_SPEED_ESTIMATE { \ 19 | "VISION_SPEED_ESTIMATE", \ 20 | 4, \ 21 | { { "usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vision_speed_estimate_t, usec) }, \ 22 | { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_vision_speed_estimate_t, x) }, \ 23 | { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vision_speed_estimate_t, y) }, \ 24 | { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vision_speed_estimate_t, z) }, \ 25 | } \ 26 | } 27 | 28 | 29 | /** 30 | * @brief Pack a vision_speed_estimate message 31 | * @param system_id ID of this system 32 | * @param component_id ID of this component (e.g. 200 for IMU) 33 | * @param msg The MAVLink message to compress the data into 34 | * 35 | * @param usec Timestamp (milliseconds) 36 | * @param x Global X speed 37 | * @param y Global Y speed 38 | * @param z Global Z speed 39 | * @return length of the message in bytes (excluding serial stream start sign) 40 | */ 41 | static inline uint16_t mavlink_msg_vision_speed_estimate_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, 42 | uint64_t usec, float x, float y, float z) 43 | { 44 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 45 | char buf[20]; 46 | _mav_put_uint64_t(buf, 0, usec); 47 | _mav_put_float(buf, 8, x); 48 | _mav_put_float(buf, 12, y); 49 | _mav_put_float(buf, 16, z); 50 | 51 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); 52 | #else 53 | mavlink_vision_speed_estimate_t packet; 54 | packet.usec = usec; 55 | packet.x = x; 56 | packet.y = y; 57 | packet.z = z; 58 | 59 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); 60 | #endif 61 | 62 | msg->msgid = MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE; 63 | return mavlink_finalize_message(msg, system_id, component_id, 20, 208); 64 | } 65 | 66 | /** 67 | * @brief Pack a vision_speed_estimate message on a channel 68 | * @param system_id ID of this system 69 | * @param component_id ID of this component (e.g. 200 for IMU) 70 | * @param chan The MAVLink channel this message was sent over 71 | * @param msg The MAVLink message to compress the data into 72 | * @param usec Timestamp (milliseconds) 73 | * @param x Global X speed 74 | * @param y Global Y speed 75 | * @param z Global Z speed 76 | * @return length of the message in bytes (excluding serial stream start sign) 77 | */ 78 | static inline uint16_t mavlink_msg_vision_speed_estimate_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, 79 | mavlink_message_t* msg, 80 | uint64_t usec,float x,float y,float z) 81 | { 82 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 83 | char buf[20]; 84 | _mav_put_uint64_t(buf, 0, usec); 85 | _mav_put_float(buf, 8, x); 86 | _mav_put_float(buf, 12, y); 87 | _mav_put_float(buf, 16, z); 88 | 89 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 20); 90 | #else 91 | mavlink_vision_speed_estimate_t packet; 92 | packet.usec = usec; 93 | packet.x = x; 94 | packet.y = y; 95 | packet.z = z; 96 | 97 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 20); 98 | #endif 99 | 100 | msg->msgid = MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE; 101 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 20, 208); 102 | } 103 | 104 | /** 105 | * @brief Encode a vision_speed_estimate struct into a message 106 | * 107 | * @param system_id ID of this system 108 | * @param component_id ID of this component (e.g. 200 for IMU) 109 | * @param msg The MAVLink message to compress the data into 110 | * @param vision_speed_estimate C-struct to read the message contents from 111 | */ 112 | static inline uint16_t mavlink_msg_vision_speed_estimate_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vision_speed_estimate_t* vision_speed_estimate) 113 | { 114 | return mavlink_msg_vision_speed_estimate_pack(system_id, component_id, msg, vision_speed_estimate->usec, vision_speed_estimate->x, vision_speed_estimate->y, vision_speed_estimate->z); 115 | } 116 | 117 | /** 118 | * @brief Send a vision_speed_estimate message 119 | * @param chan MAVLink channel to send the message 120 | * 121 | * @param usec Timestamp (milliseconds) 122 | * @param x Global X speed 123 | * @param y Global Y speed 124 | * @param z Global Z speed 125 | */ 126 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS 127 | 128 | static inline void mavlink_msg_vision_speed_estimate_send(mavlink_channel_t chan, uint64_t usec, float x, float y, float z) 129 | { 130 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 131 | char buf[20]; 132 | _mav_put_uint64_t(buf, 0, usec); 133 | _mav_put_float(buf, 8, x); 134 | _mav_put_float(buf, 12, y); 135 | _mav_put_float(buf, 16, z); 136 | 137 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, buf, 20, 208); 138 | #else 139 | mavlink_vision_speed_estimate_t packet; 140 | packet.usec = usec; 141 | packet.x = x; 142 | packet.y = y; 143 | packet.z = z; 144 | 145 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE, (const char *)&packet, 20, 208); 146 | #endif 147 | } 148 | 149 | #endif 150 | 151 | // MESSAGE VISION_SPEED_ESTIMATE UNPACKING 152 | 153 | 154 | /** 155 | * @brief Get field usec from vision_speed_estimate message 156 | * 157 | * @return Timestamp (milliseconds) 158 | */ 159 | static inline uint64_t mavlink_msg_vision_speed_estimate_get_usec(const mavlink_message_t* msg) 160 | { 161 | return _MAV_RETURN_uint64_t(msg, 0); 162 | } 163 | 164 | /** 165 | * @brief Get field x from vision_speed_estimate message 166 | * 167 | * @return Global X speed 168 | */ 169 | static inline float mavlink_msg_vision_speed_estimate_get_x(const mavlink_message_t* msg) 170 | { 171 | return _MAV_RETURN_float(msg, 8); 172 | } 173 | 174 | /** 175 | * @brief Get field y from vision_speed_estimate message 176 | * 177 | * @return Global Y speed 178 | */ 179 | static inline float mavlink_msg_vision_speed_estimate_get_y(const mavlink_message_t* msg) 180 | { 181 | return _MAV_RETURN_float(msg, 12); 182 | } 183 | 184 | /** 185 | * @brief Get field z from vision_speed_estimate message 186 | * 187 | * @return Global Z speed 188 | */ 189 | static inline float mavlink_msg_vision_speed_estimate_get_z(const mavlink_message_t* msg) 190 | { 191 | return _MAV_RETURN_float(msg, 16); 192 | } 193 | 194 | /** 195 | * @brief Decode a vision_speed_estimate message into a struct 196 | * 197 | * @param msg The message to decode 198 | * @param vision_speed_estimate C-struct to decode the message contents into 199 | */ 200 | static inline void mavlink_msg_vision_speed_estimate_decode(const mavlink_message_t* msg, mavlink_vision_speed_estimate_t* vision_speed_estimate) 201 | { 202 | #if MAVLINK_NEED_BYTE_SWAP 203 | vision_speed_estimate->usec = mavlink_msg_vision_speed_estimate_get_usec(msg); 204 | vision_speed_estimate->x = mavlink_msg_vision_speed_estimate_get_x(msg); 205 | vision_speed_estimate->y = mavlink_msg_vision_speed_estimate_get_y(msg); 206 | vision_speed_estimate->z = mavlink_msg_vision_speed_estimate_get_z(msg); 207 | #else 208 | memcpy(vision_speed_estimate, _MAV_PAYLOAD(msg), 20); 209 | #endif 210 | } 211 | --------------------------------------------------------------------------------