3 #define MAVLINK_MSG_ID_SENS_BATMON 209
21 #define MAVLINK_MSG_ID_SENS_BATMON_LEN 24
22 #define MAVLINK_MSG_ID_209_LEN 24
24 #define MAVLINK_MSG_ID_SENS_BATMON_CRC 12
25 #define MAVLINK_MSG_ID_209_CRC 12
29 #define MAVLINK_MESSAGE_INFO_SENS_BATMON { \
32 { { "temperature", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_sens_batmon_t, temperature) }, \
33 { "voltage", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_sens_batmon_t, voltage) }, \
34 { "current", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_sens_batmon_t, current) }, \
35 { "batterystatus", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_sens_batmon_t, batterystatus) }, \
36 { "serialnumber", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_sens_batmon_t, serialnumber) }, \
37 { "hostfetcontrol", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_sens_batmon_t, hostfetcontrol) }, \
38 { "cellvoltage1", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_sens_batmon_t, cellvoltage1) }, \
39 { "cellvoltage2", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_sens_batmon_t, cellvoltage2) }, \
40 { "cellvoltage3", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_sens_batmon_t, cellvoltage3) }, \
41 { "cellvoltage4", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_sens_batmon_t, cellvoltage4) }, \
42 { "cellvoltage5", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_sens_batmon_t, cellvoltage5) }, \
43 { "cellvoltage6", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_sens_batmon_t, cellvoltage6) }, \
68 static inline uint16_t mavlink_msg_sens_batmon_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
69 uint16_t temperature, uint16_t voltage, uint16_t current, uint16_t batterystatus, uint16_t serialnumber, uint16_t hostfetcontrol, uint16_t cellvoltage1, uint16_t cellvoltage2, uint16_t cellvoltage3, uint16_t cellvoltage4, uint16_t cellvoltage5, uint16_t cellvoltage6)
71 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
106 #if MAVLINK_CRC_EXTRA
133 static inline uint16_t mavlink_msg_sens_batmon_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
134 mavlink_message_t* msg,
135 uint16_t temperature,uint16_t voltage,uint16_t current,uint16_t batterystatus,uint16_t serialnumber,uint16_t hostfetcontrol,uint16_t cellvoltage1,uint16_t cellvoltage2,uint16_t cellvoltage3,uint16_t cellvoltage4,uint16_t cellvoltage5,uint16_t cellvoltage6)
137 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
172 #if MAVLINK_CRC_EXTRA
187 static inline uint16_t mavlink_msg_sens_batmon_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_sens_batmon_t* sens_batmon)
189 return mavlink_msg_sens_batmon_pack(system_id, component_id, msg, sens_batmon->
temperature, sens_batmon->
voltage, sens_batmon->
current, sens_batmon->
batterystatus, sens_batmon->
serialnumber, sens_batmon->
hostfetcontrol, sens_batmon->
cellvoltage1, sens_batmon->
cellvoltage2, sens_batmon->
cellvoltage3, sens_batmon->
cellvoltage4, sens_batmon->
cellvoltage5, sens_batmon->
cellvoltage6);
201 static inline uint16_t mavlink_msg_sens_batmon_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_sens_batmon_t* sens_batmon)
203 return mavlink_msg_sens_batmon_pack_chan(system_id, component_id, chan, msg, sens_batmon->
temperature, sens_batmon->
voltage, sens_batmon->
current, sens_batmon->
batterystatus, sens_batmon->
serialnumber, sens_batmon->
hostfetcontrol, sens_batmon->
cellvoltage1, sens_batmon->
cellvoltage2, sens_batmon->
cellvoltage3, sens_batmon->
cellvoltage4, sens_batmon->
cellvoltage5, sens_batmon->
cellvoltage6);
223 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
225 static inline void mavlink_msg_sens_batmon_send(
mavlink_channel_t chan, uint16_t temperature, uint16_t voltage, uint16_t current, uint16_t batterystatus, uint16_t serialnumber, uint16_t hostfetcontrol, uint16_t cellvoltage1, uint16_t cellvoltage2, uint16_t cellvoltage3, uint16_t cellvoltage4, uint16_t cellvoltage5, uint16_t cellvoltage6)
227 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
242 #if MAVLINK_CRC_EXTRA
262 #if MAVLINK_CRC_EXTRA
270 #if MAVLINK_MSG_ID_SENS_BATMON_LEN <= MAVLINK_MAX_PAYLOAD_LEN
278 static inline void mavlink_msg_sens_batmon_send_buf(mavlink_message_t *msgbuf,
mavlink_channel_t chan, uint16_t temperature, uint16_t voltage, uint16_t current, uint16_t batterystatus, uint16_t serialnumber, uint16_t hostfetcontrol, uint16_t cellvoltage1, uint16_t cellvoltage2, uint16_t cellvoltage3, uint16_t cellvoltage4, uint16_t cellvoltage5, uint16_t cellvoltage6)
280 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
281 char *buf = (
char *)msgbuf;
295 #if MAVLINK_CRC_EXTRA
315 #if MAVLINK_CRC_EXTRA
334 static inline uint16_t mavlink_msg_sens_batmon_get_temperature(
const mavlink_message_t* msg)
336 return _MAV_RETURN_uint16_t(msg, 0);
344 static inline uint16_t mavlink_msg_sens_batmon_get_voltage(
const mavlink_message_t* msg)
346 return _MAV_RETURN_uint16_t(msg, 2);
354 static inline uint16_t mavlink_msg_sens_batmon_get_current(
const mavlink_message_t* msg)
356 return _MAV_RETURN_uint16_t(msg, 4);
364 static inline uint16_t mavlink_msg_sens_batmon_get_batterystatus(
const mavlink_message_t* msg)
366 return _MAV_RETURN_uint16_t(msg, 6);
374 static inline uint16_t mavlink_msg_sens_batmon_get_serialnumber(
const mavlink_message_t* msg)
376 return _MAV_RETURN_uint16_t(msg, 8);
384 static inline uint16_t mavlink_msg_sens_batmon_get_hostfetcontrol(
const mavlink_message_t* msg)
386 return _MAV_RETURN_uint16_t(msg, 10);
394 static inline uint16_t mavlink_msg_sens_batmon_get_cellvoltage1(
const mavlink_message_t* msg)
396 return _MAV_RETURN_uint16_t(msg, 12);
404 static inline uint16_t mavlink_msg_sens_batmon_get_cellvoltage2(
const mavlink_message_t* msg)
406 return _MAV_RETURN_uint16_t(msg, 14);
414 static inline uint16_t mavlink_msg_sens_batmon_get_cellvoltage3(
const mavlink_message_t* msg)
416 return _MAV_RETURN_uint16_t(msg, 16);
424 static inline uint16_t mavlink_msg_sens_batmon_get_cellvoltage4(
const mavlink_message_t* msg)
426 return _MAV_RETURN_uint16_t(msg, 18);
434 static inline uint16_t mavlink_msg_sens_batmon_get_cellvoltage5(
const mavlink_message_t* msg)
436 return _MAV_RETURN_uint16_t(msg, 20);
444 static inline uint16_t mavlink_msg_sens_batmon_get_cellvoltage6(
const mavlink_message_t* msg)
446 return _MAV_RETURN_uint16_t(msg, 22);
455 static inline void mavlink_msg_sens_batmon_decode(
const mavlink_message_t* msg,
mavlink_sens_batmon_t* sens_batmon)
457 #if MAVLINK_NEED_BYTE_SWAP
458 sens_batmon->
temperature = mavlink_msg_sens_batmon_get_temperature(msg);
459 sens_batmon->
voltage = mavlink_msg_sens_batmon_get_voltage(msg);
460 sens_batmon->
current = mavlink_msg_sens_batmon_get_current(msg);
461 sens_batmon->
batterystatus = mavlink_msg_sens_batmon_get_batterystatus(msg);
462 sens_batmon->
serialnumber = mavlink_msg_sens_batmon_get_serialnumber(msg);
463 sens_batmon->
hostfetcontrol = mavlink_msg_sens_batmon_get_hostfetcontrol(msg);
464 sens_batmon->
cellvoltage1 = mavlink_msg_sens_batmon_get_cellvoltage1(msg);
465 sens_batmon->
cellvoltage2 = mavlink_msg_sens_batmon_get_cellvoltage2(msg);
466 sens_batmon->
cellvoltage3 = mavlink_msg_sens_batmon_get_cellvoltage3(msg);
467 sens_batmon->
cellvoltage4 = mavlink_msg_sens_batmon_get_cellvoltage4(msg);
468 sens_batmon->
cellvoltage5 = mavlink_msg_sens_batmon_get_cellvoltage5(msg);
469 sens_batmon->
cellvoltage6 = mavlink_msg_sens_batmon_get_cellvoltage6(msg);
uint16_t hostfetcontrol
Battery monitor sensor host FET control in Hex.
Definition: mavlink_msg_sens_batmon.h:12
#define MAVLINK_MSG_ID_SENS_BATMON_CRC
Definition: mavlink_msg_sens_batmon.h:24
uint16_t cellvoltage5
Battery pack cell 5 voltage in [mV].
Definition: mavlink_msg_sens_batmon.h:17
uint16_t cellvoltage3
Battery pack cell 3 voltage in [mV].
Definition: mavlink_msg_sens_batmon.h:15
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.
Definition: mavlink_helpers.h:105
uint16_t voltage
Battery pack voltage in [mV].
Definition: mavlink_msg_sens_batmon.h:8
#define _MAV_PAYLOAD_NON_CONST(msg)
Definition: mavlink_types.h:172
uint16_t cellvoltage1
Battery pack cell 1 voltage in [mV].
Definition: mavlink_msg_sens_batmon.h:13
uint16_t current
Battery pack current in [mA].
Definition: mavlink_msg_sens_batmon.h:9
mavlink_channel_t
Definition: mavlink_types.h:178
uint16_t cellvoltage2
Battery pack cell 2 voltage in [mV].
Definition: mavlink_msg_sens_batmon.h:14
#define _MAV_PAYLOAD(msg)
Definition: mavlink_types.h:171
struct __mavlink_sens_batmon_t mavlink_sens_batmon_t
uint16_t batterystatus
Battery monitor status report bits in Hex.
Definition: mavlink_msg_sens_batmon.h:10
uint16_t cellvoltage6
Battery pack cell 6 voltage in [mV].
Definition: mavlink_msg_sens_batmon.h:18
uint16_t serialnumber
Battery monitor serial number in Hex.
Definition: mavlink_msg_sens_batmon.h:11
uint16_t cellvoltage4
Battery pack cell 4 voltage in [mV].
Definition: mavlink_msg_sens_batmon.h:16
Definition: mavlink_msg_sens_batmon.h:5
#define MAVLINK_MSG_ID_SENS_BATMON
Definition: mavlink_msg_sens_batmon.h:3
#define _mav_put_uint16_t(buf, wire_offset, b)
Definition: protocol.h:139
uint16_t temperature
Battery pack temperature in [0.1 K].
Definition: mavlink_msg_sens_batmon.h:7
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.
Definition: mavlink_helpers.h:71
#define MAVLINK_MSG_ID_SENS_BATMON_LEN
Definition: mavlink_msg_sens_batmon.h:21