Compare commits
55 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a4ec3896a7 | |||
| 389bd1a2dd | |||
| f120b6e915 | |||
| c76dd4e64d | |||
| 00928750e0 | |||
| a28d57ffba | |||
| b02d4d05f4 | |||
| 0e14ba6a37 | |||
| 0b345185f2 | |||
| e61829e042 | |||
| 4133b5a39d | |||
| 08a25154a5 | |||
| 6fcc618980 | |||
| feccaeca10 | |||
| c8c8a7f8a5 | |||
| 7b40684838 | |||
| 0c19f30426 | |||
| 4fcbb9d3ba | |||
| d64fdf41fc | |||
| a77a4e914f | |||
| 9500850836 | |||
| d5fe70ac0e | |||
| 96219ec912 | |||
| 638fa3576b | |||
| fdb65a5034 | |||
| 3851e7aa83 | |||
| 4d25cac168 | |||
| da75c54af9 | |||
| fa477f6eab | |||
| 7e86e11134 | |||
| 2e0709d9ac | |||
| f4f4ed6153 | |||
| 77d2ba3efd | |||
| 459ab7c377 | |||
| 466d6980b8 | |||
| 326b41c594 | |||
| 522f56d4bc | |||
| b064e82d9d | |||
| 8463e0518d | |||
| a460afe203 | |||
| 3c108acd3e | |||
| e4ccca1e11 | |||
| e868b2d348 | |||
| 8f20e144c5 | |||
| 2733c2c817 | |||
| c4aa86795e | |||
| 1d30e71492 | |||
| bd73991059 | |||
| 000d694761 | |||
| e5bb1092b5 | |||
| 93991f462b | |||
| a222fd5d29 | |||
| cb84cc7a43 | |||
| 5c622c242f | |||
| 57707aac9e |
@@ -73,3 +73,7 @@ Thumbs.db
|
|||||||
|
|
||||||
build/
|
build/
|
||||||
html/
|
html/
|
||||||
|
dist/
|
||||||
|
CMakeLists.txt.*
|
||||||
|
*.7z
|
||||||
|
*dist/
|
||||||
|
|||||||
@@ -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
@@ -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 */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -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
+2
-1
@@ -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 */
|
||||||
}
|
}
|
||||||
|
|
||||||
+7
-8
@@ -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>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -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 */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -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
Reference in New Issue
Block a user