55 Commits

Author SHA1 Message Date
Matthew GONG a4ec3896a7 gencode based on f2b0120 2022-01-13 14:08:40 +08:00
Matthew GONG 389bd1a2dd update based on b7851dc 2022-01-12 15:41:54 +08:00
Matthew GONG f120b6e915 gencode based on 7c4769fd 2022-01-12 10:26:43 +08:00
Matthew GONG c76dd4e64d update gencode based on fd47416 2022-01-11 21:22:46 +08:00
Matthew GONG 00928750e0 update gencode 2022-01-11 15:32:24 +08:00
Matthew GONG a28d57ffba Merge branch 'et39' of sh.matthewgong.com:matt/kb3_sil into et39 2021-10-20 14:55:19 +08:00
Matthew GONG b02d4d05f4 可以选择port/id 2021-10-20 14:33:35 +08:00
LyuWeiye 0e14ba6a37 update gencode 2021-10-08 17:04:29 +08:00
LyuWeiye 0b345185f2 update gencode 2021-09-23 17:27:15 +08:00
LyuWeiye e61829e042 update gencode 2021-09-23 15:21:00 +08:00
Matthew GONG 4133b5a39d update gencode 2021-08-13 14:51:03 +08:00
Matthew GONG 08a25154a5 update based on 8aec580 2021-08-08 16:18:48 +08:00
Matthew GONG 6fcc618980 update based on fd35498 2021-08-05 08:04:24 +08:00
Matthew GONG feccaeca10 backup 2021-08-03 18:18:23 +08:00
Matthew GONG c8c8a7f8a5 update gencode based on 0c09ddc 2021-08-01 14:11:40 +08:00
Matthew GONG 7b40684838 update based on b195c9e 2021-07-31 16:45:44 +08:00
Matthew GONG 0c19f30426 update gencode based on dcd250f 2021-07-13 16:15:31 +08:00
LyuWeiye 4fcbb9d3ba update gencode 2021-05-21 20:44:04 +08:00
LyuWeiye d64fdf41fc update gencode 2021-05-19 21:40:33 +08:00
LyuWeiye a77a4e914f 更新代码生成 和CMakeLIst 2021-05-10 16:03:43 +08:00
Prince_an 9500850836 ET1202020_SIL 2020-12-30 22:00:38 +08:00
matt d5fe70ac0e add missing 2020-12-27 15:20:56 +08:00
matt 96219ec912 config acmi 2020-12-27 15:17:55 +08:00
matt 638fa3576b add checkbox 2020-12-27 11:31:38 +08:00
matt fdb65a5034 update gencode, support acmi 2020-12-27 11:24:31 +08:00
matt 3851e7aa83 update gencode, and works. 2020-12-21 02:42:01 +08:00
matt 4d25cac168 cr929 first release 2020-12-20 15:19:07 +08:00
matt da75c54af9 update gencode 2020-12-15 15:13:58 +08:00
matt fa477f6eab update gencode, init on ground or in air 2020-12-14 21:30:15 +08:00
matt 7e86e11134 fix thr2ecu bug, fix flat corner bug 2020-12-13 18:30:40 +08:00
matt 2e0709d9ac update gencode 2020-12-13 11:12:48 +08:00
matt f4f4ed6153 update gencode, param wind 2020-12-11 18:19:23 +08:00
matt 77d2ba3efd update gencode 2020-12-11 16:58:14 +08:00
matt 459ab7c377 update gencode, landing/recovery 2020-12-10 05:34:24 +08:00
matt 466d6980b8 update gencode, wind setting pass 2020-12-08 17:29:54 +08:00
matt 326b41c594 update gencode, add deadband for da/de/dr 2020-12-08 11:56:39 +08:00
matt 522f56d4bc update gencode, fix engine dynamics 2020-12-08 10:57:31 +08:00
matt b064e82d9d update gencode 2020-12-02 09:59:07 +08:00
matt 8463e0518d update gencode 2020-12-02 07:45:17 +08:00
matt a460afe203 update gencode, update ui 2020-12-02 07:41:26 +08:00
matt 3c108acd3e release sil 2020-11-20 11:47:24 +08:00
matt e4ccca1e11 update gencode, show mass 2020-11-19 15:43:17 +08:00
matt e868b2d348 update gencode 2020-11-18 16:43:00 +08:00
matt 8f20e144c5 update/import/export parameters
Signed-off-by: matt <matt@matthewgong.com>
2020-11-18 07:17:18 +08:00
matt 2733c2c817 update gencode
Signed-off-by: matt <matt@matthewgong.com>
2020-11-18 07:16:56 +08:00
matt c4aa86795e set lon/lat/alt/hdg 2020-11-13 07:06:02 +08:00
matt 1d30e71492 load capi 2020-11-13 06:27:12 +08:00
matt bd73991059 update gencode 2020-10-26 17:04:48 +08:00
matt 000d694761 update gencode 2020-10-22 10:50:04 +08:00
matt e5bb1092b5 feat: bmu/ccm added 2020-10-07 02:01:42 +08:00
matt 93991f462b for kb3 2020-10-05 10:41:44 +08:00
matt a222fd5d29 feat: debug build 2020-10-01 06:04:48 +08:00
Matthew cb84cc7a43 release dll 2020-09-30 12:56:54 +08:00
Matthew 5c622c242f 🐎ci: add missing release 2020-09-30 12:54:53 +08:00
Matthew 57707aac9e 🐞fix: fix changelog.md 2020-09-30 12:05:12 +08:00
479 changed files with 66138 additions and 35409 deletions
+4
View File
@@ -73,3 +73,7 @@ Thumbs.db
build/ build/
html/ html/
dist/
CMakeLists.txt.*
*.7z
*dist/
+12
View File
@@ -11,3 +11,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Added ### Added
- add vscode and CI/CD support - add vscode and CI/CD support
## [0.1.1] - 2020-09-30
### Modified
- fix spelling misstake
## [0.1.2] - 2020-09-30
### Added
- release dll
## [0.1.3] - 2020-10-05
### Added
- release for kb3
+23 -14
View File
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.5) cmake_minimum_required(VERSION 3.5)
project(proj41_sil LANGUAGES CXX) project(ET39_sil LANGUAGES C CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_INCLUDE_CURRENT_DIR ON)
@@ -26,38 +26,47 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt5 COMPONENTS Widgets Network REQUIRED) find_package(Qt5 COMPONENTS Widgets Network REQUIRED)
include_directories( SIL/work/SIL_ert_shrlib_rtw include_directories( ET39_SIL/work/ET39_SIL_ert_shrlib_rtw
SIL/work/slprj ET39_SIL/work/slprj
SIL/work/slprj/ert_shrlib/_sharedutils ET39_SIL/work/slprj/ert_shrlib/_sharedutils
SIL/R2018b/rtw/c/src ET39_SIL/R2018b/rtw/c/src
SIL/R2018b/simulink/include ET39_SIL/R2018b/simulink/include
SIL/otherFiles ET39_SIL/otherFiles
) )
file(GLOB_RECURSE ET39_SIL_SRC ET39_SIL/*.c)
message(STATUS "Files are ${ET39_SIL_SRC}")
add_definitions(-DWITH_CAPI)
add_definitions(-DCAPI_MDL=ET39_SIL)
add_definitions(-DHDR_MDL=ET39_SIL.h)
add_definitions(-DMAVLINK_USE_MESSAGE_INFO)
if(ANDROID) if(ANDROID)
add_library(proj41_sil SHARED add_library(ET39_sil SHARED
main.cpp main.cpp
mainwindow.cpp mainwindow.cpp
mainwindow.h mainwindow.h
mainwindow.ui mainwindow.ui
${TS_FILES} ${ET39_SIL_SRC}
) )
else() else()
add_executable(proj41_sil add_executable(ET39_sil WIN32
main.cpp
mainwindow.cpp mainwindow.cpp
mainwindow.h mainwindow.h
mainwindow.ui mainwindow.ui
${TS_FILES} main.cpp
${ET39_SIL_SRC}
) )
endif() endif()
target_link_libraries(proj41_sil PRIVATE Qt5::Widgets Qt5::Network) target_link_libraries(ET39_sil PRIVATE Qt5::Widgets Qt5::Network)
include(GNUInstallDirs) include(GNUInstallDirs)
message("CMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR}") message("CMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR}")
install(TARGETS proj41_sil RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") install(TARGETS ET39_sil RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
install(FILES ET39_SIL/work/ET39_SIL_win64.dll DESTINATION "${CMAKE_INSTALL_BINDIR}")
set(CPACK_GENERATOR ZIP) set(CPACK_GENERATOR ZIP)
set(CPACK_PACKAGE_VERSION_MAJOR 0) set(CPACK_PACKAGE_VERSION_MAJOR 0)
@@ -0,0 +1,58 @@
/*
* Include Files
*
*/
#if defined(MATLAB_MEX_FILE)
#include "tmwtypes.h"
#include "simstruc_types.h"
#else
#include "rtwtypes.h"
#endif
/* %%%-SFUNWIZ_wrapper_includes_Changes_BEGIN --- EDIT HERE TO _END */
/* %%%-SFUNWIZ_wrapper_includes_Changes_END --- EDIT HERE TO _BEGIN */
#define y_width 1
/*
* Create external references here.
*
*/
/* %%%-SFUNWIZ_wrapper_externs_Changes_BEGIN --- EDIT HERE TO _END */
/* %%%-SFUNWIZ_wrapper_externs_Changes_END --- EDIT HERE TO _BEGIN */
/*
* Output function
*
*/
void CRC_CheckSum_Outputs_wrapper(const uint8_T *pBuffer,
const uint16_T *len,
uint16_T *crc,
const int_T u_width)
{
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_BEGIN --- EDIT HERE TO _END */
uint16_T poly = 0x8408;
uint8_T carry;
uint8_T i_bits;
uint16_T j;
crc[0] = 0;
for (j = 0; j < len[0]; j++) {
crc[0] = (uint16_T) (crc[0] ^ (uint8_T) pBuffer[j]);
for (i_bits = 0; i_bits < 8; i_bits++) {
carry = (uint8_T) (crc[0] & 1);
crc[0] = (uint16_T) (crc[0] / 2);
if (carry) {
crc[0] = (uint16_T) (crc[0] ^ poly);
}
}
}
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_END --- EDIT HERE TO _BEGIN */
}
+105
View File
@@ -0,0 +1,105 @@
#ifndef __APP_CONFIG_H__
#ifndef AP_DT_MS
#define AP_DT_MS (5.0)
#endif
#ifndef PARAM_PROPS_MAXLEN
#define PARAM_PROPS_MAXLEN (512)
#endif
#ifndef PWM_CHANEL_NUM
#define PWM_CHANEL_NUM (12)
#endif
#ifndef RPM_CHANNEL_NUM
#define RPM_CHANNEL_NUM (0)
#endif
#ifndef SBUS_ENABLE
#define SBUS_ENABLE (0)
#endif
#ifndef CAN1_ENABLE
#define CAN1_ENABLE (0)
#endif
#ifndef CAN3_ENABLE
#define CAN3_ENABLE (0)
#endif
#ifndef UART1_RX_ENABLE
#define UART1_RX_ENABLE (512)
#endif
#ifndef UART2_RX_ENABLE
#define UART2_RX_ENABLE (0)
#endif
#ifndef UART4_RX_ENABLE
#define UART4_RX_ENABLE (0)
#endif
#ifndef UART6_RX_ENABLE
#define UART6_RX_ENABLE (0)
#endif
#ifndef UART7_RX_ENABLE
#define UART7_RX_ENABLE (512)
#endif
#ifndef UART8_RX_ENABLE
#define UART8_RX_ENABLE (0)
#endif
#ifndef UART1_TX_ENABLE
#define UART1_TX_ENABLE (256)
#endif
#ifndef UART2_TX_ENABLE
#define UART2_TX_ENABLE (0)
#endif
#ifndef UART4_TX_ENABLE
#define UART4_TX_ENABLE (0)
#endif
#ifndef UART6_TX_ENABLE
#define UART6_TX_ENABLE (0)
#endif
#ifndef UART7_TX_ENABLE
#define UART7_TX_ENABLE (256)
#endif
#ifndef UART8_TX_ENABLE
#define UART8_TX_ENABLE (0)
#endif
#define UART1_BAUDRATE (460800)
#define UART1_WORDLENGTH (UART_WORDLENGTH_8B)
#define UART1_STOPBITS (UART_STOPBITS_1)
#define UART1_PARITY (UART_PARITY_NONE)
#define UART1_MODE (UART_MODE_TX_RX)
#define UART2_BAUDRATE (460800)
#define UART2_WORDLENGTH (UART_WORDLENGTH_8B)
#define UART2_STOPBITS (UART_STOPBITS_1)
#define UART2_PARITY (UART_PARITY_NONE)
#define UART2_MODE (UART_MODE_TX_RX)
#define UART4_BAUDRATE (100000)
#define UART4_WORDLENGTH (UART_WORDLENGTH_9B)
#define UART4_STOPBITS (UART_STOPBITS_2)
#define UART4_PARITY (UART_PARITY_EVEN)
#define UART4_MODE (UART_MODE_RX)
#define UART6_BAUDRATE (115200)
#define UART6_WORDLENGTH (UART_WORDLENGTH_8B)
#define UART6_STOPBITS (UART_STOPBITS_1)
#define UART6_PARITY (UART_PARITY_NONE)
#define UART6_MODE (UART_MODE_TX_RX)
#define UART7_BAUDRATE (115200)
#define UART7_WORDLENGTH (UART_WORDLENGTH_8B)
#define UART7_STOPBITS (UART_STOPBITS_1)
#define UART7_PARITY (UART_PARITY_NONE)
#define UART7_MODE (UART_MODE_TX_RX)
#define UART8_BAUDRATE (115200)
#define UART8_WORDLENGTH (UART_WORDLENGTH_8B)
#define UART8_STOPBITS (UART_STOPBITS_1)
#define UART8_PARITY (UART_PARITY_NONE)
#define UART8_MODE (UART_MODE_TX_RX)
#endif /* __APP_CONFIG_H__ */
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -53,8 +53,9 @@ void find_param_idx_Outputs_wrapper(const uint8_T *name,
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_BEGIN --- EDIT HERE TO _END */ /* %%%-SFUNWIZ_wrapper_Outputs_Changes_BEGIN --- EDIT HERE TO _END */
#ifdef WITH_CAPI #ifdef WITH_CAPI
idx[0] = param_get_idx_by_name(name); idx[0] = param_get_idx_by_name(name);
#endif #else
idx[0] = -1; idx[0] = -1;
#endif
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_END --- EDIT HERE TO _BEGIN */ /* %%%-SFUNWIZ_wrapper_Outputs_Changes_END --- EDIT HERE TO _BEGIN */
} }
@@ -101,13 +101,6 @@ void scan_params(void)
prop.typ = PARAM_TYPE_REAL64; prop.typ = PARAM_TYPE_REAL64;
} }
break; break;
case SS_SINGLE:
{
float *s = &((float *)da[idx])[j];
prop.val_ptr.s = s;
prop.typ = PARAM_TYPE_REAL32;
}
break;
case SS_INT8: case SS_INT8:
case SS_BOOLEAN: case SS_BOOLEAN:
{ {
@@ -145,6 +138,12 @@ void scan_params(void)
prop.typ = PARAM_TYPE_UINT32; prop.typ = PARAM_TYPE_UINT32;
} }
break; break;
default:
{
prop.val_ptr.s = &((float *)da[idx])[j];
prop.typ = PARAM_TYPE_REAL32;
}
break;
} }
strncpy(prop.name, name, 16); strncpy(prop.name, name, 16);
if (j > 0) if (j > 0)
@@ -207,7 +206,7 @@ void find_param_val_Outputs_wrapper(const uint16_T *idx,
param_prop * p = param_get_by_idx(idx[0]); param_prop * p = param_get_by_idx(idx[0]);
if (p) if (p)
{ {
memcpy(name, p->name, 16); strncpy(name, p->name, 16);
type[0] = p->typ; type[0] = p->typ;
param_get_value(p, value); param_get_value(p, value);
} }
@@ -6,6 +6,8 @@ extern "C"
{ {
#endif #endif
#pragma anon_unions
#include <stdint.h> #include <stdint.h>
/** /**
+80
View File
@@ -0,0 +1,80 @@
/*
* Include Files
*
*/
#if defined(MATLAB_MEX_FILE)
#include "tmwtypes.h"
#include "simstruc_types.h"
#else
#include "rtwtypes.h"
#endif
/* %%%-SFUNWIZ_wrapper_includes_Changes_BEGIN --- EDIT HERE TO _END */
#ifdef HAL_IMPL
#include "param_pre.h"
#endif
/* %%%-SFUNWIZ_wrapper_includes_Changes_END --- EDIT HERE TO _BEGIN */
#define u_width 1
/*
* Create external references here.
*
*/
/* %%%-SFUNWIZ_wrapper_externs_Changes_BEGIN --- EDIT HERE TO _END */
static void pack(uint8_T *pkg, uint16_T *len, const int_T y_width, uint8_T *ts, uint8_T *src, uint16_T length)
{
uint8_T sum;
int16_T i,j;
sum = 0;
for (i = 0; i < 4; ++i)
{
pkg[i] = ts[i];
sum += ts[i];
}
if (length > y_width - 5)
{
length = y_width - 5;
}
for (i = 0, j = 4; i < length; ++i,++j)
{
pkg[j] = src[i];
sum += src[i];
}
pkg[j] = sum;
len[0] = length+4;
}
/* %%%-SFUNWIZ_wrapper_externs_Changes_END --- EDIT HERE TO _BEGIN */
/*
* Output function
*
*/
void hal_rec_Outputs_wrapper(const uint8_T *id,
const uint32_T *time_stamp,
uint8_T *pkg,
uint16_T *len,
const int_T y_width)
{
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_BEGIN --- EDIT HERE TO _END */
switch (id[0])
{
#ifdef HAL_IMPL
case 1:
pack(pkg, len, y_width, (uint8_T *)time_stamp, (uint8_T *)&rec_hi, sizeof(rec_hi));
break;
#endif
default:
pack(pkg, len, y_width, (uint8_T *)time_stamp, 0UL, 0u);
}
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_END --- EDIT HERE TO _BEGIN */
}
@@ -0,0 +1,57 @@
/*
* Include Files
*
*/
#if defined(MATLAB_MEX_FILE)
#include "tmwtypes.h"
#include "simstruc_types.h"
#else
#include "rtwtypes.h"
#endif
/* %%%-SFUNWIZ_wrapper_includes_Changes_BEGIN --- EDIT HERE TO _END */
#ifdef HAL_IMPL
#include <stdint.h>
#include <string.h>
extern char cmd[70];
extern uint8_t cmd_len;
#endif
/* %%%-SFUNWIZ_wrapper_includes_Changes_END --- EDIT HERE TO _BEGIN */
#define u_width 70
#define y_width 1
/*
* Create external references here.
*
*/
/* %%%-SFUNWIZ_wrapper_externs_Changes_BEGIN --- EDIT HERE TO _END */
/* %%%-SFUNWIZ_wrapper_externs_Changes_END --- EDIT HERE TO _BEGIN */
/*
* Output function
*
*/
void hal_serial_cmdline_Outputs_wrapper(const uint8_T *data,
const uint8_T *len,
uint32_T *ErrorCode)
{
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_BEGIN --- EDIT HERE TO _END */
ErrorCode[0] = 0;
#ifdef HAL_IMPL
if (cmd_len == 0)
{
cmd_len = len[0]-1;
if (cmd_len > sizeof(cmd)-1)
{
cmd_len = sizeof(cmd)-1;
}
memcpy(cmd, data, cmd_len);
}
#endif
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_END --- EDIT HERE TO _BEGIN */
}
@@ -0,0 +1,58 @@
/*
* Include Files
*
*/
#if defined(MATLAB_MEX_FILE)
#include "tmwtypes.h"
#include "simstruc_types.h"
#else
#include "rtwtypes.h"
#endif
/* %%%-SFUNWIZ_wrapper_includes_Changes_BEGIN --- EDIT HERE TO _END */
#ifdef HAL_IMPL
#include <stdint.h>
#include <string.h>
extern char echo[70];
extern uint8_t echo_len;
#endif
/* %%%-SFUNWIZ_wrapper_includes_Changes_END --- EDIT HERE TO _BEGIN */
#define y_width 1
/*
* Create external references here.
*
*/
/* %%%-SFUNWIZ_wrapper_externs_Changes_BEGIN --- EDIT HERE TO _END */
/* %%%-SFUNWIZ_wrapper_externs_Changes_END --- EDIT HERE TO _BEGIN */
/*
* Output function
*
*/
void hal_serial_echoline_Outputs_wrapper(uint8_T *data,
uint8_T *len)
{
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_BEGIN --- EDIT HERE TO _END */
#ifdef HAL_IMPL
if (echo_len)
{
if (echo_len > 70)
echo_len = 70;
memcpy(data, echo, echo_len);
memset(data+echo_len, 0, 70-echo_len);
len[0] = echo_len;
echo_len = 0;
}
else
#endif
len[0] = 0;
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_END --- EDIT HERE TO _BEGIN */
}
@@ -0,0 +1,45 @@
/*
* Include Files
*
*/
#if defined(MATLAB_MEX_FILE)
#include "tmwtypes.h"
#include "simstruc_types.h"
#else
#include "rtwtypes.h"
#endif
#include "mav_stat_def.h"
/* %%%-SFUNWIZ_wrapper_includes_Changes_BEGIN --- EDIT HERE TO _END */
/* %%%-SFUNWIZ_wrapper_includes_Changes_END --- EDIT HERE TO _BEGIN */
#define u_width 1
#define y_width 1
/*
* Create external references here.
*
*/
/* %%%-SFUNWIZ_wrapper_externs_Changes_BEGIN --- EDIT HERE TO _END */
/* %%%-SFUNWIZ_wrapper_externs_Changes_END --- EDIT HERE TO _BEGIN */
/*
* Output function
*
*/
void mav_emb_atmo_com_encode_Outputs_wrapper(const mavlink_emb_atmo_com_t *obj,
const uint8_T *sys_id,
const uint8_T *comp_id,
const uint8_T *channel,
mavlink_message_t *msg)
{
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_BEGIN --- EDIT HERE TO _END */
mavlink_msg_emb_atmo_com_encode_chan(sys_id[0], comp_id[0], channel[0], msg, obj);
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_END --- EDIT HERE TO _BEGIN */
}
@@ -0,0 +1,45 @@
/*
* Include Files
*
*/
#if defined(MATLAB_MEX_FILE)
#include "tmwtypes.h"
#include "simstruc_types.h"
#else
#include "rtwtypes.h"
#endif
#include "mav_stat_def.h"
/* %%%-SFUNWIZ_wrapper_includes_Changes_BEGIN --- EDIT HERE TO _END */
/* %%%-SFUNWIZ_wrapper_includes_Changes_END --- EDIT HERE TO _BEGIN */
#define u_width 1
#define y_width 1
/*
* Create external references here.
*
*/
/* %%%-SFUNWIZ_wrapper_externs_Changes_BEGIN --- EDIT HERE TO _END */
/* %%%-SFUNWIZ_wrapper_externs_Changes_END --- EDIT HERE TO _BEGIN */
/*
* Output function
*
*/
void mav_ins1_encode_Outputs_wrapper(const mavlink_ins1_t *obj,
const uint8_T *sys_id,
const uint8_T *comp_id,
const uint8_T *channel,
mavlink_message_t *msg)
{
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_BEGIN --- EDIT HERE TO _END */
mavlink_msg_ins1_encode_chan(sys_id[0], comp_id[0], channel[0], msg, obj);
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_END --- EDIT HERE TO _BEGIN */
}
@@ -0,0 +1,45 @@
/*
* Include Files
*
*/
#if defined(MATLAB_MEX_FILE)
#include "tmwtypes.h"
#include "simstruc_types.h"
#else
#include "rtwtypes.h"
#endif
#include "mav_stat_def.h"
/* %%%-SFUNWIZ_wrapper_includes_Changes_BEGIN --- EDIT HERE TO _END */
/* %%%-SFUNWIZ_wrapper_includes_Changes_END --- EDIT HERE TO _BEGIN */
#define u_width 1
#define y_width 1
/*
* Create external references here.
*
*/
/* %%%-SFUNWIZ_wrapper_externs_Changes_BEGIN --- EDIT HERE TO _END */
/* %%%-SFUNWIZ_wrapper_externs_Changes_END --- EDIT HERE TO _BEGIN */
/*
* Output function
*
*/
void mav_ins2_encode_Outputs_wrapper(const mavlink_ins2_t *obj,
const uint8_T *sys_id,
const uint8_T *comp_id,
const uint8_T *channel,
mavlink_message_t *msg)
{
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_BEGIN --- EDIT HERE TO _END */
mavlink_msg_ins2_encode_chan(sys_id[0], comp_id[0], channel[0], msg, obj);
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_END --- EDIT HERE TO _BEGIN */
}
@@ -0,0 +1,42 @@
/*
* Include Files
*
*/
#if defined(MATLAB_MEX_FILE)
#include "tmwtypes.h"
#include "simstruc_types.h"
#else
#include "rtwtypes.h"
#endif
#include "mav_stat_def.h"
/* %%%-SFUNWIZ_wrapper_includes_Changes_BEGIN --- EDIT HERE TO _END */
/* %%%-SFUNWIZ_wrapper_includes_Changes_END --- EDIT HERE TO _BEGIN */
#define u_width 1
#define y_width 1
/*
* Create external references here.
*
*/
/* %%%-SFUNWIZ_wrapper_externs_Changes_BEGIN --- EDIT HERE TO _END */
/* %%%-SFUNWIZ_wrapper_externs_Changes_END --- EDIT HERE TO _BEGIN */
/*
* Output function
*
*/
void mav_serial_control_decode_Outputs_wrapper(const mavlink_message_t *mav_msg,
mavlink_serial_control_t *msg_dec)
{
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_BEGIN --- EDIT HERE TO _END */
mavlink_msg_serial_control_decode(mav_msg, msg_dec);
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_END --- EDIT HERE TO _BEGIN */
}
@@ -0,0 +1,45 @@
/*
* Include Files
*
*/
#if defined(MATLAB_MEX_FILE)
#include "tmwtypes.h"
#include "simstruc_types.h"
#else
#include "rtwtypes.h"
#endif
#include "mav_stat_def.h"
/* %%%-SFUNWIZ_wrapper_includes_Changes_BEGIN --- EDIT HERE TO _END */
/* %%%-SFUNWIZ_wrapper_includes_Changes_END --- EDIT HERE TO _BEGIN */
#define u_width 1
#define y_width 1
/*
* Create external references here.
*
*/
/* %%%-SFUNWIZ_wrapper_externs_Changes_BEGIN --- EDIT HERE TO _END */
/* %%%-SFUNWIZ_wrapper_externs_Changes_END --- EDIT HERE TO _BEGIN */
/*
* Output function
*
*/
void mav_serial_control_encode_Outputs_wrapper(const mavlink_serial_control_t *obj,
const uint8_T *sys_id,
const uint8_T *comp_id,
const uint8_T *channel,
mavlink_message_t *msg)
{
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_BEGIN --- EDIT HERE TO _END */
mavlink_msg_serial_control_encode_chan(sys_id[0], comp_id[0], channel[0], msg, obj);
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_END --- EDIT HERE TO _BEGIN */
}
+731
View File
@@ -0,0 +1,731 @@
#pragma once
// MESSAGE BMUState PACKING
#define MAVLINK_MSG_ID_BMUState 20301
typedef struct __mavlink_bmustate_t {
uint32_t time_boot_ms; /*< [ms] Timestamp (milliseconds since system boot)*/
uint16_t BAT1_group_voltage_mv; /*< group_voltage_mv*/
uint16_t BAT1_group_current_dA; /*< group_current_dA*/
uint16_t BAT1_remain_perc; /*< remain_perc*/
uint16_t BAT1_low_temp_degC; /*< low_temp_degC*/
uint16_t BAT1_hi_temp_degC; /*< hi_temp_degC*/
uint16_t BAT1_voltages_mv[7]; /*< voltages_mv*/
uint16_t BAT1_hi_voltage_mv; /*< hi_voltage_mv*/
uint16_t BAT1_low_voltage_mv; /*< low_voltage_mv*/
uint16_t BAT2_group_voltage_mv; /*< group_voltage_mv*/
uint16_t BAT2_group_current_dA; /*< group_current_dA*/
uint16_t BAT2_remain_perc; /*< remain_perc*/
uint16_t BAT2_low_temp_degC; /*< low_temp_degC*/
uint16_t BAT2_hi_temp_degC; /*< hi_temp_degC*/
uint16_t BAT2_voltages_mv[14]; /*< voltages_mv*/
uint16_t BAT2_hi_voltage_mv; /*< hi_voltage_mv*/
uint16_t BAT2_low_voltage_mv; /*< low_voltage_mv*/
uint8_t BAT1_STA1; /*< BAT1_STA1*/
uint8_t BAT1_STA2; /*< BAT1_STA2*/
uint8_t BAT2_STA1; /*< BAT2_STA1*/
uint8_t BAT2_STA2; /*< BAT2_STA2*/
uint8_t p500w_enabled; /*< p500w_enabled*/
} mavlink_bmustate_t;
#define MAVLINK_MSG_ID_BMUState_LEN 79
#define MAVLINK_MSG_ID_BMUState_MIN_LEN 79
#define MAVLINK_MSG_ID_20301_LEN 79
#define MAVLINK_MSG_ID_20301_MIN_LEN 79
#define MAVLINK_MSG_ID_BMUState_CRC 233
#define MAVLINK_MSG_ID_20301_CRC 233
#define MAVLINK_MSG_BMUState_FIELD_BAT1_VOLTAGES_MV_LEN 7
#define MAVLINK_MSG_BMUState_FIELD_BAT2_VOLTAGES_MV_LEN 14
#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_BMUState { \
20301, \
"BMUState", \
22, \
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_bmustate_t, time_boot_ms) }, \
{ "BAT1_group_voltage_mv", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_bmustate_t, BAT1_group_voltage_mv) }, \
{ "BAT1_group_current_dA", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_bmustate_t, BAT1_group_current_dA) }, \
{ "BAT1_remain_perc", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_bmustate_t, BAT1_remain_perc) }, \
{ "BAT1_low_temp_degC", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_bmustate_t, BAT1_low_temp_degC) }, \
{ "BAT1_hi_temp_degC", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_bmustate_t, BAT1_hi_temp_degC) }, \
{ "BAT1_voltages_mv", NULL, MAVLINK_TYPE_UINT16_T, 7, 14, offsetof(mavlink_bmustate_t, BAT1_voltages_mv) }, \
{ "BAT1_hi_voltage_mv", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_bmustate_t, BAT1_hi_voltage_mv) }, \
{ "BAT1_low_voltage_mv", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_bmustate_t, BAT1_low_voltage_mv) }, \
{ "BAT2_group_voltage_mv", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_bmustate_t, BAT2_group_voltage_mv) }, \
{ "BAT2_group_current_dA", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_bmustate_t, BAT2_group_current_dA) }, \
{ "BAT2_remain_perc", NULL, MAVLINK_TYPE_UINT16_T, 0, 36, offsetof(mavlink_bmustate_t, BAT2_remain_perc) }, \
{ "BAT2_low_temp_degC", NULL, MAVLINK_TYPE_UINT16_T, 0, 38, offsetof(mavlink_bmustate_t, BAT2_low_temp_degC) }, \
{ "BAT2_hi_temp_degC", NULL, MAVLINK_TYPE_UINT16_T, 0, 40, offsetof(mavlink_bmustate_t, BAT2_hi_temp_degC) }, \
{ "BAT2_voltages_mv", NULL, MAVLINK_TYPE_UINT16_T, 14, 42, offsetof(mavlink_bmustate_t, BAT2_voltages_mv) }, \
{ "BAT2_hi_voltage_mv", NULL, MAVLINK_TYPE_UINT16_T, 0, 70, offsetof(mavlink_bmustate_t, BAT2_hi_voltage_mv) }, \
{ "BAT2_low_voltage_mv", NULL, MAVLINK_TYPE_UINT16_T, 0, 72, offsetof(mavlink_bmustate_t, BAT2_low_voltage_mv) }, \
{ "BAT1_STA1", NULL, MAVLINK_TYPE_UINT8_T, 0, 74, offsetof(mavlink_bmustate_t, BAT1_STA1) }, \
{ "BAT1_STA2", NULL, MAVLINK_TYPE_UINT8_T, 0, 75, offsetof(mavlink_bmustate_t, BAT1_STA2) }, \
{ "BAT2_STA1", NULL, MAVLINK_TYPE_UINT8_T, 0, 76, offsetof(mavlink_bmustate_t, BAT2_STA1) }, \
{ "BAT2_STA2", NULL, MAVLINK_TYPE_UINT8_T, 0, 77, offsetof(mavlink_bmustate_t, BAT2_STA2) }, \
{ "p500w_enabled", NULL, MAVLINK_TYPE_UINT8_T, 0, 78, offsetof(mavlink_bmustate_t, p500w_enabled) }, \
} \
}
#else
#define MAVLINK_MESSAGE_INFO_BMUState { \
"BMUState", \
22, \
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_bmustate_t, time_boot_ms) }, \
{ "BAT1_group_voltage_mv", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_bmustate_t, BAT1_group_voltage_mv) }, \
{ "BAT1_group_current_dA", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_bmustate_t, BAT1_group_current_dA) }, \
{ "BAT1_remain_perc", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_bmustate_t, BAT1_remain_perc) }, \
{ "BAT1_low_temp_degC", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_bmustate_t, BAT1_low_temp_degC) }, \
{ "BAT1_hi_temp_degC", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_bmustate_t, BAT1_hi_temp_degC) }, \
{ "BAT1_voltages_mv", NULL, MAVLINK_TYPE_UINT16_T, 7, 14, offsetof(mavlink_bmustate_t, BAT1_voltages_mv) }, \
{ "BAT1_hi_voltage_mv", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_bmustate_t, BAT1_hi_voltage_mv) }, \
{ "BAT1_low_voltage_mv", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_bmustate_t, BAT1_low_voltage_mv) }, \
{ "BAT2_group_voltage_mv", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_bmustate_t, BAT2_group_voltage_mv) }, \
{ "BAT2_group_current_dA", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_bmustate_t, BAT2_group_current_dA) }, \
{ "BAT2_remain_perc", NULL, MAVLINK_TYPE_UINT16_T, 0, 36, offsetof(mavlink_bmustate_t, BAT2_remain_perc) }, \
{ "BAT2_low_temp_degC", NULL, MAVLINK_TYPE_UINT16_T, 0, 38, offsetof(mavlink_bmustate_t, BAT2_low_temp_degC) }, \
{ "BAT2_hi_temp_degC", NULL, MAVLINK_TYPE_UINT16_T, 0, 40, offsetof(mavlink_bmustate_t, BAT2_hi_temp_degC) }, \
{ "BAT2_voltages_mv", NULL, MAVLINK_TYPE_UINT16_T, 14, 42, offsetof(mavlink_bmustate_t, BAT2_voltages_mv) }, \
{ "BAT2_hi_voltage_mv", NULL, MAVLINK_TYPE_UINT16_T, 0, 70, offsetof(mavlink_bmustate_t, BAT2_hi_voltage_mv) }, \
{ "BAT2_low_voltage_mv", NULL, MAVLINK_TYPE_UINT16_T, 0, 72, offsetof(mavlink_bmustate_t, BAT2_low_voltage_mv) }, \
{ "BAT1_STA1", NULL, MAVLINK_TYPE_UINT8_T, 0, 74, offsetof(mavlink_bmustate_t, BAT1_STA1) }, \
{ "BAT1_STA2", NULL, MAVLINK_TYPE_UINT8_T, 0, 75, offsetof(mavlink_bmustate_t, BAT1_STA2) }, \
{ "BAT2_STA1", NULL, MAVLINK_TYPE_UINT8_T, 0, 76, offsetof(mavlink_bmustate_t, BAT2_STA1) }, \
{ "BAT2_STA2", NULL, MAVLINK_TYPE_UINT8_T, 0, 77, offsetof(mavlink_bmustate_t, BAT2_STA2) }, \
{ "p500w_enabled", NULL, MAVLINK_TYPE_UINT8_T, 0, 78, offsetof(mavlink_bmustate_t, p500w_enabled) }, \
} \
}
#endif
/**
* @brief Pack a bmustate 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
*
* @param time_boot_ms [ms] Timestamp (milliseconds since system boot)
* @param BAT1_group_voltage_mv group_voltage_mv
* @param BAT1_group_current_dA group_current_dA
* @param BAT1_remain_perc remain_perc
* @param BAT1_low_temp_degC low_temp_degC
* @param BAT1_hi_temp_degC hi_temp_degC
* @param BAT1_voltages_mv voltages_mv
* @param BAT1_hi_voltage_mv hi_voltage_mv
* @param BAT1_low_voltage_mv low_voltage_mv
* @param BAT2_group_voltage_mv group_voltage_mv
* @param BAT2_group_current_dA group_current_dA
* @param BAT2_remain_perc remain_perc
* @param BAT2_low_temp_degC low_temp_degC
* @param BAT2_hi_temp_degC hi_temp_degC
* @param BAT2_voltages_mv voltages_mv
* @param BAT2_hi_voltage_mv hi_voltage_mv
* @param BAT2_low_voltage_mv low_voltage_mv
* @param BAT1_STA1 BAT1_STA1
* @param BAT1_STA2 BAT1_STA2
* @param BAT2_STA1 BAT2_STA1
* @param BAT2_STA2 BAT2_STA2
* @param p500w_enabled p500w_enabled
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_bmustate_pack(uint16_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint32_t time_boot_ms, uint16_t BAT1_group_voltage_mv, uint16_t BAT1_group_current_dA, uint16_t BAT1_remain_perc, uint16_t BAT1_low_temp_degC, uint16_t BAT1_hi_temp_degC, const uint16_t *BAT1_voltages_mv, uint16_t BAT1_hi_voltage_mv, uint16_t BAT1_low_voltage_mv, uint16_t BAT2_group_voltage_mv, uint16_t BAT2_group_current_dA, uint16_t BAT2_remain_perc, uint16_t BAT2_low_temp_degC, uint16_t BAT2_hi_temp_degC, const uint16_t *BAT2_voltages_mv, uint16_t BAT2_hi_voltage_mv, uint16_t BAT2_low_voltage_mv, uint8_t BAT1_STA1, uint8_t BAT1_STA2, uint8_t BAT2_STA1, uint8_t BAT2_STA2, uint8_t p500w_enabled)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_BMUState_LEN];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_uint16_t(buf, 4, BAT1_group_voltage_mv);
_mav_put_uint16_t(buf, 6, BAT1_group_current_dA);
_mav_put_uint16_t(buf, 8, BAT1_remain_perc);
_mav_put_uint16_t(buf, 10, BAT1_low_temp_degC);
_mav_put_uint16_t(buf, 12, BAT1_hi_temp_degC);
_mav_put_uint16_t(buf, 28, BAT1_hi_voltage_mv);
_mav_put_uint16_t(buf, 30, BAT1_low_voltage_mv);
_mav_put_uint16_t(buf, 32, BAT2_group_voltage_mv);
_mav_put_uint16_t(buf, 34, BAT2_group_current_dA);
_mav_put_uint16_t(buf, 36, BAT2_remain_perc);
_mav_put_uint16_t(buf, 38, BAT2_low_temp_degC);
_mav_put_uint16_t(buf, 40, BAT2_hi_temp_degC);
_mav_put_uint16_t(buf, 70, BAT2_hi_voltage_mv);
_mav_put_uint16_t(buf, 72, BAT2_low_voltage_mv);
_mav_put_uint8_t(buf, 74, BAT1_STA1);
_mav_put_uint8_t(buf, 75, BAT1_STA2);
_mav_put_uint8_t(buf, 76, BAT2_STA1);
_mav_put_uint8_t(buf, 77, BAT2_STA2);
_mav_put_uint8_t(buf, 78, p500w_enabled);
_mav_put_uint16_t_array(buf, 14, BAT1_voltages_mv, 7);
_mav_put_uint16_t_array(buf, 42, BAT2_voltages_mv, 14);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_BMUState_LEN);
#else
mavlink_bmustate_t packet;
packet.time_boot_ms = time_boot_ms;
packet.BAT1_group_voltage_mv = BAT1_group_voltage_mv;
packet.BAT1_group_current_dA = BAT1_group_current_dA;
packet.BAT1_remain_perc = BAT1_remain_perc;
packet.BAT1_low_temp_degC = BAT1_low_temp_degC;
packet.BAT1_hi_temp_degC = BAT1_hi_temp_degC;
packet.BAT1_hi_voltage_mv = BAT1_hi_voltage_mv;
packet.BAT1_low_voltage_mv = BAT1_low_voltage_mv;
packet.BAT2_group_voltage_mv = BAT2_group_voltage_mv;
packet.BAT2_group_current_dA = BAT2_group_current_dA;
packet.BAT2_remain_perc = BAT2_remain_perc;
packet.BAT2_low_temp_degC = BAT2_low_temp_degC;
packet.BAT2_hi_temp_degC = BAT2_hi_temp_degC;
packet.BAT2_hi_voltage_mv = BAT2_hi_voltage_mv;
packet.BAT2_low_voltage_mv = BAT2_low_voltage_mv;
packet.BAT1_STA1 = BAT1_STA1;
packet.BAT1_STA2 = BAT1_STA2;
packet.BAT2_STA1 = BAT2_STA1;
packet.BAT2_STA2 = BAT2_STA2;
packet.p500w_enabled = p500w_enabled;
mav_array_memcpy(packet.BAT1_voltages_mv, BAT1_voltages_mv, sizeof(uint16_t)*7);
mav_array_memcpy(packet.BAT2_voltages_mv, BAT2_voltages_mv, sizeof(uint16_t)*14);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_BMUState_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_BMUState;
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_BMUState_MIN_LEN, MAVLINK_MSG_ID_BMUState_LEN, MAVLINK_MSG_ID_BMUState_CRC);
}
/**
* @brief Pack a bmustate 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
* @param time_boot_ms [ms] Timestamp (milliseconds since system boot)
* @param BAT1_group_voltage_mv group_voltage_mv
* @param BAT1_group_current_dA group_current_dA
* @param BAT1_remain_perc remain_perc
* @param BAT1_low_temp_degC low_temp_degC
* @param BAT1_hi_temp_degC hi_temp_degC
* @param BAT1_voltages_mv voltages_mv
* @param BAT1_hi_voltage_mv hi_voltage_mv
* @param BAT1_low_voltage_mv low_voltage_mv
* @param BAT2_group_voltage_mv group_voltage_mv
* @param BAT2_group_current_dA group_current_dA
* @param BAT2_remain_perc remain_perc
* @param BAT2_low_temp_degC low_temp_degC
* @param BAT2_hi_temp_degC hi_temp_degC
* @param BAT2_voltages_mv voltages_mv
* @param BAT2_hi_voltage_mv hi_voltage_mv
* @param BAT2_low_voltage_mv low_voltage_mv
* @param BAT1_STA1 BAT1_STA1
* @param BAT1_STA2 BAT1_STA2
* @param BAT2_STA1 BAT2_STA1
* @param BAT2_STA2 BAT2_STA2
* @param p500w_enabled p500w_enabled
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_bmustate_pack_chan(uint16_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint32_t time_boot_ms,uint16_t BAT1_group_voltage_mv,uint16_t BAT1_group_current_dA,uint16_t BAT1_remain_perc,uint16_t BAT1_low_temp_degC,uint16_t BAT1_hi_temp_degC,const uint16_t *BAT1_voltages_mv,uint16_t BAT1_hi_voltage_mv,uint16_t BAT1_low_voltage_mv,uint16_t BAT2_group_voltage_mv,uint16_t BAT2_group_current_dA,uint16_t BAT2_remain_perc,uint16_t BAT2_low_temp_degC,uint16_t BAT2_hi_temp_degC,const uint16_t *BAT2_voltages_mv,uint16_t BAT2_hi_voltage_mv,uint16_t BAT2_low_voltage_mv,uint8_t BAT1_STA1,uint8_t BAT1_STA2,uint8_t BAT2_STA1,uint8_t BAT2_STA2,uint8_t p500w_enabled)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_BMUState_LEN];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_uint16_t(buf, 4, BAT1_group_voltage_mv);
_mav_put_uint16_t(buf, 6, BAT1_group_current_dA);
_mav_put_uint16_t(buf, 8, BAT1_remain_perc);
_mav_put_uint16_t(buf, 10, BAT1_low_temp_degC);
_mav_put_uint16_t(buf, 12, BAT1_hi_temp_degC);
_mav_put_uint16_t(buf, 28, BAT1_hi_voltage_mv);
_mav_put_uint16_t(buf, 30, BAT1_low_voltage_mv);
_mav_put_uint16_t(buf, 32, BAT2_group_voltage_mv);
_mav_put_uint16_t(buf, 34, BAT2_group_current_dA);
_mav_put_uint16_t(buf, 36, BAT2_remain_perc);
_mav_put_uint16_t(buf, 38, BAT2_low_temp_degC);
_mav_put_uint16_t(buf, 40, BAT2_hi_temp_degC);
_mav_put_uint16_t(buf, 70, BAT2_hi_voltage_mv);
_mav_put_uint16_t(buf, 72, BAT2_low_voltage_mv);
_mav_put_uint8_t(buf, 74, BAT1_STA1);
_mav_put_uint8_t(buf, 75, BAT1_STA2);
_mav_put_uint8_t(buf, 76, BAT2_STA1);
_mav_put_uint8_t(buf, 77, BAT2_STA2);
_mav_put_uint8_t(buf, 78, p500w_enabled);
_mav_put_uint16_t_array(buf, 14, BAT1_voltages_mv, 7);
_mav_put_uint16_t_array(buf, 42, BAT2_voltages_mv, 14);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_BMUState_LEN);
#else
mavlink_bmustate_t packet;
packet.time_boot_ms = time_boot_ms;
packet.BAT1_group_voltage_mv = BAT1_group_voltage_mv;
packet.BAT1_group_current_dA = BAT1_group_current_dA;
packet.BAT1_remain_perc = BAT1_remain_perc;
packet.BAT1_low_temp_degC = BAT1_low_temp_degC;
packet.BAT1_hi_temp_degC = BAT1_hi_temp_degC;
packet.BAT1_hi_voltage_mv = BAT1_hi_voltage_mv;
packet.BAT1_low_voltage_mv = BAT1_low_voltage_mv;
packet.BAT2_group_voltage_mv = BAT2_group_voltage_mv;
packet.BAT2_group_current_dA = BAT2_group_current_dA;
packet.BAT2_remain_perc = BAT2_remain_perc;
packet.BAT2_low_temp_degC = BAT2_low_temp_degC;
packet.BAT2_hi_temp_degC = BAT2_hi_temp_degC;
packet.BAT2_hi_voltage_mv = BAT2_hi_voltage_mv;
packet.BAT2_low_voltage_mv = BAT2_low_voltage_mv;
packet.BAT1_STA1 = BAT1_STA1;
packet.BAT1_STA2 = BAT1_STA2;
packet.BAT2_STA1 = BAT2_STA1;
packet.BAT2_STA2 = BAT2_STA2;
packet.p500w_enabled = p500w_enabled;
mav_array_memcpy(packet.BAT1_voltages_mv, BAT1_voltages_mv, sizeof(uint16_t)*7);
mav_array_memcpy(packet.BAT2_voltages_mv, BAT2_voltages_mv, sizeof(uint16_t)*14);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_BMUState_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_BMUState;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_BMUState_MIN_LEN, MAVLINK_MSG_ID_BMUState_LEN, MAVLINK_MSG_ID_BMUState_CRC);
}
/**
* @brief Encode a bmustate 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 bmustate C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_bmustate_encode(uint16_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_bmustate_t* bmustate)
{
return mavlink_msg_bmustate_pack(system_id, component_id, msg, bmustate->time_boot_ms, bmustate->BAT1_group_voltage_mv, bmustate->BAT1_group_current_dA, bmustate->BAT1_remain_perc, bmustate->BAT1_low_temp_degC, bmustate->BAT1_hi_temp_degC, bmustate->BAT1_voltages_mv, bmustate->BAT1_hi_voltage_mv, bmustate->BAT1_low_voltage_mv, bmustate->BAT2_group_voltage_mv, bmustate->BAT2_group_current_dA, bmustate->BAT2_remain_perc, bmustate->BAT2_low_temp_degC, bmustate->BAT2_hi_temp_degC, bmustate->BAT2_voltages_mv, bmustate->BAT2_hi_voltage_mv, bmustate->BAT2_low_voltage_mv, bmustate->BAT1_STA1, bmustate->BAT1_STA2, bmustate->BAT2_STA1, bmustate->BAT2_STA2, bmustate->p500w_enabled);
}
/**
* @brief Encode a bmustate 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 bmustate C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_bmustate_encode_chan(uint16_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_bmustate_t* bmustate)
{
return mavlink_msg_bmustate_pack_chan(system_id, component_id, chan, msg, bmustate->time_boot_ms, bmustate->BAT1_group_voltage_mv, bmustate->BAT1_group_current_dA, bmustate->BAT1_remain_perc, bmustate->BAT1_low_temp_degC, bmustate->BAT1_hi_temp_degC, bmustate->BAT1_voltages_mv, bmustate->BAT1_hi_voltage_mv, bmustate->BAT1_low_voltage_mv, bmustate->BAT2_group_voltage_mv, bmustate->BAT2_group_current_dA, bmustate->BAT2_remain_perc, bmustate->BAT2_low_temp_degC, bmustate->BAT2_hi_temp_degC, bmustate->BAT2_voltages_mv, bmustate->BAT2_hi_voltage_mv, bmustate->BAT2_low_voltage_mv, bmustate->BAT1_STA1, bmustate->BAT1_STA2, bmustate->BAT2_STA1, bmustate->BAT2_STA2, bmustate->p500w_enabled);
}
/**
* @brief Send a bmustate message
* @param chan MAVLink channel to send the message
*
* @param time_boot_ms [ms] Timestamp (milliseconds since system boot)
* @param BAT1_group_voltage_mv group_voltage_mv
* @param BAT1_group_current_dA group_current_dA
* @param BAT1_remain_perc remain_perc
* @param BAT1_low_temp_degC low_temp_degC
* @param BAT1_hi_temp_degC hi_temp_degC
* @param BAT1_voltages_mv voltages_mv
* @param BAT1_hi_voltage_mv hi_voltage_mv
* @param BAT1_low_voltage_mv low_voltage_mv
* @param BAT2_group_voltage_mv group_voltage_mv
* @param BAT2_group_current_dA group_current_dA
* @param BAT2_remain_perc remain_perc
* @param BAT2_low_temp_degC low_temp_degC
* @param BAT2_hi_temp_degC hi_temp_degC
* @param BAT2_voltages_mv voltages_mv
* @param BAT2_hi_voltage_mv hi_voltage_mv
* @param BAT2_low_voltage_mv low_voltage_mv
* @param BAT1_STA1 BAT1_STA1
* @param BAT1_STA2 BAT1_STA2
* @param BAT2_STA1 BAT2_STA1
* @param BAT2_STA2 BAT2_STA2
* @param p500w_enabled p500w_enabled
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_bmustate_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint16_t BAT1_group_voltage_mv, uint16_t BAT1_group_current_dA, uint16_t BAT1_remain_perc, uint16_t BAT1_low_temp_degC, uint16_t BAT1_hi_temp_degC, const uint16_t *BAT1_voltages_mv, uint16_t BAT1_hi_voltage_mv, uint16_t BAT1_low_voltage_mv, uint16_t BAT2_group_voltage_mv, uint16_t BAT2_group_current_dA, uint16_t BAT2_remain_perc, uint16_t BAT2_low_temp_degC, uint16_t BAT2_hi_temp_degC, const uint16_t *BAT2_voltages_mv, uint16_t BAT2_hi_voltage_mv, uint16_t BAT2_low_voltage_mv, uint8_t BAT1_STA1, uint8_t BAT1_STA2, uint8_t BAT2_STA1, uint8_t BAT2_STA2, uint8_t p500w_enabled)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_BMUState_LEN];
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_uint16_t(buf, 4, BAT1_group_voltage_mv);
_mav_put_uint16_t(buf, 6, BAT1_group_current_dA);
_mav_put_uint16_t(buf, 8, BAT1_remain_perc);
_mav_put_uint16_t(buf, 10, BAT1_low_temp_degC);
_mav_put_uint16_t(buf, 12, BAT1_hi_temp_degC);
_mav_put_uint16_t(buf, 28, BAT1_hi_voltage_mv);
_mav_put_uint16_t(buf, 30, BAT1_low_voltage_mv);
_mav_put_uint16_t(buf, 32, BAT2_group_voltage_mv);
_mav_put_uint16_t(buf, 34, BAT2_group_current_dA);
_mav_put_uint16_t(buf, 36, BAT2_remain_perc);
_mav_put_uint16_t(buf, 38, BAT2_low_temp_degC);
_mav_put_uint16_t(buf, 40, BAT2_hi_temp_degC);
_mav_put_uint16_t(buf, 70, BAT2_hi_voltage_mv);
_mav_put_uint16_t(buf, 72, BAT2_low_voltage_mv);
_mav_put_uint8_t(buf, 74, BAT1_STA1);
_mav_put_uint8_t(buf, 75, BAT1_STA2);
_mav_put_uint8_t(buf, 76, BAT2_STA1);
_mav_put_uint8_t(buf, 77, BAT2_STA2);
_mav_put_uint8_t(buf, 78, p500w_enabled);
_mav_put_uint16_t_array(buf, 14, BAT1_voltages_mv, 7);
_mav_put_uint16_t_array(buf, 42, BAT2_voltages_mv, 14);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BMUState, buf, MAVLINK_MSG_ID_BMUState_MIN_LEN, MAVLINK_MSG_ID_BMUState_LEN, MAVLINK_MSG_ID_BMUState_CRC);
#else
mavlink_bmustate_t packet;
packet.time_boot_ms = time_boot_ms;
packet.BAT1_group_voltage_mv = BAT1_group_voltage_mv;
packet.BAT1_group_current_dA = BAT1_group_current_dA;
packet.BAT1_remain_perc = BAT1_remain_perc;
packet.BAT1_low_temp_degC = BAT1_low_temp_degC;
packet.BAT1_hi_temp_degC = BAT1_hi_temp_degC;
packet.BAT1_hi_voltage_mv = BAT1_hi_voltage_mv;
packet.BAT1_low_voltage_mv = BAT1_low_voltage_mv;
packet.BAT2_group_voltage_mv = BAT2_group_voltage_mv;
packet.BAT2_group_current_dA = BAT2_group_current_dA;
packet.BAT2_remain_perc = BAT2_remain_perc;
packet.BAT2_low_temp_degC = BAT2_low_temp_degC;
packet.BAT2_hi_temp_degC = BAT2_hi_temp_degC;
packet.BAT2_hi_voltage_mv = BAT2_hi_voltage_mv;
packet.BAT2_low_voltage_mv = BAT2_low_voltage_mv;
packet.BAT1_STA1 = BAT1_STA1;
packet.BAT1_STA2 = BAT1_STA2;
packet.BAT2_STA1 = BAT2_STA1;
packet.BAT2_STA2 = BAT2_STA2;
packet.p500w_enabled = p500w_enabled;
mav_array_memcpy(packet.BAT1_voltages_mv, BAT1_voltages_mv, sizeof(uint16_t)*7);
mav_array_memcpy(packet.BAT2_voltages_mv, BAT2_voltages_mv, sizeof(uint16_t)*14);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BMUState, (const char *)&packet, MAVLINK_MSG_ID_BMUState_MIN_LEN, MAVLINK_MSG_ID_BMUState_LEN, MAVLINK_MSG_ID_BMUState_CRC);
#endif
}
/**
* @brief Send a bmustate message
* @param chan MAVLink channel to send the message
* @param struct The MAVLink struct to serialize
*/
static inline void mavlink_msg_bmustate_send_struct(mavlink_channel_t chan, const mavlink_bmustate_t* bmustate)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
mavlink_msg_bmustate_send(chan, bmustate->time_boot_ms, bmustate->BAT1_group_voltage_mv, bmustate->BAT1_group_current_dA, bmustate->BAT1_remain_perc, bmustate->BAT1_low_temp_degC, bmustate->BAT1_hi_temp_degC, bmustate->BAT1_voltages_mv, bmustate->BAT1_hi_voltage_mv, bmustate->BAT1_low_voltage_mv, bmustate->BAT2_group_voltage_mv, bmustate->BAT2_group_current_dA, bmustate->BAT2_remain_perc, bmustate->BAT2_low_temp_degC, bmustate->BAT2_hi_temp_degC, bmustate->BAT2_voltages_mv, bmustate->BAT2_hi_voltage_mv, bmustate->BAT2_low_voltage_mv, bmustate->BAT1_STA1, bmustate->BAT1_STA2, bmustate->BAT2_STA1, bmustate->BAT2_STA2, bmustate->p500w_enabled);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BMUState, (const char *)bmustate, MAVLINK_MSG_ID_BMUState_MIN_LEN, MAVLINK_MSG_ID_BMUState_LEN, MAVLINK_MSG_ID_BMUState_CRC);
#endif
}
#if MAVLINK_MSG_ID_BMUState_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.
*/
static inline void mavlink_msg_bmustate_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint16_t BAT1_group_voltage_mv, uint16_t BAT1_group_current_dA, uint16_t BAT1_remain_perc, uint16_t BAT1_low_temp_degC, uint16_t BAT1_hi_temp_degC, const uint16_t *BAT1_voltages_mv, uint16_t BAT1_hi_voltage_mv, uint16_t BAT1_low_voltage_mv, uint16_t BAT2_group_voltage_mv, uint16_t BAT2_group_current_dA, uint16_t BAT2_remain_perc, uint16_t BAT2_low_temp_degC, uint16_t BAT2_hi_temp_degC, const uint16_t *BAT2_voltages_mv, uint16_t BAT2_hi_voltage_mv, uint16_t BAT2_low_voltage_mv, uint8_t BAT1_STA1, uint8_t BAT1_STA2, uint8_t BAT2_STA1, uint8_t BAT2_STA2, uint8_t p500w_enabled)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_uint32_t(buf, 0, time_boot_ms);
_mav_put_uint16_t(buf, 4, BAT1_group_voltage_mv);
_mav_put_uint16_t(buf, 6, BAT1_group_current_dA);
_mav_put_uint16_t(buf, 8, BAT1_remain_perc);
_mav_put_uint16_t(buf, 10, BAT1_low_temp_degC);
_mav_put_uint16_t(buf, 12, BAT1_hi_temp_degC);
_mav_put_uint16_t(buf, 28, BAT1_hi_voltage_mv);
_mav_put_uint16_t(buf, 30, BAT1_low_voltage_mv);
_mav_put_uint16_t(buf, 32, BAT2_group_voltage_mv);
_mav_put_uint16_t(buf, 34, BAT2_group_current_dA);
_mav_put_uint16_t(buf, 36, BAT2_remain_perc);
_mav_put_uint16_t(buf, 38, BAT2_low_temp_degC);
_mav_put_uint16_t(buf, 40, BAT2_hi_temp_degC);
_mav_put_uint16_t(buf, 70, BAT2_hi_voltage_mv);
_mav_put_uint16_t(buf, 72, BAT2_low_voltage_mv);
_mav_put_uint8_t(buf, 74, BAT1_STA1);
_mav_put_uint8_t(buf, 75, BAT1_STA2);
_mav_put_uint8_t(buf, 76, BAT2_STA1);
_mav_put_uint8_t(buf, 77, BAT2_STA2);
_mav_put_uint8_t(buf, 78, p500w_enabled);
_mav_put_uint16_t_array(buf, 14, BAT1_voltages_mv, 7);
_mav_put_uint16_t_array(buf, 42, BAT2_voltages_mv, 14);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BMUState, buf, MAVLINK_MSG_ID_BMUState_MIN_LEN, MAVLINK_MSG_ID_BMUState_LEN, MAVLINK_MSG_ID_BMUState_CRC);
#else
mavlink_bmustate_t *packet = (mavlink_bmustate_t *)msgbuf;
packet->time_boot_ms = time_boot_ms;
packet->BAT1_group_voltage_mv = BAT1_group_voltage_mv;
packet->BAT1_group_current_dA = BAT1_group_current_dA;
packet->BAT1_remain_perc = BAT1_remain_perc;
packet->BAT1_low_temp_degC = BAT1_low_temp_degC;
packet->BAT1_hi_temp_degC = BAT1_hi_temp_degC;
packet->BAT1_hi_voltage_mv = BAT1_hi_voltage_mv;
packet->BAT1_low_voltage_mv = BAT1_low_voltage_mv;
packet->BAT2_group_voltage_mv = BAT2_group_voltage_mv;
packet->BAT2_group_current_dA = BAT2_group_current_dA;
packet->BAT2_remain_perc = BAT2_remain_perc;
packet->BAT2_low_temp_degC = BAT2_low_temp_degC;
packet->BAT2_hi_temp_degC = BAT2_hi_temp_degC;
packet->BAT2_hi_voltage_mv = BAT2_hi_voltage_mv;
packet->BAT2_low_voltage_mv = BAT2_low_voltage_mv;
packet->BAT1_STA1 = BAT1_STA1;
packet->BAT1_STA2 = BAT1_STA2;
packet->BAT2_STA1 = BAT2_STA1;
packet->BAT2_STA2 = BAT2_STA2;
packet->p500w_enabled = p500w_enabled;
mav_array_memcpy(packet->BAT1_voltages_mv, BAT1_voltages_mv, sizeof(uint16_t)*7);
mav_array_memcpy(packet->BAT2_voltages_mv, BAT2_voltages_mv, sizeof(uint16_t)*14);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BMUState, (const char *)packet, MAVLINK_MSG_ID_BMUState_MIN_LEN, MAVLINK_MSG_ID_BMUState_LEN, MAVLINK_MSG_ID_BMUState_CRC);
#endif
}
#endif
#endif
// MESSAGE BMUState UNPACKING
/**
* @brief Get field time_boot_ms from bmustate message
*
* @return [ms] Timestamp (milliseconds since system boot)
*/
static inline uint32_t mavlink_msg_bmustate_get_time_boot_ms(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 0);
}
/**
* @brief Get field BAT1_group_voltage_mv from bmustate message
*
* @return group_voltage_mv
*/
static inline uint16_t mavlink_msg_bmustate_get_BAT1_group_voltage_mv(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 4);
}
/**
* @brief Get field BAT1_group_current_dA from bmustate message
*
* @return group_current_dA
*/
static inline uint16_t mavlink_msg_bmustate_get_BAT1_group_current_dA(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 6);
}
/**
* @brief Get field BAT1_remain_perc from bmustate message
*
* @return remain_perc
*/
static inline uint16_t mavlink_msg_bmustate_get_BAT1_remain_perc(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 8);
}
/**
* @brief Get field BAT1_low_temp_degC from bmustate message
*
* @return low_temp_degC
*/
static inline uint16_t mavlink_msg_bmustate_get_BAT1_low_temp_degC(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 10);
}
/**
* @brief Get field BAT1_hi_temp_degC from bmustate message
*
* @return hi_temp_degC
*/
static inline uint16_t mavlink_msg_bmustate_get_BAT1_hi_temp_degC(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 12);
}
/**
* @brief Get field BAT1_voltages_mv from bmustate message
*
* @return voltages_mv
*/
static inline uint16_t mavlink_msg_bmustate_get_BAT1_voltages_mv(const mavlink_message_t* msg, uint16_t *BAT1_voltages_mv)
{
return _MAV_RETURN_uint16_t_array(msg, BAT1_voltages_mv, 7, 14);
}
/**
* @brief Get field BAT1_hi_voltage_mv from bmustate message
*
* @return hi_voltage_mv
*/
static inline uint16_t mavlink_msg_bmustate_get_BAT1_hi_voltage_mv(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 28);
}
/**
* @brief Get field BAT1_low_voltage_mv from bmustate message
*
* @return low_voltage_mv
*/
static inline uint16_t mavlink_msg_bmustate_get_BAT1_low_voltage_mv(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 30);
}
/**
* @brief Get field BAT2_group_voltage_mv from bmustate message
*
* @return group_voltage_mv
*/
static inline uint16_t mavlink_msg_bmustate_get_BAT2_group_voltage_mv(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 32);
}
/**
* @brief Get field BAT2_group_current_dA from bmustate message
*
* @return group_current_dA
*/
static inline uint16_t mavlink_msg_bmustate_get_BAT2_group_current_dA(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 34);
}
/**
* @brief Get field BAT2_remain_perc from bmustate message
*
* @return remain_perc
*/
static inline uint16_t mavlink_msg_bmustate_get_BAT2_remain_perc(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 36);
}
/**
* @brief Get field BAT2_low_temp_degC from bmustate message
*
* @return low_temp_degC
*/
static inline uint16_t mavlink_msg_bmustate_get_BAT2_low_temp_degC(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 38);
}
/**
* @brief Get field BAT2_hi_temp_degC from bmustate message
*
* @return hi_temp_degC
*/
static inline uint16_t mavlink_msg_bmustate_get_BAT2_hi_temp_degC(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 40);
}
/**
* @brief Get field BAT2_voltages_mv from bmustate message
*
* @return voltages_mv
*/
static inline uint16_t mavlink_msg_bmustate_get_BAT2_voltages_mv(const mavlink_message_t* msg, uint16_t *BAT2_voltages_mv)
{
return _MAV_RETURN_uint16_t_array(msg, BAT2_voltages_mv, 14, 42);
}
/**
* @brief Get field BAT2_hi_voltage_mv from bmustate message
*
* @return hi_voltage_mv
*/
static inline uint16_t mavlink_msg_bmustate_get_BAT2_hi_voltage_mv(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 70);
}
/**
* @brief Get field BAT2_low_voltage_mv from bmustate message
*
* @return low_voltage_mv
*/
static inline uint16_t mavlink_msg_bmustate_get_BAT2_low_voltage_mv(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 72);
}
/**
* @brief Get field BAT1_STA1 from bmustate message
*
* @return BAT1_STA1
*/
static inline uint8_t mavlink_msg_bmustate_get_BAT1_STA1(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 74);
}
/**
* @brief Get field BAT1_STA2 from bmustate message
*
* @return BAT1_STA2
*/
static inline uint8_t mavlink_msg_bmustate_get_BAT1_STA2(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 75);
}
/**
* @brief Get field BAT2_STA1 from bmustate message
*
* @return BAT2_STA1
*/
static inline uint8_t mavlink_msg_bmustate_get_BAT2_STA1(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 76);
}
/**
* @brief Get field BAT2_STA2 from bmustate message
*
* @return BAT2_STA2
*/
static inline uint8_t mavlink_msg_bmustate_get_BAT2_STA2(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 77);
}
/**
* @brief Get field p500w_enabled from bmustate message
*
* @return p500w_enabled
*/
static inline uint8_t mavlink_msg_bmustate_get_p500w_enabled(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 78);
}
/**
* @brief Decode a bmustate message into a struct
*
* @param msg The message to decode
* @param bmustate C-struct to decode the message contents into
*/
static inline void mavlink_msg_bmustate_decode(const mavlink_message_t* msg, mavlink_bmustate_t* bmustate)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
bmustate->time_boot_ms = mavlink_msg_bmustate_get_time_boot_ms(msg);
bmustate->BAT1_group_voltage_mv = mavlink_msg_bmustate_get_BAT1_group_voltage_mv(msg);
bmustate->BAT1_group_current_dA = mavlink_msg_bmustate_get_BAT1_group_current_dA(msg);
bmustate->BAT1_remain_perc = mavlink_msg_bmustate_get_BAT1_remain_perc(msg);
bmustate->BAT1_low_temp_degC = mavlink_msg_bmustate_get_BAT1_low_temp_degC(msg);
bmustate->BAT1_hi_temp_degC = mavlink_msg_bmustate_get_BAT1_hi_temp_degC(msg);
mavlink_msg_bmustate_get_BAT1_voltages_mv(msg, bmustate->BAT1_voltages_mv);
bmustate->BAT1_hi_voltage_mv = mavlink_msg_bmustate_get_BAT1_hi_voltage_mv(msg);
bmustate->BAT1_low_voltage_mv = mavlink_msg_bmustate_get_BAT1_low_voltage_mv(msg);
bmustate->BAT2_group_voltage_mv = mavlink_msg_bmustate_get_BAT2_group_voltage_mv(msg);
bmustate->BAT2_group_current_dA = mavlink_msg_bmustate_get_BAT2_group_current_dA(msg);
bmustate->BAT2_remain_perc = mavlink_msg_bmustate_get_BAT2_remain_perc(msg);
bmustate->BAT2_low_temp_degC = mavlink_msg_bmustate_get_BAT2_low_temp_degC(msg);
bmustate->BAT2_hi_temp_degC = mavlink_msg_bmustate_get_BAT2_hi_temp_degC(msg);
mavlink_msg_bmustate_get_BAT2_voltages_mv(msg, bmustate->BAT2_voltages_mv);
bmustate->BAT2_hi_voltage_mv = mavlink_msg_bmustate_get_BAT2_hi_voltage_mv(msg);
bmustate->BAT2_low_voltage_mv = mavlink_msg_bmustate_get_BAT2_low_voltage_mv(msg);
bmustate->BAT1_STA1 = mavlink_msg_bmustate_get_BAT1_STA1(msg);
bmustate->BAT1_STA2 = mavlink_msg_bmustate_get_BAT1_STA2(msg);
bmustate->BAT2_STA1 = mavlink_msg_bmustate_get_BAT2_STA1(msg);
bmustate->BAT2_STA2 = mavlink_msg_bmustate_get_BAT2_STA2(msg);
bmustate->p500w_enabled = mavlink_msg_bmustate_get_p500w_enabled(msg);
#else
uint8_t len = msg->len < MAVLINK_MSG_ID_BMUState_LEN? msg->len : MAVLINK_MSG_ID_BMUState_LEN;
memset(bmustate, 0, MAVLINK_MSG_ID_BMUState_LEN);
memcpy(bmustate, _MAV_PAYLOAD(msg), len);
#endif
}

Some files were not shown because too many files have changed in this diff Show More