diff --git a/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/ardupilotmega.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/ardupilotmega.h index 620883e654..642d82587c 100644 --- a/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/ardupilotmega.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/ardupilotmega.h @@ -16,11 +16,11 @@ extern "C" { // MESSAGE LENGTHS AND CRCS #ifndef MAVLINK_MESSAGE_LENGTHS -#define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 28, 22, 22, 21, 6, 6, 37, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 37, 0, 0, 0, 27, 25, 0, 0, 0, 0, 0, 68, 26, 185, 181, 42, 6, 4, 0, 11, 18, 0, 0, 37, 20, 35, 33, 3, 0, 0, 0, 22, 39, 37, 53, 51, 53, 51, 0, 28, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 62, 44, 64, 84, 9, 254, 16, 0, 36, 44, 64, 22, 6, 14, 12, 97, 2, 2, 113, 35, 6, 79, 35, 35, 22, 13, 255, 14, 18, 43, 8, 22, 14, 36, 43, 41, 0, 0, 14, 0, 0, 0, 36, 60, 30, 42, 8, 4, 12, 15, 13, 6, 15, 14, 0, 12, 3, 8, 28, 44, 3, 9, 22, 12, 18, 34, 66, 98, 8, 48, 19, 3, 20, 24, 29, 45, 4, 40, 2, 0, 0, 29, 0, 0, 0, 0, 27, 44, 22, 25, 0, 0, 0, 0, 0, 42, 14, 2, 3, 2, 1, 33, 1, 6, 2, 4, 2, 3, 2, 0, 1, 3, 2, 4, 2, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 52, 53, 0, 0, 40, 0, 254, 36, 30, 18, 18, 51, 9, 0} +#define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 28, 22, 22, 21, 6, 6, 37, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 37, 0, 0, 0, 27, 25, 0, 0, 0, 0, 0, 68, 26, 185, 181, 42, 6, 4, 0, 11, 18, 0, 0, 37, 20, 35, 33, 3, 0, 0, 0, 22, 39, 37, 53, 51, 53, 51, 0, 28, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 62, 44, 64, 84, 9, 254, 16, 0, 36, 44, 64, 22, 6, 14, 12, 97, 2, 2, 113, 35, 6, 79, 35, 35, 22, 13, 255, 14, 18, 43, 8, 22, 14, 36, 43, 41, 0, 0, 14, 0, 0, 0, 36, 60, 30, 42, 8, 4, 12, 15, 13, 6, 15, 14, 0, 12, 3, 8, 28, 44, 3, 9, 22, 12, 18, 34, 66, 98, 8, 48, 19, 3, 20, 24, 29, 45, 4, 40, 2, 0, 0, 29, 0, 0, 0, 0, 27, 44, 22, 25, 0, 0, 0, 0, 0, 42, 14, 2, 3, 2, 1, 33, 1, 6, 2, 4, 2, 3, 2, 0, 1, 3, 2, 4, 2, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 52, 53, 0, 0, 42, 0, 254, 36, 30, 18, 18, 51, 9, 0} #endif #ifndef MAVLINK_MESSAGE_CRCS -#define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 78, 0, 0, 0, 15, 3, 0, 0, 0, 0, 0, 153, 183, 51, 82, 118, 148, 21, 0, 243, 124, 0, 0, 38, 20, 158, 152, 143, 0, 0, 0, 106, 49, 22, 143, 140, 5, 150, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 93, 138, 108, 32, 185, 84, 34, 0, 124, 237, 4, 76, 128, 56, 116, 134, 237, 203, 250, 87, 203, 220, 25, 226, 46, 29, 223, 85, 6, 229, 203, 1, 195, 109, 168, 181, 0, 0, 131, 0, 0, 0, 154, 178, 200, 134, 219, 208, 188, 84, 22, 19, 21, 134, 0, 78, 68, 189, 127, 154, 21, 21, 144, 1, 234, 73, 181, 22, 83, 167, 138, 234, 240, 47, 189, 52, 174, 229, 85, 0, 0, 72, 0, 0, 0, 0, 92, 36, 71, 98, 0, 0, 0, 0, 0, 134, 205, 94, 128, 54, 63, 112, 201, 221, 226, 238, 103, 235, 14, 0, 77, 50, 163, 115, 47, 0, 0, 0, 0, 0, 0, 207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 104, 85, 0, 0, 223, 0, 8, 204, 49, 170, 44, 83, 46, 0} +#define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 78, 0, 0, 0, 15, 3, 0, 0, 0, 0, 0, 153, 183, 51, 82, 118, 148, 21, 0, 243, 124, 0, 0, 38, 20, 158, 152, 143, 0, 0, 0, 106, 49, 22, 143, 140, 5, 150, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 93, 138, 108, 32, 185, 84, 34, 0, 124, 237, 4, 76, 128, 56, 116, 134, 237, 203, 250, 87, 203, 220, 25, 226, 46, 29, 223, 85, 6, 229, 203, 1, 195, 109, 168, 181, 0, 0, 131, 0, 0, 0, 154, 178, 200, 134, 219, 208, 188, 84, 22, 19, 21, 134, 0, 78, 68, 189, 127, 154, 21, 21, 144, 1, 234, 73, 181, 22, 83, 167, 138, 234, 240, 47, 189, 52, 174, 229, 85, 0, 0, 72, 0, 0, 0, 0, 92, 36, 71, 98, 0, 0, 0, 0, 0, 134, 205, 94, 128, 54, 63, 112, 201, 221, 226, 238, 103, 235, 14, 0, 77, 50, 163, 115, 47, 0, 0, 0, 0, 0, 0, 207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 104, 85, 0, 0, 210, 0, 8, 204, 49, 170, 44, 83, 46, 0} #endif #ifndef MAVLINK_MESSAGE_INFO diff --git a/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/version.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/version.h index 721245fcd2..850e048f9f 100644 --- a/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/version.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/ardupilotmega/version.h @@ -5,7 +5,7 @@ #ifndef MAVLINK_VERSION_H #define MAVLINK_VERSION_H -#define MAVLINK_BUILD_DATE "Thu Nov 26 10:24:17 2015" +#define MAVLINK_BUILD_DATE "Tue Dec 1 17:10:47 2015" #define MAVLINK_WIRE_PROTOCOL_VERSION "1.0" #define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255 diff --git a/libraries/GCS_MAVLink/include/mavlink/v1.0/common/common.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/common.h index df540a1c0e..748392851c 100644 --- a/libraries/GCS_MAVLink/include/mavlink/v1.0/common/common.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/common.h @@ -16,11 +16,11 @@ extern "C" { // MESSAGE LENGTHS AND CRCS #ifndef MAVLINK_MESSAGE_LENGTHS -#define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 28, 22, 22, 21, 6, 6, 37, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 37, 0, 0, 0, 27, 25, 0, 0, 0, 0, 0, 68, 26, 185, 181, 42, 6, 4, 0, 11, 18, 0, 0, 37, 20, 35, 33, 3, 0, 0, 0, 22, 39, 37, 53, 51, 53, 51, 0, 28, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 62, 44, 64, 84, 9, 254, 16, 0, 36, 44, 64, 22, 6, 14, 12, 97, 2, 2, 113, 35, 6, 79, 35, 35, 22, 13, 255, 14, 18, 43, 8, 22, 14, 36, 43, 41, 0, 0, 14, 0, 0, 0, 36, 60, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 52, 53, 0, 0, 40, 0, 254, 36, 30, 18, 18, 51, 9, 0} +#define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 28, 22, 22, 21, 6, 6, 37, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 37, 0, 0, 0, 27, 25, 0, 0, 0, 0, 0, 68, 26, 185, 181, 42, 6, 4, 0, 11, 18, 0, 0, 37, 20, 35, 33, 3, 0, 0, 0, 22, 39, 37, 53, 51, 53, 51, 0, 28, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 62, 44, 64, 84, 9, 254, 16, 0, 36, 44, 64, 22, 6, 14, 12, 97, 2, 2, 113, 35, 6, 79, 35, 35, 22, 13, 255, 14, 18, 43, 8, 22, 14, 36, 43, 41, 0, 0, 14, 0, 0, 0, 36, 60, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 52, 53, 0, 0, 42, 0, 254, 36, 30, 18, 18, 51, 9, 0} #endif #ifndef MAVLINK_MESSAGE_CRCS -#define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 78, 0, 0, 0, 15, 3, 0, 0, 0, 0, 0, 153, 183, 51, 82, 118, 148, 21, 0, 243, 124, 0, 0, 38, 20, 158, 152, 143, 0, 0, 0, 106, 49, 22, 143, 140, 5, 150, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 93, 138, 108, 32, 185, 84, 34, 0, 124, 237, 4, 76, 128, 56, 116, 134, 237, 203, 250, 87, 203, 220, 25, 226, 46, 29, 223, 85, 6, 229, 203, 1, 195, 109, 168, 181, 0, 0, 131, 0, 0, 0, 154, 178, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 104, 85, 0, 0, 223, 0, 8, 204, 49, 170, 44, 83, 46, 0} +#define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 78, 0, 0, 0, 15, 3, 0, 0, 0, 0, 0, 153, 183, 51, 82, 118, 148, 21, 0, 243, 124, 0, 0, 38, 20, 158, 152, 143, 0, 0, 0, 106, 49, 22, 143, 140, 5, 150, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 93, 138, 108, 32, 185, 84, 34, 0, 124, 237, 4, 76, 128, 56, 116, 134, 237, 203, 250, 87, 203, 220, 25, 226, 46, 29, 223, 85, 6, 229, 203, 1, 195, 109, 168, 181, 0, 0, 131, 0, 0, 0, 154, 178, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 104, 85, 0, 0, 210, 0, 8, 204, 49, 170, 44, 83, 46, 0} #endif #ifndef MAVLINK_MESSAGE_INFO @@ -639,7 +639,8 @@ typedef enum ADSB_FLAGS ADSB_FLAGS_VALID_VELOCITY=8, /* | */ ADSB_FLAGS_VALID_CALLSIGN=16, /* | */ ADSB_FLAGS_SIMULATED=32, /* | */ - ADSB_FLAGS_ENUM_END=33, /* | */ + ADSB_FLAGS_VALID_SQUAWK=64, /* | */ + ADSB_FLAGS_ENUM_END=65, /* | */ } ADSB_FLAGS; #endif diff --git a/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_adsb_vehicle.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_adsb_vehicle.h index 8887ae1576..0de724c8bf 100644 --- a/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_adsb_vehicle.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/mavlink_msg_adsb_vehicle.h @@ -12,23 +12,24 @@ typedef struct __mavlink_adsb_vehicle_t float ver_velocity; /*< The vertical velocity in meters/second, positive is up*/ uint16_t heading; /*< Course over ground in centidegrees*/ uint16_t flags; /*< Flags to indicate various statuses including valid data fields*/ + uint16_t squawk; /*< Squawk code*/ uint8_t altitude_type; /*< Type from ADSB_ALTITUDE_TYPE enum*/ char callsign[9]; /*< The callsign, 8+null*/ uint8_t emitter_type; /*< Type from ADSB_EMITTER_TYPE enum*/ uint8_t tslc; /*< Time since last communication in seconds*/ } mavlink_adsb_vehicle_t; -#define MAVLINK_MSG_ID_ADSB_VEHICLE_LEN 40 -#define MAVLINK_MSG_ID_246_LEN 40 +#define MAVLINK_MSG_ID_ADSB_VEHICLE_LEN 42 +#define MAVLINK_MSG_ID_246_LEN 42 -#define MAVLINK_MSG_ID_ADSB_VEHICLE_CRC 223 -#define MAVLINK_MSG_ID_246_CRC 223 +#define MAVLINK_MSG_ID_ADSB_VEHICLE_CRC 210 +#define MAVLINK_MSG_ID_246_CRC 210 #define MAVLINK_MSG_ADSB_VEHICLE_FIELD_CALLSIGN_LEN 9 #define MAVLINK_MESSAGE_INFO_ADSB_VEHICLE { \ "ADSB_VEHICLE", \ - 12, \ + 13, \ { { "ICAO_address", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_adsb_vehicle_t, ICAO_address) }, \ { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_adsb_vehicle_t, lat) }, \ { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_adsb_vehicle_t, lon) }, \ @@ -37,10 +38,11 @@ typedef struct __mavlink_adsb_vehicle_t { "ver_velocity", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_adsb_vehicle_t, ver_velocity) }, \ { "heading", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_adsb_vehicle_t, heading) }, \ { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_adsb_vehicle_t, flags) }, \ - { "altitude_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_adsb_vehicle_t, altitude_type) }, \ - { "callsign", NULL, MAVLINK_TYPE_CHAR, 9, 29, offsetof(mavlink_adsb_vehicle_t, callsign) }, \ - { "emitter_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 38, offsetof(mavlink_adsb_vehicle_t, emitter_type) }, \ - { "tslc", NULL, MAVLINK_TYPE_UINT8_T, 0, 39, offsetof(mavlink_adsb_vehicle_t, tslc) }, \ + { "squawk", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_adsb_vehicle_t, squawk) }, \ + { "altitude_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_adsb_vehicle_t, altitude_type) }, \ + { "callsign", NULL, MAVLINK_TYPE_CHAR, 9, 31, offsetof(mavlink_adsb_vehicle_t, callsign) }, \ + { "emitter_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_adsb_vehicle_t, emitter_type) }, \ + { "tslc", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_adsb_vehicle_t, tslc) }, \ } \ } @@ -63,10 +65,11 @@ typedef struct __mavlink_adsb_vehicle_t * @param emitter_type Type from ADSB_EMITTER_TYPE enum * @param tslc Time since last communication in seconds * @param flags Flags to indicate various statuses including valid data fields + * @param squawk Squawk code * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_adsb_vehicle_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, - uint32_t ICAO_address, int32_t lat, int32_t lon, uint8_t altitude_type, float altitude, uint16_t heading, float hor_velocity, float ver_velocity, const char *callsign, uint8_t emitter_type, uint8_t tslc, uint16_t flags) + uint32_t ICAO_address, int32_t lat, int32_t lon, uint8_t altitude_type, float altitude, uint16_t heading, float hor_velocity, float ver_velocity, const char *callsign, uint8_t emitter_type, uint8_t tslc, uint16_t flags, uint16_t squawk) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS char buf[MAVLINK_MSG_ID_ADSB_VEHICLE_LEN]; @@ -78,10 +81,11 @@ static inline uint16_t mavlink_msg_adsb_vehicle_pack(uint8_t system_id, uint8_t _mav_put_float(buf, 20, ver_velocity); _mav_put_uint16_t(buf, 24, heading); _mav_put_uint16_t(buf, 26, flags); - _mav_put_uint8_t(buf, 28, altitude_type); - _mav_put_uint8_t(buf, 38, emitter_type); - _mav_put_uint8_t(buf, 39, tslc); - _mav_put_char_array(buf, 29, callsign, 9); + _mav_put_uint16_t(buf, 28, squawk); + _mav_put_uint8_t(buf, 30, altitude_type); + _mav_put_uint8_t(buf, 40, emitter_type); + _mav_put_uint8_t(buf, 41, tslc); + _mav_put_char_array(buf, 31, callsign, 9); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN); #else mavlink_adsb_vehicle_t packet; @@ -93,6 +97,7 @@ static inline uint16_t mavlink_msg_adsb_vehicle_pack(uint8_t system_id, uint8_t packet.ver_velocity = ver_velocity; packet.heading = heading; packet.flags = flags; + packet.squawk = squawk; packet.altitude_type = altitude_type; packet.emitter_type = emitter_type; packet.tslc = tslc; @@ -126,11 +131,12 @@ static inline uint16_t mavlink_msg_adsb_vehicle_pack(uint8_t system_id, uint8_t * @param emitter_type Type from ADSB_EMITTER_TYPE enum * @param tslc Time since last communication in seconds * @param flags Flags to indicate various statuses including valid data fields + * @param squawk Squawk code * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_adsb_vehicle_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, - uint32_t ICAO_address,int32_t lat,int32_t lon,uint8_t altitude_type,float altitude,uint16_t heading,float hor_velocity,float ver_velocity,const char *callsign,uint8_t emitter_type,uint8_t tslc,uint16_t flags) + uint32_t ICAO_address,int32_t lat,int32_t lon,uint8_t altitude_type,float altitude,uint16_t heading,float hor_velocity,float ver_velocity,const char *callsign,uint8_t emitter_type,uint8_t tslc,uint16_t flags,uint16_t squawk) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS char buf[MAVLINK_MSG_ID_ADSB_VEHICLE_LEN]; @@ -142,10 +148,11 @@ static inline uint16_t mavlink_msg_adsb_vehicle_pack_chan(uint8_t system_id, uin _mav_put_float(buf, 20, ver_velocity); _mav_put_uint16_t(buf, 24, heading); _mav_put_uint16_t(buf, 26, flags); - _mav_put_uint8_t(buf, 28, altitude_type); - _mav_put_uint8_t(buf, 38, emitter_type); - _mav_put_uint8_t(buf, 39, tslc); - _mav_put_char_array(buf, 29, callsign, 9); + _mav_put_uint16_t(buf, 28, squawk); + _mav_put_uint8_t(buf, 30, altitude_type); + _mav_put_uint8_t(buf, 40, emitter_type); + _mav_put_uint8_t(buf, 41, tslc); + _mav_put_char_array(buf, 31, callsign, 9); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN); #else mavlink_adsb_vehicle_t packet; @@ -157,6 +164,7 @@ static inline uint16_t mavlink_msg_adsb_vehicle_pack_chan(uint8_t system_id, uin packet.ver_velocity = ver_velocity; packet.heading = heading; packet.flags = flags; + packet.squawk = squawk; packet.altitude_type = altitude_type; packet.emitter_type = emitter_type; packet.tslc = tslc; @@ -182,7 +190,7 @@ static inline uint16_t mavlink_msg_adsb_vehicle_pack_chan(uint8_t system_id, uin */ static inline uint16_t mavlink_msg_adsb_vehicle_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_adsb_vehicle_t* adsb_vehicle) { - return mavlink_msg_adsb_vehicle_pack(system_id, component_id, msg, adsb_vehicle->ICAO_address, adsb_vehicle->lat, adsb_vehicle->lon, adsb_vehicle->altitude_type, adsb_vehicle->altitude, adsb_vehicle->heading, adsb_vehicle->hor_velocity, adsb_vehicle->ver_velocity, adsb_vehicle->callsign, adsb_vehicle->emitter_type, adsb_vehicle->tslc, adsb_vehicle->flags); + return mavlink_msg_adsb_vehicle_pack(system_id, component_id, msg, adsb_vehicle->ICAO_address, adsb_vehicle->lat, adsb_vehicle->lon, adsb_vehicle->altitude_type, adsb_vehicle->altitude, adsb_vehicle->heading, adsb_vehicle->hor_velocity, adsb_vehicle->ver_velocity, adsb_vehicle->callsign, adsb_vehicle->emitter_type, adsb_vehicle->tslc, adsb_vehicle->flags, adsb_vehicle->squawk); } /** @@ -196,7 +204,7 @@ static inline uint16_t mavlink_msg_adsb_vehicle_encode(uint8_t system_id, uint8_ */ static inline uint16_t mavlink_msg_adsb_vehicle_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_adsb_vehicle_t* adsb_vehicle) { - return mavlink_msg_adsb_vehicle_pack_chan(system_id, component_id, chan, msg, adsb_vehicle->ICAO_address, adsb_vehicle->lat, adsb_vehicle->lon, adsb_vehicle->altitude_type, adsb_vehicle->altitude, adsb_vehicle->heading, adsb_vehicle->hor_velocity, adsb_vehicle->ver_velocity, adsb_vehicle->callsign, adsb_vehicle->emitter_type, adsb_vehicle->tslc, adsb_vehicle->flags); + return mavlink_msg_adsb_vehicle_pack_chan(system_id, component_id, chan, msg, adsb_vehicle->ICAO_address, adsb_vehicle->lat, adsb_vehicle->lon, adsb_vehicle->altitude_type, adsb_vehicle->altitude, adsb_vehicle->heading, adsb_vehicle->hor_velocity, adsb_vehicle->ver_velocity, adsb_vehicle->callsign, adsb_vehicle->emitter_type, adsb_vehicle->tslc, adsb_vehicle->flags, adsb_vehicle->squawk); } /** @@ -215,10 +223,11 @@ static inline uint16_t mavlink_msg_adsb_vehicle_encode_chan(uint8_t system_id, u * @param emitter_type Type from ADSB_EMITTER_TYPE enum * @param tslc Time since last communication in seconds * @param flags Flags to indicate various statuses including valid data fields + * @param squawk Squawk code */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS -static inline void mavlink_msg_adsb_vehicle_send(mavlink_channel_t chan, uint32_t ICAO_address, int32_t lat, int32_t lon, uint8_t altitude_type, float altitude, uint16_t heading, float hor_velocity, float ver_velocity, const char *callsign, uint8_t emitter_type, uint8_t tslc, uint16_t flags) +static inline void mavlink_msg_adsb_vehicle_send(mavlink_channel_t chan, uint32_t ICAO_address, int32_t lat, int32_t lon, uint8_t altitude_type, float altitude, uint16_t heading, float hor_velocity, float ver_velocity, const char *callsign, uint8_t emitter_type, uint8_t tslc, uint16_t flags, uint16_t squawk) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS char buf[MAVLINK_MSG_ID_ADSB_VEHICLE_LEN]; @@ -230,10 +239,11 @@ static inline void mavlink_msg_adsb_vehicle_send(mavlink_channel_t chan, uint32_ _mav_put_float(buf, 20, ver_velocity); _mav_put_uint16_t(buf, 24, heading); _mav_put_uint16_t(buf, 26, flags); - _mav_put_uint8_t(buf, 28, altitude_type); - _mav_put_uint8_t(buf, 38, emitter_type); - _mav_put_uint8_t(buf, 39, tslc); - _mav_put_char_array(buf, 29, callsign, 9); + _mav_put_uint16_t(buf, 28, squawk); + _mav_put_uint8_t(buf, 30, altitude_type); + _mav_put_uint8_t(buf, 40, emitter_type); + _mav_put_uint8_t(buf, 41, tslc); + _mav_put_char_array(buf, 31, callsign, 9); #if MAVLINK_CRC_EXTRA _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, buf, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC); #else @@ -249,6 +259,7 @@ static inline void mavlink_msg_adsb_vehicle_send(mavlink_channel_t chan, uint32_ packet.ver_velocity = ver_velocity; packet.heading = heading; packet.flags = flags; + packet.squawk = squawk; packet.altitude_type = altitude_type; packet.emitter_type = emitter_type; packet.tslc = tslc; @@ -269,7 +280,7 @@ static inline void mavlink_msg_adsb_vehicle_send(mavlink_channel_t chan, uint32_ is usually the receive buffer for the channel, and allows a reply to an incoming message with minimum stack space usage. */ -static inline void mavlink_msg_adsb_vehicle_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t ICAO_address, int32_t lat, int32_t lon, uint8_t altitude_type, float altitude, uint16_t heading, float hor_velocity, float ver_velocity, const char *callsign, uint8_t emitter_type, uint8_t tslc, uint16_t flags) +static inline void mavlink_msg_adsb_vehicle_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t ICAO_address, int32_t lat, int32_t lon, uint8_t altitude_type, float altitude, uint16_t heading, float hor_velocity, float ver_velocity, const char *callsign, uint8_t emitter_type, uint8_t tslc, uint16_t flags, uint16_t squawk) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS char *buf = (char *)msgbuf; @@ -281,10 +292,11 @@ static inline void mavlink_msg_adsb_vehicle_send_buf(mavlink_message_t *msgbuf, _mav_put_float(buf, 20, ver_velocity); _mav_put_uint16_t(buf, 24, heading); _mav_put_uint16_t(buf, 26, flags); - _mav_put_uint8_t(buf, 28, altitude_type); - _mav_put_uint8_t(buf, 38, emitter_type); - _mav_put_uint8_t(buf, 39, tslc); - _mav_put_char_array(buf, 29, callsign, 9); + _mav_put_uint16_t(buf, 28, squawk); + _mav_put_uint8_t(buf, 30, altitude_type); + _mav_put_uint8_t(buf, 40, emitter_type); + _mav_put_uint8_t(buf, 41, tslc); + _mav_put_char_array(buf, 31, callsign, 9); #if MAVLINK_CRC_EXTRA _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADSB_VEHICLE, buf, MAVLINK_MSG_ID_ADSB_VEHICLE_LEN, MAVLINK_MSG_ID_ADSB_VEHICLE_CRC); #else @@ -300,6 +312,7 @@ static inline void mavlink_msg_adsb_vehicle_send_buf(mavlink_message_t *msgbuf, packet->ver_velocity = ver_velocity; packet->heading = heading; packet->flags = flags; + packet->squawk = squawk; packet->altitude_type = altitude_type; packet->emitter_type = emitter_type; packet->tslc = tslc; @@ -355,7 +368,7 @@ static inline int32_t mavlink_msg_adsb_vehicle_get_lon(const mavlink_message_t* */ static inline uint8_t mavlink_msg_adsb_vehicle_get_altitude_type(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 28); + return _MAV_RETURN_uint8_t(msg, 30); } /** @@ -405,7 +418,7 @@ static inline float mavlink_msg_adsb_vehicle_get_ver_velocity(const mavlink_mess */ static inline uint16_t mavlink_msg_adsb_vehicle_get_callsign(const mavlink_message_t* msg, char *callsign) { - return _MAV_RETURN_char_array(msg, callsign, 9, 29); + return _MAV_RETURN_char_array(msg, callsign, 9, 31); } /** @@ -415,7 +428,7 @@ static inline uint16_t mavlink_msg_adsb_vehicle_get_callsign(const mavlink_messa */ static inline uint8_t mavlink_msg_adsb_vehicle_get_emitter_type(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 38); + return _MAV_RETURN_uint8_t(msg, 40); } /** @@ -425,7 +438,7 @@ static inline uint8_t mavlink_msg_adsb_vehicle_get_emitter_type(const mavlink_me */ static inline uint8_t mavlink_msg_adsb_vehicle_get_tslc(const mavlink_message_t* msg) { - return _MAV_RETURN_uint8_t(msg, 39); + return _MAV_RETURN_uint8_t(msg, 41); } /** @@ -438,6 +451,16 @@ static inline uint16_t mavlink_msg_adsb_vehicle_get_flags(const mavlink_message_ return _MAV_RETURN_uint16_t(msg, 26); } +/** + * @brief Get field squawk from adsb_vehicle message + * + * @return Squawk code + */ +static inline uint16_t mavlink_msg_adsb_vehicle_get_squawk(const mavlink_message_t* msg) +{ + return _MAV_RETURN_uint16_t(msg, 28); +} + /** * @brief Decode a adsb_vehicle message into a struct * @@ -455,6 +478,7 @@ static inline void mavlink_msg_adsb_vehicle_decode(const mavlink_message_t* msg, adsb_vehicle->ver_velocity = mavlink_msg_adsb_vehicle_get_ver_velocity(msg); adsb_vehicle->heading = mavlink_msg_adsb_vehicle_get_heading(msg); adsb_vehicle->flags = mavlink_msg_adsb_vehicle_get_flags(msg); + adsb_vehicle->squawk = mavlink_msg_adsb_vehicle_get_squawk(msg); adsb_vehicle->altitude_type = mavlink_msg_adsb_vehicle_get_altitude_type(msg); mavlink_msg_adsb_vehicle_get_callsign(msg, adsb_vehicle->callsign); adsb_vehicle->emitter_type = mavlink_msg_adsb_vehicle_get_emitter_type(msg); diff --git a/libraries/GCS_MAVLink/include/mavlink/v1.0/common/testsuite.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/testsuite.h index e156d3befc..544cf13fe2 100644 --- a/libraries/GCS_MAVLink/include/mavlink/v1.0/common/testsuite.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/testsuite.h @@ -5620,7 +5620,7 @@ static void mavlink_test_adsb_vehicle(uint8_t system_id, uint8_t component_id, m uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; mavlink_adsb_vehicle_t packet_in = { - 963497464,963497672,963497880,101.0,129.0,157.0,18483,18587,89,"DEFGHIJK",247,58 + 963497464,963497672,963497880,101.0,129.0,157.0,18483,18587,18691,223,"FGHIJKLM",125,192 }; mavlink_adsb_vehicle_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); @@ -5632,6 +5632,7 @@ static void mavlink_test_adsb_vehicle(uint8_t system_id, uint8_t component_id, m packet1.ver_velocity = packet_in.ver_velocity; packet1.heading = packet_in.heading; packet1.flags = packet_in.flags; + packet1.squawk = packet_in.squawk; packet1.altitude_type = packet_in.altitude_type; packet1.emitter_type = packet_in.emitter_type; packet1.tslc = packet_in.tslc; @@ -5645,12 +5646,12 @@ static void mavlink_test_adsb_vehicle(uint8_t system_id, uint8_t component_id, m MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_adsb_vehicle_pack(system_id, component_id, &msg , packet1.ICAO_address , packet1.lat , packet1.lon , packet1.altitude_type , packet1.altitude , packet1.heading , packet1.hor_velocity , packet1.ver_velocity , packet1.callsign , packet1.emitter_type , packet1.tslc , packet1.flags ); + mavlink_msg_adsb_vehicle_pack(system_id, component_id, &msg , packet1.ICAO_address , packet1.lat , packet1.lon , packet1.altitude_type , packet1.altitude , packet1.heading , packet1.hor_velocity , packet1.ver_velocity , packet1.callsign , packet1.emitter_type , packet1.tslc , packet1.flags , packet1.squawk ); mavlink_msg_adsb_vehicle_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_adsb_vehicle_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.ICAO_address , packet1.lat , packet1.lon , packet1.altitude_type , packet1.altitude , packet1.heading , packet1.hor_velocity , packet1.ver_velocity , packet1.callsign , packet1.emitter_type , packet1.tslc , packet1.flags ); + mavlink_msg_adsb_vehicle_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.ICAO_address , packet1.lat , packet1.lon , packet1.altitude_type , packet1.altitude , packet1.heading , packet1.hor_velocity , packet1.ver_velocity , packet1.callsign , packet1.emitter_type , packet1.tslc , packet1.flags , packet1.squawk ); mavlink_msg_adsb_vehicle_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); @@ -5663,7 +5664,7 @@ static void mavlink_test_adsb_vehicle(uint8_t system_id, uint8_t component_id, m MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); - mavlink_msg_adsb_vehicle_send(MAVLINK_COMM_1 , packet1.ICAO_address , packet1.lat , packet1.lon , packet1.altitude_type , packet1.altitude , packet1.heading , packet1.hor_velocity , packet1.ver_velocity , packet1.callsign , packet1.emitter_type , packet1.tslc , packet1.flags ); + mavlink_msg_adsb_vehicle_send(MAVLINK_COMM_1 , packet1.ICAO_address , packet1.lat , packet1.lon , packet1.altitude_type , packet1.altitude , packet1.heading , packet1.hor_velocity , packet1.ver_velocity , packet1.callsign , packet1.emitter_type , packet1.tslc , packet1.flags , packet1.squawk ); mavlink_msg_adsb_vehicle_decode(last_msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); } diff --git a/libraries/GCS_MAVLink/include/mavlink/v1.0/common/version.h b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/version.h index 5bc8fc2b78..f1836474ad 100644 --- a/libraries/GCS_MAVLink/include/mavlink/v1.0/common/version.h +++ b/libraries/GCS_MAVLink/include/mavlink/v1.0/common/version.h @@ -5,7 +5,7 @@ #ifndef MAVLINK_VERSION_H #define MAVLINK_VERSION_H -#define MAVLINK_BUILD_DATE "Thu Nov 26 10:24:19 2015" +#define MAVLINK_BUILD_DATE "Tue Dec 1 17:10:50 2015" #define MAVLINK_WIRE_PROTOCOL_VERSION "1.0" #define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255