2018-05-20 20:55:47 +08:00
|
|
|
#pragma once
|
|
|
|
|
// MESSAGE PUBIT_RESULT PACKING
|
|
|
|
|
|
|
|
|
|
#define MAVLINK_MSG_ID_PUBIT_RESULT 20107
|
|
|
|
|
|
|
|
|
|
MAVPACKED(
|
|
|
|
|
typedef struct __mavlink_pubit_result_t {
|
2018-06-03 17:07:10 +08:00
|
|
|
uint32_t time_boot_ms; /*< [ms] Timestamp (milliseconds since system boot)*/
|
|
|
|
|
uint32_t CPM1; /*< CPM1*/
|
|
|
|
|
uint32_t CPM2; /*< CPM2*/
|
|
|
|
|
uint32_t CPM3; /*< CPM3*/
|
|
|
|
|
uint32_t BIM1; /*< BIM1*/
|
|
|
|
|
uint32_t BIM1_RS422; /*< BIM1_RS422*/
|
|
|
|
|
uint32_t BIM1_POWER; /*< BIM1_POWER*/
|
|
|
|
|
uint32_t BIM1_CFL; /*< BIM1_CFL*/
|
|
|
|
|
uint32_t BIM1_CPU; /*< BIM1_CPU*/
|
|
|
|
|
uint32_t BIM1_A659; /*< BIM1_A659*/
|
|
|
|
|
uint32_t BIM1_PS[6]; /*< BIM1_PowerStates*/
|
|
|
|
|
uint32_t BIM2; /*< BIM2*/
|
|
|
|
|
uint32_t BIM2_RS422; /*< BIM2_RS422*/
|
|
|
|
|
uint32_t BIM2_POWER; /*< BIM2_POWER*/
|
|
|
|
|
uint32_t BIM2_CFL; /*< BIM2_CFL*/
|
|
|
|
|
uint32_t BIM2_CPU; /*< BIM2_CPU*/
|
|
|
|
|
uint32_t BIM2_A659; /*< BIM2_A659*/
|
|
|
|
|
uint32_t BIM2_PS[6]; /*< BIM2_PowerStates*/
|
2018-05-20 20:55:47 +08:00
|
|
|
}) mavlink_pubit_result_t;
|
|
|
|
|
|
2018-06-03 17:07:10 +08:00
|
|
|
#define MAVLINK_MSG_ID_PUBIT_RESULT_LEN 112
|
|
|
|
|
#define MAVLINK_MSG_ID_PUBIT_RESULT_MIN_LEN 112
|
|
|
|
|
#define MAVLINK_MSG_ID_20107_LEN 112
|
|
|
|
|
#define MAVLINK_MSG_ID_20107_MIN_LEN 112
|
2018-05-20 20:55:47 +08:00
|
|
|
|
2018-06-03 17:07:10 +08:00
|
|
|
#define MAVLINK_MSG_ID_PUBIT_RESULT_CRC 172
|
|
|
|
|
#define MAVLINK_MSG_ID_20107_CRC 172
|
2018-05-20 20:55:47 +08:00
|
|
|
|
2018-06-03 17:07:10 +08:00
|
|
|
#define MAVLINK_MSG_PUBIT_RESULT_FIELD_BIM1_PS_LEN 6
|
|
|
|
|
#define MAVLINK_MSG_PUBIT_RESULT_FIELD_BIM2_PS_LEN 6
|
2018-05-20 20:55:47 +08:00
|
|
|
|
|
|
|
|
#if MAVLINK_COMMAND_24BIT
|
|
|
|
|
#define MAVLINK_MESSAGE_INFO_PUBIT_RESULT { \
|
|
|
|
|
20107, \
|
|
|
|
|
"PUBIT_RESULT", \
|
2018-06-03 17:07:10 +08:00
|
|
|
18, \
|
2018-05-20 20:55:47 +08:00
|
|
|
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_pubit_result_t, time_boot_ms) }, \
|
|
|
|
|
{ "CPM1", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_pubit_result_t, CPM1) }, \
|
|
|
|
|
{ "CPM2", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_pubit_result_t, CPM2) }, \
|
|
|
|
|
{ "CPM3", NULL, MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_pubit_result_t, CPM3) }, \
|
2018-06-03 17:07:10 +08:00
|
|
|
{ "BIM1", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_pubit_result_t, BIM1) }, \
|
|
|
|
|
{ "BIM1_RS422", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_pubit_result_t, BIM1_RS422) }, \
|
|
|
|
|
{ "BIM1_POWER", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_pubit_result_t, BIM1_POWER) }, \
|
|
|
|
|
{ "BIM1_CFL", NULL, MAVLINK_TYPE_UINT32_T, 0, 28, offsetof(mavlink_pubit_result_t, BIM1_CFL) }, \
|
|
|
|
|
{ "BIM1_CPU", NULL, MAVLINK_TYPE_UINT32_T, 0, 32, offsetof(mavlink_pubit_result_t, BIM1_CPU) }, \
|
|
|
|
|
{ "BIM1_A659", NULL, MAVLINK_TYPE_UINT32_T, 0, 36, offsetof(mavlink_pubit_result_t, BIM1_A659) }, \
|
|
|
|
|
{ "BIM1_PS", NULL, MAVLINK_TYPE_UINT32_T, 6, 40, offsetof(mavlink_pubit_result_t, BIM1_PS) }, \
|
|
|
|
|
{ "BIM2", NULL, MAVLINK_TYPE_UINT32_T, 0, 64, offsetof(mavlink_pubit_result_t, BIM2) }, \
|
|
|
|
|
{ "BIM2_RS422", NULL, MAVLINK_TYPE_UINT32_T, 0, 68, offsetof(mavlink_pubit_result_t, BIM2_RS422) }, \
|
|
|
|
|
{ "BIM2_POWER", NULL, MAVLINK_TYPE_UINT32_T, 0, 72, offsetof(mavlink_pubit_result_t, BIM2_POWER) }, \
|
|
|
|
|
{ "BIM2_CFL", NULL, MAVLINK_TYPE_UINT32_T, 0, 76, offsetof(mavlink_pubit_result_t, BIM2_CFL) }, \
|
|
|
|
|
{ "BIM2_CPU", NULL, MAVLINK_TYPE_UINT32_T, 0, 80, offsetof(mavlink_pubit_result_t, BIM2_CPU) }, \
|
|
|
|
|
{ "BIM2_A659", NULL, MAVLINK_TYPE_UINT32_T, 0, 84, offsetof(mavlink_pubit_result_t, BIM2_A659) }, \
|
|
|
|
|
{ "BIM2_PS", NULL, MAVLINK_TYPE_UINT32_T, 6, 88, offsetof(mavlink_pubit_result_t, BIM2_PS) }, \
|
2018-05-20 20:55:47 +08:00
|
|
|
} \
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
#define MAVLINK_MESSAGE_INFO_PUBIT_RESULT { \
|
|
|
|
|
"PUBIT_RESULT", \
|
2018-06-03 17:07:10 +08:00
|
|
|
18, \
|
2018-05-20 20:55:47 +08:00
|
|
|
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_pubit_result_t, time_boot_ms) }, \
|
|
|
|
|
{ "CPM1", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_pubit_result_t, CPM1) }, \
|
|
|
|
|
{ "CPM2", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_pubit_result_t, CPM2) }, \
|
|
|
|
|
{ "CPM3", NULL, MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_pubit_result_t, CPM3) }, \
|
2018-06-03 17:07:10 +08:00
|
|
|
{ "BIM1", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_pubit_result_t, BIM1) }, \
|
|
|
|
|
{ "BIM1_RS422", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_pubit_result_t, BIM1_RS422) }, \
|
|
|
|
|
{ "BIM1_POWER", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_pubit_result_t, BIM1_POWER) }, \
|
|
|
|
|
{ "BIM1_CFL", NULL, MAVLINK_TYPE_UINT32_T, 0, 28, offsetof(mavlink_pubit_result_t, BIM1_CFL) }, \
|
|
|
|
|
{ "BIM1_CPU", NULL, MAVLINK_TYPE_UINT32_T, 0, 32, offsetof(mavlink_pubit_result_t, BIM1_CPU) }, \
|
|
|
|
|
{ "BIM1_A659", NULL, MAVLINK_TYPE_UINT32_T, 0, 36, offsetof(mavlink_pubit_result_t, BIM1_A659) }, \
|
|
|
|
|
{ "BIM1_PS", NULL, MAVLINK_TYPE_UINT32_T, 6, 40, offsetof(mavlink_pubit_result_t, BIM1_PS) }, \
|
|
|
|
|
{ "BIM2", NULL, MAVLINK_TYPE_UINT32_T, 0, 64, offsetof(mavlink_pubit_result_t, BIM2) }, \
|
|
|
|
|
{ "BIM2_RS422", NULL, MAVLINK_TYPE_UINT32_T, 0, 68, offsetof(mavlink_pubit_result_t, BIM2_RS422) }, \
|
|
|
|
|
{ "BIM2_POWER", NULL, MAVLINK_TYPE_UINT32_T, 0, 72, offsetof(mavlink_pubit_result_t, BIM2_POWER) }, \
|
|
|
|
|
{ "BIM2_CFL", NULL, MAVLINK_TYPE_UINT32_T, 0, 76, offsetof(mavlink_pubit_result_t, BIM2_CFL) }, \
|
|
|
|
|
{ "BIM2_CPU", NULL, MAVLINK_TYPE_UINT32_T, 0, 80, offsetof(mavlink_pubit_result_t, BIM2_CPU) }, \
|
|
|
|
|
{ "BIM2_A659", NULL, MAVLINK_TYPE_UINT32_T, 0, 84, offsetof(mavlink_pubit_result_t, BIM2_A659) }, \
|
|
|
|
|
{ "BIM2_PS", NULL, MAVLINK_TYPE_UINT32_T, 6, 88, offsetof(mavlink_pubit_result_t, BIM2_PS) }, \
|
2018-05-20 20:55:47 +08:00
|
|
|
} \
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Pack a pubit_result message
|
|
|
|
|
* @param system_id ID of this system
|
|
|
|
|
* @param component_id ID of this component (e.g. 200 for IMU)
|
|
|
|
|
* @param msg The MAVLink message to compress the data into
|
|
|
|
|
*
|
2018-06-03 17:07:10 +08:00
|
|
|
* @param time_boot_ms [ms] Timestamp (milliseconds since system boot)
|
|
|
|
|
* @param CPM1 CPM1
|
|
|
|
|
* @param CPM2 CPM2
|
|
|
|
|
* @param CPM3 CPM3
|
|
|
|
|
* @param BIM1 BIM1
|
|
|
|
|
* @param BIM1_RS422 BIM1_RS422
|
|
|
|
|
* @param BIM1_POWER BIM1_POWER
|
|
|
|
|
* @param BIM1_CFL BIM1_CFL
|
|
|
|
|
* @param BIM1_CPU BIM1_CPU
|
|
|
|
|
* @param BIM1_A659 BIM1_A659
|
|
|
|
|
* @param BIM1_PS BIM1_PowerStates
|
|
|
|
|
* @param BIM2 BIM2
|
|
|
|
|
* @param BIM2_RS422 BIM2_RS422
|
|
|
|
|
* @param BIM2_POWER BIM2_POWER
|
|
|
|
|
* @param BIM2_CFL BIM2_CFL
|
|
|
|
|
* @param BIM2_CPU BIM2_CPU
|
|
|
|
|
* @param BIM2_A659 BIM2_A659
|
|
|
|
|
* @param BIM2_PS BIM2_PowerStates
|
2018-05-20 20:55:47 +08:00
|
|
|
* @return length of the message in bytes (excluding serial stream start sign)
|
|
|
|
|
*/
|
|
|
|
|
static inline uint16_t mavlink_msg_pubit_result_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
2018-06-03 17:07:10 +08:00
|
|
|
uint32_t time_boot_ms, uint32_t CPM1, uint32_t CPM2, uint32_t CPM3, uint32_t BIM1, uint32_t BIM1_RS422, uint32_t BIM1_POWER, uint32_t BIM1_CFL, uint32_t BIM1_CPU, uint32_t BIM1_A659, const uint32_t *BIM1_PS, uint32_t BIM2, uint32_t BIM2_RS422, uint32_t BIM2_POWER, uint32_t BIM2_CFL, uint32_t BIM2_CPU, uint32_t BIM2_A659, const uint32_t *BIM2_PS)
|
2018-05-20 20:55:47 +08:00
|
|
|
{
|
|
|
|
|
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
|
|
|
|
char buf[MAVLINK_MSG_ID_PUBIT_RESULT_LEN];
|
|
|
|
|
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
|
|
|
|
_mav_put_uint32_t(buf, 4, CPM1);
|
|
|
|
|
_mav_put_uint32_t(buf, 8, CPM2);
|
|
|
|
|
_mav_put_uint32_t(buf, 12, CPM3);
|
2018-06-03 17:07:10 +08:00
|
|
|
_mav_put_uint32_t(buf, 16, BIM1);
|
|
|
|
|
_mav_put_uint32_t(buf, 20, BIM1_RS422);
|
|
|
|
|
_mav_put_uint32_t(buf, 24, BIM1_POWER);
|
|
|
|
|
_mav_put_uint32_t(buf, 28, BIM1_CFL);
|
|
|
|
|
_mav_put_uint32_t(buf, 32, BIM1_CPU);
|
|
|
|
|
_mav_put_uint32_t(buf, 36, BIM1_A659);
|
|
|
|
|
_mav_put_uint32_t(buf, 64, BIM2);
|
|
|
|
|
_mav_put_uint32_t(buf, 68, BIM2_RS422);
|
|
|
|
|
_mav_put_uint32_t(buf, 72, BIM2_POWER);
|
|
|
|
|
_mav_put_uint32_t(buf, 76, BIM2_CFL);
|
|
|
|
|
_mav_put_uint32_t(buf, 80, BIM2_CPU);
|
|
|
|
|
_mav_put_uint32_t(buf, 84, BIM2_A659);
|
|
|
|
|
_mav_put_uint32_t_array(buf, 40, BIM1_PS, 6);
|
|
|
|
|
_mav_put_uint32_t_array(buf, 88, BIM2_PS, 6);
|
2018-05-20 20:55:47 +08:00
|
|
|
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PUBIT_RESULT_LEN);
|
|
|
|
|
#else
|
|
|
|
|
mavlink_pubit_result_t packet;
|
|
|
|
|
packet.time_boot_ms = time_boot_ms;
|
|
|
|
|
packet.CPM1 = CPM1;
|
|
|
|
|
packet.CPM2 = CPM2;
|
|
|
|
|
packet.CPM3 = CPM3;
|
2018-06-03 17:07:10 +08:00
|
|
|
packet.BIM1 = BIM1;
|
|
|
|
|
packet.BIM1_RS422 = BIM1_RS422;
|
|
|
|
|
packet.BIM1_POWER = BIM1_POWER;
|
|
|
|
|
packet.BIM1_CFL = BIM1_CFL;
|
|
|
|
|
packet.BIM1_CPU = BIM1_CPU;
|
|
|
|
|
packet.BIM1_A659 = BIM1_A659;
|
|
|
|
|
packet.BIM2 = BIM2;
|
|
|
|
|
packet.BIM2_RS422 = BIM2_RS422;
|
|
|
|
|
packet.BIM2_POWER = BIM2_POWER;
|
|
|
|
|
packet.BIM2_CFL = BIM2_CFL;
|
|
|
|
|
packet.BIM2_CPU = BIM2_CPU;
|
|
|
|
|
packet.BIM2_A659 = BIM2_A659;
|
|
|
|
|
mav_array_memcpy(packet.BIM1_PS, BIM1_PS, sizeof(uint32_t)*6);
|
|
|
|
|
mav_array_memcpy(packet.BIM2_PS, BIM2_PS, sizeof(uint32_t)*6);
|
2018-05-20 20:55:47 +08:00
|
|
|
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PUBIT_RESULT_LEN);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
msg->msgid = MAVLINK_MSG_ID_PUBIT_RESULT;
|
|
|
|
|
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PUBIT_RESULT_MIN_LEN, MAVLINK_MSG_ID_PUBIT_RESULT_LEN, MAVLINK_MSG_ID_PUBIT_RESULT_CRC);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Pack a pubit_result message on a channel
|
|
|
|
|
* @param system_id ID of this system
|
|
|
|
|
* @param component_id ID of this component (e.g. 200 for IMU)
|
|
|
|
|
* @param chan The MAVLink channel this message will be sent over
|
|
|
|
|
* @param msg The MAVLink message to compress the data into
|
2018-06-03 17:07:10 +08:00
|
|
|
* @param time_boot_ms [ms] Timestamp (milliseconds since system boot)
|
|
|
|
|
* @param CPM1 CPM1
|
|
|
|
|
* @param CPM2 CPM2
|
|
|
|
|
* @param CPM3 CPM3
|
|
|
|
|
* @param BIM1 BIM1
|
|
|
|
|
* @param BIM1_RS422 BIM1_RS422
|
|
|
|
|
* @param BIM1_POWER BIM1_POWER
|
|
|
|
|
* @param BIM1_CFL BIM1_CFL
|
|
|
|
|
* @param BIM1_CPU BIM1_CPU
|
|
|
|
|
* @param BIM1_A659 BIM1_A659
|
|
|
|
|
* @param BIM1_PS BIM1_PowerStates
|
|
|
|
|
* @param BIM2 BIM2
|
|
|
|
|
* @param BIM2_RS422 BIM2_RS422
|
|
|
|
|
* @param BIM2_POWER BIM2_POWER
|
|
|
|
|
* @param BIM2_CFL BIM2_CFL
|
|
|
|
|
* @param BIM2_CPU BIM2_CPU
|
|
|
|
|
* @param BIM2_A659 BIM2_A659
|
|
|
|
|
* @param BIM2_PS BIM2_PowerStates
|
2018-05-20 20:55:47 +08:00
|
|
|
* @return length of the message in bytes (excluding serial stream start sign)
|
|
|
|
|
*/
|
|
|
|
|
static inline uint16_t mavlink_msg_pubit_result_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
|
|
|
|
mavlink_message_t* msg,
|
2018-06-03 17:07:10 +08:00
|
|
|
uint32_t time_boot_ms,uint32_t CPM1,uint32_t CPM2,uint32_t CPM3,uint32_t BIM1,uint32_t BIM1_RS422,uint32_t BIM1_POWER,uint32_t BIM1_CFL,uint32_t BIM1_CPU,uint32_t BIM1_A659,const uint32_t *BIM1_PS,uint32_t BIM2,uint32_t BIM2_RS422,uint32_t BIM2_POWER,uint32_t BIM2_CFL,uint32_t BIM2_CPU,uint32_t BIM2_A659,const uint32_t *BIM2_PS)
|
2018-05-20 20:55:47 +08:00
|
|
|
{
|
|
|
|
|
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
|
|
|
|
char buf[MAVLINK_MSG_ID_PUBIT_RESULT_LEN];
|
|
|
|
|
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
|
|
|
|
_mav_put_uint32_t(buf, 4, CPM1);
|
|
|
|
|
_mav_put_uint32_t(buf, 8, CPM2);
|
|
|
|
|
_mav_put_uint32_t(buf, 12, CPM3);
|
2018-06-03 17:07:10 +08:00
|
|
|
_mav_put_uint32_t(buf, 16, BIM1);
|
|
|
|
|
_mav_put_uint32_t(buf, 20, BIM1_RS422);
|
|
|
|
|
_mav_put_uint32_t(buf, 24, BIM1_POWER);
|
|
|
|
|
_mav_put_uint32_t(buf, 28, BIM1_CFL);
|
|
|
|
|
_mav_put_uint32_t(buf, 32, BIM1_CPU);
|
|
|
|
|
_mav_put_uint32_t(buf, 36, BIM1_A659);
|
|
|
|
|
_mav_put_uint32_t(buf, 64, BIM2);
|
|
|
|
|
_mav_put_uint32_t(buf, 68, BIM2_RS422);
|
|
|
|
|
_mav_put_uint32_t(buf, 72, BIM2_POWER);
|
|
|
|
|
_mav_put_uint32_t(buf, 76, BIM2_CFL);
|
|
|
|
|
_mav_put_uint32_t(buf, 80, BIM2_CPU);
|
|
|
|
|
_mav_put_uint32_t(buf, 84, BIM2_A659);
|
|
|
|
|
_mav_put_uint32_t_array(buf, 40, BIM1_PS, 6);
|
|
|
|
|
_mav_put_uint32_t_array(buf, 88, BIM2_PS, 6);
|
2018-05-20 20:55:47 +08:00
|
|
|
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PUBIT_RESULT_LEN);
|
|
|
|
|
#else
|
|
|
|
|
mavlink_pubit_result_t packet;
|
|
|
|
|
packet.time_boot_ms = time_boot_ms;
|
|
|
|
|
packet.CPM1 = CPM1;
|
|
|
|
|
packet.CPM2 = CPM2;
|
|
|
|
|
packet.CPM3 = CPM3;
|
2018-06-03 17:07:10 +08:00
|
|
|
packet.BIM1 = BIM1;
|
|
|
|
|
packet.BIM1_RS422 = BIM1_RS422;
|
|
|
|
|
packet.BIM1_POWER = BIM1_POWER;
|
|
|
|
|
packet.BIM1_CFL = BIM1_CFL;
|
|
|
|
|
packet.BIM1_CPU = BIM1_CPU;
|
|
|
|
|
packet.BIM1_A659 = BIM1_A659;
|
|
|
|
|
packet.BIM2 = BIM2;
|
|
|
|
|
packet.BIM2_RS422 = BIM2_RS422;
|
|
|
|
|
packet.BIM2_POWER = BIM2_POWER;
|
|
|
|
|
packet.BIM2_CFL = BIM2_CFL;
|
|
|
|
|
packet.BIM2_CPU = BIM2_CPU;
|
|
|
|
|
packet.BIM2_A659 = BIM2_A659;
|
|
|
|
|
mav_array_memcpy(packet.BIM1_PS, BIM1_PS, sizeof(uint32_t)*6);
|
|
|
|
|
mav_array_memcpy(packet.BIM2_PS, BIM2_PS, sizeof(uint32_t)*6);
|
2018-05-20 20:55:47 +08:00
|
|
|
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PUBIT_RESULT_LEN);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
msg->msgid = MAVLINK_MSG_ID_PUBIT_RESULT;
|
|
|
|
|
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PUBIT_RESULT_MIN_LEN, MAVLINK_MSG_ID_PUBIT_RESULT_LEN, MAVLINK_MSG_ID_PUBIT_RESULT_CRC);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Encode a pubit_result struct
|
|
|
|
|
*
|
|
|
|
|
* @param system_id ID of this system
|
|
|
|
|
* @param component_id ID of this component (e.g. 200 for IMU)
|
|
|
|
|
* @param msg The MAVLink message to compress the data into
|
|
|
|
|
* @param pubit_result C-struct to read the message contents from
|
|
|
|
|
*/
|
|
|
|
|
static inline uint16_t mavlink_msg_pubit_result_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_pubit_result_t* pubit_result)
|
|
|
|
|
{
|
2018-06-03 17:07:10 +08:00
|
|
|
return mavlink_msg_pubit_result_pack(system_id, component_id, msg, pubit_result->time_boot_ms, pubit_result->CPM1, pubit_result->CPM2, pubit_result->CPM3, pubit_result->BIM1, pubit_result->BIM1_RS422, pubit_result->BIM1_POWER, pubit_result->BIM1_CFL, pubit_result->BIM1_CPU, pubit_result->BIM1_A659, pubit_result->BIM1_PS, pubit_result->BIM2, pubit_result->BIM2_RS422, pubit_result->BIM2_POWER, pubit_result->BIM2_CFL, pubit_result->BIM2_CPU, pubit_result->BIM2_A659, pubit_result->BIM2_PS);
|
2018-05-20 20:55:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Encode a pubit_result struct on a channel
|
|
|
|
|
*
|
|
|
|
|
* @param system_id ID of this system
|
|
|
|
|
* @param component_id ID of this component (e.g. 200 for IMU)
|
|
|
|
|
* @param chan The MAVLink channel this message will be sent over
|
|
|
|
|
* @param msg The MAVLink message to compress the data into
|
|
|
|
|
* @param pubit_result C-struct to read the message contents from
|
|
|
|
|
*/
|
|
|
|
|
static inline uint16_t mavlink_msg_pubit_result_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_pubit_result_t* pubit_result)
|
|
|
|
|
{
|
2018-06-03 17:07:10 +08:00
|
|
|
return mavlink_msg_pubit_result_pack_chan(system_id, component_id, chan, msg, pubit_result->time_boot_ms, pubit_result->CPM1, pubit_result->CPM2, pubit_result->CPM3, pubit_result->BIM1, pubit_result->BIM1_RS422, pubit_result->BIM1_POWER, pubit_result->BIM1_CFL, pubit_result->BIM1_CPU, pubit_result->BIM1_A659, pubit_result->BIM1_PS, pubit_result->BIM2, pubit_result->BIM2_RS422, pubit_result->BIM2_POWER, pubit_result->BIM2_CFL, pubit_result->BIM2_CPU, pubit_result->BIM2_A659, pubit_result->BIM2_PS);
|
2018-05-20 20:55:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Send a pubit_result message
|
|
|
|
|
* @param chan MAVLink channel to send the message
|
|
|
|
|
*
|
2018-06-03 17:07:10 +08:00
|
|
|
* @param time_boot_ms [ms] Timestamp (milliseconds since system boot)
|
|
|
|
|
* @param CPM1 CPM1
|
|
|
|
|
* @param CPM2 CPM2
|
|
|
|
|
* @param CPM3 CPM3
|
|
|
|
|
* @param BIM1 BIM1
|
|
|
|
|
* @param BIM1_RS422 BIM1_RS422
|
|
|
|
|
* @param BIM1_POWER BIM1_POWER
|
|
|
|
|
* @param BIM1_CFL BIM1_CFL
|
|
|
|
|
* @param BIM1_CPU BIM1_CPU
|
|
|
|
|
* @param BIM1_A659 BIM1_A659
|
|
|
|
|
* @param BIM1_PS BIM1_PowerStates
|
|
|
|
|
* @param BIM2 BIM2
|
|
|
|
|
* @param BIM2_RS422 BIM2_RS422
|
|
|
|
|
* @param BIM2_POWER BIM2_POWER
|
|
|
|
|
* @param BIM2_CFL BIM2_CFL
|
|
|
|
|
* @param BIM2_CPU BIM2_CPU
|
|
|
|
|
* @param BIM2_A659 BIM2_A659
|
|
|
|
|
* @param BIM2_PS BIM2_PowerStates
|
2018-05-20 20:55:47 +08:00
|
|
|
*/
|
|
|
|
|
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
|
|
|
|
|
2018-06-03 17:07:10 +08:00
|
|
|
static inline void mavlink_msg_pubit_result_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint32_t CPM1, uint32_t CPM2, uint32_t CPM3, uint32_t BIM1, uint32_t BIM1_RS422, uint32_t BIM1_POWER, uint32_t BIM1_CFL, uint32_t BIM1_CPU, uint32_t BIM1_A659, const uint32_t *BIM1_PS, uint32_t BIM2, uint32_t BIM2_RS422, uint32_t BIM2_POWER, uint32_t BIM2_CFL, uint32_t BIM2_CPU, uint32_t BIM2_A659, const uint32_t *BIM2_PS)
|
2018-05-20 20:55:47 +08:00
|
|
|
{
|
|
|
|
|
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
|
|
|
|
char buf[MAVLINK_MSG_ID_PUBIT_RESULT_LEN];
|
|
|
|
|
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
|
|
|
|
_mav_put_uint32_t(buf, 4, CPM1);
|
|
|
|
|
_mav_put_uint32_t(buf, 8, CPM2);
|
|
|
|
|
_mav_put_uint32_t(buf, 12, CPM3);
|
2018-06-03 17:07:10 +08:00
|
|
|
_mav_put_uint32_t(buf, 16, BIM1);
|
|
|
|
|
_mav_put_uint32_t(buf, 20, BIM1_RS422);
|
|
|
|
|
_mav_put_uint32_t(buf, 24, BIM1_POWER);
|
|
|
|
|
_mav_put_uint32_t(buf, 28, BIM1_CFL);
|
|
|
|
|
_mav_put_uint32_t(buf, 32, BIM1_CPU);
|
|
|
|
|
_mav_put_uint32_t(buf, 36, BIM1_A659);
|
|
|
|
|
_mav_put_uint32_t(buf, 64, BIM2);
|
|
|
|
|
_mav_put_uint32_t(buf, 68, BIM2_RS422);
|
|
|
|
|
_mav_put_uint32_t(buf, 72, BIM2_POWER);
|
|
|
|
|
_mav_put_uint32_t(buf, 76, BIM2_CFL);
|
|
|
|
|
_mav_put_uint32_t(buf, 80, BIM2_CPU);
|
|
|
|
|
_mav_put_uint32_t(buf, 84, BIM2_A659);
|
|
|
|
|
_mav_put_uint32_t_array(buf, 40, BIM1_PS, 6);
|
|
|
|
|
_mav_put_uint32_t_array(buf, 88, BIM2_PS, 6);
|
2018-05-20 20:55:47 +08:00
|
|
|
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PUBIT_RESULT, buf, MAVLINK_MSG_ID_PUBIT_RESULT_MIN_LEN, MAVLINK_MSG_ID_PUBIT_RESULT_LEN, MAVLINK_MSG_ID_PUBIT_RESULT_CRC);
|
|
|
|
|
#else
|
|
|
|
|
mavlink_pubit_result_t packet;
|
|
|
|
|
packet.time_boot_ms = time_boot_ms;
|
|
|
|
|
packet.CPM1 = CPM1;
|
|
|
|
|
packet.CPM2 = CPM2;
|
|
|
|
|
packet.CPM3 = CPM3;
|
2018-06-03 17:07:10 +08:00
|
|
|
packet.BIM1 = BIM1;
|
|
|
|
|
packet.BIM1_RS422 = BIM1_RS422;
|
|
|
|
|
packet.BIM1_POWER = BIM1_POWER;
|
|
|
|
|
packet.BIM1_CFL = BIM1_CFL;
|
|
|
|
|
packet.BIM1_CPU = BIM1_CPU;
|
|
|
|
|
packet.BIM1_A659 = BIM1_A659;
|
|
|
|
|
packet.BIM2 = BIM2;
|
|
|
|
|
packet.BIM2_RS422 = BIM2_RS422;
|
|
|
|
|
packet.BIM2_POWER = BIM2_POWER;
|
|
|
|
|
packet.BIM2_CFL = BIM2_CFL;
|
|
|
|
|
packet.BIM2_CPU = BIM2_CPU;
|
|
|
|
|
packet.BIM2_A659 = BIM2_A659;
|
|
|
|
|
mav_array_memcpy(packet.BIM1_PS, BIM1_PS, sizeof(uint32_t)*6);
|
|
|
|
|
mav_array_memcpy(packet.BIM2_PS, BIM2_PS, sizeof(uint32_t)*6);
|
2018-05-20 20:55:47 +08:00
|
|
|
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PUBIT_RESULT, (const char *)&packet, MAVLINK_MSG_ID_PUBIT_RESULT_MIN_LEN, MAVLINK_MSG_ID_PUBIT_RESULT_LEN, MAVLINK_MSG_ID_PUBIT_RESULT_CRC);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Send a pubit_result message
|
|
|
|
|
* @param chan MAVLink channel to send the message
|
|
|
|
|
* @param struct The MAVLink struct to serialize
|
|
|
|
|
*/
|
|
|
|
|
static inline void mavlink_msg_pubit_result_send_struct(mavlink_channel_t chan, const mavlink_pubit_result_t* pubit_result)
|
|
|
|
|
{
|
|
|
|
|
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
2018-06-03 17:07:10 +08:00
|
|
|
mavlink_msg_pubit_result_send(chan, pubit_result->time_boot_ms, pubit_result->CPM1, pubit_result->CPM2, pubit_result->CPM3, pubit_result->BIM1, pubit_result->BIM1_RS422, pubit_result->BIM1_POWER, pubit_result->BIM1_CFL, pubit_result->BIM1_CPU, pubit_result->BIM1_A659, pubit_result->BIM1_PS, pubit_result->BIM2, pubit_result->BIM2_RS422, pubit_result->BIM2_POWER, pubit_result->BIM2_CFL, pubit_result->BIM2_CPU, pubit_result->BIM2_A659, pubit_result->BIM2_PS);
|
2018-05-20 20:55:47 +08:00
|
|
|
#else
|
|
|
|
|
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PUBIT_RESULT, (const char *)pubit_result, MAVLINK_MSG_ID_PUBIT_RESULT_MIN_LEN, MAVLINK_MSG_ID_PUBIT_RESULT_LEN, MAVLINK_MSG_ID_PUBIT_RESULT_CRC);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if MAVLINK_MSG_ID_PUBIT_RESULT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
|
|
|
|
/*
|
|
|
|
|
This varient of _send() can be used to save stack space by re-using
|
|
|
|
|
memory from the receive buffer. The caller provides a
|
|
|
|
|
mavlink_message_t which is the size of a full mavlink message. This
|
|
|
|
|
is usually the receive buffer for the channel, and allows a reply to an
|
|
|
|
|
incoming message with minimum stack space usage.
|
|
|
|
|
*/
|
2018-06-03 17:07:10 +08:00
|
|
|
static inline void mavlink_msg_pubit_result_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint32_t CPM1, uint32_t CPM2, uint32_t CPM3, uint32_t BIM1, uint32_t BIM1_RS422, uint32_t BIM1_POWER, uint32_t BIM1_CFL, uint32_t BIM1_CPU, uint32_t BIM1_A659, const uint32_t *BIM1_PS, uint32_t BIM2, uint32_t BIM2_RS422, uint32_t BIM2_POWER, uint32_t BIM2_CFL, uint32_t BIM2_CPU, uint32_t BIM2_A659, const uint32_t *BIM2_PS)
|
2018-05-20 20:55:47 +08:00
|
|
|
{
|
|
|
|
|
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
|
|
|
|
char *buf = (char *)msgbuf;
|
|
|
|
|
_mav_put_uint32_t(buf, 0, time_boot_ms);
|
|
|
|
|
_mav_put_uint32_t(buf, 4, CPM1);
|
|
|
|
|
_mav_put_uint32_t(buf, 8, CPM2);
|
|
|
|
|
_mav_put_uint32_t(buf, 12, CPM3);
|
2018-06-03 17:07:10 +08:00
|
|
|
_mav_put_uint32_t(buf, 16, BIM1);
|
|
|
|
|
_mav_put_uint32_t(buf, 20, BIM1_RS422);
|
|
|
|
|
_mav_put_uint32_t(buf, 24, BIM1_POWER);
|
|
|
|
|
_mav_put_uint32_t(buf, 28, BIM1_CFL);
|
|
|
|
|
_mav_put_uint32_t(buf, 32, BIM1_CPU);
|
|
|
|
|
_mav_put_uint32_t(buf, 36, BIM1_A659);
|
|
|
|
|
_mav_put_uint32_t(buf, 64, BIM2);
|
|
|
|
|
_mav_put_uint32_t(buf, 68, BIM2_RS422);
|
|
|
|
|
_mav_put_uint32_t(buf, 72, BIM2_POWER);
|
|
|
|
|
_mav_put_uint32_t(buf, 76, BIM2_CFL);
|
|
|
|
|
_mav_put_uint32_t(buf, 80, BIM2_CPU);
|
|
|
|
|
_mav_put_uint32_t(buf, 84, BIM2_A659);
|
|
|
|
|
_mav_put_uint32_t_array(buf, 40, BIM1_PS, 6);
|
|
|
|
|
_mav_put_uint32_t_array(buf, 88, BIM2_PS, 6);
|
2018-05-20 20:55:47 +08:00
|
|
|
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PUBIT_RESULT, buf, MAVLINK_MSG_ID_PUBIT_RESULT_MIN_LEN, MAVLINK_MSG_ID_PUBIT_RESULT_LEN, MAVLINK_MSG_ID_PUBIT_RESULT_CRC);
|
|
|
|
|
#else
|
|
|
|
|
mavlink_pubit_result_t *packet = (mavlink_pubit_result_t *)msgbuf;
|
|
|
|
|
packet->time_boot_ms = time_boot_ms;
|
|
|
|
|
packet->CPM1 = CPM1;
|
|
|
|
|
packet->CPM2 = CPM2;
|
|
|
|
|
packet->CPM3 = CPM3;
|
2018-06-03 17:07:10 +08:00
|
|
|
packet->BIM1 = BIM1;
|
|
|
|
|
packet->BIM1_RS422 = BIM1_RS422;
|
|
|
|
|
packet->BIM1_POWER = BIM1_POWER;
|
|
|
|
|
packet->BIM1_CFL = BIM1_CFL;
|
|
|
|
|
packet->BIM1_CPU = BIM1_CPU;
|
|
|
|
|
packet->BIM1_A659 = BIM1_A659;
|
|
|
|
|
packet->BIM2 = BIM2;
|
|
|
|
|
packet->BIM2_RS422 = BIM2_RS422;
|
|
|
|
|
packet->BIM2_POWER = BIM2_POWER;
|
|
|
|
|
packet->BIM2_CFL = BIM2_CFL;
|
|
|
|
|
packet->BIM2_CPU = BIM2_CPU;
|
|
|
|
|
packet->BIM2_A659 = BIM2_A659;
|
|
|
|
|
mav_array_memcpy(packet->BIM1_PS, BIM1_PS, sizeof(uint32_t)*6);
|
|
|
|
|
mav_array_memcpy(packet->BIM2_PS, BIM2_PS, sizeof(uint32_t)*6);
|
2018-05-20 20:55:47 +08:00
|
|
|
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PUBIT_RESULT, (const char *)packet, MAVLINK_MSG_ID_PUBIT_RESULT_MIN_LEN, MAVLINK_MSG_ID_PUBIT_RESULT_LEN, MAVLINK_MSG_ID_PUBIT_RESULT_CRC);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
// MESSAGE PUBIT_RESULT UNPACKING
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get field time_boot_ms from pubit_result message
|
|
|
|
|
*
|
2018-06-03 17:07:10 +08:00
|
|
|
* @return [ms] Timestamp (milliseconds since system boot)
|
2018-05-20 20:55:47 +08:00
|
|
|
*/
|
|
|
|
|
static inline uint32_t mavlink_msg_pubit_result_get_time_boot_ms(const mavlink_message_t* msg)
|
|
|
|
|
{
|
|
|
|
|
return _MAV_RETURN_uint32_t(msg, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get field CPM1 from pubit_result message
|
|
|
|
|
*
|
2018-06-03 17:07:10 +08:00
|
|
|
* @return CPM1
|
2018-05-20 20:55:47 +08:00
|
|
|
*/
|
|
|
|
|
static inline uint32_t mavlink_msg_pubit_result_get_CPM1(const mavlink_message_t* msg)
|
|
|
|
|
{
|
|
|
|
|
return _MAV_RETURN_uint32_t(msg, 4);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get field CPM2 from pubit_result message
|
|
|
|
|
*
|
2018-06-03 17:07:10 +08:00
|
|
|
* @return CPM2
|
2018-05-20 20:55:47 +08:00
|
|
|
*/
|
|
|
|
|
static inline uint32_t mavlink_msg_pubit_result_get_CPM2(const mavlink_message_t* msg)
|
|
|
|
|
{
|
|
|
|
|
return _MAV_RETURN_uint32_t(msg, 8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get field CPM3 from pubit_result message
|
|
|
|
|
*
|
2018-06-03 17:07:10 +08:00
|
|
|
* @return CPM3
|
2018-05-20 20:55:47 +08:00
|
|
|
*/
|
|
|
|
|
static inline uint32_t mavlink_msg_pubit_result_get_CPM3(const mavlink_message_t* msg)
|
|
|
|
|
{
|
|
|
|
|
return _MAV_RETURN_uint32_t(msg, 12);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-06-03 17:07:10 +08:00
|
|
|
* @brief Get field BIM1 from pubit_result message
|
2018-05-20 20:55:47 +08:00
|
|
|
*
|
2018-06-03 17:07:10 +08:00
|
|
|
* @return BIM1
|
2018-05-20 20:55:47 +08:00
|
|
|
*/
|
2018-06-03 17:07:10 +08:00
|
|
|
static inline uint32_t mavlink_msg_pubit_result_get_BIM1(const mavlink_message_t* msg)
|
2018-05-20 20:55:47 +08:00
|
|
|
{
|
|
|
|
|
return _MAV_RETURN_uint32_t(msg, 16);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-06-03 17:07:10 +08:00
|
|
|
* @brief Get field BIM1_RS422 from pubit_result message
|
2018-05-20 20:55:47 +08:00
|
|
|
*
|
2018-06-03 17:07:10 +08:00
|
|
|
* @return BIM1_RS422
|
2018-05-20 20:55:47 +08:00
|
|
|
*/
|
2018-06-03 17:07:10 +08:00
|
|
|
static inline uint32_t mavlink_msg_pubit_result_get_BIM1_RS422(const mavlink_message_t* msg)
|
2018-05-20 20:55:47 +08:00
|
|
|
{
|
2018-06-03 17:07:10 +08:00
|
|
|
return _MAV_RETURN_uint32_t(msg, 20);
|
2018-05-20 20:55:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-06-03 17:07:10 +08:00
|
|
|
* @brief Get field BIM1_POWER from pubit_result message
|
2018-05-20 20:55:47 +08:00
|
|
|
*
|
2018-06-03 17:07:10 +08:00
|
|
|
* @return BIM1_POWER
|
2018-05-20 20:55:47 +08:00
|
|
|
*/
|
2018-06-03 17:07:10 +08:00
|
|
|
static inline uint32_t mavlink_msg_pubit_result_get_BIM1_POWER(const mavlink_message_t* msg)
|
2018-05-20 20:55:47 +08:00
|
|
|
{
|
2018-06-03 17:07:10 +08:00
|
|
|
return _MAV_RETURN_uint32_t(msg, 24);
|
2018-05-20 20:55:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-06-03 17:07:10 +08:00
|
|
|
* @brief Get field BIM1_CFL from pubit_result message
|
2018-05-20 20:55:47 +08:00
|
|
|
*
|
2018-06-03 17:07:10 +08:00
|
|
|
* @return BIM1_CFL
|
2018-05-20 20:55:47 +08:00
|
|
|
*/
|
2018-06-03 17:07:10 +08:00
|
|
|
static inline uint32_t mavlink_msg_pubit_result_get_BIM1_CFL(const mavlink_message_t* msg)
|
2018-05-20 20:55:47 +08:00
|
|
|
{
|
2018-06-03 17:07:10 +08:00
|
|
|
return _MAV_RETURN_uint32_t(msg, 28);
|
2018-05-20 20:55:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-06-03 17:07:10 +08:00
|
|
|
* @brief Get field BIM1_CPU from pubit_result message
|
2018-05-20 20:55:47 +08:00
|
|
|
*
|
2018-06-03 17:07:10 +08:00
|
|
|
* @return BIM1_CPU
|
2018-05-20 20:55:47 +08:00
|
|
|
*/
|
2018-06-03 17:07:10 +08:00
|
|
|
static inline uint32_t mavlink_msg_pubit_result_get_BIM1_CPU(const mavlink_message_t* msg)
|
2018-05-20 20:55:47 +08:00
|
|
|
{
|
2018-06-03 17:07:10 +08:00
|
|
|
return _MAV_RETURN_uint32_t(msg, 32);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get field BIM1_A659 from pubit_result message
|
|
|
|
|
*
|
|
|
|
|
* @return BIM1_A659
|
|
|
|
|
*/
|
|
|
|
|
static inline uint32_t mavlink_msg_pubit_result_get_BIM1_A659(const mavlink_message_t* msg)
|
|
|
|
|
{
|
|
|
|
|
return _MAV_RETURN_uint32_t(msg, 36);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get field BIM1_PS from pubit_result message
|
|
|
|
|
*
|
|
|
|
|
* @return BIM1_PowerStates
|
|
|
|
|
*/
|
|
|
|
|
static inline uint16_t mavlink_msg_pubit_result_get_BIM1_PS(const mavlink_message_t* msg, uint32_t *BIM1_PS)
|
|
|
|
|
{
|
|
|
|
|
return _MAV_RETURN_uint32_t_array(msg, BIM1_PS, 6, 40);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get field BIM2 from pubit_result message
|
|
|
|
|
*
|
|
|
|
|
* @return BIM2
|
|
|
|
|
*/
|
|
|
|
|
static inline uint32_t mavlink_msg_pubit_result_get_BIM2(const mavlink_message_t* msg)
|
|
|
|
|
{
|
|
|
|
|
return _MAV_RETURN_uint32_t(msg, 64);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get field BIM2_RS422 from pubit_result message
|
|
|
|
|
*
|
|
|
|
|
* @return BIM2_RS422
|
|
|
|
|
*/
|
|
|
|
|
static inline uint32_t mavlink_msg_pubit_result_get_BIM2_RS422(const mavlink_message_t* msg)
|
|
|
|
|
{
|
|
|
|
|
return _MAV_RETURN_uint32_t(msg, 68);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get field BIM2_POWER from pubit_result message
|
|
|
|
|
*
|
|
|
|
|
* @return BIM2_POWER
|
|
|
|
|
*/
|
|
|
|
|
static inline uint32_t mavlink_msg_pubit_result_get_BIM2_POWER(const mavlink_message_t* msg)
|
|
|
|
|
{
|
|
|
|
|
return _MAV_RETURN_uint32_t(msg, 72);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get field BIM2_CFL from pubit_result message
|
|
|
|
|
*
|
|
|
|
|
* @return BIM2_CFL
|
|
|
|
|
*/
|
|
|
|
|
static inline uint32_t mavlink_msg_pubit_result_get_BIM2_CFL(const mavlink_message_t* msg)
|
|
|
|
|
{
|
|
|
|
|
return _MAV_RETURN_uint32_t(msg, 76);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get field BIM2_CPU from pubit_result message
|
|
|
|
|
*
|
|
|
|
|
* @return BIM2_CPU
|
|
|
|
|
*/
|
|
|
|
|
static inline uint32_t mavlink_msg_pubit_result_get_BIM2_CPU(const mavlink_message_t* msg)
|
|
|
|
|
{
|
|
|
|
|
return _MAV_RETURN_uint32_t(msg, 80);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get field BIM2_A659 from pubit_result message
|
|
|
|
|
*
|
|
|
|
|
* @return BIM2_A659
|
|
|
|
|
*/
|
|
|
|
|
static inline uint32_t mavlink_msg_pubit_result_get_BIM2_A659(const mavlink_message_t* msg)
|
|
|
|
|
{
|
|
|
|
|
return _MAV_RETURN_uint32_t(msg, 84);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get field BIM2_PS from pubit_result message
|
|
|
|
|
*
|
|
|
|
|
* @return BIM2_PowerStates
|
|
|
|
|
*/
|
|
|
|
|
static inline uint16_t mavlink_msg_pubit_result_get_BIM2_PS(const mavlink_message_t* msg, uint32_t *BIM2_PS)
|
|
|
|
|
{
|
|
|
|
|
return _MAV_RETURN_uint32_t_array(msg, BIM2_PS, 6, 88);
|
2018-05-20 20:55:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Decode a pubit_result message into a struct
|
|
|
|
|
*
|
|
|
|
|
* @param msg The message to decode
|
|
|
|
|
* @param pubit_result C-struct to decode the message contents into
|
|
|
|
|
*/
|
|
|
|
|
static inline void mavlink_msg_pubit_result_decode(const mavlink_message_t* msg, mavlink_pubit_result_t* pubit_result)
|
|
|
|
|
{
|
|
|
|
|
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
|
|
|
|
pubit_result->time_boot_ms = mavlink_msg_pubit_result_get_time_boot_ms(msg);
|
|
|
|
|
pubit_result->CPM1 = mavlink_msg_pubit_result_get_CPM1(msg);
|
|
|
|
|
pubit_result->CPM2 = mavlink_msg_pubit_result_get_CPM2(msg);
|
|
|
|
|
pubit_result->CPM3 = mavlink_msg_pubit_result_get_CPM3(msg);
|
2018-06-03 17:07:10 +08:00
|
|
|
pubit_result->BIM1 = mavlink_msg_pubit_result_get_BIM1(msg);
|
|
|
|
|
pubit_result->BIM1_RS422 = mavlink_msg_pubit_result_get_BIM1_RS422(msg);
|
|
|
|
|
pubit_result->BIM1_POWER = mavlink_msg_pubit_result_get_BIM1_POWER(msg);
|
|
|
|
|
pubit_result->BIM1_CFL = mavlink_msg_pubit_result_get_BIM1_CFL(msg);
|
|
|
|
|
pubit_result->BIM1_CPU = mavlink_msg_pubit_result_get_BIM1_CPU(msg);
|
|
|
|
|
pubit_result->BIM1_A659 = mavlink_msg_pubit_result_get_BIM1_A659(msg);
|
|
|
|
|
mavlink_msg_pubit_result_get_BIM1_PS(msg, pubit_result->BIM1_PS);
|
|
|
|
|
pubit_result->BIM2 = mavlink_msg_pubit_result_get_BIM2(msg);
|
|
|
|
|
pubit_result->BIM2_RS422 = mavlink_msg_pubit_result_get_BIM2_RS422(msg);
|
|
|
|
|
pubit_result->BIM2_POWER = mavlink_msg_pubit_result_get_BIM2_POWER(msg);
|
|
|
|
|
pubit_result->BIM2_CFL = mavlink_msg_pubit_result_get_BIM2_CFL(msg);
|
|
|
|
|
pubit_result->BIM2_CPU = mavlink_msg_pubit_result_get_BIM2_CPU(msg);
|
|
|
|
|
pubit_result->BIM2_A659 = mavlink_msg_pubit_result_get_BIM2_A659(msg);
|
|
|
|
|
mavlink_msg_pubit_result_get_BIM2_PS(msg, pubit_result->BIM2_PS);
|
2018-05-20 20:55:47 +08:00
|
|
|
#else
|
|
|
|
|
uint8_t len = msg->len < MAVLINK_MSG_ID_PUBIT_RESULT_LEN? msg->len : MAVLINK_MSG_ID_PUBIT_RESULT_LEN;
|
|
|
|
|
memset(pubit_result, 0, MAVLINK_MSG_ID_PUBIT_RESULT_LEN);
|
|
|
|
|
memcpy(pubit_result, _MAV_PAYLOAD(msg), len);
|
|
|
|
|
#endif
|
|
|
|
|
}
|