Commit 37d14af4 authored by PX4BuildBot's avatar PX4BuildBot

autogenerated headers for rev...

autogenerated headers for rev https://github.com/mavlink/mavlink/tree/f876c2dc64e976a80a70851aa80766c08d261a51
parent 36914147
......@@ -24,7 +24,7 @@ extern "C" {
#endif
#ifndef MAVLINK_MESSAGE_CRCS
#define MAVLINK_MESSAGE_CRCS {{0, 50, 9, 0, 0, 0}, {1, 124, 31, 0, 0, 0}, {2, 137, 12, 0, 0, 0}, {4, 237, 14, 3, 12, 13}, {5, 217, 28, 1, 0, 0}, {6, 104, 3, 0, 0, 0}, {7, 119, 32, 0, 0, 0}, {11, 89, 6, 1, 4, 0}, {20, 214, 20, 3, 2, 3}, {21, 159, 2, 3, 0, 1}, {22, 220, 25, 0, 0, 0}, {23, 168, 23, 3, 4, 5}, {24, 24, 30, 0, 0, 0}, {25, 23, 101, 0, 0, 0}, {26, 170, 22, 0, 0, 0}, {27, 144, 26, 0, 0, 0}, {28, 67, 16, 0, 0, 0}, {29, 115, 14, 0, 0, 0}, {30, 39, 28, 0, 0, 0}, {31, 246, 32, 0, 0, 0}, {32, 185, 28, 0, 0, 0}, {33, 104, 28, 0, 0, 0}, {34, 237, 22, 0, 0, 0}, {35, 244, 22, 0, 0, 0}, {36, 222, 21, 0, 0, 0}, {37, 212, 6, 3, 4, 5}, {38, 9, 6, 3, 4, 5}, {39, 254, 37, 3, 32, 33}, {40, 230, 4, 3, 2, 3}, {41, 28, 4, 3, 2, 3}, {42, 28, 2, 0, 0, 0}, {43, 132, 2, 3, 0, 1}, {44, 221, 4, 3, 2, 3}, {45, 232, 2, 3, 0, 1}, {46, 11, 2, 0, 0, 0}, {47, 153, 3, 3, 0, 1}, {48, 41, 13, 1, 12, 0}, {49, 39, 12, 0, 0, 0}, {50, 78, 37, 3, 18, 19}, {51, 196, 4, 3, 2, 3}, {54, 15, 27, 3, 24, 25}, {55, 3, 25, 0, 0, 0}, {61, 167, 72, 0, 0, 0}, {62, 183, 26, 0, 0, 0}, {63, 119, 181, 0, 0, 0}, {64, 191, 225, 0, 0, 0}, {65, 118, 42, 0, 0, 0}, {66, 148, 6, 3, 2, 3}, {67, 21, 4, 0, 0, 0}, {69, 243, 11, 0, 0, 0}, {70, 124, 18, 3, 16, 17}, {73, 38, 37, 3, 32, 33}, {74, 20, 20, 0, 0, 0}, {75, 158, 35, 3, 30, 31}, {76, 152, 33, 3, 30, 31}, {77, 143, 3, 3, 8, 9}, {81, 106, 22, 0, 0, 0}, {82, 49, 39, 3, 36, 37}, {83, 22, 37, 0, 0, 0}, {84, 143, 53, 3, 50, 51}, {85, 140, 51, 0, 0, 0}, {86, 5, 53, 3, 50, 51}, {87, 150, 51, 0, 0, 0}, {89, 231, 28, 0, 0, 0}, {90, 183, 56, 0, 0, 0}, {91, 63, 42, 0, 0, 0}, {92, 54, 33, 0, 0, 0}, {93, 47, 81, 0, 0, 0}, {100, 175, 26, 0, 0, 0}, {101, 102, 32, 0, 0, 0}, {102, 158, 32, 0, 0, 0}, {103, 208, 20, 0, 0, 0}, {104, 56, 32, 0, 0, 0}, {105, 93, 62, 0, 0, 0}, {106, 138, 44, 0, 0, 0}, {107, 108, 64, 0, 0, 0}, {108, 32, 84, 0, 0, 0}, {109, 185, 9, 0, 0, 0}, {110, 84, 254, 3, 1, 2}, {111, 34, 16, 0, 0, 0}, {112, 174, 12, 0, 0, 0}, {113, 124, 36, 0, 0, 0}, {114, 237, 44, 0, 0, 0}, {115, 4, 64, 0, 0, 0}, {116, 76, 22, 0, 0, 0}, {117, 128, 6, 3, 4, 5}, {118, 56, 14, 0, 0, 0}, {119, 116, 12, 3, 10, 11}, {120, 134, 97, 0, 0, 0}, {121, 237, 2, 3, 0, 1}, {122, 203, 2, 3, 0, 1}, {123, 250, 113, 3, 0, 1}, {124, 87, 35, 0, 0, 0}, {125, 203, 6, 0, 0, 0}, {126, 220, 79, 0, 0, 0}, {127, 25, 35, 0, 0, 0}, {128, 226, 35, 0, 0, 0}, {129, 46, 22, 0, 0, 0}, {130, 29, 13, 0, 0, 0}, {131, 223, 255, 0, 0, 0}, {132, 85, 14, 0, 0, 0}, {133, 6, 18, 0, 0, 0}, {134, 229, 43, 0, 0, 0}, {135, 203, 8, 0, 0, 0}, {136, 1, 22, 0, 0, 0}, {137, 195, 14, 0, 0, 0}, {138, 109, 36, 0, 0, 0}, {139, 168, 43, 3, 41, 42}, {140, 181, 41, 0, 0, 0}, {141, 47, 32, 0, 0, 0}, {142, 72, 243, 0, 0, 0}, {143, 131, 14, 0, 0, 0}, {144, 127, 93, 0, 0, 0}, {146, 103, 100, 0, 0, 0}, {147, 154, 36, 0, 0, 0}, {148, 178, 60, 0, 0, 0}, {149, 200, 30, 0, 0, 0}, {201, 218, 16, 0, 0, 0}, {202, 231, 41, 0, 0, 0}, {203, 172, 98, 0, 0, 0}, {204, 251, 38, 0, 0, 0}, {205, 97, 14, 0, 0, 0}, {206, 64, 32, 0, 0, 0}, {207, 234, 33, 0, 0, 0}, {208, 175, 8, 0, 0, 0}, {209, 62, 27, 0, 0, 0}, {210, 20, 102, 0, 0, 0}, {211, 54, 16, 0, 0, 0}, {212, 222, 46, 0, 0, 0}, {230, 163, 42, 0, 0, 0}, {231, 105, 40, 0, 0, 0}, {232, 151, 63, 0, 0, 0}, {233, 35, 182, 0, 0, 0}, {234, 150, 40, 0, 0, 0}, {235, 179, 42, 0, 0, 0}, {241, 90, 32, 0, 0, 0}, {242, 104, 52, 0, 0, 0}, {243, 85, 53, 1, 52, 0}, {244, 95, 6, 0, 0, 0}, {245, 130, 2, 0, 0, 0}, {246, 184, 38, 0, 0, 0}, {247, 81, 19, 0, 0, 0}, {248, 8, 254, 3, 3, 4}, {249, 204, 36, 0, 0, 0}, {250, 49, 30, 0, 0, 0}, {251, 170, 18, 0, 0, 0}, {252, 44, 18, 0, 0, 0}, {253, 83, 51, 0, 0, 0}, {254, 46, 9, 0, 0, 0}, {256, 71, 42, 3, 8, 9}, {257, 131, 9, 0, 0, 0}, {258, 187, 32, 3, 0, 1}, {259, 92, 235, 0, 0, 0}, {260, 146, 5, 0, 0, 0}, {261, 179, 27, 0, 0, 0}, {262, 12, 18, 0, 0, 0}, {263, 133, 255, 0, 0, 0}, {264, 49, 28, 0, 0, 0}, {265, 26, 16, 0, 0, 0}, {266, 193, 255, 3, 2, 3}, {267, 35, 255, 3, 2, 3}, {268, 14, 4, 3, 2, 3}, {269, 58, 246, 0, 0, 0}, {270, 232, 247, 3, 14, 15}, {299, 19, 96, 0, 0, 0}, {300, 217, 22, 0, 0, 0}, {310, 28, 17, 0, 0, 0}, {311, 95, 116, 0, 0, 0}, {320, 243, 20, 3, 2, 3}, {321, 88, 2, 3, 0, 1}, {322, 243, 149, 0, 0, 0}, {323, 78, 147, 3, 0, 1}, {324, 132, 146, 0, 0, 0}, {330, 23, 158, 0, 0, 0}}
#define MAVLINK_MESSAGE_CRCS {{0, 50, 9, 0, 0, 0}, {1, 124, 31, 0, 0, 0}, {2, 137, 12, 0, 0, 0}, {4, 237, 14, 3, 12, 13}, {5, 217, 28, 1, 0, 0}, {6, 104, 3, 0, 0, 0}, {7, 119, 32, 0, 0, 0}, {11, 89, 6, 1, 4, 0}, {20, 214, 20, 3, 2, 3}, {21, 159, 2, 3, 0, 1}, {22, 220, 25, 0, 0, 0}, {23, 168, 23, 3, 4, 5}, {24, 24, 30, 0, 0, 0}, {25, 23, 101, 0, 0, 0}, {26, 170, 22, 0, 0, 0}, {27, 144, 26, 0, 0, 0}, {28, 67, 16, 0, 0, 0}, {29, 115, 14, 0, 0, 0}, {30, 39, 28, 0, 0, 0}, {31, 246, 32, 0, 0, 0}, {32, 185, 28, 0, 0, 0}, {33, 104, 28, 0, 0, 0}, {34, 237, 22, 0, 0, 0}, {35, 244, 22, 0, 0, 0}, {36, 222, 21, 0, 0, 0}, {37, 212, 6, 3, 4, 5}, {38, 9, 6, 3, 4, 5}, {39, 254, 37, 3, 32, 33}, {40, 230, 4, 3, 2, 3}, {41, 28, 4, 3, 2, 3}, {42, 28, 2, 0, 0, 0}, {43, 132, 2, 3, 0, 1}, {44, 221, 4, 3, 2, 3}, {45, 232, 2, 3, 0, 1}, {46, 11, 2, 0, 0, 0}, {47, 153, 3, 3, 0, 1}, {48, 41, 13, 1, 12, 0}, {49, 39, 12, 0, 0, 0}, {50, 78, 37, 3, 18, 19}, {51, 196, 4, 3, 2, 3}, {54, 15, 27, 3, 24, 25}, {55, 3, 25, 0, 0, 0}, {61, 167, 72, 0, 0, 0}, {62, 183, 26, 0, 0, 0}, {63, 119, 181, 0, 0, 0}, {64, 191, 225, 0, 0, 0}, {65, 118, 42, 0, 0, 0}, {66, 148, 6, 3, 2, 3}, {67, 21, 4, 0, 0, 0}, {69, 243, 11, 0, 0, 0}, {70, 124, 18, 3, 16, 17}, {73, 38, 37, 3, 32, 33}, {74, 20, 20, 0, 0, 0}, {75, 158, 35, 3, 30, 31}, {76, 152, 33, 3, 30, 31}, {77, 143, 3, 3, 8, 9}, {81, 106, 22, 0, 0, 0}, {82, 49, 39, 3, 36, 37}, {83, 22, 37, 0, 0, 0}, {84, 143, 53, 3, 50, 51}, {85, 140, 51, 0, 0, 0}, {86, 5, 53, 3, 50, 51}, {87, 150, 51, 0, 0, 0}, {89, 231, 28, 0, 0, 0}, {90, 183, 56, 0, 0, 0}, {91, 63, 42, 0, 0, 0}, {92, 54, 33, 0, 0, 0}, {93, 47, 81, 0, 0, 0}, {100, 175, 26, 0, 0, 0}, {101, 102, 32, 0, 0, 0}, {102, 158, 32, 0, 0, 0}, {103, 208, 20, 0, 0, 0}, {104, 56, 32, 0, 0, 0}, {105, 93, 62, 0, 0, 0}, {106, 138, 44, 0, 0, 0}, {107, 108, 64, 0, 0, 0}, {108, 32, 84, 0, 0, 0}, {109, 185, 9, 0, 0, 0}, {110, 84, 254, 3, 1, 2}, {111, 34, 16, 0, 0, 0}, {112, 174, 12, 0, 0, 0}, {113, 124, 36, 0, 0, 0}, {114, 237, 44, 0, 0, 0}, {115, 4, 64, 0, 0, 0}, {116, 76, 22, 0, 0, 0}, {117, 128, 6, 3, 4, 5}, {118, 56, 14, 0, 0, 0}, {119, 116, 12, 3, 10, 11}, {120, 134, 97, 0, 0, 0}, {121, 237, 2, 3, 0, 1}, {122, 203, 2, 3, 0, 1}, {123, 250, 113, 3, 0, 1}, {124, 87, 35, 0, 0, 0}, {125, 203, 6, 0, 0, 0}, {126, 220, 79, 0, 0, 0}, {127, 25, 35, 0, 0, 0}, {128, 226, 35, 0, 0, 0}, {129, 46, 22, 0, 0, 0}, {130, 29, 13, 0, 0, 0}, {131, 223, 255, 0, 0, 0}, {132, 85, 14, 0, 0, 0}, {133, 6, 18, 0, 0, 0}, {134, 229, 43, 0, 0, 0}, {135, 203, 8, 0, 0, 0}, {136, 1, 22, 0, 0, 0}, {137, 195, 14, 0, 0, 0}, {138, 109, 36, 0, 0, 0}, {139, 168, 43, 3, 41, 42}, {140, 181, 41, 0, 0, 0}, {141, 47, 32, 0, 0, 0}, {142, 72, 243, 0, 0, 0}, {143, 131, 14, 0, 0, 0}, {144, 127, 93, 0, 0, 0}, {146, 103, 100, 0, 0, 0}, {147, 154, 36, 0, 0, 0}, {148, 178, 60, 0, 0, 0}, {149, 200, 30, 0, 0, 0}, {201, 218, 16, 0, 0, 0}, {202, 231, 41, 0, 0, 0}, {203, 172, 98, 0, 0, 0}, {204, 251, 38, 0, 0, 0}, {205, 97, 14, 0, 0, 0}, {206, 64, 32, 0, 0, 0}, {207, 234, 33, 0, 0, 0}, {208, 175, 8, 0, 0, 0}, {209, 155, 41, 0, 0, 0}, {210, 20, 102, 0, 0, 0}, {211, 54, 16, 0, 0, 0}, {212, 222, 46, 0, 0, 0}, {230, 163, 42, 0, 0, 0}, {231, 105, 40, 0, 0, 0}, {232, 151, 63, 0, 0, 0}, {233, 35, 182, 0, 0, 0}, {234, 150, 40, 0, 0, 0}, {235, 179, 42, 0, 0, 0}, {241, 90, 32, 0, 0, 0}, {242, 104, 52, 0, 0, 0}, {243, 85, 53, 1, 52, 0}, {244, 95, 6, 0, 0, 0}, {245, 130, 2, 0, 0, 0}, {246, 184, 38, 0, 0, 0}, {247, 81, 19, 0, 0, 0}, {248, 8, 254, 3, 3, 4}, {249, 204, 36, 0, 0, 0}, {250, 49, 30, 0, 0, 0}, {251, 170, 18, 0, 0, 0}, {252, 44, 18, 0, 0, 0}, {253, 83, 51, 0, 0, 0}, {254, 46, 9, 0, 0, 0}, {256, 71, 42, 3, 8, 9}, {257, 131, 9, 0, 0, 0}, {258, 187, 32, 3, 0, 1}, {259, 92, 235, 0, 0, 0}, {260, 146, 5, 0, 0, 0}, {261, 179, 27, 0, 0, 0}, {262, 12, 18, 0, 0, 0}, {263, 133, 255, 0, 0, 0}, {264, 49, 28, 0, 0, 0}, {265, 26, 16, 0, 0, 0}, {266, 193, 255, 3, 2, 3}, {267, 35, 255, 3, 2, 3}, {268, 14, 4, 3, 2, 3}, {269, 58, 246, 0, 0, 0}, {270, 232, 247, 3, 14, 15}, {299, 19, 96, 0, 0, 0}, {300, 217, 22, 0, 0, 0}, {310, 28, 17, 0, 0, 0}, {311, 95, 116, 0, 0, 0}, {320, 243, 20, 3, 2, 3}, {321, 88, 2, 3, 0, 1}, {322, 243, 149, 0, 0, 0}, {323, 78, 147, 3, 0, 1}, {324, 132, 146, 0, 0, 0}, {330, 23, 158, 0, 0, 0}}
#endif
#include "../protocol.h"
......
......@@ -5,12 +5,14 @@
MAVPACKED(
typedef struct __mavlink_sens_batmon_t {
uint64_t batmon_timestamp; /*< Time since system start [us]*/
float temperature; /*< Battery pack temperature in [deg C]*/
uint32_t safetystatus; /*< Battery monitor safetystatus report bits in Hex*/
uint32_t operationstatus; /*< Battery monitor operation status report bits in Hex*/
uint16_t voltage; /*< Battery pack voltage in [mV]*/
int16_t current; /*< Battery pack current in [mA]*/
uint16_t batterystatus; /*< Battery monitor status report bits in Hex*/
uint16_t serialnumber; /*< Battery monitor serial number in Hex*/
uint16_t hostfetcontrol; /*< Battery monitor sensor host FET control in Hex*/
uint16_t cellvoltage1; /*< Battery pack cell 1 voltage in [mV]*/
uint16_t cellvoltage2; /*< Battery pack cell 2 voltage in [mV]*/
uint16_t cellvoltage3; /*< Battery pack cell 3 voltage in [mV]*/
......@@ -20,13 +22,13 @@ typedef struct __mavlink_sens_batmon_t {
uint8_t SoC; /*< Battery pack state-of-charge*/
}) mavlink_sens_batmon_t;
#define MAVLINK_MSG_ID_SENS_BATMON_LEN 27
#define MAVLINK_MSG_ID_SENS_BATMON_MIN_LEN 27
#define MAVLINK_MSG_ID_209_LEN 27
#define MAVLINK_MSG_ID_209_MIN_LEN 27
#define MAVLINK_MSG_ID_SENS_BATMON_LEN 41
#define MAVLINK_MSG_ID_SENS_BATMON_MIN_LEN 41
#define MAVLINK_MSG_ID_209_LEN 41
#define MAVLINK_MSG_ID_209_MIN_LEN 41
#define MAVLINK_MSG_ID_SENS_BATMON_CRC 62
#define MAVLINK_MSG_ID_209_CRC 62
#define MAVLINK_MSG_ID_SENS_BATMON_CRC 155
#define MAVLINK_MSG_ID_209_CRC 155
......@@ -34,39 +36,43 @@ typedef struct __mavlink_sens_batmon_t {
#define MAVLINK_MESSAGE_INFO_SENS_BATMON { \
209, \
"SENS_BATMON", \
13, \
{ { "temperature", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_sens_batmon_t, temperature) }, \
{ "voltage", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_sens_batmon_t, voltage) }, \
{ "current", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_sens_batmon_t, current) }, \
{ "SoC", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_sens_batmon_t, SoC) }, \
{ "batterystatus", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_sens_batmon_t, batterystatus) }, \
{ "serialnumber", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_sens_batmon_t, serialnumber) }, \
{ "hostfetcontrol", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_sens_batmon_t, hostfetcontrol) }, \
{ "cellvoltage1", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_sens_batmon_t, cellvoltage1) }, \
{ "cellvoltage2", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_sens_batmon_t, cellvoltage2) }, \
{ "cellvoltage3", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_sens_batmon_t, cellvoltage3) }, \
{ "cellvoltage4", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_sens_batmon_t, cellvoltage4) }, \
{ "cellvoltage5", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_sens_batmon_t, cellvoltage5) }, \
{ "cellvoltage6", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_sens_batmon_t, cellvoltage6) }, \
15, \
{ { "batmon_timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_sens_batmon_t, batmon_timestamp) }, \
{ "temperature", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_sens_batmon_t, temperature) }, \
{ "voltage", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_sens_batmon_t, voltage) }, \
{ "current", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_sens_batmon_t, current) }, \
{ "SoC", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_sens_batmon_t, SoC) }, \
{ "batterystatus", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_sens_batmon_t, batterystatus) }, \
{ "serialnumber", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_sens_batmon_t, serialnumber) }, \
{ "safetystatus", NULL, MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_sens_batmon_t, safetystatus) }, \
{ "operationstatus", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_sens_batmon_t, operationstatus) }, \
{ "cellvoltage1", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_sens_batmon_t, cellvoltage1) }, \
{ "cellvoltage2", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_sens_batmon_t, cellvoltage2) }, \
{ "cellvoltage3", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_sens_batmon_t, cellvoltage3) }, \
{ "cellvoltage4", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_sens_batmon_t, cellvoltage4) }, \
{ "cellvoltage5", NULL, MAVLINK_TYPE_UINT16_T, 0, 36, offsetof(mavlink_sens_batmon_t, cellvoltage5) }, \
{ "cellvoltage6", NULL, MAVLINK_TYPE_UINT16_T, 0, 38, offsetof(mavlink_sens_batmon_t, cellvoltage6) }, \
} \
}
#else
#define MAVLINK_MESSAGE_INFO_SENS_BATMON { \
"SENS_BATMON", \
13, \
{ { "temperature", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_sens_batmon_t, temperature) }, \
{ "voltage", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_sens_batmon_t, voltage) }, \
{ "current", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_sens_batmon_t, current) }, \
{ "SoC", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_sens_batmon_t, SoC) }, \
{ "batterystatus", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_sens_batmon_t, batterystatus) }, \
{ "serialnumber", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_sens_batmon_t, serialnumber) }, \
{ "hostfetcontrol", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_sens_batmon_t, hostfetcontrol) }, \
{ "cellvoltage1", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_sens_batmon_t, cellvoltage1) }, \
{ "cellvoltage2", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_sens_batmon_t, cellvoltage2) }, \
{ "cellvoltage3", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_sens_batmon_t, cellvoltage3) }, \
{ "cellvoltage4", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_sens_batmon_t, cellvoltage4) }, \
{ "cellvoltage5", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_sens_batmon_t, cellvoltage5) }, \
{ "cellvoltage6", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_sens_batmon_t, cellvoltage6) }, \
15, \
{ { "batmon_timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_sens_batmon_t, batmon_timestamp) }, \
{ "temperature", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_sens_batmon_t, temperature) }, \
{ "voltage", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_sens_batmon_t, voltage) }, \
{ "current", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_sens_batmon_t, current) }, \
{ "SoC", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_sens_batmon_t, SoC) }, \
{ "batterystatus", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_sens_batmon_t, batterystatus) }, \
{ "serialnumber", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_sens_batmon_t, serialnumber) }, \
{ "safetystatus", NULL, MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_sens_batmon_t, safetystatus) }, \
{ "operationstatus", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_sens_batmon_t, operationstatus) }, \
{ "cellvoltage1", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_sens_batmon_t, cellvoltage1) }, \
{ "cellvoltage2", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_sens_batmon_t, cellvoltage2) }, \
{ "cellvoltage3", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_sens_batmon_t, cellvoltage3) }, \
{ "cellvoltage4", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_sens_batmon_t, cellvoltage4) }, \
{ "cellvoltage5", NULL, MAVLINK_TYPE_UINT16_T, 0, 36, offsetof(mavlink_sens_batmon_t, cellvoltage5) }, \
{ "cellvoltage6", NULL, MAVLINK_TYPE_UINT16_T, 0, 38, offsetof(mavlink_sens_batmon_t, cellvoltage6) }, \
} \
}
#endif
......@@ -77,13 +83,15 @@ typedef struct __mavlink_sens_batmon_t {
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
* @param batmon_timestamp Time since system start [us]
* @param temperature Battery pack temperature in [deg C]
* @param voltage Battery pack voltage in [mV]
* @param current Battery pack current in [mA]
* @param SoC Battery pack state-of-charge
* @param batterystatus Battery monitor status report bits in Hex
* @param serialnumber Battery monitor serial number in Hex
* @param hostfetcontrol Battery monitor sensor host FET control in Hex
* @param safetystatus Battery monitor safetystatus report bits in Hex
* @param operationstatus Battery monitor operation status report bits in Hex
* @param cellvoltage1 Battery pack cell 1 voltage in [mV]
* @param cellvoltage2 Battery pack cell 2 voltage in [mV]
* @param cellvoltage3 Battery pack cell 3 voltage in [mV]
......@@ -93,33 +101,37 @@ typedef struct __mavlink_sens_batmon_t {
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_sens_batmon_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
float temperature, uint16_t voltage, int16_t current, uint8_t SoC, 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)
uint64_t batmon_timestamp, float temperature, uint16_t voltage, int16_t current, uint8_t SoC, uint16_t batterystatus, uint16_t serialnumber, uint32_t safetystatus, uint32_t operationstatus, uint16_t cellvoltage1, uint16_t cellvoltage2, uint16_t cellvoltage3, uint16_t cellvoltage4, uint16_t cellvoltage5, uint16_t cellvoltage6)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_SENS_BATMON_LEN];
_mav_put_float(buf, 0, temperature);
_mav_put_uint16_t(buf, 4, voltage);
_mav_put_int16_t(buf, 6, current);
_mav_put_uint16_t(buf, 8, batterystatus);
_mav_put_uint16_t(buf, 10, serialnumber);
_mav_put_uint16_t(buf, 12, hostfetcontrol);
_mav_put_uint16_t(buf, 14, cellvoltage1);
_mav_put_uint16_t(buf, 16, cellvoltage2);
_mav_put_uint16_t(buf, 18, cellvoltage3);
_mav_put_uint16_t(buf, 20, cellvoltage4);
_mav_put_uint16_t(buf, 22, cellvoltage5);
_mav_put_uint16_t(buf, 24, cellvoltage6);
_mav_put_uint8_t(buf, 26, SoC);
_mav_put_uint64_t(buf, 0, batmon_timestamp);
_mav_put_float(buf, 8, temperature);
_mav_put_uint32_t(buf, 12, safetystatus);
_mav_put_uint32_t(buf, 16, operationstatus);
_mav_put_uint16_t(buf, 20, voltage);
_mav_put_int16_t(buf, 22, current);
_mav_put_uint16_t(buf, 24, batterystatus);
_mav_put_uint16_t(buf, 26, serialnumber);
_mav_put_uint16_t(buf, 28, cellvoltage1);
_mav_put_uint16_t(buf, 30, cellvoltage2);
_mav_put_uint16_t(buf, 32, cellvoltage3);
_mav_put_uint16_t(buf, 34, cellvoltage4);
_mav_put_uint16_t(buf, 36, cellvoltage5);
_mav_put_uint16_t(buf, 38, cellvoltage6);
_mav_put_uint8_t(buf, 40, SoC);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SENS_BATMON_LEN);
#else
mavlink_sens_batmon_t packet;
packet.batmon_timestamp = batmon_timestamp;
packet.temperature = temperature;
packet.safetystatus = safetystatus;
packet.operationstatus = operationstatus;
packet.voltage = voltage;
packet.current = current;
packet.batterystatus = batterystatus;
packet.serialnumber = serialnumber;
packet.hostfetcontrol = hostfetcontrol;
packet.cellvoltage1 = cellvoltage1;
packet.cellvoltage2 = cellvoltage2;
packet.cellvoltage3 = cellvoltage3;
......@@ -141,13 +153,15 @@ static inline uint16_t mavlink_msg_sens_batmon_pack(uint8_t system_id, uint8_t c
* @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 batmon_timestamp Time since system start [us]
* @param temperature Battery pack temperature in [deg C]
* @param voltage Battery pack voltage in [mV]
* @param current Battery pack current in [mA]
* @param SoC Battery pack state-of-charge
* @param batterystatus Battery monitor status report bits in Hex
* @param serialnumber Battery monitor serial number in Hex
* @param hostfetcontrol Battery monitor sensor host FET control in Hex
* @param safetystatus Battery monitor safetystatus report bits in Hex
* @param operationstatus Battery monitor operation status report bits in Hex
* @param cellvoltage1 Battery pack cell 1 voltage in [mV]
* @param cellvoltage2 Battery pack cell 2 voltage in [mV]
* @param cellvoltage3 Battery pack cell 3 voltage in [mV]
......@@ -158,33 +172,37 @@ static inline uint16_t mavlink_msg_sens_batmon_pack(uint8_t system_id, uint8_t c
*/
static inline uint16_t mavlink_msg_sens_batmon_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
float temperature,uint16_t voltage,int16_t current,uint8_t SoC,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)
uint64_t batmon_timestamp,float temperature,uint16_t voltage,int16_t current,uint8_t SoC,uint16_t batterystatus,uint16_t serialnumber,uint32_t safetystatus,uint32_t operationstatus,uint16_t cellvoltage1,uint16_t cellvoltage2,uint16_t cellvoltage3,uint16_t cellvoltage4,uint16_t cellvoltage5,uint16_t cellvoltage6)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_SENS_BATMON_LEN];
_mav_put_float(buf, 0, temperature);
_mav_put_uint16_t(buf, 4, voltage);
_mav_put_int16_t(buf, 6, current);
_mav_put_uint16_t(buf, 8, batterystatus);
_mav_put_uint16_t(buf, 10, serialnumber);
_mav_put_uint16_t(buf, 12, hostfetcontrol);
_mav_put_uint16_t(buf, 14, cellvoltage1);
_mav_put_uint16_t(buf, 16, cellvoltage2);
_mav_put_uint16_t(buf, 18, cellvoltage3);
_mav_put_uint16_t(buf, 20, cellvoltage4);
_mav_put_uint16_t(buf, 22, cellvoltage5);
_mav_put_uint16_t(buf, 24, cellvoltage6);
_mav_put_uint8_t(buf, 26, SoC);
_mav_put_uint64_t(buf, 0, batmon_timestamp);
_mav_put_float(buf, 8, temperature);
_mav_put_uint32_t(buf, 12, safetystatus);
_mav_put_uint32_t(buf, 16, operationstatus);
_mav_put_uint16_t(buf, 20, voltage);
_mav_put_int16_t(buf, 22, current);
_mav_put_uint16_t(buf, 24, batterystatus);
_mav_put_uint16_t(buf, 26, serialnumber);
_mav_put_uint16_t(buf, 28, cellvoltage1);
_mav_put_uint16_t(buf, 30, cellvoltage2);
_mav_put_uint16_t(buf, 32, cellvoltage3);
_mav_put_uint16_t(buf, 34, cellvoltage4);
_mav_put_uint16_t(buf, 36, cellvoltage5);
_mav_put_uint16_t(buf, 38, cellvoltage6);
_mav_put_uint8_t(buf, 40, SoC);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SENS_BATMON_LEN);
#else
mavlink_sens_batmon_t packet;
packet.batmon_timestamp = batmon_timestamp;
packet.temperature = temperature;
packet.safetystatus = safetystatus;
packet.operationstatus = operationstatus;
packet.voltage = voltage;
packet.current = current;
packet.batterystatus = batterystatus;
packet.serialnumber = serialnumber;
packet.hostfetcontrol = hostfetcontrol;
packet.cellvoltage1 = cellvoltage1;
packet.cellvoltage2 = cellvoltage2;
packet.cellvoltage3 = cellvoltage3;
......@@ -210,7 +228,7 @@ static inline uint16_t mavlink_msg_sens_batmon_pack_chan(uint8_t system_id, uint
*/
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)
{
return mavlink_msg_sens_batmon_pack(system_id, component_id, msg, sens_batmon->temperature, sens_batmon->voltage, sens_batmon->current, sens_batmon->SoC, 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);
return mavlink_msg_sens_batmon_pack(system_id, component_id, msg, sens_batmon->batmon_timestamp, sens_batmon->temperature, sens_batmon->voltage, sens_batmon->current, sens_batmon->SoC, sens_batmon->batterystatus, sens_batmon->serialnumber, sens_batmon->safetystatus, sens_batmon->operationstatus, sens_batmon->cellvoltage1, sens_batmon->cellvoltage2, sens_batmon->cellvoltage3, sens_batmon->cellvoltage4, sens_batmon->cellvoltage5, sens_batmon->cellvoltage6);
}
/**
......@@ -224,20 +242,22 @@ static inline uint16_t mavlink_msg_sens_batmon_encode(uint8_t system_id, uint8_t
*/
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)
{
return mavlink_msg_sens_batmon_pack_chan(system_id, component_id, chan, msg, sens_batmon->temperature, sens_batmon->voltage, sens_batmon->current, sens_batmon->SoC, 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);
return mavlink_msg_sens_batmon_pack_chan(system_id, component_id, chan, msg, sens_batmon->batmon_timestamp, sens_batmon->temperature, sens_batmon->voltage, sens_batmon->current, sens_batmon->SoC, sens_batmon->batterystatus, sens_batmon->serialnumber, sens_batmon->safetystatus, sens_batmon->operationstatus, sens_batmon->cellvoltage1, sens_batmon->cellvoltage2, sens_batmon->cellvoltage3, sens_batmon->cellvoltage4, sens_batmon->cellvoltage5, sens_batmon->cellvoltage6);
}
/**
* @brief Send a sens_batmon message
* @param chan MAVLink channel to send the message
*
* @param batmon_timestamp Time since system start [us]
* @param temperature Battery pack temperature in [deg C]
* @param voltage Battery pack voltage in [mV]
* @param current Battery pack current in [mA]
* @param SoC Battery pack state-of-charge
* @param batterystatus Battery monitor status report bits in Hex
* @param serialnumber Battery monitor serial number in Hex
* @param hostfetcontrol Battery monitor sensor host FET control in Hex
* @param safetystatus Battery monitor safetystatus report bits in Hex
* @param operationstatus Battery monitor operation status report bits in Hex
* @param cellvoltage1 Battery pack cell 1 voltage in [mV]
* @param cellvoltage2 Battery pack cell 2 voltage in [mV]
* @param cellvoltage3 Battery pack cell 3 voltage in [mV]
......@@ -247,33 +267,37 @@ static inline uint16_t mavlink_msg_sens_batmon_encode_chan(uint8_t system_id, ui
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_sens_batmon_send(mavlink_channel_t chan, float temperature, uint16_t voltage, int16_t current, uint8_t SoC, 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)
static inline void mavlink_msg_sens_batmon_send(mavlink_channel_t chan, uint64_t batmon_timestamp, float temperature, uint16_t voltage, int16_t current, uint8_t SoC, uint16_t batterystatus, uint16_t serialnumber, uint32_t safetystatus, uint32_t operationstatus, uint16_t cellvoltage1, uint16_t cellvoltage2, uint16_t cellvoltage3, uint16_t cellvoltage4, uint16_t cellvoltage5, uint16_t cellvoltage6)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_SENS_BATMON_LEN];
_mav_put_float(buf, 0, temperature);
_mav_put_uint16_t(buf, 4, voltage);
_mav_put_int16_t(buf, 6, current);
_mav_put_uint16_t(buf, 8, batterystatus);
_mav_put_uint16_t(buf, 10, serialnumber);
_mav_put_uint16_t(buf, 12, hostfetcontrol);
_mav_put_uint16_t(buf, 14, cellvoltage1);
_mav_put_uint16_t(buf, 16, cellvoltage2);
_mav_put_uint16_t(buf, 18, cellvoltage3);
_mav_put_uint16_t(buf, 20, cellvoltage4);
_mav_put_uint16_t(buf, 22, cellvoltage5);
_mav_put_uint16_t(buf, 24, cellvoltage6);
_mav_put_uint8_t(buf, 26, SoC);
_mav_put_uint64_t(buf, 0, batmon_timestamp);
_mav_put_float(buf, 8, temperature);
_mav_put_uint32_t(buf, 12, safetystatus);
_mav_put_uint32_t(buf, 16, operationstatus);
_mav_put_uint16_t(buf, 20, voltage);
_mav_put_int16_t(buf, 22, current);
_mav_put_uint16_t(buf, 24, batterystatus);
_mav_put_uint16_t(buf, 26, serialnumber);
_mav_put_uint16_t(buf, 28, cellvoltage1);
_mav_put_uint16_t(buf, 30, cellvoltage2);
_mav_put_uint16_t(buf, 32, cellvoltage3);
_mav_put_uint16_t(buf, 34, cellvoltage4);
_mav_put_uint16_t(buf, 36, cellvoltage5);
_mav_put_uint16_t(buf, 38, cellvoltage6);
_mav_put_uint8_t(buf, 40, SoC);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENS_BATMON, buf, MAVLINK_MSG_ID_SENS_BATMON_MIN_LEN, MAVLINK_MSG_ID_SENS_BATMON_LEN, MAVLINK_MSG_ID_SENS_BATMON_CRC);
#else
mavlink_sens_batmon_t packet;
packet.batmon_timestamp = batmon_timestamp;
packet.temperature = temperature;
packet.safetystatus = safetystatus;
packet.operationstatus = operationstatus;
packet.voltage = voltage;
packet.current = current;
packet.batterystatus = batterystatus;
packet.serialnumber = serialnumber;
packet.hostfetcontrol = hostfetcontrol;
packet.cellvoltage1 = cellvoltage1;
packet.cellvoltage2 = cellvoltage2;
packet.cellvoltage3 = cellvoltage3;
......@@ -294,7 +318,7 @@ static inline void mavlink_msg_sens_batmon_send(mavlink_channel_t chan, float te
static inline void mavlink_msg_sens_batmon_send_struct(mavlink_channel_t chan, const mavlink_sens_batmon_t* sens_batmon)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
mavlink_msg_sens_batmon_send(chan, sens_batmon->temperature, sens_batmon->voltage, sens_batmon->current, sens_batmon->SoC, 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);
mavlink_msg_sens_batmon_send(chan, sens_batmon->batmon_timestamp, sens_batmon->temperature, sens_batmon->voltage, sens_batmon->current, sens_batmon->SoC, sens_batmon->batterystatus, sens_batmon->serialnumber, sens_batmon->safetystatus, sens_batmon->operationstatus, sens_batmon->cellvoltage1, sens_batmon->cellvoltage2, sens_batmon->cellvoltage3, sens_batmon->cellvoltage4, sens_batmon->cellvoltage5, sens_batmon->cellvoltage6);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENS_BATMON, (const char *)sens_batmon, MAVLINK_MSG_ID_SENS_BATMON_MIN_LEN, MAVLINK_MSG_ID_SENS_BATMON_LEN, MAVLINK_MSG_ID_SENS_BATMON_CRC);
#endif
......@@ -308,33 +332,37 @@ static inline void mavlink_msg_sens_batmon_send_struct(mavlink_channel_t chan, c
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_sens_batmon_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, float temperature, uint16_t voltage, int16_t current, uint8_t SoC, 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)
static inline void mavlink_msg_sens_batmon_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t batmon_timestamp, float temperature, uint16_t voltage, int16_t current, uint8_t SoC, uint16_t batterystatus, uint16_t serialnumber, uint32_t safetystatus, uint32_t operationstatus, uint16_t cellvoltage1, uint16_t cellvoltage2, uint16_t cellvoltage3, uint16_t cellvoltage4, uint16_t cellvoltage5, uint16_t cellvoltage6)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_float(buf, 0, temperature);
_mav_put_uint16_t(buf, 4, voltage);
_mav_put_int16_t(buf, 6, current);
_mav_put_uint16_t(buf, 8, batterystatus);
_mav_put_uint16_t(buf, 10, serialnumber);
_mav_put_uint16_t(buf, 12, hostfetcontrol);
_mav_put_uint16_t(buf, 14, cellvoltage1);
_mav_put_uint16_t(buf, 16, cellvoltage2);
_mav_put_uint16_t(buf, 18, cellvoltage3);
_mav_put_uint16_t(buf, 20, cellvoltage4);
_mav_put_uint16_t(buf, 22, cellvoltage5);
_mav_put_uint16_t(buf, 24, cellvoltage6);
_mav_put_uint8_t(buf, 26, SoC);
_mav_put_uint64_t(buf, 0, batmon_timestamp);
_mav_put_float(buf, 8, temperature);
_mav_put_uint32_t(buf, 12, safetystatus);
_mav_put_uint32_t(buf, 16, operationstatus);
_mav_put_uint16_t(buf, 20, voltage);
_mav_put_int16_t(buf, 22, current);
_mav_put_uint16_t(buf, 24, batterystatus);
_mav_put_uint16_t(buf, 26, serialnumber);
_mav_put_uint16_t(buf, 28, cellvoltage1);
_mav_put_uint16_t(buf, 30, cellvoltage2);
_mav_put_uint16_t(buf, 32, cellvoltage3);
_mav_put_uint16_t(buf, 34, cellvoltage4);
_mav_put_uint16_t(buf, 36, cellvoltage5);
_mav_put_uint16_t(buf, 38, cellvoltage6);
_mav_put_uint8_t(buf, 40, SoC);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SENS_BATMON, buf, MAVLINK_MSG_ID_SENS_BATMON_MIN_LEN, MAVLINK_MSG_ID_SENS_BATMON_LEN, MAVLINK_MSG_ID_SENS_BATMON_CRC);
#else
mavlink_sens_batmon_t *packet = (mavlink_sens_batmon_t *)msgbuf;
packet->batmon_timestamp = batmon_timestamp;
packet->temperature = temperature;
packet->safetystatus = safetystatus;
packet->operationstatus = operationstatus;
packet->voltage = voltage;
packet->current = current;
packet->batterystatus = batterystatus;
packet->serialnumber = serialnumber;
packet->hostfetcontrol = hostfetcontrol;
packet->cellvoltage1 = cellvoltage1;
packet->cellvoltage2 = cellvoltage2;
packet->cellvoltage3 = cellvoltage3;
......@@ -353,6 +381,16 @@ static inline void mavlink_msg_sens_batmon_send_buf(mavlink_message_t *msgbuf, m
// MESSAGE SENS_BATMON UNPACKING
/**
* @brief Get field batmon_timestamp from sens_batmon message
*
* @return Time since system start [us]
*/
static inline uint64_t mavlink_msg_sens_batmon_get_batmon_timestamp(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint64_t(msg, 0);
}
/**
* @brief Get field temperature from sens_batmon message
*
......@@ -360,7 +398,7 @@ static inline void mavlink_msg_sens_batmon_send_buf(mavlink_message_t *msgbuf, m
*/
static inline float mavlink_msg_sens_batmon_get_temperature(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
return _MAV_RETURN_float(msg, 8);
}
/**
......@@ -370,7 +408,7 @@ static inline float mavlink_msg_sens_batmon_get_temperature(const mavlink_messag
*/
static inline uint16_t mavlink_msg_sens_batmon_get_voltage(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 4);
return _MAV_RETURN_uint16_t(msg, 20);
}
/**
......@@ -380,7 +418,7 @@ static inline uint16_t mavlink_msg_sens_batmon_get_voltage(const mavlink_message
*/
static inline int16_t mavlink_msg_sens_batmon_get_current(const mavlink_message_t* msg)
{
return _MAV_RETURN_int16_t(msg, 6);
return _MAV_RETURN_int16_t(msg, 22);
}
/**
......@@ -390,7 +428,7 @@ static inline int16_t mavlink_msg_sens_batmon_get_current(const mavlink_message_
*/
static inline uint8_t mavlink_msg_sens_batmon_get_SoC(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 26);
return _MAV_RETURN_uint8_t(msg, 40);
}
/**
......@@ -400,7 +438,7 @@ static inline uint8_t mavlink_msg_sens_batmon_get_SoC(const mavlink_message_t* m
*/
static inline uint16_t mavlink_msg_sens_batmon_get_batterystatus(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 8);
return _MAV_RETURN_uint16_t(msg, 24);
}
/**
......@@ -410,17 +448,27 @@ static inline uint16_t mavlink_msg_sens_batmon_get_batterystatus(const mavlink_m
*/
static inline uint16_t mavlink_msg_sens_batmon_get_serialnumber(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 10);
return _MAV_RETURN_uint16_t(msg, 26);
}
/**
* @brief Get field hostfetcontrol from sens_batmon message
* @brief Get field safetystatus from sens_batmon message
*
* @return Battery monitor sensor host FET control in Hex
* @return Battery monitor safetystatus report bits in Hex
*/
static inline uint16_t mavlink_msg_sens_batmon_get_hostfetcontrol(const mavlink_message_t* msg)
static inline uint32_t mavlink_msg_sens_batmon_get_safetystatus(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 12);
return _MAV_RETURN_uint32_t(msg, 12);
}
/**
* @brief Get field operationstatus from sens_batmon message
*
* @return Battery monitor operation status report bits in Hex
*/
static inline uint32_t mavlink_msg_sens_batmon_get_operationstatus(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 16);
}
/**
......@@ -430,7 +478,7 @@ static inline uint16_t mavlink_msg_sens_batmon_get_hostfetcontrol(const mavlink_
*/
static inline uint16_t mavlink_msg_sens_batmon_get_cellvoltage1(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 14);
return _MAV_RETURN_uint16_t(msg, 28);
}
/**
......@@ -440,7 +488,7 @@ static inline uint16_t mavlink_msg_sens_batmon_get_cellvoltage1(const mavlink_me
*/
static inline uint16_t mavlink_msg_sens_batmon_get_cellvoltage2(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 16);
return _MAV_RETURN_uint16_t(msg, 30);
}
/**
......@@ -450,7 +498,7 @@ static inline uint16_t mavlink_msg_sens_batmon_get_cellvoltage2(const mavlink_me
*/
static inline uint16_t mavlink_msg_sens_batmon_get_cellvoltage3(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 18);
return _MAV_RETURN_uint16_t(msg, 32);
}
/**
......@@ -460,7 +508,7 @@ static inline uint16_t mavlink_msg_sens_batmon_get_cellvoltage3(const mavlink_me
*/
static inline uint16_t mavlink_msg_sens_batmon_get_cellvoltage4(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 20);
return _MAV_RETURN_uint16_t(msg, 34);
}
/**
......@@ -470,7 +518,7 @@ static inline uint16_t mavlink_msg_sens_batmon_get_cellvoltage4(const mavlink_me
*/
static inline uint16_t mavlink_msg_sens_batmon_get_cellvoltage5(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 22);
return _MAV_RETURN_uint16_t(msg, 36);
}
/**
......@@ -480,7 +528,7 @@ static inline uint16_t mavlink_msg_sens_batmon_get_cellvoltage5(const mavlink_me
*/
static inline uint16_t mavlink_msg_sens_batmon_get_cellvoltage6(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 24);
return _MAV_RETURN_uint16_t(msg, 38);
}
/**
......@@ -492,12 +540,14 @@ static inline uint16_t mavlink_msg_sens_batmon_get_cellvoltage6(const mavlink_me
static inline void mavlink_msg_sens_batmon_decode(const mavlink_message_t* msg, mavlink_sens_batmon_t* sens_batmon)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
sens_batmon->batmon_timestamp = mavlink_msg_sens_batmon_get_batmon_timestamp(msg);
sens_batmon->temperature = mavlink_msg_sens_batmon_get_temperature(msg);
sens_batmon->safetystatus = mavlink_msg_sens_batmon_get_safetystatus(msg);
sens_batmon->operationstatus = mavlink_msg_sens_batmon_get_operationstatus(msg);
sens_batmon->voltage = mavlink_msg_sens_batmon_get_voltage(msg);
sens_batmon->current = mavlink_msg_sens_batmon_get_current(msg);
sens_batmon->batterystatus = mavlink_msg_sens_batmon_get_batterystatus(msg);
sens_batmon->serialnumber = mavlink_msg_sens_batmon_get_serialnumber(msg);
sens_batmon->hostfetcontrol = mavlink_msg_sens_batmon_get_hostfetcontrol(msg);
sens_batmon->cellvoltage1 = mavlink_msg_sens_batmon_get_cellvoltage1(msg);
sens_batmon->cellvoltage2 = mavlink_msg_sens_batmon_get_cellvoltage2(msg);
sens_batmon->cellvoltage3 = mavlink_msg_sens_batmon_get_cellvoltage3(msg);
......
......@@ -535,16 +535,18 @@ static void mavlink_test_sens_batmon(uint8_t system_id, uint8_t component_id, ma
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
uint16_t i;
mavlink_sens_batmon_t packet_in = {
17.0,17443,17547,17651,17755,17859,17963,18067,18171,18275,18379,18483,211
93372036854775807ULL,73.0,963498088,963498296,18275,18379,18483,18587,18691,18795,18899,19003,19107,19211,125
};
mavlink_sens_batmon_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.batmon_timestamp = packet_in.batmon_timestamp;
packet1.temperature = packet_in.temperature;
packet1.safetystatus = packet_in.safetystatus;
packet1.operationstatus = packet_in.operationstatus;
packet1.voltage = packet_in.voltage;
packet1.current = packet_in.current;
packet1.batterystatus = packet_in.batterystatus;
packet1.serialnumber = packet_in.serialnumber;
packet1.hostfetcontrol = packet_in.hostfetcontrol;
packet1.cellvoltage1 = packet_in.cellvoltage1;
packet1.cellvoltage2 = packet_in.cellvoltage2;
packet1.cellvoltage3 = packet_in.cellvoltage3;
......@@ -566,12 +568,12 @@ static void mavlink_test_sens_batmon(uint8_t system_id, uint8_t component_id, ma
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_sens_batmon_pack(system_id, component_id, &msg , packet1.temperature , packet1.voltage , packet1.current , packet1.SoC , packet1.batterystatus , packet1.serialnumber , packet1.hostfetcontrol , packet1.cellvoltage1 , packet1.cellvoltage2 , packet1.cellvoltage3 , packet1.cellvoltage4 , packet1.cellvoltage5 , packet1.cellvoltage6 );
mavlink_msg_sens_batmon_pack(system_id, component_id, &msg , packet1.batmon_timestamp , packet1.temperature , packet1.voltage , packet1.current , packet1.SoC , packet1.batterystatus , packet1.serialnumber , packet1.safetystatus , packet1.operationstatus , packet1.cellvoltage1 , packet1.cellvoltage2 , packet1.cellvoltage3 , packet1.cellvoltage4 , packet1.cellvoltage5 , packet1.cellvoltage6 );
mavlink_msg_sens_batmon_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_sens_batmon_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.temperature , packet1.voltage , packet1.current , packet1.SoC , packet1.batterystatus , packet1.serialnumber , packet1.hostfetcontrol , packet1.cellvoltage1 , packet1.cellvoltage2 , packet1.cellvoltage3 , packet1.cellvoltage4 , packet1.cellvoltage5 , packet1.cellvoltage6 );
mavlink_msg_sens_batmon_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.batmon_timestamp , packet1.temperature , packet1.voltage , packet1.current , packet1.SoC , packet1.batterystatus , packet1.serialnumber , packet1.safetystatus , packet1.operationstatus , packet1.cellvoltage1 , packet1.cellvoltage2 , packet1.cellvoltage3 , packet1.cellvoltage4 , packet1.cellvoltage5 , packet1.cellvoltage6 );
mavlink_msg_sens_batmon_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
......@@ -584,7 +586,7 @@ static void mavlink_test_sens_batmon(uint8_t system_id, uint8_t component_id, ma
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_sens_batmon_send(MAVLINK_COMM_1 , packet1.temperature , packet1.voltage , packet1.current , packet1.SoC , packet1.batterystatus , packet1.serialnumber , packet1.hostfetcontrol , packet1.cellvoltage1 , packet1.cellvoltage2 , packet1.cellvoltage3 , packet1.cellvoltage4 , packet1.cellvoltage5 , packet1.cellvoltage6 );
mavlink_msg_sens_batmon_send(MAVLINK_COMM_1 , packet1.batmon_timestamp , packet1.temperature , packet1.voltage , packet1.current , packet1.SoC , packet1.batterystatus , packet1.serialnumber , packet1.safetystatus , packet1.operationstatus , packet1.cellvoltage1 , packet1.cellvoltage2 , packet1.cellvoltage3 , packet1.cellvoltage4 , packet1.cellvoltage5 , packet1.cellvoltage6 );
mavlink_msg_sens_batmon_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
......
......@@ -130,13 +130,15 @@
</message>
<message id="209" name="SENS_BATMON">
<description>Battery pack monitoring data for Li-Ion batteries</description>
<field type="uint64_t" name="batmon_timestamp">Time since system start [us]</field>
<field type="float" name="temperature">Battery pack temperature in [deg C]</field>
<field type="uint16_t" name="voltage">Battery pack voltage in [mV]</field>
<field type="int16_t" name="current">Battery pack current in [mA]</field>
<field type="uint8_t" name="SoC">Battery pack state-of-charge</field>
<field type="uint16_t" name="batterystatus">Battery monitor status report bits in Hex</field>
<field type="uint16_t" name="serialnumber">Battery monitor serial number in Hex</field>
<field type="uint16_t" name="hostfetcontrol">Battery monitor sensor host FET control in Hex</field>
<field type="uint32_t" name="safetystatus">Battery monitor safetystatus report bits in Hex</field>
<field type="uint32_t" name="operationstatus">Battery monitor operation status report bits in Hex</field>
<field type="uint16_t" name="cellvoltage1">Battery pack cell 1 voltage in [mV]</field>
<field type="uint16_t" name="cellvoltage2">Battery pack cell 2 voltage in [mV]</field>
<field type="uint16_t" name="cellvoltage3">Battery pack cell 3 voltage in [mV]</field>
......
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