3 #define MAVLINK_MSG_ID_BATTERY_STATUS 147 18 #define MAVLINK_MSG_ID_BATTERY_STATUS_LEN 36 19 #define MAVLINK_MSG_ID_147_LEN 36 21 #define MAVLINK_MSG_ID_BATTERY_STATUS_CRC 154 22 #define MAVLINK_MSG_ID_147_CRC 154 24 #define MAVLINK_MSG_BATTERY_STATUS_FIELD_VOLTAGES_LEN 10 26 #define MAVLINK_MESSAGE_INFO_BATTERY_STATUS { \ 29 { { "current_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_battery_status_t, current_consumed) }, \ 30 { "energy_consumed", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_battery_status_t, energy_consumed) }, \ 31 { "temperature", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_battery_status_t, temperature) }, \ 32 { "voltages", NULL, MAVLINK_TYPE_UINT16_T, 10, 10, offsetof(mavlink_battery_status_t, voltages) }, \ 33 { "current_battery", NULL, MAVLINK_TYPE_INT16_T, 0, 30, offsetof(mavlink_battery_status_t, current_battery) }, \ 34 { "id", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_battery_status_t, id) }, \ 35 { "battery_function", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_battery_status_t, battery_function) }, \ 36 { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_battery_status_t, type) }, \ 37 { "battery_remaining", NULL, MAVLINK_TYPE_INT8_T, 0, 35, offsetof(mavlink_battery_status_t, battery_remaining) }, \ 62 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 72 _mav_put_uint16_t_array(buf, 10, voltages, 10);
114 mavlink_message_t* msg,
117 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 127 _mav_put_uint16_t_array(buf, 10, voltages, 10);
144 #if MAVLINK_CRC_EXTRA 161 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);
175 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);
192 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS 196 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 206 _mav_put_uint16_t_array(buf, 10,
voltages, 10);
207 #if MAVLINK_CRC_EXTRA 223 #if MAVLINK_CRC_EXTRA 231 #if MAVLINK_MSG_ID_BATTERY_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN 239 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)
241 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS 242 char *buf = (
char *)msgbuf;
251 _mav_put_uint16_t_array(buf, 10,
voltages, 10);
252 #if MAVLINK_CRC_EXTRA 268 #if MAVLINK_CRC_EXTRA 319 return _MAV_RETURN_int16_t(msg, 8);
329 return _MAV_RETURN_uint16_t_array(msg, voltages, 10, 10);
339 return _MAV_RETURN_int16_t(msg, 30);
349 return _MAV_RETURN_int32_t(msg, 0);
359 return _MAV_RETURN_int32_t(msg, 4);
380 #if MAVLINK_NEED_BYTE_SWAP static int32_t mavlink_msg_battery_status_get_current_consumed(const mavlink_message_t *msg)
Get field current_consumed from battery_status message.
static uint8_t mavlink_msg_battery_status_get_type(const mavlink_message_t *msg)
Get field type from battery_status message.
static 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)
Encode a battery_status struct.
static int8_t mavlink_msg_battery_status_get_battery_remaining(const mavlink_message_t *msg)
Get field battery_remaining from battery_status message.
#define _MAV_RETURN_uint8_t(msg, wire_offset)
MAVLINK_HELPER uint16_t mavlink_finalize_message(mavlink_message_t *msg, uint8_t system_id, uint8_t component_id, uint8_t length)
Finalize a MAVLink message with MAVLINK_COMM_0 as default channel.
#define _mav_put_uint8_t(buf, wire_offset, b)
static int16_t mavlink_msg_battery_status_get_current_battery(const mavlink_message_t *msg)
Get field current_battery from battery_status message.
#define _mav_put_int32_t(buf, wire_offset, b)
#define _MAV_PAYLOAD_NON_CONST(msg)
static uint8_t mavlink_msg_battery_status_get_id(const mavlink_message_t *msg)
Send a battery_status message.
#define _MAV_RETURN_int8_t(msg, wire_offset)
static int16_t mavlink_msg_battery_status_get_temperature(const mavlink_message_t *msg)
Get field temperature from battery_status message.
static 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)
Pack a battery_status message on a channel.
static 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)
Encode a battery_status struct on a channel.
#define MAVLINK_MSG_ID_BATTERY_STATUS_CRC
#define _MAV_PAYLOAD(msg)
struct __mavlink_battery_status_t mavlink_battery_status_t
static void mavlink_msg_battery_status_decode(const mavlink_message_t *msg, mavlink_battery_status_t *battery_status)
Decode a battery_status message into a struct.
#define MAVLINK_MSG_ID_BATTERY_STATUS
#define _mav_put_int8_t(buf, wire_offset, b)
static uint8_t mavlink_msg_battery_status_get_battery_function(const mavlink_message_t *msg)
Get field battery_function from battery_status message.
static uint16_t mavlink_msg_battery_status_get_voltages(const mavlink_message_t *msg, uint16_t *voltages)
Get field voltages from battery_status message.
static 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)
Pack a battery_status message.
static int32_t mavlink_msg_battery_status_get_energy_consumed(const mavlink_message_t *msg)
Get field energy_consumed from battery_status message.
static void mav_array_memcpy(void *dest, const void *src, size_t n)
MAVLINK_HELPER uint16_t mavlink_finalize_message_chan(mavlink_message_t *msg, uint8_t system_id, uint8_t component_id, uint8_t chan, uint8_t length)
Finalize a MAVLink message with channel assignment.
#define _mav_put_int16_t(buf, wire_offset, b)
#define MAVLINK_MSG_ID_BATTERY_STATUS_LEN