Commit 68f99575 authored by PX4BuildBot's avatar PX4BuildBot

autogenerated headers for rev...

autogenerated headers for rev https://github.com/mavlink/mavlink/tree/8cf87fc5afe996604cc4399f21f83c7989ae5d9a
parent 62abc603
......@@ -7,7 +7,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Mar 26 2018"
#define MAVLINK_BUILD_DATE "Tue Mar 27 2018"
#define MAVLINK_WIRE_PROTOCOL_VERSION "2.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
......
......@@ -7,7 +7,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Mar 26 2018"
#define MAVLINK_BUILD_DATE "Tue Mar 27 2018"
#define MAVLINK_WIRE_PROTOCOL_VERSION "2.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
......
......@@ -7,7 +7,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Mar 26 2018"
#define MAVLINK_BUILD_DATE "Tue Mar 27 2018"
#define MAVLINK_WIRE_PROTOCOL_VERSION "2.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
......
......@@ -906,6 +906,22 @@ typedef enum MAV_BATTERY_FUNCTION
} MAV_BATTERY_FUNCTION;
#endif
/** @brief Enumeration for states of low battery extent */
#ifndef HAVE_ENUM_MAV_BATTERY_CHARGE_STATE
#define HAVE_ENUM_MAV_BATTERY_CHARGE_STATE
typedef enum MAV_BATTERY_CHARGE_STATE
{
MAV_BATTERY_CHARGE_STATE_UNDEFINED=0, /* Low battery state is not provided | */
MAV_BATTERY_CHARGE_STATE_OK=1, /* Battery is not nearly empty, normal operation | */
MAV_BATTERY_CHARGE_STATE_LOW=2, /* Battery state is low, warn and monitor close | */
MAV_BATTERY_CHARGE_STATE_CRITICAL=3, /* Battry state is critical, return / abort immediately | */
MAV_BATTERY_CHARGE_STATE_EMERGENCY=4, /* Battry state is too low for ordinary abortion, fastest possible emergency stop preventing damage | */
MAV_BATTERY_CHARGE_STATE_FAILED=5, /* Battry failed, damage unavoidable | */
MAV_BATTERY_CHARGE_STATE_UNHEALTHY=6, /* Battry is diagnosed to be broken or an error occurred, usage is discouraged / prohibited | */
MAV_BATTERY_CHARGE_STATE_ENUM_END=7, /* | */
} MAV_BATTERY_CHARGE_STATE;
#endif
/** @brief Enumeration of VTOL states */
#ifndef HAVE_ENUM_MAV_VTOL_STATE
#define HAVE_ENUM_MAV_VTOL_STATE
......
......@@ -14,11 +14,13 @@ typedef struct __mavlink_battery_status_t {
uint8_t battery_function; /*< Function of the battery*/
uint8_t type; /*< Type (chemistry) of the battery*/
int8_t battery_remaining; /*< Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery*/
int32_t time_remaining; /*< Remaining battery time, in seconds (1 = 1s = 0% energy left), 0: autopilot does not provide remaining battery time estimate*/
uint8_t charge_state; /*< State for extent of discharge, provided by autopilot for warning or external reactions*/
}) mavlink_battery_status_t;
#define MAVLINK_MSG_ID_BATTERY_STATUS_LEN 36
#define MAVLINK_MSG_ID_BATTERY_STATUS_LEN 41
#define MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN 36
#define MAVLINK_MSG_ID_147_LEN 36
#define MAVLINK_MSG_ID_147_LEN 41
#define MAVLINK_MSG_ID_147_MIN_LEN 36
#define MAVLINK_MSG_ID_BATTERY_STATUS_CRC 154
......@@ -30,7 +32,7 @@ typedef struct __mavlink_battery_status_t {
#define MAVLINK_MESSAGE_INFO_BATTERY_STATUS { \
147, \
"BATTERY_STATUS", \
9, \
11, \
{ { "id", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_battery_status_t, id) }, \
{ "battery_function", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_battery_status_t, battery_function) }, \
{ "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_battery_status_t, type) }, \
......@@ -40,12 +42,14 @@ typedef struct __mavlink_battery_status_t {
{ "current_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_battery_status_t, current_consumed) }, \
{ "energy_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_battery_status_t, energy_consumed) }, \
{ "battery_remaining", NULL, MAVLINK_TYPE_INT8_T, 0, 35, offsetof(mavlink_battery_status_t, battery_remaining) }, \
{ "time_remaining", NULL, MAVLINK_TYPE_INT32_T, 0, 36, offsetof(mavlink_battery_status_t, time_remaining) }, \
{ "charge_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_battery_status_t, charge_state) }, \
} \
}
#else
#define MAVLINK_MESSAGE_INFO_BATTERY_STATUS { \
"BATTERY_STATUS", \
9, \
11, \
{ { "id", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_battery_status_t, id) }, \
{ "battery_function", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_battery_status_t, battery_function) }, \
{ "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_battery_status_t, type) }, \
......@@ -55,6 +59,8 @@ typedef struct __mavlink_battery_status_t {
{ "current_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_battery_status_t, current_consumed) }, \
{ "energy_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_battery_status_t, energy_consumed) }, \
{ "battery_remaining", NULL, MAVLINK_TYPE_INT8_T, 0, 35, offsetof(mavlink_battery_status_t, battery_remaining) }, \
{ "time_remaining", NULL, MAVLINK_TYPE_INT32_T, 0, 36, offsetof(mavlink_battery_status_t, time_remaining) }, \
{ "charge_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_battery_status_t, charge_state) }, \
} \
}
#endif
......@@ -74,10 +80,12 @@ typedef struct __mavlink_battery_status_t {
* @param current_consumed Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate
* @param energy_consumed Consumed energy, in HectoJoules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate
* @param battery_remaining Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery
* @param time_remaining Remaining battery time, in seconds (1 = 1s = 0% energy left), 0: autopilot does not provide remaining battery time estimate
* @param charge_state State for extent of discharge, provided by autopilot for warning or external reactions
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_battery_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t id, uint8_t battery_function, uint8_t type, int16_t temperature, const uint16_t *voltages, int16_t current_battery, int32_t current_consumed, int32_t energy_consumed, int8_t battery_remaining)
uint8_t id, uint8_t battery_function, uint8_t type, int16_t temperature, const uint16_t *voltages, int16_t current_battery, int32_t current_consumed, int32_t energy_consumed, int8_t battery_remaining, int32_t time_remaining, uint8_t charge_state)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_BATTERY_STATUS_LEN];
......@@ -89,6 +97,8 @@ static inline uint16_t mavlink_msg_battery_status_pack(uint8_t system_id, uint8_
_mav_put_uint8_t(buf, 33, battery_function);
_mav_put_uint8_t(buf, 34, type);
_mav_put_int8_t(buf, 35, battery_remaining);
_mav_put_int32_t(buf, 36, time_remaining);
_mav_put_uint8_t(buf, 40, charge_state);
_mav_put_uint16_t_array(buf, 10, voltages, 10);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_BATTERY_STATUS_LEN);
#else
......@@ -101,6 +111,8 @@ static inline uint16_t mavlink_msg_battery_status_pack(uint8_t system_id, uint8_
packet.battery_function = battery_function;
packet.type = type;
packet.battery_remaining = battery_remaining;
packet.time_remaining = time_remaining;
packet.charge_state = charge_state;
mav_array_memcpy(packet.voltages, voltages, sizeof(uint16_t)*10);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_BATTERY_STATUS_LEN);
#endif
......@@ -124,11 +136,13 @@ static inline uint16_t mavlink_msg_battery_status_pack(uint8_t system_id, uint8_
* @param current_consumed Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate
* @param energy_consumed Consumed energy, in HectoJoules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate
* @param battery_remaining Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery
* @param time_remaining Remaining battery time, in seconds (1 = 1s = 0% energy left), 0: autopilot does not provide remaining battery time estimate
* @param charge_state State for extent of discharge, provided by autopilot for warning or external reactions
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_battery_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t id,uint8_t battery_function,uint8_t type,int16_t temperature,const uint16_t *voltages,int16_t current_battery,int32_t current_consumed,int32_t energy_consumed,int8_t battery_remaining)
uint8_t id,uint8_t battery_function,uint8_t type,int16_t temperature,const uint16_t *voltages,int16_t current_battery,int32_t current_consumed,int32_t energy_consumed,int8_t battery_remaining,int32_t time_remaining,uint8_t charge_state)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_BATTERY_STATUS_LEN];
......@@ -140,6 +154,8 @@ static inline uint16_t mavlink_msg_battery_status_pack_chan(uint8_t system_id, u
_mav_put_uint8_t(buf, 33, battery_function);
_mav_put_uint8_t(buf, 34, type);
_mav_put_int8_t(buf, 35, battery_remaining);
_mav_put_int32_t(buf, 36, time_remaining);
_mav_put_uint8_t(buf, 40, charge_state);
_mav_put_uint16_t_array(buf, 10, voltages, 10);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_BATTERY_STATUS_LEN);
#else
......@@ -152,6 +168,8 @@ static inline uint16_t mavlink_msg_battery_status_pack_chan(uint8_t system_id, u
packet.battery_function = battery_function;
packet.type = type;
packet.battery_remaining = battery_remaining;
packet.time_remaining = time_remaining;
packet.charge_state = charge_state;
mav_array_memcpy(packet.voltages, voltages, sizeof(uint16_t)*10);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_BATTERY_STATUS_LEN);
#endif
......@@ -170,7 +188,7 @@ static inline uint16_t mavlink_msg_battery_status_pack_chan(uint8_t system_id, u
*/
static inline uint16_t mavlink_msg_battery_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_battery_status_t* battery_status)
{
return mavlink_msg_battery_status_pack(system_id, component_id, msg, battery_status->id, battery_status->battery_function, battery_status->type, battery_status->temperature, battery_status->voltages, battery_status->current_battery, battery_status->current_consumed, battery_status->energy_consumed, battery_status->battery_remaining);
return mavlink_msg_battery_status_pack(system_id, component_id, msg, battery_status->id, battery_status->battery_function, battery_status->type, battery_status->temperature, battery_status->voltages, battery_status->current_battery, battery_status->current_consumed, battery_status->energy_consumed, battery_status->battery_remaining, battery_status->time_remaining, battery_status->charge_state);
}
/**
......@@ -184,7 +202,7 @@ static inline uint16_t mavlink_msg_battery_status_encode(uint8_t system_id, uint
*/
static inline uint16_t mavlink_msg_battery_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_battery_status_t* battery_status)
{
return mavlink_msg_battery_status_pack_chan(system_id, component_id, chan, msg, battery_status->id, battery_status->battery_function, battery_status->type, battery_status->temperature, battery_status->voltages, battery_status->current_battery, battery_status->current_consumed, battery_status->energy_consumed, battery_status->battery_remaining);
return mavlink_msg_battery_status_pack_chan(system_id, component_id, chan, msg, battery_status->id, battery_status->battery_function, battery_status->type, battery_status->temperature, battery_status->voltages, battery_status->current_battery, battery_status->current_consumed, battery_status->energy_consumed, battery_status->battery_remaining, battery_status->time_remaining, battery_status->charge_state);
}
/**
......@@ -200,10 +218,12 @@ static inline uint16_t mavlink_msg_battery_status_encode_chan(uint8_t system_id,
* @param current_consumed Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate
* @param energy_consumed Consumed energy, in HectoJoules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate
* @param battery_remaining Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery
* @param time_remaining Remaining battery time, in seconds (1 = 1s = 0% energy left), 0: autopilot does not provide remaining battery time estimate
* @param charge_state State for extent of discharge, provided by autopilot for warning or external reactions
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_battery_status_send(mavlink_channel_t chan, uint8_t id, uint8_t battery_function, uint8_t type, int16_t temperature, const uint16_t *voltages, int16_t current_battery, int32_t current_consumed, int32_t energy_consumed, int8_t battery_remaining)
static inline void mavlink_msg_battery_status_send(mavlink_channel_t chan, uint8_t id, uint8_t battery_function, uint8_t type, int16_t temperature, const uint16_t *voltages, int16_t current_battery, int32_t current_consumed, int32_t energy_consumed, int8_t battery_remaining, int32_t time_remaining, uint8_t charge_state)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_BATTERY_STATUS_LEN];
......@@ -215,6 +235,8 @@ static inline void mavlink_msg_battery_status_send(mavlink_channel_t chan, uint8
_mav_put_uint8_t(buf, 33, battery_function);
_mav_put_uint8_t(buf, 34, type);
_mav_put_int8_t(buf, 35, battery_remaining);
_mav_put_int32_t(buf, 36, time_remaining);
_mav_put_uint8_t(buf, 40, charge_state);
_mav_put_uint16_t_array(buf, 10, voltages, 10);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, buf, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC);
#else
......@@ -227,6 +249,8 @@ static inline void mavlink_msg_battery_status_send(mavlink_channel_t chan, uint8
packet.battery_function = battery_function;
packet.type = type;
packet.battery_remaining = battery_remaining;
packet.time_remaining = time_remaining;
packet.charge_state = charge_state;
mav_array_memcpy(packet.voltages, voltages, sizeof(uint16_t)*10);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, (const char *)&packet, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC);
#endif
......@@ -240,7 +264,7 @@ static inline void mavlink_msg_battery_status_send(mavlink_channel_t chan, uint8
static inline void mavlink_msg_battery_status_send_struct(mavlink_channel_t chan, const mavlink_battery_status_t* battery_status)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
mavlink_msg_battery_status_send(chan, battery_status->id, battery_status->battery_function, battery_status->type, battery_status->temperature, battery_status->voltages, battery_status->current_battery, battery_status->current_consumed, battery_status->energy_consumed, battery_status->battery_remaining);
mavlink_msg_battery_status_send(chan, battery_status->id, battery_status->battery_function, battery_status->type, battery_status->temperature, battery_status->voltages, battery_status->current_battery, battery_status->current_consumed, battery_status->energy_consumed, battery_status->battery_remaining, battery_status->time_remaining, battery_status->charge_state);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, (const char *)battery_status, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC);
#endif
......@@ -254,7 +278,7 @@ static inline void mavlink_msg_battery_status_send_struct(mavlink_channel_t chan
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_battery_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t id, uint8_t battery_function, uint8_t type, int16_t temperature, const uint16_t *voltages, int16_t current_battery, int32_t current_consumed, int32_t energy_consumed, int8_t battery_remaining)
static inline void mavlink_msg_battery_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t id, uint8_t battery_function, uint8_t type, int16_t temperature, const uint16_t *voltages, int16_t current_battery, int32_t current_consumed, int32_t energy_consumed, int8_t battery_remaining, int32_t time_remaining, uint8_t charge_state)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
......@@ -266,6 +290,8 @@ static inline void mavlink_msg_battery_status_send_buf(mavlink_message_t *msgbuf
_mav_put_uint8_t(buf, 33, battery_function);
_mav_put_uint8_t(buf, 34, type);
_mav_put_int8_t(buf, 35, battery_remaining);
_mav_put_int32_t(buf, 36, time_remaining);
_mav_put_uint8_t(buf, 40, charge_state);
_mav_put_uint16_t_array(buf, 10, voltages, 10);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, buf, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC);
#else
......@@ -278,6 +304,8 @@ static inline void mavlink_msg_battery_status_send_buf(mavlink_message_t *msgbuf
packet->battery_function = battery_function;
packet->type = type;
packet->battery_remaining = battery_remaining;
packet->time_remaining = time_remaining;
packet->charge_state = charge_state;
mav_array_memcpy(packet->voltages, voltages, sizeof(uint16_t)*10);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BATTERY_STATUS, (const char *)packet, MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_LEN, MAVLINK_MSG_ID_BATTERY_STATUS_CRC);
#endif
......@@ -379,6 +407,26 @@ static inline int8_t mavlink_msg_battery_status_get_battery_remaining(const mavl
return _MAV_RETURN_int8_t(msg, 35);
}
/**
* @brief Get field time_remaining from battery_status message
*
* @return Remaining battery time, in seconds (1 = 1s = 0% energy left), 0: autopilot does not provide remaining battery time estimate
*/
static inline int32_t mavlink_msg_battery_status_get_time_remaining(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 36);
}
/**
* @brief Get field charge_state from battery_status message
*
* @return State for extent of discharge, provided by autopilot for warning or external reactions
*/
static inline uint8_t mavlink_msg_battery_status_get_charge_state(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 40);
}
/**
* @brief Decode a battery_status message into a struct
*
......@@ -397,6 +445,8 @@ static inline void mavlink_msg_battery_status_decode(const mavlink_message_t* ms
battery_status->battery_function = mavlink_msg_battery_status_get_battery_function(msg);
battery_status->type = mavlink_msg_battery_status_get_type(msg);
battery_status->battery_remaining = mavlink_msg_battery_status_get_battery_remaining(msg);
battery_status->time_remaining = mavlink_msg_battery_status_get_time_remaining(msg);
battery_status->charge_state = mavlink_msg_battery_status_get_charge_state(msg);
#else
uint8_t len = msg->len < MAVLINK_MSG_ID_BATTERY_STATUS_LEN? msg->len : MAVLINK_MSG_ID_BATTERY_STATUS_LEN;
memset(battery_status, 0, MAVLINK_MSG_ID_BATTERY_STATUS_LEN);
......
......@@ -6958,7 +6958,7 @@ static void mavlink_test_battery_status(uint8_t system_id, uint8_t component_id,
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
uint16_t i;
mavlink_battery_status_t packet_in = {
963497464,963497672,17651,{ 17755, 17756, 17757, 17758, 17759, 17760, 17761, 17762, 17763, 17764 },18795,101,168,235,46
963497464,963497672,17651,{ 17755, 17756, 17757, 17758, 17759, 17760, 17761, 17762, 17763, 17764 },18795,101,168,235,46,963499336,125
};
mavlink_battery_status_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
......@@ -6970,6 +6970,8 @@ static void mavlink_test_battery_status(uint8_t system_id, uint8_t component_id,
packet1.battery_function = packet_in.battery_function;
packet1.type = packet_in.type;
packet1.battery_remaining = packet_in.battery_remaining;
packet1.time_remaining = packet_in.time_remaining;
packet1.charge_state = packet_in.charge_state;
mav_array_memcpy(packet1.voltages, packet_in.voltages, sizeof(uint16_t)*10);
......@@ -6985,12 +6987,12 @@ static void mavlink_test_battery_status(uint8_t system_id, uint8_t component_id,
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_battery_status_pack(system_id, component_id, &msg , packet1.id , packet1.battery_function , packet1.type , packet1.temperature , packet1.voltages , packet1.current_battery , packet1.current_consumed , packet1.energy_consumed , packet1.battery_remaining );
mavlink_msg_battery_status_pack(system_id, component_id, &msg , packet1.id , packet1.battery_function , packet1.type , packet1.temperature , packet1.voltages , packet1.current_battery , packet1.current_consumed , packet1.energy_consumed , packet1.battery_remaining , packet1.time_remaining , packet1.charge_state );
mavlink_msg_battery_status_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_battery_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.battery_function , packet1.type , packet1.temperature , packet1.voltages , packet1.current_battery , packet1.current_consumed , packet1.energy_consumed , packet1.battery_remaining );
mavlink_msg_battery_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.battery_function , packet1.type , packet1.temperature , packet1.voltages , packet1.current_battery , packet1.current_consumed , packet1.energy_consumed , packet1.battery_remaining , packet1.time_remaining , packet1.charge_state );
mavlink_msg_battery_status_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
......@@ -7003,7 +7005,7 @@ static void mavlink_test_battery_status(uint8_t system_id, uint8_t component_id,
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_battery_status_send(MAVLINK_COMM_1 , packet1.id , packet1.battery_function , packet1.type , packet1.temperature , packet1.voltages , packet1.current_battery , packet1.current_consumed , packet1.energy_consumed , packet1.battery_remaining );
mavlink_msg_battery_status_send(MAVLINK_COMM_1 , packet1.id , packet1.battery_function , packet1.type , packet1.temperature , packet1.voltages , packet1.current_battery , packet1.current_consumed , packet1.energy_consumed , packet1.battery_remaining , packet1.time_remaining , packet1.charge_state );
mavlink_msg_battery_status_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
......
......@@ -7,7 +7,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Mar 26 2018"
#define MAVLINK_BUILD_DATE "Tue Mar 27 2018"
#define MAVLINK_WIRE_PROTOCOL_VERSION "2.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
......
......@@ -7,7 +7,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Mar 26 2018"
#define MAVLINK_BUILD_DATE "Tue Mar 27 2018"
#define MAVLINK_WIRE_PROTOCOL_VERSION "2.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
......
......@@ -7,7 +7,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Mar 26 2018"
#define MAVLINK_BUILD_DATE "Tue Mar 27 2018"
#define MAVLINK_WIRE_PROTOCOL_VERSION "2.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
......
......@@ -2498,6 +2498,30 @@
<description>Payload battery</description>
</entry>
</enum>
<enum name="MAV_BATTERY_CHARGE_STATE">
<description>Enumeration for states of low battery extent</description>
<entry value="0" name="MAV_BATTERY_CHARGE_STATE_UNDEFINED">
<description>Low battery state is not provided</description>
</entry>
<entry value="1" name="MAV_BATTERY_CHARGE_STATE_OK">
<description>Battery is not nearly empty, normal operation</description>
</entry>
<entry value="2" name="MAV_BATTERY_CHARGE_STATE_LOW">
<description>Battery state is low, warn and monitor close</description>
</entry>
<entry value="3" name="MAV_BATTERY_CHARGE_STATE_CRITICAL">
<description>Battry state is critical, return / abort immediately</description>
</entry>
<entry value="4" name="MAV_BATTERY_CHARGE_STATE_EMERGENCY">
<description>Battry state is too low for ordinary abortion, fastest possible emergency stop preventing damage</description>
</entry>
<entry value="5" name="MAV_BATTERY_CHARGE_STATE_FAILED">
<description>Battry failed, damage unavoidable</description>
</entry>
<entry value="6" name="MAV_BATTERY_CHARGE_STATE_UNHEALTHY">
<description>Battry is diagnosed to be broken or an error occurred, usage is discouraged / prohibited</description>
</entry>
</enum>
<enum name="MAV_VTOL_STATE">
<description>Enumeration of VTOL states</description>
<entry value="0" name="MAV_VTOL_STATE_UNDEFINED">
......@@ -4112,6 +4136,9 @@
<field type="int32_t" name="current_consumed" units="mAh">Consumed charge, in milliampere hours (1 = 1 mAh), -1: autopilot does not provide mAh consumption estimate</field>
<field type="int32_t" name="energy_consumed" units="hJ">Consumed energy, in HectoJoules (intergrated U*I*dt) (1 = 100 Joule), -1: autopilot does not provide energy consumption estimate</field>
<field type="int8_t" name="battery_remaining" units="%">Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery</field>
<extensions/>
<field type="int32_t" name="time_remaining" units="s">Remaining battery time, in seconds (1 = 1s = 0% energy left), 0: autopilot does not provide remaining battery time estimate</field>
<field type="uint8_t" name="charge_state" enum="MAV_BATTERY_CHARGE_STATE">State for extent of discharge, provided by autopilot for warning or external reactions</field>
</message>
<message id="148" name="AUTOPILOT_VERSION">
<description>Version and capability of autopilot software</description>
......
......@@ -7,7 +7,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Mar 26 2018"
#define MAVLINK_BUILD_DATE "Tue Mar 27 2018"
#define MAVLINK_WIRE_PROTOCOL_VERSION "2.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 9
......
......@@ -7,7 +7,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Mar 26 2018"
#define MAVLINK_BUILD_DATE "Tue Mar 27 2018"
#define MAVLINK_WIRE_PROTOCOL_VERSION "2.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
......
......@@ -7,7 +7,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Mar 26 2018"
#define MAVLINK_BUILD_DATE "Tue Mar 27 2018"
#define MAVLINK_WIRE_PROTOCOL_VERSION "2.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
......
......@@ -7,7 +7,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Mar 26 2018"
#define MAVLINK_BUILD_DATE "Tue Mar 27 2018"
#define MAVLINK_WIRE_PROTOCOL_VERSION "2.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 179
......
......@@ -7,7 +7,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Mar 26 2018"
#define MAVLINK_BUILD_DATE "Tue Mar 27 2018"
#define MAVLINK_WIRE_PROTOCOL_VERSION "2.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment