This commit is contained in:
Lorenz Meier
2014-07-29 16:36:13 +02:00
parent 11b5839ecb
commit 77d9553174
14 changed files with 345 additions and 181 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Jul 28 11:30:20 2014"
#define MAVLINK_BUILD_DATE "Tue Jul 29 16:35:14 2014"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
+1 -1
View File
@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Jul 28 11:30:29 2014"
#define MAVLINK_BUILD_DATE "Tue Jul 29 16:35:21 2014"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
+1 -1
View File
@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Jul 28 11:31:20 2014"
#define MAVLINK_BUILD_DATE "Tue Jul 29 16:36:07 2014"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
+1 -1
View File
@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Jul 28 11:30:36 2014"
#define MAVLINK_BUILD_DATE "Tue Jul 29 16:35:28 2014"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
+1 -1
View File
@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Jul 28 11:30:43 2014"
#define MAVLINK_BUILD_DATE "Tue Jul 29 16:35:34 2014"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 9
+91 -67
View File
@@ -5,34 +5,36 @@
typedef struct __mavlink_detection_stats_t
{
float best_score; ///< Best score
int32_t best_lat; ///< Latitude of best detection
int32_t best_lon; ///< Longitude of best detection
int32_t best_lat; ///< Latitude of best detection * 1E7
int32_t best_lon; ///< Longitude of best detection * 1E7
int32_t best_detection_id; ///< ID of best detection
float detection_fps; ///< Average frames per seconds for detection
float fps; ///< Average images per seconds processed
uint16_t detections; ///< Number of detections
uint16_t images_done; ///< Number of images in already processed
uint16_t images_todo; ///< Number of images in queue to process
int16_t best_alt; ///< Altitude of best detection * 1E3
uint16_t images_done; ///< Number of images already processed
uint16_t images_todo; ///< Number of images still to process
} mavlink_detection_stats_t;
#define MAVLINK_MSG_ID_DETECTION_STATS_LEN 26
#define MAVLINK_MSG_ID_205_LEN 26
#define MAVLINK_MSG_ID_DETECTION_STATS_LEN 28
#define MAVLINK_MSG_ID_205_LEN 28
#define MAVLINK_MSG_ID_DETECTION_STATS_CRC 61
#define MAVLINK_MSG_ID_205_CRC 61
#define MAVLINK_MSG_ID_DETECTION_STATS_CRC 165
#define MAVLINK_MSG_ID_205_CRC 165
#define MAVLINK_MESSAGE_INFO_DETECTION_STATS { \
"DETECTION_STATS", \
8, \
9, \
{ { "best_score", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_detection_stats_t, best_score) }, \
{ "best_lat", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_detection_stats_t, best_lat) }, \
{ "best_lon", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_detection_stats_t, best_lon) }, \
{ "best_detection_id", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_detection_stats_t, best_detection_id) }, \
{ "detection_fps", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_detection_stats_t, detection_fps) }, \
{ "fps", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_detection_stats_t, fps) }, \
{ "detections", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_detection_stats_t, detections) }, \
{ "images_done", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_detection_stats_t, images_done) }, \
{ "images_todo", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_detection_stats_t, images_todo) }, \
{ "best_alt", NULL, MAVLINK_TYPE_INT16_T, 0, 22, offsetof(mavlink_detection_stats_t, best_alt) }, \
{ "images_done", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_detection_stats_t, images_done) }, \
{ "images_todo", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_detection_stats_t, images_todo) }, \
} \
}
@@ -45,16 +47,17 @@ typedef struct __mavlink_detection_stats_t
*
* @param detections Number of detections
* @param best_score Best score
* @param best_lat Latitude of best detection
* @param best_lon Longitude of best detection
* @param best_lat Latitude of best detection * 1E7
* @param best_lon Longitude of best detection * 1E7
* @param best_alt Altitude of best detection * 1E3
* @param best_detection_id ID of best detection
* @param images_done Number of images in already processed
* @param images_todo Number of images in queue to process
* @param detection_fps Average frames per seconds for detection
* @param images_done Number of images already processed
* @param images_todo Number of images still to process
* @param fps Average images per seconds processed
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_detection_stats_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint16_t detections, float best_score, int32_t best_lat, int32_t best_lon, int32_t best_detection_id, uint16_t images_done, uint16_t images_todo, float detection_fps)
uint16_t detections, float best_score, int32_t best_lat, int32_t best_lon, int16_t best_alt, int32_t best_detection_id, uint16_t images_done, uint16_t images_todo, float fps)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_DETECTION_STATS_LEN];
@@ -62,10 +65,11 @@ static inline uint16_t mavlink_msg_detection_stats_pack(uint8_t system_id, uint8
_mav_put_int32_t(buf, 4, best_lat);
_mav_put_int32_t(buf, 8, best_lon);
_mav_put_int32_t(buf, 12, best_detection_id);
_mav_put_float(buf, 16, detection_fps);
_mav_put_float(buf, 16, fps);
_mav_put_uint16_t(buf, 20, detections);
_mav_put_uint16_t(buf, 22, images_done);
_mav_put_uint16_t(buf, 24, images_todo);
_mav_put_int16_t(buf, 22, best_alt);
_mav_put_uint16_t(buf, 24, images_done);
_mav_put_uint16_t(buf, 26, images_todo);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DETECTION_STATS_LEN);
#else
@@ -74,8 +78,9 @@ static inline uint16_t mavlink_msg_detection_stats_pack(uint8_t system_id, uint8
packet.best_lat = best_lat;
packet.best_lon = best_lon;
packet.best_detection_id = best_detection_id;
packet.detection_fps = detection_fps;
packet.fps = fps;
packet.detections = detections;
packet.best_alt = best_alt;
packet.images_done = images_done;
packet.images_todo = images_todo;
@@ -98,17 +103,18 @@ static inline uint16_t mavlink_msg_detection_stats_pack(uint8_t system_id, uint8
* @param msg The MAVLink message to compress the data into
* @param detections Number of detections
* @param best_score Best score
* @param best_lat Latitude of best detection
* @param best_lon Longitude of best detection
* @param best_lat Latitude of best detection * 1E7
* @param best_lon Longitude of best detection * 1E7
* @param best_alt Altitude of best detection * 1E3
* @param best_detection_id ID of best detection
* @param images_done Number of images in already processed
* @param images_todo Number of images in queue to process
* @param detection_fps Average frames per seconds for detection
* @param images_done Number of images already processed
* @param images_todo Number of images still to process
* @param fps Average images per seconds processed
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_detection_stats_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint16_t detections,float best_score,int32_t best_lat,int32_t best_lon,int32_t best_detection_id,uint16_t images_done,uint16_t images_todo,float detection_fps)
uint16_t detections,float best_score,int32_t best_lat,int32_t best_lon,int16_t best_alt,int32_t best_detection_id,uint16_t images_done,uint16_t images_todo,float fps)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_DETECTION_STATS_LEN];
@@ -116,10 +122,11 @@ static inline uint16_t mavlink_msg_detection_stats_pack_chan(uint8_t system_id,
_mav_put_int32_t(buf, 4, best_lat);
_mav_put_int32_t(buf, 8, best_lon);
_mav_put_int32_t(buf, 12, best_detection_id);
_mav_put_float(buf, 16, detection_fps);
_mav_put_float(buf, 16, fps);
_mav_put_uint16_t(buf, 20, detections);
_mav_put_uint16_t(buf, 22, images_done);
_mav_put_uint16_t(buf, 24, images_todo);
_mav_put_int16_t(buf, 22, best_alt);
_mav_put_uint16_t(buf, 24, images_done);
_mav_put_uint16_t(buf, 26, images_todo);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DETECTION_STATS_LEN);
#else
@@ -128,8 +135,9 @@ static inline uint16_t mavlink_msg_detection_stats_pack_chan(uint8_t system_id,
packet.best_lat = best_lat;
packet.best_lon = best_lon;
packet.best_detection_id = best_detection_id;
packet.detection_fps = detection_fps;
packet.fps = fps;
packet.detections = detections;
packet.best_alt = best_alt;
packet.images_done = images_done;
packet.images_todo = images_todo;
@@ -154,7 +162,7 @@ static inline uint16_t mavlink_msg_detection_stats_pack_chan(uint8_t system_id,
*/
static inline uint16_t mavlink_msg_detection_stats_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_detection_stats_t* detection_stats)
{
return mavlink_msg_detection_stats_pack(system_id, component_id, msg, detection_stats->detections, detection_stats->best_score, detection_stats->best_lat, detection_stats->best_lon, detection_stats->best_detection_id, detection_stats->images_done, detection_stats->images_todo, detection_stats->detection_fps);
return mavlink_msg_detection_stats_pack(system_id, component_id, msg, detection_stats->detections, detection_stats->best_score, detection_stats->best_lat, detection_stats->best_lon, detection_stats->best_alt, detection_stats->best_detection_id, detection_stats->images_done, detection_stats->images_todo, detection_stats->fps);
}
/**
@@ -168,7 +176,7 @@ static inline uint16_t mavlink_msg_detection_stats_encode(uint8_t system_id, uin
*/
static inline uint16_t mavlink_msg_detection_stats_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_detection_stats_t* detection_stats)
{
return mavlink_msg_detection_stats_pack_chan(system_id, component_id, chan, msg, detection_stats->detections, detection_stats->best_score, detection_stats->best_lat, detection_stats->best_lon, detection_stats->best_detection_id, detection_stats->images_done, detection_stats->images_todo, detection_stats->detection_fps);
return mavlink_msg_detection_stats_pack_chan(system_id, component_id, chan, msg, detection_stats->detections, detection_stats->best_score, detection_stats->best_lat, detection_stats->best_lon, detection_stats->best_alt, detection_stats->best_detection_id, detection_stats->images_done, detection_stats->images_todo, detection_stats->fps);
}
/**
@@ -177,16 +185,17 @@ static inline uint16_t mavlink_msg_detection_stats_encode_chan(uint8_t system_id
*
* @param detections Number of detections
* @param best_score Best score
* @param best_lat Latitude of best detection
* @param best_lon Longitude of best detection
* @param best_lat Latitude of best detection * 1E7
* @param best_lon Longitude of best detection * 1E7
* @param best_alt Altitude of best detection * 1E3
* @param best_detection_id ID of best detection
* @param images_done Number of images in already processed
* @param images_todo Number of images in queue to process
* @param detection_fps Average frames per seconds for detection
* @param images_done Number of images already processed
* @param images_todo Number of images still to process
* @param fps Average images per seconds processed
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_detection_stats_send(mavlink_channel_t chan, uint16_t detections, float best_score, int32_t best_lat, int32_t best_lon, int32_t best_detection_id, uint16_t images_done, uint16_t images_todo, float detection_fps)
static inline void mavlink_msg_detection_stats_send(mavlink_channel_t chan, uint16_t detections, float best_score, int32_t best_lat, int32_t best_lon, int16_t best_alt, int32_t best_detection_id, uint16_t images_done, uint16_t images_todo, float fps)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_DETECTION_STATS_LEN];
@@ -194,10 +203,11 @@ static inline void mavlink_msg_detection_stats_send(mavlink_channel_t chan, uint
_mav_put_int32_t(buf, 4, best_lat);
_mav_put_int32_t(buf, 8, best_lon);
_mav_put_int32_t(buf, 12, best_detection_id);
_mav_put_float(buf, 16, detection_fps);
_mav_put_float(buf, 16, fps);
_mav_put_uint16_t(buf, 20, detections);
_mav_put_uint16_t(buf, 22, images_done);
_mav_put_uint16_t(buf, 24, images_todo);
_mav_put_int16_t(buf, 22, best_alt);
_mav_put_uint16_t(buf, 24, images_done);
_mav_put_uint16_t(buf, 26, images_todo);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DETECTION_STATS, buf, MAVLINK_MSG_ID_DETECTION_STATS_LEN, MAVLINK_MSG_ID_DETECTION_STATS_CRC);
@@ -210,8 +220,9 @@ static inline void mavlink_msg_detection_stats_send(mavlink_channel_t chan, uint
packet.best_lat = best_lat;
packet.best_lon = best_lon;
packet.best_detection_id = best_detection_id;
packet.detection_fps = detection_fps;
packet.fps = fps;
packet.detections = detections;
packet.best_alt = best_alt;
packet.images_done = images_done;
packet.images_todo = images_todo;
@@ -231,7 +242,7 @@ static inline void mavlink_msg_detection_stats_send(mavlink_channel_t chan, uint
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_detection_stats_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t detections, float best_score, int32_t best_lat, int32_t best_lon, int32_t best_detection_id, uint16_t images_done, uint16_t images_todo, float detection_fps)
static inline void mavlink_msg_detection_stats_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t detections, float best_score, int32_t best_lat, int32_t best_lon, int16_t best_alt, int32_t best_detection_id, uint16_t images_done, uint16_t images_todo, float fps)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
@@ -239,10 +250,11 @@ static inline void mavlink_msg_detection_stats_send_buf(mavlink_message_t *msgbu
_mav_put_int32_t(buf, 4, best_lat);
_mav_put_int32_t(buf, 8, best_lon);
_mav_put_int32_t(buf, 12, best_detection_id);
_mav_put_float(buf, 16, detection_fps);
_mav_put_float(buf, 16, fps);
_mav_put_uint16_t(buf, 20, detections);
_mav_put_uint16_t(buf, 22, images_done);
_mav_put_uint16_t(buf, 24, images_todo);
_mav_put_int16_t(buf, 22, best_alt);
_mav_put_uint16_t(buf, 24, images_done);
_mav_put_uint16_t(buf, 26, images_todo);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DETECTION_STATS, buf, MAVLINK_MSG_ID_DETECTION_STATS_LEN, MAVLINK_MSG_ID_DETECTION_STATS_CRC);
@@ -255,8 +267,9 @@ static inline void mavlink_msg_detection_stats_send_buf(mavlink_message_t *msgbu
packet->best_lat = best_lat;
packet->best_lon = best_lon;
packet->best_detection_id = best_detection_id;
packet->detection_fps = detection_fps;
packet->fps = fps;
packet->detections = detections;
packet->best_alt = best_alt;
packet->images_done = images_done;
packet->images_todo = images_todo;
@@ -297,7 +310,7 @@ static inline float mavlink_msg_detection_stats_get_best_score(const mavlink_mes
/**
* @brief Get field best_lat from detection_stats message
*
* @return Latitude of best detection
* @return Latitude of best detection * 1E7
*/
static inline int32_t mavlink_msg_detection_stats_get_best_lat(const mavlink_message_t* msg)
{
@@ -307,13 +320,23 @@ static inline int32_t mavlink_msg_detection_stats_get_best_lat(const mavlink_mes
/**
* @brief Get field best_lon from detection_stats message
*
* @return Longitude of best detection
* @return Longitude of best detection * 1E7
*/
static inline int32_t mavlink_msg_detection_stats_get_best_lon(const mavlink_message_t* msg)
{
return _MAV_RETURN_int32_t(msg, 8);
}
/**
* @brief Get field best_alt from detection_stats message
*
* @return Altitude of best detection * 1E3
*/
static inline int16_t mavlink_msg_detection_stats_get_best_alt(const mavlink_message_t* msg)
{
return _MAV_RETURN_int16_t(msg, 22);
}
/**
* @brief Get field best_detection_id from detection_stats message
*
@@ -327,29 +350,29 @@ static inline int32_t mavlink_msg_detection_stats_get_best_detection_id(const ma
/**
* @brief Get field images_done from detection_stats message
*
* @return Number of images in already processed
* @return Number of images already processed
*/
static inline uint16_t mavlink_msg_detection_stats_get_images_done(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 22);
}
/**
* @brief Get field images_todo from detection_stats message
*
* @return Number of images in queue to process
*/
static inline uint16_t mavlink_msg_detection_stats_get_images_todo(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 24);
}
/**
* @brief Get field detection_fps from detection_stats message
* @brief Get field images_todo from detection_stats message
*
* @return Average frames per seconds for detection
* @return Number of images still to process
*/
static inline float mavlink_msg_detection_stats_get_detection_fps(const mavlink_message_t* msg)
static inline uint16_t mavlink_msg_detection_stats_get_images_todo(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 26);
}
/**
* @brief Get field fps from detection_stats message
*
* @return Average images per seconds processed
*/
static inline float mavlink_msg_detection_stats_get_fps(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 16);
}
@@ -367,8 +390,9 @@ static inline void mavlink_msg_detection_stats_decode(const mavlink_message_t* m
detection_stats->best_lat = mavlink_msg_detection_stats_get_best_lat(msg);
detection_stats->best_lon = mavlink_msg_detection_stats_get_best_lon(msg);
detection_stats->best_detection_id = mavlink_msg_detection_stats_get_best_detection_id(msg);
detection_stats->detection_fps = mavlink_msg_detection_stats_get_detection_fps(msg);
detection_stats->fps = mavlink_msg_detection_stats_get_fps(msg);
detection_stats->detections = mavlink_msg_detection_stats_get_detections(msg);
detection_stats->best_alt = mavlink_msg_detection_stats_get_best_alt(msg);
detection_stats->images_done = mavlink_msg_detection_stats_get_images_done(msg);
detection_stats->images_todo = mavlink_msg_detection_stats_get_images_todo(msg);
#else
+216 -88
View File
@@ -5,36 +5,46 @@
typedef struct __mavlink_onboard_health_t
{
uint32_t uptime; ///< Uptime of system
float disk_usage_gb; ///< Disk usage in GiB
float ram_total; ///< RAM size in GiB
float swap_total; ///< Swap size in GiB
float disk_total; ///< Disk total in GiB
float temp; ///< Temperature
float voltage; ///< Supply voltage
float voltage; ///< Supply voltage V
float network_load_in; ///< Network load inbound KiB/s
float network_load_out; ///< Network load outbound in KiB/s
uint16_t cpu_freq; ///< CPU frequency
uint8_t cpu_load[4]; ///< CPU load per core in percent
uint8_t cpu_load; ///< CPU load in percent
uint8_t ram_usage; ///< RAM usage in percent
uint8_t swap_usage; ///< Swap usage in percent
int8_t disk_health; ///< Disk health (-1: N/A, 0: ERR, 1: RO, 2: RW)
uint8_t disk_usage; ///< Disk usage in percent
} mavlink_onboard_health_t;
#define MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN 25
#define MAVLINK_MSG_ID_206_LEN 25
#define MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN 39
#define MAVLINK_MSG_ID_206_LEN 39
#define MAVLINK_MSG_ID_ONBOARD_HEALTH_CRC 19
#define MAVLINK_MSG_ID_206_CRC 19
#define MAVLINK_MSG_ID_ONBOARD_HEALTH_CRC 83
#define MAVLINK_MSG_ID_206_CRC 83
#define MAVLINK_MSG_ONBOARD_HEALTH_FIELD_CPU_LOAD_LEN 4
#define MAVLINK_MESSAGE_INFO_ONBOARD_HEALTH { \
"ONBOARD_HEALTH", \
9, \
14, \
{ { "uptime", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_onboard_health_t, uptime) }, \
{ "disk_usage_gb", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_onboard_health_t, disk_usage_gb) }, \
{ "temp", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_onboard_health_t, temp) }, \
{ "voltage", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_onboard_health_t, voltage) }, \
{ "cpu_freq", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_onboard_health_t, cpu_freq) }, \
{ "cpu_load", NULL, MAVLINK_TYPE_UINT8_T, 4, 18, offsetof(mavlink_onboard_health_t, cpu_load) }, \
{ "ram_usage", NULL, MAVLINK_TYPE_UINT8_T, 0, 22, offsetof(mavlink_onboard_health_t, ram_usage) }, \
{ "disk_health", NULL, MAVLINK_TYPE_INT8_T, 0, 23, offsetof(mavlink_onboard_health_t, disk_health) }, \
{ "disk_usage", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_onboard_health_t, disk_usage) }, \
{ "ram_total", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_onboard_health_t, ram_total) }, \
{ "swap_total", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_onboard_health_t, swap_total) }, \
{ "disk_total", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_onboard_health_t, disk_total) }, \
{ "temp", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_onboard_health_t, temp) }, \
{ "voltage", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_onboard_health_t, voltage) }, \
{ "network_load_in", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_onboard_health_t, network_load_in) }, \
{ "network_load_out", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_onboard_health_t, network_load_out) }, \
{ "cpu_freq", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_onboard_health_t, cpu_freq) }, \
{ "cpu_load", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_onboard_health_t, cpu_load) }, \
{ "ram_usage", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_onboard_health_t, ram_usage) }, \
{ "swap_usage", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_onboard_health_t, swap_usage) }, \
{ "disk_health", NULL, MAVLINK_TYPE_INT8_T, 0, 37, offsetof(mavlink_onboard_health_t, disk_health) }, \
{ "disk_usage", NULL, MAVLINK_TYPE_UINT8_T, 0, 38, offsetof(mavlink_onboard_health_t, disk_usage) }, \
} \
}
@@ -47,41 +57,58 @@ typedef struct __mavlink_onboard_health_t
*
* @param uptime Uptime of system
* @param cpu_freq CPU frequency
* @param cpu_load CPU load per core in percent
* @param cpu_load CPU load in percent
* @param ram_usage RAM usage in percent
* @param ram_total RAM size in GiB
* @param swap_usage Swap usage in percent
* @param swap_total Swap size in GiB
* @param disk_health Disk health (-1: N/A, 0: ERR, 1: RO, 2: RW)
* @param disk_usage Disk usage in percent
* @param disk_usage_gb Disk usage in GiB
* @param disk_total Disk total in GiB
* @param temp Temperature
* @param voltage Supply voltage
* @param voltage Supply voltage V
* @param network_load_in Network load inbound KiB/s
* @param network_load_out Network load outbound in KiB/s
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_onboard_health_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint32_t uptime, uint16_t cpu_freq, const uint8_t *cpu_load, uint8_t ram_usage, int8_t disk_health, uint8_t disk_usage, float disk_usage_gb, float temp, float voltage)
uint32_t uptime, uint16_t cpu_freq, uint8_t cpu_load, uint8_t ram_usage, float ram_total, uint8_t swap_usage, float swap_total, int8_t disk_health, uint8_t disk_usage, float disk_total, float temp, float voltage, float network_load_in, float network_load_out)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN];
_mav_put_uint32_t(buf, 0, uptime);
_mav_put_float(buf, 4, disk_usage_gb);
_mav_put_float(buf, 8, temp);
_mav_put_float(buf, 12, voltage);
_mav_put_uint16_t(buf, 16, cpu_freq);
_mav_put_uint8_t(buf, 22, ram_usage);
_mav_put_int8_t(buf, 23, disk_health);
_mav_put_uint8_t(buf, 24, disk_usage);
_mav_put_uint8_t_array(buf, 18, cpu_load, 4);
_mav_put_float(buf, 4, ram_total);
_mav_put_float(buf, 8, swap_total);
_mav_put_float(buf, 12, disk_total);
_mav_put_float(buf, 16, temp);
_mav_put_float(buf, 20, voltage);
_mav_put_float(buf, 24, network_load_in);
_mav_put_float(buf, 28, network_load_out);
_mav_put_uint16_t(buf, 32, cpu_freq);
_mav_put_uint8_t(buf, 34, cpu_load);
_mav_put_uint8_t(buf, 35, ram_usage);
_mav_put_uint8_t(buf, 36, swap_usage);
_mav_put_int8_t(buf, 37, disk_health);
_mav_put_uint8_t(buf, 38, disk_usage);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN);
#else
mavlink_onboard_health_t packet;
packet.uptime = uptime;
packet.disk_usage_gb = disk_usage_gb;
packet.ram_total = ram_total;
packet.swap_total = swap_total;
packet.disk_total = disk_total;
packet.temp = temp;
packet.voltage = voltage;
packet.network_load_in = network_load_in;
packet.network_load_out = network_load_out;
packet.cpu_freq = cpu_freq;
packet.cpu_load = cpu_load;
packet.ram_usage = ram_usage;
packet.swap_usage = swap_usage;
packet.disk_health = disk_health;
packet.disk_usage = disk_usage;
mav_array_memcpy(packet.cpu_load, cpu_load, sizeof(uint8_t)*4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN);
#endif
@@ -101,42 +128,59 @@ static inline uint16_t mavlink_msg_onboard_health_pack(uint8_t system_id, uint8_
* @param msg The MAVLink message to compress the data into
* @param uptime Uptime of system
* @param cpu_freq CPU frequency
* @param cpu_load CPU load per core in percent
* @param cpu_load CPU load in percent
* @param ram_usage RAM usage in percent
* @param ram_total RAM size in GiB
* @param swap_usage Swap usage in percent
* @param swap_total Swap size in GiB
* @param disk_health Disk health (-1: N/A, 0: ERR, 1: RO, 2: RW)
* @param disk_usage Disk usage in percent
* @param disk_usage_gb Disk usage in GiB
* @param disk_total Disk total in GiB
* @param temp Temperature
* @param voltage Supply voltage
* @param voltage Supply voltage V
* @param network_load_in Network load inbound KiB/s
* @param network_load_out Network load outbound in KiB/s
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_onboard_health_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint32_t uptime,uint16_t cpu_freq,const uint8_t *cpu_load,uint8_t ram_usage,int8_t disk_health,uint8_t disk_usage,float disk_usage_gb,float temp,float voltage)
uint32_t uptime,uint16_t cpu_freq,uint8_t cpu_load,uint8_t ram_usage,float ram_total,uint8_t swap_usage,float swap_total,int8_t disk_health,uint8_t disk_usage,float disk_total,float temp,float voltage,float network_load_in,float network_load_out)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN];
_mav_put_uint32_t(buf, 0, uptime);
_mav_put_float(buf, 4, disk_usage_gb);
_mav_put_float(buf, 8, temp);
_mav_put_float(buf, 12, voltage);
_mav_put_uint16_t(buf, 16, cpu_freq);
_mav_put_uint8_t(buf, 22, ram_usage);
_mav_put_int8_t(buf, 23, disk_health);
_mav_put_uint8_t(buf, 24, disk_usage);
_mav_put_uint8_t_array(buf, 18, cpu_load, 4);
_mav_put_float(buf, 4, ram_total);
_mav_put_float(buf, 8, swap_total);
_mav_put_float(buf, 12, disk_total);
_mav_put_float(buf, 16, temp);
_mav_put_float(buf, 20, voltage);
_mav_put_float(buf, 24, network_load_in);
_mav_put_float(buf, 28, network_load_out);
_mav_put_uint16_t(buf, 32, cpu_freq);
_mav_put_uint8_t(buf, 34, cpu_load);
_mav_put_uint8_t(buf, 35, ram_usage);
_mav_put_uint8_t(buf, 36, swap_usage);
_mav_put_int8_t(buf, 37, disk_health);
_mav_put_uint8_t(buf, 38, disk_usage);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN);
#else
mavlink_onboard_health_t packet;
packet.uptime = uptime;
packet.disk_usage_gb = disk_usage_gb;
packet.ram_total = ram_total;
packet.swap_total = swap_total;
packet.disk_total = disk_total;
packet.temp = temp;
packet.voltage = voltage;
packet.network_load_in = network_load_in;
packet.network_load_out = network_load_out;
packet.cpu_freq = cpu_freq;
packet.cpu_load = cpu_load;
packet.ram_usage = ram_usage;
packet.swap_usage = swap_usage;
packet.disk_health = disk_health;
packet.disk_usage = disk_usage;
mav_array_memcpy(packet.cpu_load, cpu_load, sizeof(uint8_t)*4);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN);
#endif
@@ -158,7 +202,7 @@ static inline uint16_t mavlink_msg_onboard_health_pack_chan(uint8_t system_id, u
*/
static inline uint16_t mavlink_msg_onboard_health_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_onboard_health_t* onboard_health)
{
return mavlink_msg_onboard_health_pack(system_id, component_id, msg, onboard_health->uptime, onboard_health->cpu_freq, onboard_health->cpu_load, onboard_health->ram_usage, onboard_health->disk_health, onboard_health->disk_usage, onboard_health->disk_usage_gb, onboard_health->temp, onboard_health->voltage);
return mavlink_msg_onboard_health_pack(system_id, component_id, msg, onboard_health->uptime, onboard_health->cpu_freq, onboard_health->cpu_load, onboard_health->ram_usage, onboard_health->ram_total, onboard_health->swap_usage, onboard_health->swap_total, onboard_health->disk_health, onboard_health->disk_usage, onboard_health->disk_total, onboard_health->temp, onboard_health->voltage, onboard_health->network_load_in, onboard_health->network_load_out);
}
/**
@@ -172,7 +216,7 @@ static inline uint16_t mavlink_msg_onboard_health_encode(uint8_t system_id, uint
*/
static inline uint16_t mavlink_msg_onboard_health_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_onboard_health_t* onboard_health)
{
return mavlink_msg_onboard_health_pack_chan(system_id, component_id, chan, msg, onboard_health->uptime, onboard_health->cpu_freq, onboard_health->cpu_load, onboard_health->ram_usage, onboard_health->disk_health, onboard_health->disk_usage, onboard_health->disk_usage_gb, onboard_health->temp, onboard_health->voltage);
return mavlink_msg_onboard_health_pack_chan(system_id, component_id, chan, msg, onboard_health->uptime, onboard_health->cpu_freq, onboard_health->cpu_load, onboard_health->ram_usage, onboard_health->ram_total, onboard_health->swap_usage, onboard_health->swap_total, onboard_health->disk_health, onboard_health->disk_usage, onboard_health->disk_total, onboard_health->temp, onboard_health->voltage, onboard_health->network_load_in, onboard_health->network_load_out);
}
/**
@@ -181,29 +225,40 @@ static inline uint16_t mavlink_msg_onboard_health_encode_chan(uint8_t system_id,
*
* @param uptime Uptime of system
* @param cpu_freq CPU frequency
* @param cpu_load CPU load per core in percent
* @param cpu_load CPU load in percent
* @param ram_usage RAM usage in percent
* @param ram_total RAM size in GiB
* @param swap_usage Swap usage in percent
* @param swap_total Swap size in GiB
* @param disk_health Disk health (-1: N/A, 0: ERR, 1: RO, 2: RW)
* @param disk_usage Disk usage in percent
* @param disk_usage_gb Disk usage in GiB
* @param disk_total Disk total in GiB
* @param temp Temperature
* @param voltage Supply voltage
* @param voltage Supply voltage V
* @param network_load_in Network load inbound KiB/s
* @param network_load_out Network load outbound in KiB/s
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_onboard_health_send(mavlink_channel_t chan, uint32_t uptime, uint16_t cpu_freq, const uint8_t *cpu_load, uint8_t ram_usage, int8_t disk_health, uint8_t disk_usage, float disk_usage_gb, float temp, float voltage)
static inline void mavlink_msg_onboard_health_send(mavlink_channel_t chan, uint32_t uptime, uint16_t cpu_freq, uint8_t cpu_load, uint8_t ram_usage, float ram_total, uint8_t swap_usage, float swap_total, int8_t disk_health, uint8_t disk_usage, float disk_total, float temp, float voltage, float network_load_in, float network_load_out)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN];
_mav_put_uint32_t(buf, 0, uptime);
_mav_put_float(buf, 4, disk_usage_gb);
_mav_put_float(buf, 8, temp);
_mav_put_float(buf, 12, voltage);
_mav_put_uint16_t(buf, 16, cpu_freq);
_mav_put_uint8_t(buf, 22, ram_usage);
_mav_put_int8_t(buf, 23, disk_health);
_mav_put_uint8_t(buf, 24, disk_usage);
_mav_put_uint8_t_array(buf, 18, cpu_load, 4);
_mav_put_float(buf, 4, ram_total);
_mav_put_float(buf, 8, swap_total);
_mav_put_float(buf, 12, disk_total);
_mav_put_float(buf, 16, temp);
_mav_put_float(buf, 20, voltage);
_mav_put_float(buf, 24, network_load_in);
_mav_put_float(buf, 28, network_load_out);
_mav_put_uint16_t(buf, 32, cpu_freq);
_mav_put_uint8_t(buf, 34, cpu_load);
_mav_put_uint8_t(buf, 35, ram_usage);
_mav_put_uint8_t(buf, 36, swap_usage);
_mav_put_int8_t(buf, 37, disk_health);
_mav_put_uint8_t(buf, 38, disk_usage);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ONBOARD_HEALTH, buf, MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN, MAVLINK_MSG_ID_ONBOARD_HEALTH_CRC);
#else
@@ -212,14 +267,20 @@ static inline void mavlink_msg_onboard_health_send(mavlink_channel_t chan, uint3
#else
mavlink_onboard_health_t packet;
packet.uptime = uptime;
packet.disk_usage_gb = disk_usage_gb;
packet.ram_total = ram_total;
packet.swap_total = swap_total;
packet.disk_total = disk_total;
packet.temp = temp;
packet.voltage = voltage;
packet.network_load_in = network_load_in;
packet.network_load_out = network_load_out;
packet.cpu_freq = cpu_freq;
packet.cpu_load = cpu_load;
packet.ram_usage = ram_usage;
packet.swap_usage = swap_usage;
packet.disk_health = disk_health;
packet.disk_usage = disk_usage;
mav_array_memcpy(packet.cpu_load, cpu_load, sizeof(uint8_t)*4);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ONBOARD_HEALTH, (const char *)&packet, MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN, MAVLINK_MSG_ID_ONBOARD_HEALTH_CRC);
#else
@@ -236,19 +297,25 @@ static inline void mavlink_msg_onboard_health_send(mavlink_channel_t chan, uint3
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_onboard_health_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t uptime, uint16_t cpu_freq, const uint8_t *cpu_load, uint8_t ram_usage, int8_t disk_health, uint8_t disk_usage, float disk_usage_gb, float temp, float voltage)
static inline void mavlink_msg_onboard_health_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t uptime, uint16_t cpu_freq, uint8_t cpu_load, uint8_t ram_usage, float ram_total, uint8_t swap_usage, float swap_total, int8_t disk_health, uint8_t disk_usage, float disk_total, float temp, float voltage, float network_load_in, float network_load_out)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_uint32_t(buf, 0, uptime);
_mav_put_float(buf, 4, disk_usage_gb);
_mav_put_float(buf, 8, temp);
_mav_put_float(buf, 12, voltage);
_mav_put_uint16_t(buf, 16, cpu_freq);
_mav_put_uint8_t(buf, 22, ram_usage);
_mav_put_int8_t(buf, 23, disk_health);
_mav_put_uint8_t(buf, 24, disk_usage);
_mav_put_uint8_t_array(buf, 18, cpu_load, 4);
_mav_put_float(buf, 4, ram_total);
_mav_put_float(buf, 8, swap_total);
_mav_put_float(buf, 12, disk_total);
_mav_put_float(buf, 16, temp);
_mav_put_float(buf, 20, voltage);
_mav_put_float(buf, 24, network_load_in);
_mav_put_float(buf, 28, network_load_out);
_mav_put_uint16_t(buf, 32, cpu_freq);
_mav_put_uint8_t(buf, 34, cpu_load);
_mav_put_uint8_t(buf, 35, ram_usage);
_mav_put_uint8_t(buf, 36, swap_usage);
_mav_put_int8_t(buf, 37, disk_health);
_mav_put_uint8_t(buf, 38, disk_usage);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ONBOARD_HEALTH, buf, MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN, MAVLINK_MSG_ID_ONBOARD_HEALTH_CRC);
#else
@@ -257,14 +324,20 @@ static inline void mavlink_msg_onboard_health_send_buf(mavlink_message_t *msgbuf
#else
mavlink_onboard_health_t *packet = (mavlink_onboard_health_t *)msgbuf;
packet->uptime = uptime;
packet->disk_usage_gb = disk_usage_gb;
packet->ram_total = ram_total;
packet->swap_total = swap_total;
packet->disk_total = disk_total;
packet->temp = temp;
packet->voltage = voltage;
packet->network_load_in = network_load_in;
packet->network_load_out = network_load_out;
packet->cpu_freq = cpu_freq;
packet->cpu_load = cpu_load;
packet->ram_usage = ram_usage;
packet->swap_usage = swap_usage;
packet->disk_health = disk_health;
packet->disk_usage = disk_usage;
mav_array_memcpy(packet->cpu_load, cpu_load, sizeof(uint8_t)*4);
#if MAVLINK_CRC_EXTRA
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ONBOARD_HEALTH, (const char *)packet, MAVLINK_MSG_ID_ONBOARD_HEALTH_LEN, MAVLINK_MSG_ID_ONBOARD_HEALTH_CRC);
#else
@@ -296,17 +369,17 @@ static inline uint32_t mavlink_msg_onboard_health_get_uptime(const mavlink_messa
*/
static inline uint16_t mavlink_msg_onboard_health_get_cpu_freq(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 16);
return _MAV_RETURN_uint16_t(msg, 32);
}
/**
* @brief Get field cpu_load from onboard_health message
*
* @return CPU load per core in percent
* @return CPU load in percent
*/
static inline uint16_t mavlink_msg_onboard_health_get_cpu_load(const mavlink_message_t* msg, uint8_t *cpu_load)
static inline uint8_t mavlink_msg_onboard_health_get_cpu_load(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t_array(msg, cpu_load, 4, 18);
return _MAV_RETURN_uint8_t(msg, 34);
}
/**
@@ -316,7 +389,37 @@ static inline uint16_t mavlink_msg_onboard_health_get_cpu_load(const mavlink_mes
*/
static inline uint8_t mavlink_msg_onboard_health_get_ram_usage(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 22);
return _MAV_RETURN_uint8_t(msg, 35);
}
/**
* @brief Get field ram_total from onboard_health message
*
* @return RAM size in GiB
*/
static inline float mavlink_msg_onboard_health_get_ram_total(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
}
/**
* @brief Get field swap_usage from onboard_health message
*
* @return Swap usage in percent
*/
static inline uint8_t mavlink_msg_onboard_health_get_swap_usage(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 36);
}
/**
* @brief Get field swap_total from onboard_health message
*
* @return Swap size in GiB
*/
static inline float mavlink_msg_onboard_health_get_swap_total(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
}
/**
@@ -326,7 +429,7 @@ static inline uint8_t mavlink_msg_onboard_health_get_ram_usage(const mavlink_mes
*/
static inline int8_t mavlink_msg_onboard_health_get_disk_health(const mavlink_message_t* msg)
{
return _MAV_RETURN_int8_t(msg, 23);
return _MAV_RETURN_int8_t(msg, 37);
}
/**
@@ -336,17 +439,17 @@ static inline int8_t mavlink_msg_onboard_health_get_disk_health(const mavlink_me
*/
static inline uint8_t mavlink_msg_onboard_health_get_disk_usage(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 24);
return _MAV_RETURN_uint8_t(msg, 38);
}
/**
* @brief Get field disk_usage_gb from onboard_health message
* @brief Get field disk_total from onboard_health message
*
* @return Disk usage in GiB
* @return Disk total in GiB
*/
static inline float mavlink_msg_onboard_health_get_disk_usage_gb(const mavlink_message_t* msg)
static inline float mavlink_msg_onboard_health_get_disk_total(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 4);
return _MAV_RETURN_float(msg, 12);
}
/**
@@ -356,17 +459,37 @@ static inline float mavlink_msg_onboard_health_get_disk_usage_gb(const mavlink_m
*/
static inline float mavlink_msg_onboard_health_get_temp(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 8);
return _MAV_RETURN_float(msg, 16);
}
/**
* @brief Get field voltage from onboard_health message
*
* @return Supply voltage
* @return Supply voltage V
*/
static inline float mavlink_msg_onboard_health_get_voltage(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 12);
return _MAV_RETURN_float(msg, 20);
}
/**
* @brief Get field network_load_in from onboard_health message
*
* @return Network load inbound KiB/s
*/
static inline float mavlink_msg_onboard_health_get_network_load_in(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 24);
}
/**
* @brief Get field network_load_out from onboard_health message
*
* @return Network load outbound in KiB/s
*/
static inline float mavlink_msg_onboard_health_get_network_load_out(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 28);
}
/**
@@ -379,12 +502,17 @@ static inline void mavlink_msg_onboard_health_decode(const mavlink_message_t* ms
{
#if MAVLINK_NEED_BYTE_SWAP
onboard_health->uptime = mavlink_msg_onboard_health_get_uptime(msg);
onboard_health->disk_usage_gb = mavlink_msg_onboard_health_get_disk_usage_gb(msg);
onboard_health->ram_total = mavlink_msg_onboard_health_get_ram_total(msg);
onboard_health->swap_total = mavlink_msg_onboard_health_get_swap_total(msg);
onboard_health->disk_total = mavlink_msg_onboard_health_get_disk_total(msg);
onboard_health->temp = mavlink_msg_onboard_health_get_temp(msg);
onboard_health->voltage = mavlink_msg_onboard_health_get_voltage(msg);
onboard_health->network_load_in = mavlink_msg_onboard_health_get_network_load_in(msg);
onboard_health->network_load_out = mavlink_msg_onboard_health_get_network_load_out(msg);
onboard_health->cpu_freq = mavlink_msg_onboard_health_get_cpu_freq(msg);
mavlink_msg_onboard_health_get_cpu_load(msg, onboard_health->cpu_load);
onboard_health->cpu_load = mavlink_msg_onboard_health_get_cpu_load(msg);
onboard_health->ram_usage = mavlink_msg_onboard_health_get_ram_usage(msg);
onboard_health->swap_usage = mavlink_msg_onboard_health_get_swap_usage(msg);
onboard_health->disk_health = mavlink_msg_onboard_health_get_disk_health(msg);
onboard_health->disk_usage = mavlink_msg_onboard_health_get_disk_usage(msg);
#else
+2 -2
View File
@@ -16,11 +16,11 @@ extern "C" {
// MESSAGE LENGTHS AND CRCS
#ifndef MAVLINK_MESSAGE_LENGTHS
#define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 28, 22, 22, 21, 6, 6, 37, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 19, 17, 15, 15, 27, 25, 18, 18, 20, 20, 9, 34, 26, 46, 36, 42, 6, 4, 0, 11, 18, 0, 0, 0, 20, 0, 33, 3, 0, 0, 20, 22, 39, 45, 44, 0, 0, 0, 0, 28, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 62, 54, 64, 84, 9, 254, 249, 9, 36, 26, 64, 22, 6, 14, 12, 97, 2, 2, 113, 35, 6, 79, 35, 35, 0, 13, 255, 14, 18, 43, 8, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 33, 25, 0, 11, 52, 1, 92, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 26, 16, 0, 0, 0, 0, 0, 0, 0, 4, 255, 12, 6, 0, 0, 0, 0, 0, 0, 106, 43, 55, 0, 0, 53, 0, 0, 0, 0, 21, 0, 0, 0, 0, 26, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 30, 18, 18, 51, 9, 0}
#define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 28, 22, 22, 21, 6, 6, 37, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 19, 17, 15, 15, 27, 25, 18, 18, 20, 20, 9, 34, 26, 46, 36, 42, 6, 4, 0, 11, 18, 0, 0, 0, 20, 0, 33, 3, 0, 0, 20, 22, 39, 45, 44, 0, 0, 0, 0, 28, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 62, 54, 64, 84, 9, 254, 249, 9, 36, 26, 64, 22, 6, 14, 12, 97, 2, 2, 113, 35, 6, 79, 35, 35, 0, 13, 255, 14, 18, 43, 8, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 33, 25, 0, 11, 52, 1, 92, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 26, 16, 0, 0, 0, 0, 0, 0, 0, 4, 255, 12, 6, 0, 0, 0, 0, 0, 0, 106, 43, 55, 0, 0, 53, 0, 0, 0, 0, 21, 0, 0, 0, 0, 28, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 30, 18, 18, 51, 9, 0}
#endif
#ifndef MAVLINK_MESSAGE_CRCS
#define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 214, 223, 141, 33, 15, 3, 100, 24, 239, 238, 30, 240, 183, 130, 130, 118, 148, 21, 0, 243, 124, 0, 0, 0, 20, 0, 152, 143, 0, 0, 127, 106, 147, 211, 198, 0, 0, 0, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 93, 211, 108, 32, 185, 235, 93, 124, 124, 119, 4, 76, 128, 56, 116, 134, 237, 203, 250, 87, 203, 220, 25, 226, 0, 29, 223, 85, 6, 229, 203, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 177, 241, 15, 0, 108, 86, 95, 224, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 249, 182, 0, 0, 0, 0, 0, 0, 0, 153, 16, 29, 162, 0, 0, 0, 0, 0, 0, 90, 95, 36, 0, 0, 88, 0, 0, 0, 0, 254, 0, 0, 0, 0, 61, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 49, 170, 44, 83, 46, 0}
#define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 214, 223, 141, 33, 15, 3, 100, 24, 239, 238, 30, 240, 183, 130, 130, 118, 148, 21, 0, 243, 124, 0, 0, 0, 20, 0, 152, 143, 0, 0, 127, 106, 147, 211, 198, 0, 0, 0, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 93, 211, 108, 32, 185, 235, 93, 124, 124, 119, 4, 76, 128, 56, 116, 134, 237, 203, 250, 87, 203, 220, 25, 226, 0, 29, 223, 85, 6, 229, 203, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 177, 241, 15, 0, 108, 86, 95, 224, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 249, 182, 0, 0, 0, 0, 0, 0, 0, 153, 16, 29, 162, 0, 0, 0, 0, 0, 0, 90, 95, 36, 0, 0, 88, 0, 0, 0, 0, 254, 0, 0, 0, 0, 165, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 49, 170, 44, 83, 46, 0}
#endif
#ifndef MAVLINK_MESSAGE_INFO
+26 -14
View File
@@ -983,6 +983,7 @@ static void mavlink_test_detection_stats(uint8_t system_id, uint8_t component_id
}18275,
}18379,
}18483,
}18587,
};
mavlink_detection_stats_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
@@ -990,8 +991,9 @@ static void mavlink_test_detection_stats(uint8_t system_id, uint8_t component_id
packet1.best_lat = packet_in.best_lat;
packet1.best_lon = packet_in.best_lon;
packet1.best_detection_id = packet_in.best_detection_id;
packet1.detection_fps = packet_in.detection_fps;
packet1.fps = packet_in.fps;
packet1.detections = packet_in.detections;
packet1.best_alt = packet_in.best_alt;
packet1.images_done = packet_in.images_done;
packet1.images_todo = packet_in.images_todo;
@@ -1003,12 +1005,12 @@ static void mavlink_test_detection_stats(uint8_t system_id, uint8_t component_id
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_detection_stats_pack(system_id, component_id, &msg , packet1.detections , packet1.best_score , packet1.best_lat , packet1.best_lon , packet1.best_detection_id , packet1.images_done , packet1.images_todo , packet1.detection_fps );
mavlink_msg_detection_stats_pack(system_id, component_id, &msg , packet1.detections , packet1.best_score , packet1.best_lat , packet1.best_lon , packet1.best_alt , packet1.best_detection_id , packet1.images_done , packet1.images_todo , packet1.fps );
mavlink_msg_detection_stats_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_detection_stats_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.detections , packet1.best_score , packet1.best_lat , packet1.best_lon , packet1.best_detection_id , packet1.images_done , packet1.images_todo , packet1.detection_fps );
mavlink_msg_detection_stats_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.detections , packet1.best_score , packet1.best_lat , packet1.best_lon , packet1.best_alt , packet1.best_detection_id , packet1.images_done , packet1.images_todo , packet1.fps );
mavlink_msg_detection_stats_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
@@ -1021,7 +1023,7 @@ static void mavlink_test_detection_stats(uint8_t system_id, uint8_t component_id
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_detection_stats_send(MAVLINK_COMM_1 , packet1.detections , packet1.best_score , packet1.best_lat , packet1.best_lon , packet1.best_detection_id , packet1.images_done , packet1.images_todo , packet1.detection_fps );
mavlink_msg_detection_stats_send(MAVLINK_COMM_1 , packet1.detections , packet1.best_score , packet1.best_lat , packet1.best_lon , packet1.best_alt , packet1.best_detection_id , packet1.images_done , packet1.images_todo , packet1.fps );
mavlink_msg_detection_stats_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
@@ -1036,24 +1038,34 @@ static void mavlink_test_onboard_health(uint8_t system_id, uint8_t component_id,
}45.0,
}73.0,
}101.0,
}18067,
}{ 187, 188, 189, 190 },
}199,
}10,
}77,
}129.0,
}157.0,
}185.0,
}213.0,
}18899,
}235,
}46,
}113,
}180,
}247,
};
mavlink_onboard_health_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1));
packet1.uptime = packet_in.uptime;
packet1.disk_usage_gb = packet_in.disk_usage_gb;
packet1.ram_total = packet_in.ram_total;
packet1.swap_total = packet_in.swap_total;
packet1.disk_total = packet_in.disk_total;
packet1.temp = packet_in.temp;
packet1.voltage = packet_in.voltage;
packet1.network_load_in = packet_in.network_load_in;
packet1.network_load_out = packet_in.network_load_out;
packet1.cpu_freq = packet_in.cpu_freq;
packet1.cpu_load = packet_in.cpu_load;
packet1.ram_usage = packet_in.ram_usage;
packet1.swap_usage = packet_in.swap_usage;
packet1.disk_health = packet_in.disk_health;
packet1.disk_usage = packet_in.disk_usage;
mav_array_memcpy(packet1.cpu_load, packet_in.cpu_load, sizeof(uint8_t)*4);
memset(&packet2, 0, sizeof(packet2));
@@ -1062,12 +1074,12 @@ static void mavlink_test_onboard_health(uint8_t system_id, uint8_t component_id,
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_onboard_health_pack(system_id, component_id, &msg , packet1.uptime , packet1.cpu_freq , packet1.cpu_load , packet1.ram_usage , packet1.disk_health , packet1.disk_usage , packet1.disk_usage_gb , packet1.temp , packet1.voltage );
mavlink_msg_onboard_health_pack(system_id, component_id, &msg , packet1.uptime , packet1.cpu_freq , packet1.cpu_load , packet1.ram_usage , packet1.ram_total , packet1.swap_usage , packet1.swap_total , packet1.disk_health , packet1.disk_usage , packet1.disk_total , packet1.temp , packet1.voltage , packet1.network_load_in , packet1.network_load_out );
mavlink_msg_onboard_health_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_onboard_health_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.uptime , packet1.cpu_freq , packet1.cpu_load , packet1.ram_usage , packet1.disk_health , packet1.disk_usage , packet1.disk_usage_gb , packet1.temp , packet1.voltage );
mavlink_msg_onboard_health_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.uptime , packet1.cpu_freq , packet1.cpu_load , packet1.ram_usage , packet1.ram_total , packet1.swap_usage , packet1.swap_total , packet1.disk_health , packet1.disk_usage , packet1.disk_total , packet1.temp , packet1.voltage , packet1.network_load_in , packet1.network_load_out );
mavlink_msg_onboard_health_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
@@ -1080,7 +1092,7 @@ static void mavlink_test_onboard_health(uint8_t system_id, uint8_t component_id,
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2));
mavlink_msg_onboard_health_send(MAVLINK_COMM_1 , packet1.uptime , packet1.cpu_freq , packet1.cpu_load , packet1.ram_usage , packet1.disk_health , packet1.disk_usage , packet1.disk_usage_gb , packet1.temp , packet1.voltage );
mavlink_msg_onboard_health_send(MAVLINK_COMM_1 , packet1.uptime , packet1.cpu_freq , packet1.cpu_load , packet1.ram_usage , packet1.ram_total , packet1.swap_usage , packet1.swap_total , packet1.disk_health , packet1.disk_usage , packet1.disk_total , packet1.temp , packet1.voltage , packet1.network_load_in , packet1.network_load_out );
mavlink_msg_onboard_health_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}
+1 -1
View File
@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Jul 28 11:30:44 2014"
#define MAVLINK_BUILD_DATE "Tue Jul 29 16:35:36 2014"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
+1 -1
View File
@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Jul 28 11:30:51 2014"
#define MAVLINK_BUILD_DATE "Tue Jul 29 16:35:42 2014"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
+1 -1
View File
@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Jul 28 11:30:59 2014"
#define MAVLINK_BUILD_DATE "Tue Jul 29 16:35:49 2014"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
+1 -1
View File
@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Jul 28 11:31:08 2014"
#define MAVLINK_BUILD_DATE "Tue Jul 29 16:35:55 2014"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 179
+1 -1
View File
@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Jul 28 11:31:09 2014"
#define MAVLINK_BUILD_DATE "Tue Jul 29 16:35:56 2014"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255