Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
3d751338
Commit
3d751338
authored
Apr 19, 2012
by
James Goppert
Browse files
Updated to mavlink, need to update qgc project.
parent
0f3ad35d
Changes
414
Expand all
Hide whitespace changes
Inline
Side-by-side
mavlink/VERSION
0 → 100644
View file @
3d751338
1.0.5
mavlink/include/mavlink/config.h
0 → 100644
View file @
3d751338
#define MAVLINK_VERSION "1.0.5"
mavlink/include/mavlink/v0.9/ardupilotmega/ardupilotmega.h
0 → 100644
View file @
3d751338
This diff is collapsed.
Click to expand it.
mavlink/include/mavlink/v0.9/ardupilotmega/mavlink.h
0 → 100644
View file @
3d751338
/** @file
* @brief MAVLink comm protocol built from ardupilotmega.xml
* @see http://pixhawk.ethz.ch/software/mavlink
*/
#ifndef MAVLINK_H
#define MAVLINK_H
#ifndef MAVLINK_STX
#define MAVLINK_STX 85
#endif
#ifndef MAVLINK_ENDIAN
#define MAVLINK_ENDIAN MAVLINK_BIG_ENDIAN
#endif
#ifndef MAVLINK_ALIGNED_FIELDS
#define MAVLINK_ALIGNED_FIELDS 0
#endif
#ifndef MAVLINK_CRC_EXTRA
#define MAVLINK_CRC_EXTRA 0
#endif
#include
"version.h"
#include
"ardupilotmega.h"
#endif // MAVLINK_H
mavlink/include/
v1.0
/ardupilotmega/mavlink_msg_
dcm
.h
→
mavlink/include/
mavlink/v0.9
/ardupilotmega/mavlink_msg_
ahrs
.h
View file @
3d751338
// MESSAGE
DCM
PACKING
// MESSAGE
AHRS
PACKING
#define MAVLINK_MSG_ID_
DCM
163
#define MAVLINK_MSG_ID_
AHRS
163
typedef
struct
__mavlink_
dcm
_t
typedef
struct
__mavlink_
ahrs
_t
{
{
float
omegaIx
;
///< X gyro drift estimate rad/s
float
omegaIx
;
///< X gyro drift estimate rad/s
float
omegaIy
;
///< Y gyro drift estimate rad/s
float
omegaIy
;
///< Y gyro drift estimate rad/s
...
@@ -11,29 +11,29 @@ typedef struct __mavlink_dcm_t
...
@@ -11,29 +11,29 @@ typedef struct __mavlink_dcm_t
float
renorm_val
;
///< average renormalisation value
float
renorm_val
;
///< average renormalisation value
float
error_rp
;
///< average error_roll_pitch value
float
error_rp
;
///< average error_roll_pitch value
float
error_yaw
;
///< average error_yaw value
float
error_yaw
;
///< average error_yaw value
}
mavlink_
dcm
_t
;
}
mavlink_
ahrs
_t
;
#define MAVLINK_MSG_ID_
DCM
_LEN 28
#define MAVLINK_MSG_ID_
AHRS
_LEN 28
#define MAVLINK_MSG_ID_163_LEN 28
#define MAVLINK_MSG_ID_163_LEN 28
#define MAVLINK_MESSAGE_INFO_
DCM
{ \
#define MAVLINK_MESSAGE_INFO_
AHRS
{ \
"
DCM
", \
"
AHRS
", \
7, \
7, \
{ { "omegaIx", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_
dcm
_t, omegaIx) }, \
{ { "omegaIx", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_
ahrs
_t, omegaIx) }, \
{ "omegaIy", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_
dcm
_t, omegaIy) }, \
{ "omegaIy", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_
ahrs
_t, omegaIy) }, \
{ "omegaIz", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_
dcm
_t, omegaIz) }, \
{ "omegaIz", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_
ahrs
_t, omegaIz) }, \
{ "accel_weight", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_
dcm
_t, accel_weight) }, \
{ "accel_weight", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_
ahrs
_t, accel_weight) }, \
{ "renorm_val", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_
dcm
_t, renorm_val) }, \
{ "renorm_val", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_
ahrs
_t, renorm_val) }, \
{ "error_rp", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_
dcm
_t, error_rp) }, \
{ "error_rp", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_
ahrs
_t, error_rp) }, \
{ "error_yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_
dcm
_t, error_yaw) }, \
{ "error_yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_
ahrs
_t, error_yaw) }, \
} \
} \
}
}
/**
/**
* @brief Pack a
dcm
message
* @brief Pack a
ahrs
message
* @param system_id ID of this system
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
* @param msg The MAVLink message to compress the data into
...
@@ -47,7 +47,7 @@ typedef struct __mavlink_dcm_t
...
@@ -47,7 +47,7 @@ typedef struct __mavlink_dcm_t
* @param error_yaw average error_yaw value
* @param error_yaw average error_yaw value
* @return length of the message in bytes (excluding serial stream start sign)
* @return length of the message in bytes (excluding serial stream start sign)
*/
*/
static
inline
uint16_t
mavlink_msg_
dcm
_pack
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
static
inline
uint16_t
mavlink_msg_
ahrs
_pack
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
float
omegaIx
,
float
omegaIy
,
float
omegaIz
,
float
accel_weight
,
float
renorm_val
,
float
error_rp
,
float
error_yaw
)
float
omegaIx
,
float
omegaIy
,
float
omegaIz
,
float
accel_weight
,
float
renorm_val
,
float
error_rp
,
float
error_yaw
)
{
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
...
@@ -62,7 +62,7 @@ static inline uint16_t mavlink_msg_dcm_pack(uint8_t system_id, uint8_t component
...
@@ -62,7 +62,7 @@ static inline uint16_t mavlink_msg_dcm_pack(uint8_t system_id, uint8_t component
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
28
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
28
);
#else
#else
mavlink_
dcm
_t
packet
;
mavlink_
ahrs
_t
packet
;
packet
.
omegaIx
=
omegaIx
;
packet
.
omegaIx
=
omegaIx
;
packet
.
omegaIy
=
omegaIy
;
packet
.
omegaIy
=
omegaIy
;
packet
.
omegaIz
=
omegaIz
;
packet
.
omegaIz
=
omegaIz
;
...
@@ -74,12 +74,12 @@ static inline uint16_t mavlink_msg_dcm_pack(uint8_t system_id, uint8_t component
...
@@ -74,12 +74,12 @@ static inline uint16_t mavlink_msg_dcm_pack(uint8_t system_id, uint8_t component
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
28
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
28
);
#endif
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_
DCM
;
msg
->
msgid
=
MAVLINK_MSG_ID_
AHRS
;
return
mavlink_finalize_message
(
msg
,
system_id
,
component_id
,
28
,
205
);
return
mavlink_finalize_message
(
msg
,
system_id
,
component_id
,
28
);
}
}
/**
/**
* @brief Pack a
dcm
message on a channel
* @brief Pack a
ahrs
message on a channel
* @param system_id ID of this system
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message was sent over
* @param chan The MAVLink channel this message was sent over
...
@@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_dcm_pack(uint8_t system_id, uint8_t component
...
@@ -93,7 +93,7 @@ static inline uint16_t mavlink_msg_dcm_pack(uint8_t system_id, uint8_t component
* @param error_yaw average error_yaw value
* @param error_yaw average error_yaw value
* @return length of the message in bytes (excluding serial stream start sign)
* @return length of the message in bytes (excluding serial stream start sign)
*/
*/
static
inline
uint16_t
mavlink_msg_
dcm
_pack_chan
(
uint8_t
system_id
,
uint8_t
component_id
,
uint8_t
chan
,
static
inline
uint16_t
mavlink_msg_
ahrs
_pack_chan
(
uint8_t
system_id
,
uint8_t
component_id
,
uint8_t
chan
,
mavlink_message_t
*
msg
,
mavlink_message_t
*
msg
,
float
omegaIx
,
float
omegaIy
,
float
omegaIz
,
float
accel_weight
,
float
renorm_val
,
float
error_rp
,
float
error_yaw
)
float
omegaIx
,
float
omegaIy
,
float
omegaIz
,
float
accel_weight
,
float
renorm_val
,
float
error_rp
,
float
error_yaw
)
{
{
...
@@ -109,7 +109,7 @@ static inline uint16_t mavlink_msg_dcm_pack_chan(uint8_t system_id, uint8_t comp
...
@@ -109,7 +109,7 @@ static inline uint16_t mavlink_msg_dcm_pack_chan(uint8_t system_id, uint8_t comp
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
28
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
28
);
#else
#else
mavlink_
dcm
_t
packet
;
mavlink_
ahrs
_t
packet
;
packet
.
omegaIx
=
omegaIx
;
packet
.
omegaIx
=
omegaIx
;
packet
.
omegaIy
=
omegaIy
;
packet
.
omegaIy
=
omegaIy
;
packet
.
omegaIz
=
omegaIz
;
packet
.
omegaIz
=
omegaIz
;
...
@@ -121,25 +121,25 @@ static inline uint16_t mavlink_msg_dcm_pack_chan(uint8_t system_id, uint8_t comp
...
@@ -121,25 +121,25 @@ static inline uint16_t mavlink_msg_dcm_pack_chan(uint8_t system_id, uint8_t comp
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
28
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
28
);
#endif
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_
DCM
;
msg
->
msgid
=
MAVLINK_MSG_ID_
AHRS
;
return
mavlink_finalize_message_chan
(
msg
,
system_id
,
component_id
,
chan
,
28
,
205
);
return
mavlink_finalize_message_chan
(
msg
,
system_id
,
component_id
,
chan
,
28
);
}
}
/**
/**
* @brief Encode a
dcm
struct into a message
* @brief Encode a
ahrs
struct into a message
*
*
* @param system_id ID of this system
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
* @param msg The MAVLink message to compress the data into
* @param
dcm
C-struct to read the message contents from
* @param
ahrs
C-struct to read the message contents from
*/
*/
static
inline
uint16_t
mavlink_msg_
dcm
_encode
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
const
mavlink_
dcm_t
*
dcm
)
static
inline
uint16_t
mavlink_msg_
ahrs
_encode
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
const
mavlink_
ahrs_t
*
ahrs
)
{
{
return
mavlink_msg_
dcm
_pack
(
system_id
,
component_id
,
msg
,
dcm
->
omegaIx
,
dcm
->
omegaIy
,
dcm
->
omegaIz
,
dcm
->
accel_weight
,
dcm
->
renorm_val
,
dcm
->
error_rp
,
dcm
->
error_yaw
);
return
mavlink_msg_
ahrs
_pack
(
system_id
,
component_id
,
msg
,
ahrs
->
omegaIx
,
ahrs
->
omegaIy
,
ahrs
->
omegaIz
,
ahrs
->
accel_weight
,
ahrs
->
renorm_val
,
ahrs
->
error_rp
,
ahrs
->
error_yaw
);
}
}
/**
/**
* @brief Send a
dcm
message
* @brief Send a
ahrs
message
* @param chan MAVLink channel to send the message
* @param chan MAVLink channel to send the message
*
*
* @param omegaIx X gyro drift estimate rad/s
* @param omegaIx X gyro drift estimate rad/s
...
@@ -152,7 +152,7 @@ static inline uint16_t mavlink_msg_dcm_encode(uint8_t system_id, uint8_t compone
...
@@ -152,7 +152,7 @@ static inline uint16_t mavlink_msg_dcm_encode(uint8_t system_id, uint8_t compone
*/
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static
inline
void
mavlink_msg_
dcm
_send
(
mavlink_channel_t
chan
,
float
omegaIx
,
float
omegaIy
,
float
omegaIz
,
float
accel_weight
,
float
renorm_val
,
float
error_rp
,
float
error_yaw
)
static
inline
void
mavlink_msg_
ahrs
_send
(
mavlink_channel_t
chan
,
float
omegaIx
,
float
omegaIy
,
float
omegaIz
,
float
accel_weight
,
float
renorm_val
,
float
error_rp
,
float
error_yaw
)
{
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
28
];
char
buf
[
28
];
...
@@ -164,9 +164,9 @@ static inline void mavlink_msg_dcm_send(mavlink_channel_t chan, float omegaIx, f
...
@@ -164,9 +164,9 @@ static inline void mavlink_msg_dcm_send(mavlink_channel_t chan, float omegaIx, f
_mav_put_float
(
buf
,
20
,
error_rp
);
_mav_put_float
(
buf
,
20
,
error_rp
);
_mav_put_float
(
buf
,
24
,
error_yaw
);
_mav_put_float
(
buf
,
24
,
error_yaw
);
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_
DCM
,
buf
,
28
,
205
);
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_
AHRS
,
buf
,
28
);
#else
#else
mavlink_
dcm
_t
packet
;
mavlink_
ahrs
_t
packet
;
packet
.
omegaIx
=
omegaIx
;
packet
.
omegaIx
=
omegaIx
;
packet
.
omegaIy
=
omegaIy
;
packet
.
omegaIy
=
omegaIy
;
packet
.
omegaIz
=
omegaIz
;
packet
.
omegaIz
=
omegaIz
;
...
@@ -175,102 +175,102 @@ static inline void mavlink_msg_dcm_send(mavlink_channel_t chan, float omegaIx, f
...
@@ -175,102 +175,102 @@ static inline void mavlink_msg_dcm_send(mavlink_channel_t chan, float omegaIx, f
packet
.
error_rp
=
error_rp
;
packet
.
error_rp
=
error_rp
;
packet
.
error_yaw
=
error_yaw
;
packet
.
error_yaw
=
error_yaw
;
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_
DCM
,
(
const
char
*
)
&
packet
,
28
,
205
);
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_
AHRS
,
(
const
char
*
)
&
packet
,
28
);
#endif
#endif
}
}
#endif
#endif
// MESSAGE
DCM
UNPACKING
// MESSAGE
AHRS
UNPACKING
/**
/**
* @brief Get field omegaIx from
dcm
message
* @brief Get field omegaIx from
ahrs
message
*
*
* @return X gyro drift estimate rad/s
* @return X gyro drift estimate rad/s
*/
*/
static
inline
float
mavlink_msg_
dcm
_get_omegaIx
(
const
mavlink_message_t
*
msg
)
static
inline
float
mavlink_msg_
ahrs
_get_omegaIx
(
const
mavlink_message_t
*
msg
)
{
{
return
_MAV_RETURN_float
(
msg
,
0
);
return
_MAV_RETURN_float
(
msg
,
0
);
}
}
/**
/**
* @brief Get field omegaIy from
dcm
message
* @brief Get field omegaIy from
ahrs
message
*
*
* @return Y gyro drift estimate rad/s
* @return Y gyro drift estimate rad/s
*/
*/
static
inline
float
mavlink_msg_
dcm
_get_omegaIy
(
const
mavlink_message_t
*
msg
)
static
inline
float
mavlink_msg_
ahrs
_get_omegaIy
(
const
mavlink_message_t
*
msg
)
{
{
return
_MAV_RETURN_float
(
msg
,
4
);
return
_MAV_RETURN_float
(
msg
,
4
);
}
}
/**
/**
* @brief Get field omegaIz from
dcm
message
* @brief Get field omegaIz from
ahrs
message
*
*
* @return Z gyro drift estimate rad/s
* @return Z gyro drift estimate rad/s
*/
*/
static
inline
float
mavlink_msg_
dcm
_get_omegaIz
(
const
mavlink_message_t
*
msg
)
static
inline
float
mavlink_msg_
ahrs
_get_omegaIz
(
const
mavlink_message_t
*
msg
)
{
{
return
_MAV_RETURN_float
(
msg
,
8
);
return
_MAV_RETURN_float
(
msg
,
8
);
}
}
/**
/**
* @brief Get field accel_weight from
dcm
message
* @brief Get field accel_weight from
ahrs
message
*
*
* @return average accel_weight
* @return average accel_weight
*/
*/
static
inline
float
mavlink_msg_
dcm
_get_accel_weight
(
const
mavlink_message_t
*
msg
)
static
inline
float
mavlink_msg_
ahrs
_get_accel_weight
(
const
mavlink_message_t
*
msg
)
{
{
return
_MAV_RETURN_float
(
msg
,
12
);
return
_MAV_RETURN_float
(
msg
,
12
);
}
}
/**
/**
* @brief Get field renorm_val from
dcm
message
* @brief Get field renorm_val from
ahrs
message
*
*
* @return average renormalisation value
* @return average renormalisation value
*/
*/
static
inline
float
mavlink_msg_
dcm
_get_renorm_val
(
const
mavlink_message_t
*
msg
)
static
inline
float
mavlink_msg_
ahrs
_get_renorm_val
(
const
mavlink_message_t
*
msg
)
{
{
return
_MAV_RETURN_float
(
msg
,
16
);
return
_MAV_RETURN_float
(
msg
,
16
);
}
}
/**
/**
* @brief Get field error_rp from
dcm
message
* @brief Get field error_rp from
ahrs
message
*
*
* @return average error_roll_pitch value
* @return average error_roll_pitch value
*/
*/
static
inline
float
mavlink_msg_
dcm
_get_error_rp
(
const
mavlink_message_t
*
msg
)
static
inline
float
mavlink_msg_
ahrs
_get_error_rp
(
const
mavlink_message_t
*
msg
)
{
{
return
_MAV_RETURN_float
(
msg
,
20
);
return
_MAV_RETURN_float
(
msg
,
20
);
}
}
/**
/**
* @brief Get field error_yaw from
dcm
message
* @brief Get field error_yaw from
ahrs
message
*
*
* @return average error_yaw value
* @return average error_yaw value
*/
*/
static
inline
float
mavlink_msg_
dcm
_get_error_yaw
(
const
mavlink_message_t
*
msg
)
static
inline
float
mavlink_msg_
ahrs
_get_error_yaw
(
const
mavlink_message_t
*
msg
)
{
{
return
_MAV_RETURN_float
(
msg
,
24
);
return
_MAV_RETURN_float
(
msg
,
24
);
}
}
/**
/**
* @brief Decode a
dcm
message into a struct
* @brief Decode a
ahrs
message into a struct
*
*
* @param msg The message to decode
* @param msg The message to decode
* @param
dcm
C-struct to decode the message contents into
* @param
ahrs
C-struct to decode the message contents into
*/
*/
static
inline
void
mavlink_msg_
dcm
_decode
(
const
mavlink_message_t
*
msg
,
mavlink_
dcm_t
*
dcm
)
static
inline
void
mavlink_msg_
ahrs
_decode
(
const
mavlink_message_t
*
msg
,
mavlink_
ahrs_t
*
ahrs
)
{
{
#if MAVLINK_NEED_BYTE_SWAP
#if MAVLINK_NEED_BYTE_SWAP
dcm
->
omegaIx
=
mavlink_msg_
dcm
_get_omegaIx
(
msg
);
ahrs
->
omegaIx
=
mavlink_msg_
ahrs
_get_omegaIx
(
msg
);
dcm
->
omegaIy
=
mavlink_msg_
dcm
_get_omegaIy
(
msg
);
ahrs
->
omegaIy
=
mavlink_msg_
ahrs
_get_omegaIy
(
msg
);
dcm
->
omegaIz
=
mavlink_msg_
dcm
_get_omegaIz
(
msg
);
ahrs
->
omegaIz
=
mavlink_msg_
ahrs
_get_omegaIz
(
msg
);
dcm
->
accel_weight
=
mavlink_msg_
dcm
_get_accel_weight
(
msg
);
ahrs
->
accel_weight
=
mavlink_msg_
ahrs
_get_accel_weight
(
msg
);
dcm
->
renorm_val
=
mavlink_msg_
dcm
_get_renorm_val
(
msg
);
ahrs
->
renorm_val
=
mavlink_msg_
ahrs
_get_renorm_val
(
msg
);
dcm
->
error_rp
=
mavlink_msg_
dcm
_get_error_rp
(
msg
);
ahrs
->
error_rp
=
mavlink_msg_
ahrs
_get_error_rp
(
msg
);
dcm
->
error_yaw
=
mavlink_msg_
dcm
_get_error_yaw
(
msg
);
ahrs
->
error_yaw
=
mavlink_msg_
ahrs
_get_error_yaw
(
msg
);
#else
#else
memcpy
(
dcm
,
_MAV_PAYLOAD
(
msg
),
28
);
memcpy
(
ahrs
,
_MAV_PAYLOAD
(
msg
),
28
);
#endif
#endif
}
}
mavlink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_ap_adc.h
0 → 100644
View file @
3d751338
// MESSAGE AP_ADC PACKING
#define MAVLINK_MSG_ID_AP_ADC 153
typedef
struct
__mavlink_ap_adc_t
{
uint16_t
adc1
;
///< ADC output 1
uint16_t
adc2
;
///< ADC output 2
uint16_t
adc3
;
///< ADC output 3
uint16_t
adc4
;
///< ADC output 4
uint16_t
adc5
;
///< ADC output 5
uint16_t
adc6
;
///< ADC output 6
}
mavlink_ap_adc_t
;
#define MAVLINK_MSG_ID_AP_ADC_LEN 12
#define MAVLINK_MSG_ID_153_LEN 12
#define MAVLINK_MESSAGE_INFO_AP_ADC { \
"AP_ADC", \
6, \
{ { "adc1", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_ap_adc_t, adc1) }, \
{ "adc2", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_ap_adc_t, adc2) }, \
{ "adc3", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_ap_adc_t, adc3) }, \
{ "adc4", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_ap_adc_t, adc4) }, \
{ "adc5", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_ap_adc_t, adc5) }, \
{ "adc6", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_ap_adc_t, adc6) }, \
} \
}
/**
* @brief Pack a ap_adc 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 adc1 ADC output 1
* @param adc2 ADC output 2
* @param adc3 ADC output 3
* @param adc4 ADC output 4
* @param adc5 ADC output 5
* @param adc6 ADC output 6
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_ap_adc_pack
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
uint16_t
adc1
,
uint16_t
adc2
,
uint16_t
adc3
,
uint16_t
adc4
,
uint16_t
adc5
,
uint16_t
adc6
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
12
];
_mav_put_uint16_t
(
buf
,
0
,
adc1
);
_mav_put_uint16_t
(
buf
,
2
,
adc2
);
_mav_put_uint16_t
(
buf
,
4
,
adc3
);
_mav_put_uint16_t
(
buf
,
6
,
adc4
);
_mav_put_uint16_t
(
buf
,
8
,
adc5
);
_mav_put_uint16_t
(
buf
,
10
,
adc6
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
12
);
#else
mavlink_ap_adc_t
packet
;
packet
.
adc1
=
adc1
;
packet
.
adc2
=
adc2
;
packet
.
adc3
=
adc3
;
packet
.
adc4
=
adc4
;
packet
.
adc5
=
adc5
;
packet
.
adc6
=
adc6
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
12
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_AP_ADC
;
return
mavlink_finalize_message
(
msg
,
system_id
,
component_id
,
12
);
}
/**
* @brief Pack a ap_adc 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param adc1 ADC output 1
* @param adc2 ADC output 2
* @param adc3 ADC output 3
* @param adc4 ADC output 4
* @param adc5 ADC output 5
* @param adc6 ADC output 6
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_ap_adc_pack_chan
(
uint8_t
system_id
,
uint8_t
component_id
,
uint8_t
chan
,
mavlink_message_t
*
msg
,
uint16_t
adc1
,
uint16_t
adc2
,
uint16_t
adc3
,
uint16_t
adc4
,
uint16_t
adc5
,
uint16_t
adc6
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
12
];
_mav_put_uint16_t
(
buf
,
0
,
adc1
);
_mav_put_uint16_t
(
buf
,
2
,
adc2
);
_mav_put_uint16_t
(
buf
,
4
,
adc3
);
_mav_put_uint16_t
(
buf
,
6
,
adc4
);
_mav_put_uint16_t
(
buf
,
8
,
adc5
);
_mav_put_uint16_t
(
buf
,
10
,
adc6
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
12
);
#else
mavlink_ap_adc_t
packet
;
packet
.
adc1
=
adc1
;
packet
.
adc2
=
adc2
;
packet
.
adc3
=
adc3
;
packet
.
adc4
=
adc4
;
packet
.
adc5
=
adc5
;
packet
.
adc6
=
adc6
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
12
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_AP_ADC
;
return
mavlink_finalize_message_chan
(
msg
,
system_id
,
component_id
,
chan
,
12
);
}
/**
* @brief Encode a ap_adc struct into a 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 ap_adc C-struct to read the message contents from
*/
static
inline
uint16_t
mavlink_msg_ap_adc_encode
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
const
mavlink_ap_adc_t
*
ap_adc
)
{
return
mavlink_msg_ap_adc_pack
(
system_id
,
component_id
,
msg
,
ap_adc
->
adc1
,
ap_adc
->
adc2
,
ap_adc
->
adc3
,
ap_adc
->
adc4
,
ap_adc
->
adc5
,
ap_adc
->
adc6
);
}
/**
* @brief Send a ap_adc message
* @param chan MAVLink channel to send the message
*
* @param adc1 ADC output 1
* @param adc2 ADC output 2
* @param adc3 ADC output 3
* @param adc4 ADC output 4
* @param adc5 ADC output 5
* @param adc6 ADC output 6
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static
inline
void
mavlink_msg_ap_adc_send
(
mavlink_channel_t
chan
,
uint16_t
adc1
,
uint16_t
adc2
,
uint16_t
adc3
,
uint16_t
adc4
,
uint16_t
adc5
,
uint16_t
adc6
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
12
];
_mav_put_uint16_t
(
buf
,
0
,
adc1
);
_mav_put_uint16_t
(
buf
,
2
,
adc2
);
_mav_put_uint16_t
(
buf
,
4
,
adc3
);
_mav_put_uint16_t
(
buf
,
6
,
adc4
);
_mav_put_uint16_t
(
buf
,
8
,
adc5
);
_mav_put_uint16_t
(
buf
,
10
,
adc6
);
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_AP_ADC
,
buf
,
12
);
#else
mavlink_ap_adc_t
packet
;
packet
.
adc1
=
adc1
;
packet
.
adc2
=
adc2
;
packet
.
adc3
=
adc3
;
packet
.
adc4
=
adc4
;
packet
.
adc5
=
adc5
;
packet
.
adc6
=
adc6
;
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_AP_ADC
,
(
const
char
*
)
&
packet
,
12
);
#endif
}
#endif
// MESSAGE AP_ADC UNPACKING
/**
* @brief Get field adc1 from ap_adc message
*
* @return ADC output 1
*/
static
inline
uint16_t
mavlink_msg_ap_adc_get_adc1
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint16_t
(
msg
,
0
);
}
/**
* @brief Get field adc2 from ap_adc message
*
* @return ADC output 2
*/
static
inline
uint16_t
mavlink_msg_ap_adc_get_adc2
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint16_t
(
msg
,
2
);
}
/**
* @brief Get field adc3 from ap_adc message
*
* @return ADC output 3
*/
static
inline
uint16_t
mavlink_msg_ap_adc_get_adc3
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint16_t
(
msg
,
4
);
}
/**
* @brief Get field adc4 from ap_adc message
*
* @return ADC output 4
*/
static
inline
uint16_t
mavlink_msg_ap_adc_get_adc4
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint16_t
(
msg
,
6
);
}
/**
* @brief Get field adc5 from ap_adc message
*
* @return ADC output 5
*/
static
inline
uint16_t
mavlink_msg_ap_adc_get_adc5
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint16_t
(
msg
,
8
);
}
/**
* @brief Get field adc6 from ap_adc message
*
* @return ADC output 6
*/
static
inline
uint16_t
mavlink_msg_ap_adc_get_adc6
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint16_t
(
msg
,
10
);
}
/**
* @brief Decode a ap_adc message into a struct
*
* @param msg The message to decode
* @param ap_adc C-struct to decode the message contents into
*/
static
inline
void
mavlink_msg_ap_adc_decode
(
const
mavlink_message_t
*
msg
,
mavlink_ap_adc_t
*
ap_adc
)
{
#if MAVLINK_NEED_BYTE_SWAP
ap_adc
->
adc1
=
mavlink_msg_ap_adc_get_adc1
(
msg
);
ap_adc
->
adc2
=
mavlink_msg_ap_adc_get_adc2
(
msg
);
ap_adc
->
adc3
=
mavlink_msg_ap_adc_get_adc3
(
msg
);
ap_adc
->
adc4
=
mavlink_msg_ap_adc_get_adc4
(
msg
);
ap_adc
->
adc5
=
mavlink_msg_ap_adc_get_adc5
(
msg
);
ap_adc
->
adc6
=
mavlink_msg_ap_adc_get_adc6
(
msg
);
#else
memcpy
(
ap_adc
,
_MAV_PAYLOAD
(
msg
),
12
);
#endif
}
mavlink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_digicam_configure.h
0 → 100644
View file @
3d751338
// MESSAGE DIGICAM_CONFIGURE PACKING
#define MAVLINK_MSG_ID_DIGICAM_CONFIGURE 154
typedef
struct
__mavlink_digicam_configure_t
{
uint8_t
target_system
;
///< System ID
uint8_t
target_component
;
///< Component ID
uint8_t
mode
;
///< Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore)
uint16_t
shutter_speed
;
///< Divisor number //e.g. 1000 means 1/1000 (0 means ignore)
uint8_t
aperture
;
///< F stop number x 10 //e.g. 28 means 2.8 (0 means ignore)
uint8_t
iso
;
///< ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore)
uint8_t
exposure_type
;
///< Exposure type enumeration from 1 to N (0 means ignore)
uint8_t
command_id
;
///< Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once
uint8_t
engine_cut_off
;
///< Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off)
uint8_t
extra_param
;
///< Extra parameters enumeration (0 means ignore)
float
extra_value
;
///< Correspondent value to given extra_param
}
mavlink_digicam_configure_t
;
#define MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN 15
#define MAVLINK_MSG_ID_154_LEN 15
#define MAVLINK_MESSAGE_INFO_DIGICAM_CONFIGURE { \
"DIGICAM_CONFIGURE", \
11, \
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_digicam_configure_t, target_system) }, \
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_digicam_configure_t, target_component) }, \
{ "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_digicam_configure_t, mode) }, \
{ "shutter_speed", NULL, MAVLINK_TYPE_UINT16_T, 0, 3, offsetof(mavlink_digicam_configure_t, shutter_speed) }, \
{ "aperture", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_digicam_configure_t, aperture) }, \
{ "iso", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_digicam_configure_t, iso) }, \
{ "exposure_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_digicam_configure_t, exposure_type) }, \
{ "command_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_digicam_configure_t, command_id) }, \
{ "engine_cut_off", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_digicam_configure_t, engine_cut_off) }, \
{ "extra_param", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_digicam_configure_t, extra_param) }, \
{ "extra_value", NULL, MAVLINK_TYPE_FLOAT, 0, 11, offsetof(mavlink_digicam_configure_t, extra_value) }, \
} \
}
/**
* @brief Pack a digicam_configure 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 target_system System ID
* @param target_component Component ID
* @param mode Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore)
* @param shutter_speed Divisor number //e.g. 1000 means 1/1000 (0 means ignore)
* @param aperture F stop number x 10 //e.g. 28 means 2.8 (0 means ignore)
* @param iso ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore)
* @param exposure_type Exposure type enumeration from 1 to N (0 means ignore)
* @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once
* @param engine_cut_off Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off)
* @param extra_param Extra parameters enumeration (0 means ignore)
* @param extra_value Correspondent value to given extra_param
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_digicam_configure_pack
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
uint8_t
target_system
,
uint8_t
target_component
,
uint8_t
mode
,
uint16_t
shutter_speed
,
uint8_t
aperture
,
uint8_t
iso
,
uint8_t
exposure_type
,
uint8_t
command_id
,
uint8_t
engine_cut_off
,
uint8_t
extra_param
,
float
extra_value
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
15
];
_mav_put_uint8_t
(
buf
,
0
,
target_system
);
_mav_put_uint8_t
(
buf
,
1
,
target_component
);
_mav_put_uint8_t
(
buf
,
2
,
mode
);
_mav_put_uint16_t
(
buf
,
3
,
shutter_speed
);
_mav_put_uint8_t
(
buf
,
5
,
aperture
);
_mav_put_uint8_t
(
buf
,
6
,
iso
);
_mav_put_uint8_t
(
buf
,
7
,
exposure_type
);
_mav_put_uint8_t
(
buf
,
8
,
command_id
);
_mav_put_uint8_t
(
buf
,
9
,
engine_cut_off
);
_mav_put_uint8_t
(
buf
,
10
,
extra_param
);
_mav_put_float
(
buf
,
11
,
extra_value
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
15
);
#else
mavlink_digicam_configure_t
packet
;
packet
.
target_system
=
target_system
;
packet
.
target_component
=
target_component
;
packet
.
mode
=
mode
;
packet
.
shutter_speed
=
shutter_speed
;
packet
.
aperture
=
aperture
;
packet
.
iso
=
iso
;
packet
.
exposure_type
=
exposure_type
;
packet
.
command_id
=
command_id
;
packet
.
engine_cut_off
=
engine_cut_off
;
packet
.
extra_param
=
extra_param
;
packet
.
extra_value
=
extra_value
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
15
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_DIGICAM_CONFIGURE
;
return
mavlink_finalize_message
(
msg
,
system_id
,
component_id
,
15
);
}
/**
* @brief Pack a digicam_configure 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param target_system System ID
* @param target_component Component ID
* @param mode Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore)
* @param shutter_speed Divisor number //e.g. 1000 means 1/1000 (0 means ignore)
* @param aperture F stop number x 10 //e.g. 28 means 2.8 (0 means ignore)
* @param iso ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore)
* @param exposure_type Exposure type enumeration from 1 to N (0 means ignore)
* @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once
* @param engine_cut_off Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off)
* @param extra_param Extra parameters enumeration (0 means ignore)
* @param extra_value Correspondent value to given extra_param
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_digicam_configure_pack_chan
(
uint8_t
system_id
,
uint8_t
component_id
,
uint8_t
chan
,
mavlink_message_t
*
msg
,
uint8_t
target_system
,
uint8_t
target_component
,
uint8_t
mode
,
uint16_t
shutter_speed
,
uint8_t
aperture
,
uint8_t
iso
,
uint8_t
exposure_type
,
uint8_t
command_id
,
uint8_t
engine_cut_off
,
uint8_t
extra_param
,
float
extra_value
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
15
];
_mav_put_uint8_t
(
buf
,
0
,
target_system
);
_mav_put_uint8_t
(
buf
,
1
,
target_component
);
_mav_put_uint8_t
(
buf
,
2
,
mode
);
_mav_put_uint16_t
(
buf
,
3
,
shutter_speed
);
_mav_put_uint8_t
(
buf
,
5
,
aperture
);
_mav_put_uint8_t
(
buf
,
6
,
iso
);
_mav_put_uint8_t
(
buf
,
7
,
exposure_type
);
_mav_put_uint8_t
(
buf
,
8
,
command_id
);
_mav_put_uint8_t
(
buf
,
9
,
engine_cut_off
);
_mav_put_uint8_t
(
buf
,
10
,
extra_param
);
_mav_put_float
(
buf
,
11
,
extra_value
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
15
);
#else
mavlink_digicam_configure_t
packet
;
packet
.
target_system
=
target_system
;
packet
.
target_component
=
target_component
;
packet
.
mode
=
mode
;
packet
.
shutter_speed
=
shutter_speed
;
packet
.
aperture
=
aperture
;
packet
.
iso
=
iso
;
packet
.
exposure_type
=
exposure_type
;
packet
.
command_id
=
command_id
;
packet
.
engine_cut_off
=
engine_cut_off
;
packet
.
extra_param
=
extra_param
;
packet
.
extra_value
=
extra_value
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
15
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_DIGICAM_CONFIGURE
;
return
mavlink_finalize_message_chan
(
msg
,
system_id
,
component_id
,
chan
,
15
);
}
/**
* @brief Encode a digicam_configure struct into a 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 digicam_configure C-struct to read the message contents from
*/
static
inline
uint16_t
mavlink_msg_digicam_configure_encode
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
const
mavlink_digicam_configure_t
*
digicam_configure
)
{
return
mavlink_msg_digicam_configure_pack
(
system_id
,
component_id
,
msg
,
digicam_configure
->
target_system
,
digicam_configure
->
target_component
,
digicam_configure
->
mode
,
digicam_configure
->
shutter_speed
,
digicam_configure
->
aperture
,
digicam_configure
->
iso
,
digicam_configure
->
exposure_type
,
digicam_configure
->
command_id
,
digicam_configure
->
engine_cut_off
,
digicam_configure
->
extra_param
,
digicam_configure
->
extra_value
);
}
/**
* @brief Send a digicam_configure message
* @param chan MAVLink channel to send the message
*
* @param target_system System ID
* @param target_component Component ID
* @param mode Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore)
* @param shutter_speed Divisor number //e.g. 1000 means 1/1000 (0 means ignore)
* @param aperture F stop number x 10 //e.g. 28 means 2.8 (0 means ignore)
* @param iso ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore)
* @param exposure_type Exposure type enumeration from 1 to N (0 means ignore)
* @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once
* @param engine_cut_off Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off)
* @param extra_param Extra parameters enumeration (0 means ignore)
* @param extra_value Correspondent value to given extra_param
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static
inline
void
mavlink_msg_digicam_configure_send
(
mavlink_channel_t
chan
,
uint8_t
target_system
,
uint8_t
target_component
,
uint8_t
mode
,
uint16_t
shutter_speed
,
uint8_t
aperture
,
uint8_t
iso
,
uint8_t
exposure_type
,
uint8_t
command_id
,
uint8_t
engine_cut_off
,
uint8_t
extra_param
,
float
extra_value
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
15
];
_mav_put_uint8_t
(
buf
,
0
,
target_system
);
_mav_put_uint8_t
(
buf
,
1
,
target_component
);
_mav_put_uint8_t
(
buf
,
2
,
mode
);
_mav_put_uint16_t
(
buf
,
3
,
shutter_speed
);
_mav_put_uint8_t
(
buf
,
5
,
aperture
);
_mav_put_uint8_t
(
buf
,
6
,
iso
);
_mav_put_uint8_t
(
buf
,
7
,
exposure_type
);
_mav_put_uint8_t
(
buf
,
8
,
command_id
);
_mav_put_uint8_t
(
buf
,
9
,
engine_cut_off
);
_mav_put_uint8_t
(
buf
,
10
,
extra_param
);
_mav_put_float
(
buf
,
11
,
extra_value
);
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_DIGICAM_CONFIGURE
,
buf
,
15
);
#else
mavlink_digicam_configure_t
packet
;
packet
.
target_system
=
target_system
;
packet
.
target_component
=
target_component
;
packet
.
mode
=
mode
;
packet
.
shutter_speed
=
shutter_speed
;
packet
.
aperture
=
aperture
;
packet
.
iso
=
iso
;
packet
.
exposure_type
=
exposure_type
;
packet
.
command_id
=
command_id
;
packet
.
engine_cut_off
=
engine_cut_off
;
packet
.
extra_param
=
extra_param
;
packet
.
extra_value
=
extra_value
;
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_DIGICAM_CONFIGURE
,
(
const
char
*
)
&
packet
,
15
);
#endif
}
#endif
// MESSAGE DIGICAM_CONFIGURE UNPACKING
/**
* @brief Get field target_system from digicam_configure message
*
* @return System ID
*/
static
inline
uint8_t
mavlink_msg_digicam_configure_get_target_system
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
0
);
}
/**
* @brief Get field target_component from digicam_configure message
*
* @return Component ID
*/
static
inline
uint8_t
mavlink_msg_digicam_configure_get_target_component
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
1
);
}
/**
* @brief Get field mode from digicam_configure message
*
* @return Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore)
*/
static
inline
uint8_t
mavlink_msg_digicam_configure_get_mode
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
2
);
}
/**
* @brief Get field shutter_speed from digicam_configure message
*
* @return Divisor number //e.g. 1000 means 1/1000 (0 means ignore)
*/
static
inline
uint16_t
mavlink_msg_digicam_configure_get_shutter_speed
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint16_t
(
msg
,
3
);
}
/**
* @brief Get field aperture from digicam_configure message
*
* @return F stop number x 10 //e.g. 28 means 2.8 (0 means ignore)
*/
static
inline
uint8_t
mavlink_msg_digicam_configure_get_aperture
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
5
);
}
/**
* @brief Get field iso from digicam_configure message
*
* @return ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore)
*/
static
inline
uint8_t
mavlink_msg_digicam_configure_get_iso
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
6
);
}
/**
* @brief Get field exposure_type from digicam_configure message
*
* @return Exposure type enumeration from 1 to N (0 means ignore)
*/
static
inline
uint8_t
mavlink_msg_digicam_configure_get_exposure_type
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
7
);
}
/**
* @brief Get field command_id from digicam_configure message
*
* @return Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once
*/
static
inline
uint8_t
mavlink_msg_digicam_configure_get_command_id
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
8
);
}
/**
* @brief Get field engine_cut_off from digicam_configure message
*
* @return Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off)
*/
static
inline
uint8_t
mavlink_msg_digicam_configure_get_engine_cut_off
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
9
);
}
/**
* @brief Get field extra_param from digicam_configure message
*
* @return Extra parameters enumeration (0 means ignore)
*/
static
inline
uint8_t
mavlink_msg_digicam_configure_get_extra_param
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
10
);
}
/**
* @brief Get field extra_value from digicam_configure message
*
* @return Correspondent value to given extra_param
*/
static
inline
float
mavlink_msg_digicam_configure_get_extra_value
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_float
(
msg
,
11
);
}
/**
* @brief Decode a digicam_configure message into a struct
*
* @param msg The message to decode
* @param digicam_configure C-struct to decode the message contents into
*/
static
inline
void
mavlink_msg_digicam_configure_decode
(
const
mavlink_message_t
*
msg
,
mavlink_digicam_configure_t
*
digicam_configure
)
{
#if MAVLINK_NEED_BYTE_SWAP
digicam_configure
->
target_system
=
mavlink_msg_digicam_configure_get_target_system
(
msg
);
digicam_configure
->
target_component
=
mavlink_msg_digicam_configure_get_target_component
(
msg
);
digicam_configure
->
mode
=
mavlink_msg_digicam_configure_get_mode
(
msg
);
digicam_configure
->
shutter_speed
=
mavlink_msg_digicam_configure_get_shutter_speed
(
msg
);
digicam_configure
->
aperture
=
mavlink_msg_digicam_configure_get_aperture
(
msg
);
digicam_configure
->
iso
=
mavlink_msg_digicam_configure_get_iso
(
msg
);
digicam_configure
->
exposure_type
=
mavlink_msg_digicam_configure_get_exposure_type
(
msg
);
digicam_configure
->
command_id
=
mavlink_msg_digicam_configure_get_command_id
(
msg
);
digicam_configure
->
engine_cut_off
=
mavlink_msg_digicam_configure_get_engine_cut_off
(
msg
);
digicam_configure
->
extra_param
=
mavlink_msg_digicam_configure_get_extra_param
(
msg
);
digicam_configure
->
extra_value
=
mavlink_msg_digicam_configure_get_extra_value
(
msg
);
#else
memcpy
(
digicam_configure
,
_MAV_PAYLOAD
(
msg
),
15
);
#endif
}
mavlink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_digicam_control.h
0 → 100644
View file @
3d751338
// MESSAGE DIGICAM_CONTROL PACKING
#define MAVLINK_MSG_ID_DIGICAM_CONTROL 155
typedef
struct
__mavlink_digicam_control_t
{
uint8_t
target_system
;
///< System ID
uint8_t
target_component
;
///< Component ID
uint8_t
session
;
///< 0: stop, 1: start or keep it up //Session control e.g. show/hide lens
uint8_t
zoom_pos
;
///< 1 to N //Zoom's absolute position (0 means ignore)
int8_t
zoom_step
;
///< -100 to 100 //Zooming step value to offset zoom from the current position
uint8_t
focus_lock
;
///< 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus
uint8_t
shot
;
///< 0: ignore, 1: shot or start filming
uint8_t
command_id
;
///< Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once
uint8_t
extra_param
;
///< Extra parameters enumeration (0 means ignore)
float
extra_value
;
///< Correspondent value to given extra_param
}
mavlink_digicam_control_t
;
#define MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN 13
#define MAVLINK_MSG_ID_155_LEN 13
#define MAVLINK_MESSAGE_INFO_DIGICAM_CONTROL { \
"DIGICAM_CONTROL", \
10, \
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_digicam_control_t, target_system) }, \
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_digicam_control_t, target_component) }, \
{ "session", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_digicam_control_t, session) }, \
{ "zoom_pos", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_digicam_control_t, zoom_pos) }, \
{ "zoom_step", NULL, MAVLINK_TYPE_INT8_T, 0, 4, offsetof(mavlink_digicam_control_t, zoom_step) }, \
{ "focus_lock", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_digicam_control_t, focus_lock) }, \
{ "shot", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_digicam_control_t, shot) }, \
{ "command_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_digicam_control_t, command_id) }, \
{ "extra_param", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_digicam_control_t, extra_param) }, \
{ "extra_value", NULL, MAVLINK_TYPE_FLOAT, 0, 9, offsetof(mavlink_digicam_control_t, extra_value) }, \
} \
}
/**
* @brief Pack a digicam_control 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 target_system System ID
* @param target_component Component ID
* @param session 0: stop, 1: start or keep it up //Session control e.g. show/hide lens
* @param zoom_pos 1 to N //Zoom's absolute position (0 means ignore)
* @param zoom_step -100 to 100 //Zooming step value to offset zoom from the current position
* @param focus_lock 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus
* @param shot 0: ignore, 1: shot or start filming
* @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once
* @param extra_param Extra parameters enumeration (0 means ignore)
* @param extra_value Correspondent value to given extra_param
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_digicam_control_pack
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
uint8_t
target_system
,
uint8_t
target_component
,
uint8_t
session
,
uint8_t
zoom_pos
,
int8_t
zoom_step
,
uint8_t
focus_lock
,
uint8_t
shot
,
uint8_t
command_id
,
uint8_t
extra_param
,
float
extra_value
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
13
];
_mav_put_uint8_t
(
buf
,
0
,
target_system
);
_mav_put_uint8_t
(
buf
,
1
,
target_component
);
_mav_put_uint8_t
(
buf
,
2
,
session
);
_mav_put_uint8_t
(
buf
,
3
,
zoom_pos
);
_mav_put_int8_t
(
buf
,
4
,
zoom_step
);
_mav_put_uint8_t
(
buf
,
5
,
focus_lock
);
_mav_put_uint8_t
(
buf
,
6
,
shot
);
_mav_put_uint8_t
(
buf
,
7
,
command_id
);
_mav_put_uint8_t
(
buf
,
8
,
extra_param
);
_mav_put_float
(
buf
,
9
,
extra_value
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
13
);
#else
mavlink_digicam_control_t
packet
;
packet
.
target_system
=
target_system
;
packet
.
target_component
=
target_component
;
packet
.
session
=
session
;
packet
.
zoom_pos
=
zoom_pos
;
packet
.
zoom_step
=
zoom_step
;
packet
.
focus_lock
=
focus_lock
;
packet
.
shot
=
shot
;
packet
.
command_id
=
command_id
;
packet
.
extra_param
=
extra_param
;
packet
.
extra_value
=
extra_value
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
13
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_DIGICAM_CONTROL
;
return
mavlink_finalize_message
(
msg
,
system_id
,
component_id
,
13
);
}
/**
* @brief Pack a digicam_control 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param target_system System ID
* @param target_component Component ID
* @param session 0: stop, 1: start or keep it up //Session control e.g. show/hide lens
* @param zoom_pos 1 to N //Zoom's absolute position (0 means ignore)
* @param zoom_step -100 to 100 //Zooming step value to offset zoom from the current position
* @param focus_lock 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus
* @param shot 0: ignore, 1: shot or start filming
* @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once
* @param extra_param Extra parameters enumeration (0 means ignore)
* @param extra_value Correspondent value to given extra_param
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_digicam_control_pack_chan
(
uint8_t
system_id
,
uint8_t
component_id
,
uint8_t
chan
,
mavlink_message_t
*
msg
,
uint8_t
target_system
,
uint8_t
target_component
,
uint8_t
session
,
uint8_t
zoom_pos
,
int8_t
zoom_step
,
uint8_t
focus_lock
,
uint8_t
shot
,
uint8_t
command_id
,
uint8_t
extra_param
,
float
extra_value
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
13
];
_mav_put_uint8_t
(
buf
,
0
,
target_system
);
_mav_put_uint8_t
(
buf
,
1
,
target_component
);
_mav_put_uint8_t
(
buf
,
2
,
session
);
_mav_put_uint8_t
(
buf
,
3
,
zoom_pos
);
_mav_put_int8_t
(
buf
,
4
,
zoom_step
);
_mav_put_uint8_t
(
buf
,
5
,
focus_lock
);
_mav_put_uint8_t
(
buf
,
6
,
shot
);
_mav_put_uint8_t
(
buf
,
7
,
command_id
);
_mav_put_uint8_t
(
buf
,
8
,
extra_param
);
_mav_put_float
(
buf
,
9
,
extra_value
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
13
);
#else
mavlink_digicam_control_t
packet
;
packet
.
target_system
=
target_system
;
packet
.
target_component
=
target_component
;
packet
.
session
=
session
;
packet
.
zoom_pos
=
zoom_pos
;
packet
.
zoom_step
=
zoom_step
;
packet
.
focus_lock
=
focus_lock
;
packet
.
shot
=
shot
;
packet
.
command_id
=
command_id
;
packet
.
extra_param
=
extra_param
;
packet
.
extra_value
=
extra_value
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
13
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_DIGICAM_CONTROL
;
return
mavlink_finalize_message_chan
(
msg
,
system_id
,
component_id
,
chan
,
13
);
}
/**
* @brief Encode a digicam_control struct into a 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 digicam_control C-struct to read the message contents from
*/
static
inline
uint16_t
mavlink_msg_digicam_control_encode
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
const
mavlink_digicam_control_t
*
digicam_control
)
{
return
mavlink_msg_digicam_control_pack
(
system_id
,
component_id
,
msg
,
digicam_control
->
target_system
,
digicam_control
->
target_component
,
digicam_control
->
session
,
digicam_control
->
zoom_pos
,
digicam_control
->
zoom_step
,
digicam_control
->
focus_lock
,
digicam_control
->
shot
,
digicam_control
->
command_id
,
digicam_control
->
extra_param
,
digicam_control
->
extra_value
);
}
/**
* @brief Send a digicam_control message
* @param chan MAVLink channel to send the message
*
* @param target_system System ID
* @param target_component Component ID
* @param session 0: stop, 1: start or keep it up //Session control e.g. show/hide lens
* @param zoom_pos 1 to N //Zoom's absolute position (0 means ignore)
* @param zoom_step -100 to 100 //Zooming step value to offset zoom from the current position
* @param focus_lock 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus
* @param shot 0: ignore, 1: shot or start filming
* @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once
* @param extra_param Extra parameters enumeration (0 means ignore)
* @param extra_value Correspondent value to given extra_param
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static
inline
void
mavlink_msg_digicam_control_send
(
mavlink_channel_t
chan
,
uint8_t
target_system
,
uint8_t
target_component
,
uint8_t
session
,
uint8_t
zoom_pos
,
int8_t
zoom_step
,
uint8_t
focus_lock
,
uint8_t
shot
,
uint8_t
command_id
,
uint8_t
extra_param
,
float
extra_value
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
13
];
_mav_put_uint8_t
(
buf
,
0
,
target_system
);
_mav_put_uint8_t
(
buf
,
1
,
target_component
);
_mav_put_uint8_t
(
buf
,
2
,
session
);
_mav_put_uint8_t
(
buf
,
3
,
zoom_pos
);
_mav_put_int8_t
(
buf
,
4
,
zoom_step
);
_mav_put_uint8_t
(
buf
,
5
,
focus_lock
);
_mav_put_uint8_t
(
buf
,
6
,
shot
);
_mav_put_uint8_t
(
buf
,
7
,
command_id
);
_mav_put_uint8_t
(
buf
,
8
,
extra_param
);
_mav_put_float
(
buf
,
9
,
extra_value
);
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_DIGICAM_CONTROL
,
buf
,
13
);
#else
mavlink_digicam_control_t
packet
;
packet
.
target_system
=
target_system
;
packet
.
target_component
=
target_component
;
packet
.
session
=
session
;
packet
.
zoom_pos
=
zoom_pos
;
packet
.
zoom_step
=
zoom_step
;
packet
.
focus_lock
=
focus_lock
;
packet
.
shot
=
shot
;
packet
.
command_id
=
command_id
;
packet
.
extra_param
=
extra_param
;
packet
.
extra_value
=
extra_value
;
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_DIGICAM_CONTROL
,
(
const
char
*
)
&
packet
,
13
);
#endif
}
#endif
// MESSAGE DIGICAM_CONTROL UNPACKING
/**
* @brief Get field target_system from digicam_control message
*
* @return System ID
*/
static
inline
uint8_t
mavlink_msg_digicam_control_get_target_system
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
0
);
}
/**
* @brief Get field target_component from digicam_control message
*
* @return Component ID
*/
static
inline
uint8_t
mavlink_msg_digicam_control_get_target_component
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
1
);
}
/**
* @brief Get field session from digicam_control message
*
* @return 0: stop, 1: start or keep it up //Session control e.g. show/hide lens
*/
static
inline
uint8_t
mavlink_msg_digicam_control_get_session
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
2
);
}
/**
* @brief Get field zoom_pos from digicam_control message
*
* @return 1 to N //Zoom's absolute position (0 means ignore)
*/
static
inline
uint8_t
mavlink_msg_digicam_control_get_zoom_pos
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
3
);
}
/**
* @brief Get field zoom_step from digicam_control message
*
* @return -100 to 100 //Zooming step value to offset zoom from the current position
*/
static
inline
int8_t
mavlink_msg_digicam_control_get_zoom_step
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_int8_t
(
msg
,
4
);
}
/**
* @brief Get field focus_lock from digicam_control message
*
* @return 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus
*/
static
inline
uint8_t
mavlink_msg_digicam_control_get_focus_lock
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
5
);
}
/**
* @brief Get field shot from digicam_control message
*
* @return 0: ignore, 1: shot or start filming
*/
static
inline
uint8_t
mavlink_msg_digicam_control_get_shot
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
6
);
}
/**
* @brief Get field command_id from digicam_control message
*
* @return Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once
*/
static
inline
uint8_t
mavlink_msg_digicam_control_get_command_id
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
7
);
}
/**
* @brief Get field extra_param from digicam_control message
*
* @return Extra parameters enumeration (0 means ignore)
*/
static
inline
uint8_t
mavlink_msg_digicam_control_get_extra_param
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
8
);
}
/**
* @brief Get field extra_value from digicam_control message
*
* @return Correspondent value to given extra_param
*/
static
inline
float
mavlink_msg_digicam_control_get_extra_value
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_float
(
msg
,
9
);
}
/**
* @brief Decode a digicam_control message into a struct
*
* @param msg The message to decode
* @param digicam_control C-struct to decode the message contents into
*/
static
inline
void
mavlink_msg_digicam_control_decode
(
const
mavlink_message_t
*
msg
,
mavlink_digicam_control_t
*
digicam_control
)
{
#if MAVLINK_NEED_BYTE_SWAP
digicam_control
->
target_system
=
mavlink_msg_digicam_control_get_target_system
(
msg
);
digicam_control
->
target_component
=
mavlink_msg_digicam_control_get_target_component
(
msg
);
digicam_control
->
session
=
mavlink_msg_digicam_control_get_session
(
msg
);
digicam_control
->
zoom_pos
=
mavlink_msg_digicam_control_get_zoom_pos
(
msg
);
digicam_control
->
zoom_step
=
mavlink_msg_digicam_control_get_zoom_step
(
msg
);
digicam_control
->
focus_lock
=
mavlink_msg_digicam_control_get_focus_lock
(
msg
);
digicam_control
->
shot
=
mavlink_msg_digicam_control_get_shot
(
msg
);
digicam_control
->
command_id
=
mavlink_msg_digicam_control_get_command_id
(
msg
);
digicam_control
->
extra_param
=
mavlink_msg_digicam_control_get_extra_param
(
msg
);
digicam_control
->
extra_value
=
mavlink_msg_digicam_control_get_extra_value
(
msg
);
#else
memcpy
(
digicam_control
,
_MAV_PAYLOAD
(
msg
),
13
);
#endif
}
mavlink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_fence_fetch_point.h
0 → 100644
View file @
3d751338
// MESSAGE FENCE_FETCH_POINT PACKING
#define MAVLINK_MSG_ID_FENCE_FETCH_POINT 161
typedef
struct
__mavlink_fence_fetch_point_t
{
uint8_t
target_system
;
///< System ID
uint8_t
target_component
;
///< Component ID
uint8_t
idx
;
///< point index (first point is 1, 0 is for return point)
}
mavlink_fence_fetch_point_t
;
#define MAVLINK_MSG_ID_FENCE_FETCH_POINT_LEN 3
#define MAVLINK_MSG_ID_161_LEN 3
#define MAVLINK_MESSAGE_INFO_FENCE_FETCH_POINT { \
"FENCE_FETCH_POINT", \
3, \
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_fence_fetch_point_t, target_system) }, \
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_fence_fetch_point_t, target_component) }, \
{ "idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_fence_fetch_point_t, idx) }, \
} \
}
/**
* @brief Pack a fence_fetch_point 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 target_system System ID
* @param target_component Component ID
* @param idx point index (first point is 1, 0 is for return point)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_fence_fetch_point_pack
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
uint8_t
target_system
,
uint8_t
target_component
,
uint8_t
idx
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
3
];
_mav_put_uint8_t
(
buf
,
0
,
target_system
);
_mav_put_uint8_t
(
buf
,
1
,
target_component
);
_mav_put_uint8_t
(
buf
,
2
,
idx
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
3
);
#else
mavlink_fence_fetch_point_t
packet
;
packet
.
target_system
=
target_system
;
packet
.
target_component
=
target_component
;
packet
.
idx
=
idx
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
3
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_FENCE_FETCH_POINT
;
return
mavlink_finalize_message
(
msg
,
system_id
,
component_id
,
3
);
}
/**
* @brief Pack a fence_fetch_point 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param target_system System ID
* @param target_component Component ID
* @param idx point index (first point is 1, 0 is for return point)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_fence_fetch_point_pack_chan
(
uint8_t
system_id
,
uint8_t
component_id
,
uint8_t
chan
,
mavlink_message_t
*
msg
,
uint8_t
target_system
,
uint8_t
target_component
,
uint8_t
idx
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
3
];
_mav_put_uint8_t
(
buf
,
0
,
target_system
);
_mav_put_uint8_t
(
buf
,
1
,
target_component
);
_mav_put_uint8_t
(
buf
,
2
,
idx
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
3
);
#else
mavlink_fence_fetch_point_t
packet
;
packet
.
target_system
=
target_system
;
packet
.
target_component
=
target_component
;
packet
.
idx
=
idx
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
3
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_FENCE_FETCH_POINT
;
return
mavlink_finalize_message_chan
(
msg
,
system_id
,
component_id
,
chan
,
3
);
}
/**
* @brief Encode a fence_fetch_point struct into a 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 fence_fetch_point C-struct to read the message contents from
*/
static
inline
uint16_t
mavlink_msg_fence_fetch_point_encode
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
const
mavlink_fence_fetch_point_t
*
fence_fetch_point
)
{
return
mavlink_msg_fence_fetch_point_pack
(
system_id
,
component_id
,
msg
,
fence_fetch_point
->
target_system
,
fence_fetch_point
->
target_component
,
fence_fetch_point
->
idx
);
}
/**
* @brief Send a fence_fetch_point message
* @param chan MAVLink channel to send the message
*
* @param target_system System ID
* @param target_component Component ID
* @param idx point index (first point is 1, 0 is for return point)
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static
inline
void
mavlink_msg_fence_fetch_point_send
(
mavlink_channel_t
chan
,
uint8_t
target_system
,
uint8_t
target_component
,
uint8_t
idx
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
3
];
_mav_put_uint8_t
(
buf
,
0
,
target_system
);
_mav_put_uint8_t
(
buf
,
1
,
target_component
);
_mav_put_uint8_t
(
buf
,
2
,
idx
);
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_FENCE_FETCH_POINT
,
buf
,
3
);
#else
mavlink_fence_fetch_point_t
packet
;
packet
.
target_system
=
target_system
;
packet
.
target_component
=
target_component
;
packet
.
idx
=
idx
;
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_FENCE_FETCH_POINT
,
(
const
char
*
)
&
packet
,
3
);
#endif
}
#endif
// MESSAGE FENCE_FETCH_POINT UNPACKING
/**
* @brief Get field target_system from fence_fetch_point message
*
* @return System ID
*/
static
inline
uint8_t
mavlink_msg_fence_fetch_point_get_target_system
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
0
);
}
/**
* @brief Get field target_component from fence_fetch_point message
*
* @return Component ID
*/
static
inline
uint8_t
mavlink_msg_fence_fetch_point_get_target_component
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
1
);
}
/**
* @brief Get field idx from fence_fetch_point message
*
* @return point index (first point is 1, 0 is for return point)
*/
static
inline
uint8_t
mavlink_msg_fence_fetch_point_get_idx
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
2
);
}
/**
* @brief Decode a fence_fetch_point message into a struct
*
* @param msg The message to decode
* @param fence_fetch_point C-struct to decode the message contents into
*/
static
inline
void
mavlink_msg_fence_fetch_point_decode
(
const
mavlink_message_t
*
msg
,
mavlink_fence_fetch_point_t
*
fence_fetch_point
)
{
#if MAVLINK_NEED_BYTE_SWAP
fence_fetch_point
->
target_system
=
mavlink_msg_fence_fetch_point_get_target_system
(
msg
);
fence_fetch_point
->
target_component
=
mavlink_msg_fence_fetch_point_get_target_component
(
msg
);
fence_fetch_point
->
idx
=
mavlink_msg_fence_fetch_point_get_idx
(
msg
);
#else
memcpy
(
fence_fetch_point
,
_MAV_PAYLOAD
(
msg
),
3
);
#endif
}
mavlink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_fence_point.h
0 → 100644
View file @
3d751338
// MESSAGE FENCE_POINT PACKING
#define MAVLINK_MSG_ID_FENCE_POINT 160
typedef
struct
__mavlink_fence_point_t
{
uint8_t
target_system
;
///< System ID
uint8_t
target_component
;
///< Component ID
uint8_t
idx
;
///< point index (first point is 1, 0 is for return point)
uint8_t
count
;
///< total number of points (for sanity checking)
float
lat
;
///< Latitude of point
float
lng
;
///< Longitude of point
}
mavlink_fence_point_t
;
#define MAVLINK_MSG_ID_FENCE_POINT_LEN 12
#define MAVLINK_MSG_ID_160_LEN 12
#define MAVLINK_MESSAGE_INFO_FENCE_POINT { \
"FENCE_POINT", \
6, \
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_fence_point_t, target_system) }, \
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_fence_point_t, target_component) }, \
{ "idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_fence_point_t, idx) }, \
{ "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_fence_point_t, count) }, \
{ "lat", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_fence_point_t, lat) }, \
{ "lng", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_fence_point_t, lng) }, \
} \
}
/**
* @brief Pack a fence_point 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 target_system System ID
* @param target_component Component ID
* @param idx point index (first point is 1, 0 is for return point)
* @param count total number of points (for sanity checking)
* @param lat Latitude of point
* @param lng Longitude of point
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_fence_point_pack
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
uint8_t
target_system
,
uint8_t
target_component
,
uint8_t
idx
,
uint8_t
count
,
float
lat
,
float
lng
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
12
];
_mav_put_uint8_t
(
buf
,
0
,
target_system
);
_mav_put_uint8_t
(
buf
,
1
,
target_component
);
_mav_put_uint8_t
(
buf
,
2
,
idx
);
_mav_put_uint8_t
(
buf
,
3
,
count
);
_mav_put_float
(
buf
,
4
,
lat
);
_mav_put_float
(
buf
,
8
,
lng
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
12
);
#else
mavlink_fence_point_t
packet
;
packet
.
target_system
=
target_system
;
packet
.
target_component
=
target_component
;
packet
.
idx
=
idx
;
packet
.
count
=
count
;
packet
.
lat
=
lat
;
packet
.
lng
=
lng
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
12
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_FENCE_POINT
;
return
mavlink_finalize_message
(
msg
,
system_id
,
component_id
,
12
);
}
/**
* @brief Pack a fence_point 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param target_system System ID
* @param target_component Component ID
* @param idx point index (first point is 1, 0 is for return point)
* @param count total number of points (for sanity checking)
* @param lat Latitude of point
* @param lng Longitude of point
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_fence_point_pack_chan
(
uint8_t
system_id
,
uint8_t
component_id
,
uint8_t
chan
,
mavlink_message_t
*
msg
,
uint8_t
target_system
,
uint8_t
target_component
,
uint8_t
idx
,
uint8_t
count
,
float
lat
,
float
lng
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
12
];
_mav_put_uint8_t
(
buf
,
0
,
target_system
);
_mav_put_uint8_t
(
buf
,
1
,
target_component
);
_mav_put_uint8_t
(
buf
,
2
,
idx
);
_mav_put_uint8_t
(
buf
,
3
,
count
);
_mav_put_float
(
buf
,
4
,
lat
);
_mav_put_float
(
buf
,
8
,
lng
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
12
);
#else
mavlink_fence_point_t
packet
;
packet
.
target_system
=
target_system
;
packet
.
target_component
=
target_component
;
packet
.
idx
=
idx
;
packet
.
count
=
count
;
packet
.
lat
=
lat
;
packet
.
lng
=
lng
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
12
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_FENCE_POINT
;
return
mavlink_finalize_message_chan
(
msg
,
system_id
,
component_id
,
chan
,
12
);
}
/**
* @brief Encode a fence_point struct into a 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 fence_point C-struct to read the message contents from
*/
static
inline
uint16_t
mavlink_msg_fence_point_encode
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
const
mavlink_fence_point_t
*
fence_point
)
{
return
mavlink_msg_fence_point_pack
(
system_id
,
component_id
,
msg
,
fence_point
->
target_system
,
fence_point
->
target_component
,
fence_point
->
idx
,
fence_point
->
count
,
fence_point
->
lat
,
fence_point
->
lng
);
}
/**
* @brief Send a fence_point message
* @param chan MAVLink channel to send the message
*
* @param target_system System ID
* @param target_component Component ID
* @param idx point index (first point is 1, 0 is for return point)
* @param count total number of points (for sanity checking)
* @param lat Latitude of point
* @param lng Longitude of point
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static
inline
void
mavlink_msg_fence_point_send
(
mavlink_channel_t
chan
,
uint8_t
target_system
,
uint8_t
target_component
,
uint8_t
idx
,
uint8_t
count
,
float
lat
,
float
lng
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
12
];
_mav_put_uint8_t
(
buf
,
0
,
target_system
);
_mav_put_uint8_t
(
buf
,
1
,
target_component
);
_mav_put_uint8_t
(
buf
,
2
,
idx
);
_mav_put_uint8_t
(
buf
,
3
,
count
);
_mav_put_float
(
buf
,
4
,
lat
);
_mav_put_float
(
buf
,
8
,
lng
);
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_FENCE_POINT
,
buf
,
12
);
#else
mavlink_fence_point_t
packet
;
packet
.
target_system
=
target_system
;
packet
.
target_component
=
target_component
;
packet
.
idx
=
idx
;
packet
.
count
=
count
;
packet
.
lat
=
lat
;
packet
.
lng
=
lng
;
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_FENCE_POINT
,
(
const
char
*
)
&
packet
,
12
);
#endif
}
#endif
// MESSAGE FENCE_POINT UNPACKING
/**
* @brief Get field target_system from fence_point message
*
* @return System ID
*/
static
inline
uint8_t
mavlink_msg_fence_point_get_target_system
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
0
);
}
/**
* @brief Get field target_component from fence_point message
*
* @return Component ID
*/
static
inline
uint8_t
mavlink_msg_fence_point_get_target_component
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
1
);
}
/**
* @brief Get field idx from fence_point message
*
* @return point index (first point is 1, 0 is for return point)
*/
static
inline
uint8_t
mavlink_msg_fence_point_get_idx
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
2
);
}
/**
* @brief Get field count from fence_point message
*
* @return total number of points (for sanity checking)
*/
static
inline
uint8_t
mavlink_msg_fence_point_get_count
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
3
);
}
/**
* @brief Get field lat from fence_point message
*
* @return Latitude of point
*/
static
inline
float
mavlink_msg_fence_point_get_lat
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_float
(
msg
,
4
);
}
/**
* @brief Get field lng from fence_point message
*
* @return Longitude of point
*/
static
inline
float
mavlink_msg_fence_point_get_lng
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_float
(
msg
,
8
);
}
/**
* @brief Decode a fence_point message into a struct
*
* @param msg The message to decode
* @param fence_point C-struct to decode the message contents into
*/
static
inline
void
mavlink_msg_fence_point_decode
(
const
mavlink_message_t
*
msg
,
mavlink_fence_point_t
*
fence_point
)
{
#if MAVLINK_NEED_BYTE_SWAP
fence_point
->
target_system
=
mavlink_msg_fence_point_get_target_system
(
msg
);
fence_point
->
target_component
=
mavlink_msg_fence_point_get_target_component
(
msg
);
fence_point
->
idx
=
mavlink_msg_fence_point_get_idx
(
msg
);
fence_point
->
count
=
mavlink_msg_fence_point_get_count
(
msg
);
fence_point
->
lat
=
mavlink_msg_fence_point_get_lat
(
msg
);
fence_point
->
lng
=
mavlink_msg_fence_point_get_lng
(
msg
);
#else
memcpy
(
fence_point
,
_MAV_PAYLOAD
(
msg
),
12
);
#endif
}
mavlink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_fence_status.h
0 → 100644
View file @
3d751338
// MESSAGE FENCE_STATUS PACKING
#define MAVLINK_MSG_ID_FENCE_STATUS 162
typedef
struct
__mavlink_fence_status_t
{
uint8_t
breach_status
;
///< 0 if currently inside fence, 1 if outside
uint16_t
breach_count
;
///< number of fence breaches
uint8_t
breach_type
;
///< last breach type (see FENCE_BREACH_* enum)
uint32_t
breach_time
;
///< time of last breach in milliseconds since boot
}
mavlink_fence_status_t
;
#define MAVLINK_MSG_ID_FENCE_STATUS_LEN 8
#define MAVLINK_MSG_ID_162_LEN 8
#define MAVLINK_MESSAGE_INFO_FENCE_STATUS { \
"FENCE_STATUS", \
4, \
{ { "breach_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_fence_status_t, breach_status) }, \
{ "breach_count", NULL, MAVLINK_TYPE_UINT16_T, 0, 1, offsetof(mavlink_fence_status_t, breach_count) }, \
{ "breach_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_fence_status_t, breach_type) }, \
{ "breach_time", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_fence_status_t, breach_time) }, \
} \
}
/**
* @brief Pack a fence_status 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 breach_status 0 if currently inside fence, 1 if outside
* @param breach_count number of fence breaches
* @param breach_type last breach type (see FENCE_BREACH_* enum)
* @param breach_time time of last breach in milliseconds since boot
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_fence_status_pack
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
uint8_t
breach_status
,
uint16_t
breach_count
,
uint8_t
breach_type
,
uint32_t
breach_time
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
8
];
_mav_put_uint8_t
(
buf
,
0
,
breach_status
);
_mav_put_uint16_t
(
buf
,
1
,
breach_count
);
_mav_put_uint8_t
(
buf
,
3
,
breach_type
);
_mav_put_uint32_t
(
buf
,
4
,
breach_time
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
8
);
#else
mavlink_fence_status_t
packet
;
packet
.
breach_status
=
breach_status
;
packet
.
breach_count
=
breach_count
;
packet
.
breach_type
=
breach_type
;
packet
.
breach_time
=
breach_time
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
8
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_FENCE_STATUS
;
return
mavlink_finalize_message
(
msg
,
system_id
,
component_id
,
8
);
}
/**
* @brief Pack a fence_status 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param breach_status 0 if currently inside fence, 1 if outside
* @param breach_count number of fence breaches
* @param breach_type last breach type (see FENCE_BREACH_* enum)
* @param breach_time time of last breach in milliseconds since boot
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_fence_status_pack_chan
(
uint8_t
system_id
,
uint8_t
component_id
,
uint8_t
chan
,
mavlink_message_t
*
msg
,
uint8_t
breach_status
,
uint16_t
breach_count
,
uint8_t
breach_type
,
uint32_t
breach_time
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
8
];
_mav_put_uint8_t
(
buf
,
0
,
breach_status
);
_mav_put_uint16_t
(
buf
,
1
,
breach_count
);
_mav_put_uint8_t
(
buf
,
3
,
breach_type
);
_mav_put_uint32_t
(
buf
,
4
,
breach_time
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
8
);
#else
mavlink_fence_status_t
packet
;
packet
.
breach_status
=
breach_status
;
packet
.
breach_count
=
breach_count
;
packet
.
breach_type
=
breach_type
;
packet
.
breach_time
=
breach_time
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
8
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_FENCE_STATUS
;
return
mavlink_finalize_message_chan
(
msg
,
system_id
,
component_id
,
chan
,
8
);
}
/**
* @brief Encode a fence_status struct into a 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 fence_status C-struct to read the message contents from
*/
static
inline
uint16_t
mavlink_msg_fence_status_encode
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
const
mavlink_fence_status_t
*
fence_status
)
{
return
mavlink_msg_fence_status_pack
(
system_id
,
component_id
,
msg
,
fence_status
->
breach_status
,
fence_status
->
breach_count
,
fence_status
->
breach_type
,
fence_status
->
breach_time
);
}
/**
* @brief Send a fence_status message
* @param chan MAVLink channel to send the message
*
* @param breach_status 0 if currently inside fence, 1 if outside
* @param breach_count number of fence breaches
* @param breach_type last breach type (see FENCE_BREACH_* enum)
* @param breach_time time of last breach in milliseconds since boot
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static
inline
void
mavlink_msg_fence_status_send
(
mavlink_channel_t
chan
,
uint8_t
breach_status
,
uint16_t
breach_count
,
uint8_t
breach_type
,
uint32_t
breach_time
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
8
];
_mav_put_uint8_t
(
buf
,
0
,
breach_status
);
_mav_put_uint16_t
(
buf
,
1
,
breach_count
);
_mav_put_uint8_t
(
buf
,
3
,
breach_type
);
_mav_put_uint32_t
(
buf
,
4
,
breach_time
);
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_FENCE_STATUS
,
buf
,
8
);
#else
mavlink_fence_status_t
packet
;
packet
.
breach_status
=
breach_status
;
packet
.
breach_count
=
breach_count
;
packet
.
breach_type
=
breach_type
;
packet
.
breach_time
=
breach_time
;
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_FENCE_STATUS
,
(
const
char
*
)
&
packet
,
8
);
#endif
}
#endif
// MESSAGE FENCE_STATUS UNPACKING
/**
* @brief Get field breach_status from fence_status message
*
* @return 0 if currently inside fence, 1 if outside
*/
static
inline
uint8_t
mavlink_msg_fence_status_get_breach_status
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
0
);
}
/**
* @brief Get field breach_count from fence_status message
*
* @return number of fence breaches
*/
static
inline
uint16_t
mavlink_msg_fence_status_get_breach_count
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint16_t
(
msg
,
1
);
}
/**
* @brief Get field breach_type from fence_status message
*
* @return last breach type (see FENCE_BREACH_* enum)
*/
static
inline
uint8_t
mavlink_msg_fence_status_get_breach_type
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
3
);
}
/**
* @brief Get field breach_time from fence_status message
*
* @return time of last breach in milliseconds since boot
*/
static
inline
uint32_t
mavlink_msg_fence_status_get_breach_time
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint32_t
(
msg
,
4
);
}
/**
* @brief Decode a fence_status message into a struct
*
* @param msg The message to decode
* @param fence_status C-struct to decode the message contents into
*/
static
inline
void
mavlink_msg_fence_status_decode
(
const
mavlink_message_t
*
msg
,
mavlink_fence_status_t
*
fence_status
)
{
#if MAVLINK_NEED_BYTE_SWAP
fence_status
->
breach_status
=
mavlink_msg_fence_status_get_breach_status
(
msg
);
fence_status
->
breach_count
=
mavlink_msg_fence_status_get_breach_count
(
msg
);
fence_status
->
breach_type
=
mavlink_msg_fence_status_get_breach_type
(
msg
);
fence_status
->
breach_time
=
mavlink_msg_fence_status_get_breach_time
(
msg
);
#else
memcpy
(
fence_status
,
_MAV_PAYLOAD
(
msg
),
8
);
#endif
}
mavlink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_hwstatus.h
0 → 100644
View file @
3d751338
// MESSAGE HWSTATUS PACKING
#define MAVLINK_MSG_ID_HWSTATUS 165
typedef
struct
__mavlink_hwstatus_t
{
uint16_t
Vcc
;
///< board voltage (mV)
uint8_t
I2Cerr
;
///< I2C error count
}
mavlink_hwstatus_t
;
#define MAVLINK_MSG_ID_HWSTATUS_LEN 3
#define MAVLINK_MSG_ID_165_LEN 3
#define MAVLINK_MESSAGE_INFO_HWSTATUS { \
"HWSTATUS", \
2, \
{ { "Vcc", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_hwstatus_t, Vcc) }, \
{ "I2Cerr", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_hwstatus_t, I2Cerr) }, \
} \
}
/**
* @brief Pack a hwstatus 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 Vcc board voltage (mV)
* @param I2Cerr I2C error count
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_hwstatus_pack
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
uint16_t
Vcc
,
uint8_t
I2Cerr
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
3
];
_mav_put_uint16_t
(
buf
,
0
,
Vcc
);
_mav_put_uint8_t
(
buf
,
2
,
I2Cerr
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
3
);
#else
mavlink_hwstatus_t
packet
;
packet
.
Vcc
=
Vcc
;
packet
.
I2Cerr
=
I2Cerr
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
3
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_HWSTATUS
;
return
mavlink_finalize_message
(
msg
,
system_id
,
component_id
,
3
);
}
/**
* @brief Pack a hwstatus 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param Vcc board voltage (mV)
* @param I2Cerr I2C error count
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_hwstatus_pack_chan
(
uint8_t
system_id
,
uint8_t
component_id
,
uint8_t
chan
,
mavlink_message_t
*
msg
,
uint16_t
Vcc
,
uint8_t
I2Cerr
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
3
];
_mav_put_uint16_t
(
buf
,
0
,
Vcc
);
_mav_put_uint8_t
(
buf
,
2
,
I2Cerr
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
3
);
#else
mavlink_hwstatus_t
packet
;
packet
.
Vcc
=
Vcc
;
packet
.
I2Cerr
=
I2Cerr
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
3
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_HWSTATUS
;
return
mavlink_finalize_message_chan
(
msg
,
system_id
,
component_id
,
chan
,
3
);
}
/**
* @brief Encode a hwstatus struct into a 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 hwstatus C-struct to read the message contents from
*/
static
inline
uint16_t
mavlink_msg_hwstatus_encode
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
const
mavlink_hwstatus_t
*
hwstatus
)
{
return
mavlink_msg_hwstatus_pack
(
system_id
,
component_id
,
msg
,
hwstatus
->
Vcc
,
hwstatus
->
I2Cerr
);
}
/**
* @brief Send a hwstatus message
* @param chan MAVLink channel to send the message
*
* @param Vcc board voltage (mV)
* @param I2Cerr I2C error count
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static
inline
void
mavlink_msg_hwstatus_send
(
mavlink_channel_t
chan
,
uint16_t
Vcc
,
uint8_t
I2Cerr
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
3
];
_mav_put_uint16_t
(
buf
,
0
,
Vcc
);
_mav_put_uint8_t
(
buf
,
2
,
I2Cerr
);
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_HWSTATUS
,
buf
,
3
);
#else
mavlink_hwstatus_t
packet
;
packet
.
Vcc
=
Vcc
;
packet
.
I2Cerr
=
I2Cerr
;
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_HWSTATUS
,
(
const
char
*
)
&
packet
,
3
);
#endif
}
#endif
// MESSAGE HWSTATUS UNPACKING
/**
* @brief Get field Vcc from hwstatus message
*
* @return board voltage (mV)
*/
static
inline
uint16_t
mavlink_msg_hwstatus_get_Vcc
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint16_t
(
msg
,
0
);
}
/**
* @brief Get field I2Cerr from hwstatus message
*
* @return I2C error count
*/
static
inline
uint8_t
mavlink_msg_hwstatus_get_I2Cerr
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
2
);
}
/**
* @brief Decode a hwstatus message into a struct
*
* @param msg The message to decode
* @param hwstatus C-struct to decode the message contents into
*/
static
inline
void
mavlink_msg_hwstatus_decode
(
const
mavlink_message_t
*
msg
,
mavlink_hwstatus_t
*
hwstatus
)
{
#if MAVLINK_NEED_BYTE_SWAP
hwstatus
->
Vcc
=
mavlink_msg_hwstatus_get_Vcc
(
msg
);
hwstatus
->
I2Cerr
=
mavlink_msg_hwstatus_get_I2Cerr
(
msg
);
#else
memcpy
(
hwstatus
,
_MAV_PAYLOAD
(
msg
),
3
);
#endif
}
mavlink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_meminfo.h
0 → 100644
View file @
3d751338
// MESSAGE MEMINFO PACKING
#define MAVLINK_MSG_ID_MEMINFO 152
typedef
struct
__mavlink_meminfo_t
{
uint16_t
brkval
;
///< heap top
uint16_t
freemem
;
///< free memory
}
mavlink_meminfo_t
;
#define MAVLINK_MSG_ID_MEMINFO_LEN 4
#define MAVLINK_MSG_ID_152_LEN 4
#define MAVLINK_MESSAGE_INFO_MEMINFO { \
"MEMINFO", \
2, \
{ { "brkval", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_meminfo_t, brkval) }, \
{ "freemem", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_meminfo_t, freemem) }, \
} \
}
/**
* @brief Pack a meminfo 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 brkval heap top
* @param freemem free memory
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_meminfo_pack
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
uint16_t
brkval
,
uint16_t
freemem
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
4
];
_mav_put_uint16_t
(
buf
,
0
,
brkval
);
_mav_put_uint16_t
(
buf
,
2
,
freemem
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
4
);
#else
mavlink_meminfo_t
packet
;
packet
.
brkval
=
brkval
;
packet
.
freemem
=
freemem
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
4
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_MEMINFO
;
return
mavlink_finalize_message
(
msg
,
system_id
,
component_id
,
4
);
}
/**
* @brief Pack a meminfo 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param brkval heap top
* @param freemem free memory
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_meminfo_pack_chan
(
uint8_t
system_id
,
uint8_t
component_id
,
uint8_t
chan
,
mavlink_message_t
*
msg
,
uint16_t
brkval
,
uint16_t
freemem
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
4
];
_mav_put_uint16_t
(
buf
,
0
,
brkval
);
_mav_put_uint16_t
(
buf
,
2
,
freemem
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
4
);
#else
mavlink_meminfo_t
packet
;
packet
.
brkval
=
brkval
;
packet
.
freemem
=
freemem
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
4
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_MEMINFO
;
return
mavlink_finalize_message_chan
(
msg
,
system_id
,
component_id
,
chan
,
4
);
}
/**
* @brief Encode a meminfo struct into a 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 meminfo C-struct to read the message contents from
*/
static
inline
uint16_t
mavlink_msg_meminfo_encode
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
const
mavlink_meminfo_t
*
meminfo
)
{
return
mavlink_msg_meminfo_pack
(
system_id
,
component_id
,
msg
,
meminfo
->
brkval
,
meminfo
->
freemem
);
}
/**
* @brief Send a meminfo message
* @param chan MAVLink channel to send the message
*
* @param brkval heap top
* @param freemem free memory
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static
inline
void
mavlink_msg_meminfo_send
(
mavlink_channel_t
chan
,
uint16_t
brkval
,
uint16_t
freemem
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
4
];
_mav_put_uint16_t
(
buf
,
0
,
brkval
);
_mav_put_uint16_t
(
buf
,
2
,
freemem
);
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_MEMINFO
,
buf
,
4
);
#else
mavlink_meminfo_t
packet
;
packet
.
brkval
=
brkval
;
packet
.
freemem
=
freemem
;
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_MEMINFO
,
(
const
char
*
)
&
packet
,
4
);
#endif
}
#endif
// MESSAGE MEMINFO UNPACKING
/**
* @brief Get field brkval from meminfo message
*
* @return heap top
*/
static
inline
uint16_t
mavlink_msg_meminfo_get_brkval
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint16_t
(
msg
,
0
);
}
/**
* @brief Get field freemem from meminfo message
*
* @return free memory
*/
static
inline
uint16_t
mavlink_msg_meminfo_get_freemem
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint16_t
(
msg
,
2
);
}
/**
* @brief Decode a meminfo message into a struct
*
* @param msg The message to decode
* @param meminfo C-struct to decode the message contents into
*/
static
inline
void
mavlink_msg_meminfo_decode
(
const
mavlink_message_t
*
msg
,
mavlink_meminfo_t
*
meminfo
)
{
#if MAVLINK_NEED_BYTE_SWAP
meminfo
->
brkval
=
mavlink_msg_meminfo_get_brkval
(
msg
);
meminfo
->
freemem
=
mavlink_msg_meminfo_get_freemem
(
msg
);
#else
memcpy
(
meminfo
,
_MAV_PAYLOAD
(
msg
),
4
);
#endif
}
mavlink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_mount_configure.h
0 → 100644
View file @
3d751338
// MESSAGE MOUNT_CONFIGURE PACKING
#define MAVLINK_MSG_ID_MOUNT_CONFIGURE 156
typedef
struct
__mavlink_mount_configure_t
{
uint8_t
target_system
;
///< System ID
uint8_t
target_component
;
///< Component ID
uint8_t
mount_mode
;
///< mount operating mode (see MAV_MOUNT_MODE enum)
uint8_t
stab_roll
;
///< (1 = yes, 0 = no)
uint8_t
stab_pitch
;
///< (1 = yes, 0 = no)
uint8_t
stab_yaw
;
///< (1 = yes, 0 = no)
}
mavlink_mount_configure_t
;
#define MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN 6
#define MAVLINK_MSG_ID_156_LEN 6
#define MAVLINK_MESSAGE_INFO_MOUNT_CONFIGURE { \
"MOUNT_CONFIGURE", \
6, \
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mount_configure_t, target_system) }, \
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mount_configure_t, target_component) }, \
{ "mount_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mount_configure_t, mount_mode) }, \
{ "stab_roll", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mount_configure_t, stab_roll) }, \
{ "stab_pitch", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mount_configure_t, stab_pitch) }, \
{ "stab_yaw", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mount_configure_t, stab_yaw) }, \
} \
}
/**
* @brief Pack a mount_configure 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 target_system System ID
* @param target_component Component ID
* @param mount_mode mount operating mode (see MAV_MOUNT_MODE enum)
* @param stab_roll (1 = yes, 0 = no)
* @param stab_pitch (1 = yes, 0 = no)
* @param stab_yaw (1 = yes, 0 = no)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_mount_configure_pack
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
uint8_t
target_system
,
uint8_t
target_component
,
uint8_t
mount_mode
,
uint8_t
stab_roll
,
uint8_t
stab_pitch
,
uint8_t
stab_yaw
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
6
];
_mav_put_uint8_t
(
buf
,
0
,
target_system
);
_mav_put_uint8_t
(
buf
,
1
,
target_component
);
_mav_put_uint8_t
(
buf
,
2
,
mount_mode
);
_mav_put_uint8_t
(
buf
,
3
,
stab_roll
);
_mav_put_uint8_t
(
buf
,
4
,
stab_pitch
);
_mav_put_uint8_t
(
buf
,
5
,
stab_yaw
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
6
);
#else
mavlink_mount_configure_t
packet
;
packet
.
target_system
=
target_system
;
packet
.
target_component
=
target_component
;
packet
.
mount_mode
=
mount_mode
;
packet
.
stab_roll
=
stab_roll
;
packet
.
stab_pitch
=
stab_pitch
;
packet
.
stab_yaw
=
stab_yaw
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
6
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_MOUNT_CONFIGURE
;
return
mavlink_finalize_message
(
msg
,
system_id
,
component_id
,
6
);
}
/**
* @brief Pack a mount_configure 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param target_system System ID
* @param target_component Component ID
* @param mount_mode mount operating mode (see MAV_MOUNT_MODE enum)
* @param stab_roll (1 = yes, 0 = no)
* @param stab_pitch (1 = yes, 0 = no)
* @param stab_yaw (1 = yes, 0 = no)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_mount_configure_pack_chan
(
uint8_t
system_id
,
uint8_t
component_id
,
uint8_t
chan
,
mavlink_message_t
*
msg
,
uint8_t
target_system
,
uint8_t
target_component
,
uint8_t
mount_mode
,
uint8_t
stab_roll
,
uint8_t
stab_pitch
,
uint8_t
stab_yaw
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
6
];
_mav_put_uint8_t
(
buf
,
0
,
target_system
);
_mav_put_uint8_t
(
buf
,
1
,
target_component
);
_mav_put_uint8_t
(
buf
,
2
,
mount_mode
);
_mav_put_uint8_t
(
buf
,
3
,
stab_roll
);
_mav_put_uint8_t
(
buf
,
4
,
stab_pitch
);
_mav_put_uint8_t
(
buf
,
5
,
stab_yaw
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
6
);
#else
mavlink_mount_configure_t
packet
;
packet
.
target_system
=
target_system
;
packet
.
target_component
=
target_component
;
packet
.
mount_mode
=
mount_mode
;
packet
.
stab_roll
=
stab_roll
;
packet
.
stab_pitch
=
stab_pitch
;
packet
.
stab_yaw
=
stab_yaw
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
6
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_MOUNT_CONFIGURE
;
return
mavlink_finalize_message_chan
(
msg
,
system_id
,
component_id
,
chan
,
6
);
}
/**
* @brief Encode a mount_configure struct into a 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 mount_configure C-struct to read the message contents from
*/
static
inline
uint16_t
mavlink_msg_mount_configure_encode
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
const
mavlink_mount_configure_t
*
mount_configure
)
{
return
mavlink_msg_mount_configure_pack
(
system_id
,
component_id
,
msg
,
mount_configure
->
target_system
,
mount_configure
->
target_component
,
mount_configure
->
mount_mode
,
mount_configure
->
stab_roll
,
mount_configure
->
stab_pitch
,
mount_configure
->
stab_yaw
);
}
/**
* @brief Send a mount_configure message
* @param chan MAVLink channel to send the message
*
* @param target_system System ID
* @param target_component Component ID
* @param mount_mode mount operating mode (see MAV_MOUNT_MODE enum)
* @param stab_roll (1 = yes, 0 = no)
* @param stab_pitch (1 = yes, 0 = no)
* @param stab_yaw (1 = yes, 0 = no)
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static
inline
void
mavlink_msg_mount_configure_send
(
mavlink_channel_t
chan
,
uint8_t
target_system
,
uint8_t
target_component
,
uint8_t
mount_mode
,
uint8_t
stab_roll
,
uint8_t
stab_pitch
,
uint8_t
stab_yaw
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
6
];
_mav_put_uint8_t
(
buf
,
0
,
target_system
);
_mav_put_uint8_t
(
buf
,
1
,
target_component
);
_mav_put_uint8_t
(
buf
,
2
,
mount_mode
);
_mav_put_uint8_t
(
buf
,
3
,
stab_roll
);
_mav_put_uint8_t
(
buf
,
4
,
stab_pitch
);
_mav_put_uint8_t
(
buf
,
5
,
stab_yaw
);
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_MOUNT_CONFIGURE
,
buf
,
6
);
#else
mavlink_mount_configure_t
packet
;
packet
.
target_system
=
target_system
;
packet
.
target_component
=
target_component
;
packet
.
mount_mode
=
mount_mode
;
packet
.
stab_roll
=
stab_roll
;
packet
.
stab_pitch
=
stab_pitch
;
packet
.
stab_yaw
=
stab_yaw
;
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_MOUNT_CONFIGURE
,
(
const
char
*
)
&
packet
,
6
);
#endif
}
#endif
// MESSAGE MOUNT_CONFIGURE UNPACKING
/**
* @brief Get field target_system from mount_configure message
*
* @return System ID
*/
static
inline
uint8_t
mavlink_msg_mount_configure_get_target_system
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
0
);
}
/**
* @brief Get field target_component from mount_configure message
*
* @return Component ID
*/
static
inline
uint8_t
mavlink_msg_mount_configure_get_target_component
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
1
);
}
/**
* @brief Get field mount_mode from mount_configure message
*
* @return mount operating mode (see MAV_MOUNT_MODE enum)
*/
static
inline
uint8_t
mavlink_msg_mount_configure_get_mount_mode
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
2
);
}
/**
* @brief Get field stab_roll from mount_configure message
*
* @return (1 = yes, 0 = no)
*/
static
inline
uint8_t
mavlink_msg_mount_configure_get_stab_roll
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
3
);
}
/**
* @brief Get field stab_pitch from mount_configure message
*
* @return (1 = yes, 0 = no)
*/
static
inline
uint8_t
mavlink_msg_mount_configure_get_stab_pitch
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
4
);
}
/**
* @brief Get field stab_yaw from mount_configure message
*
* @return (1 = yes, 0 = no)
*/
static
inline
uint8_t
mavlink_msg_mount_configure_get_stab_yaw
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
5
);
}
/**
* @brief Decode a mount_configure message into a struct
*
* @param msg The message to decode
* @param mount_configure C-struct to decode the message contents into
*/
static
inline
void
mavlink_msg_mount_configure_decode
(
const
mavlink_message_t
*
msg
,
mavlink_mount_configure_t
*
mount_configure
)
{
#if MAVLINK_NEED_BYTE_SWAP
mount_configure
->
target_system
=
mavlink_msg_mount_configure_get_target_system
(
msg
);
mount_configure
->
target_component
=
mavlink_msg_mount_configure_get_target_component
(
msg
);
mount_configure
->
mount_mode
=
mavlink_msg_mount_configure_get_mount_mode
(
msg
);
mount_configure
->
stab_roll
=
mavlink_msg_mount_configure_get_stab_roll
(
msg
);
mount_configure
->
stab_pitch
=
mavlink_msg_mount_configure_get_stab_pitch
(
msg
);
mount_configure
->
stab_yaw
=
mavlink_msg_mount_configure_get_stab_yaw
(
msg
);
#else
memcpy
(
mount_configure
,
_MAV_PAYLOAD
(
msg
),
6
);
#endif
}
mavlink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_mount_control.h
0 → 100644
View file @
3d751338
// MESSAGE MOUNT_CONTROL PACKING
#define MAVLINK_MSG_ID_MOUNT_CONTROL 157
typedef
struct
__mavlink_mount_control_t
{
uint8_t
target_system
;
///< System ID
uint8_t
target_component
;
///< Component ID
int32_t
input_a
;
///< pitch(deg*100) or lat, depending on mount mode
int32_t
input_b
;
///< roll(deg*100) or lon depending on mount mode
int32_t
input_c
;
///< yaw(deg*100) or alt (in cm) depending on mount mode
uint8_t
save_position
;
///< if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING)
}
mavlink_mount_control_t
;
#define MAVLINK_MSG_ID_MOUNT_CONTROL_LEN 15
#define MAVLINK_MSG_ID_157_LEN 15
#define MAVLINK_MESSAGE_INFO_MOUNT_CONTROL { \
"MOUNT_CONTROL", \
6, \
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mount_control_t, target_system) }, \
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mount_control_t, target_component) }, \
{ "input_a", NULL, MAVLINK_TYPE_INT32_T, 0, 2, offsetof(mavlink_mount_control_t, input_a) }, \
{ "input_b", NULL, MAVLINK_TYPE_INT32_T, 0, 6, offsetof(mavlink_mount_control_t, input_b) }, \
{ "input_c", NULL, MAVLINK_TYPE_INT32_T, 0, 10, offsetof(mavlink_mount_control_t, input_c) }, \
{ "save_position", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_mount_control_t, save_position) }, \
} \
}
/**
* @brief Pack a mount_control 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 target_system System ID
* @param target_component Component ID
* @param input_a pitch(deg*100) or lat, depending on mount mode
* @param input_b roll(deg*100) or lon depending on mount mode
* @param input_c yaw(deg*100) or alt (in cm) depending on mount mode
* @param save_position if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_mount_control_pack
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
uint8_t
target_system
,
uint8_t
target_component
,
int32_t
input_a
,
int32_t
input_b
,
int32_t
input_c
,
uint8_t
save_position
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
15
];
_mav_put_uint8_t
(
buf
,
0
,
target_system
);
_mav_put_uint8_t
(
buf
,
1
,
target_component
);
_mav_put_int32_t
(
buf
,
2
,
input_a
);
_mav_put_int32_t
(
buf
,
6
,
input_b
);
_mav_put_int32_t
(
buf
,
10
,
input_c
);
_mav_put_uint8_t
(
buf
,
14
,
save_position
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
15
);
#else
mavlink_mount_control_t
packet
;
packet
.
target_system
=
target_system
;
packet
.
target_component
=
target_component
;
packet
.
input_a
=
input_a
;
packet
.
input_b
=
input_b
;
packet
.
input_c
=
input_c
;
packet
.
save_position
=
save_position
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
15
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_MOUNT_CONTROL
;
return
mavlink_finalize_message
(
msg
,
system_id
,
component_id
,
15
);
}
/**
* @brief Pack a mount_control 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param target_system System ID
* @param target_component Component ID
* @param input_a pitch(deg*100) or lat, depending on mount mode
* @param input_b roll(deg*100) or lon depending on mount mode
* @param input_c yaw(deg*100) or alt (in cm) depending on mount mode
* @param save_position if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_mount_control_pack_chan
(
uint8_t
system_id
,
uint8_t
component_id
,
uint8_t
chan
,
mavlink_message_t
*
msg
,
uint8_t
target_system
,
uint8_t
target_component
,
int32_t
input_a
,
int32_t
input_b
,
int32_t
input_c
,
uint8_t
save_position
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
15
];
_mav_put_uint8_t
(
buf
,
0
,
target_system
);
_mav_put_uint8_t
(
buf
,
1
,
target_component
);
_mav_put_int32_t
(
buf
,
2
,
input_a
);
_mav_put_int32_t
(
buf
,
6
,
input_b
);
_mav_put_int32_t
(
buf
,
10
,
input_c
);
_mav_put_uint8_t
(
buf
,
14
,
save_position
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
15
);
#else
mavlink_mount_control_t
packet
;
packet
.
target_system
=
target_system
;
packet
.
target_component
=
target_component
;
packet
.
input_a
=
input_a
;
packet
.
input_b
=
input_b
;
packet
.
input_c
=
input_c
;
packet
.
save_position
=
save_position
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
15
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_MOUNT_CONTROL
;
return
mavlink_finalize_message_chan
(
msg
,
system_id
,
component_id
,
chan
,
15
);
}
/**
* @brief Encode a mount_control struct into a 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 mount_control C-struct to read the message contents from
*/
static
inline
uint16_t
mavlink_msg_mount_control_encode
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
const
mavlink_mount_control_t
*
mount_control
)
{
return
mavlink_msg_mount_control_pack
(
system_id
,
component_id
,
msg
,
mount_control
->
target_system
,
mount_control
->
target_component
,
mount_control
->
input_a
,
mount_control
->
input_b
,
mount_control
->
input_c
,
mount_control
->
save_position
);
}
/**
* @brief Send a mount_control message
* @param chan MAVLink channel to send the message
*
* @param target_system System ID
* @param target_component Component ID
* @param input_a pitch(deg*100) or lat, depending on mount mode
* @param input_b roll(deg*100) or lon depending on mount mode
* @param input_c yaw(deg*100) or alt (in cm) depending on mount mode
* @param save_position if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING)
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static
inline
void
mavlink_msg_mount_control_send
(
mavlink_channel_t
chan
,
uint8_t
target_system
,
uint8_t
target_component
,
int32_t
input_a
,
int32_t
input_b
,
int32_t
input_c
,
uint8_t
save_position
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
15
];
_mav_put_uint8_t
(
buf
,
0
,
target_system
);
_mav_put_uint8_t
(
buf
,
1
,
target_component
);
_mav_put_int32_t
(
buf
,
2
,
input_a
);
_mav_put_int32_t
(
buf
,
6
,
input_b
);
_mav_put_int32_t
(
buf
,
10
,
input_c
);
_mav_put_uint8_t
(
buf
,
14
,
save_position
);
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_MOUNT_CONTROL
,
buf
,
15
);
#else
mavlink_mount_control_t
packet
;
packet
.
target_system
=
target_system
;
packet
.
target_component
=
target_component
;
packet
.
input_a
=
input_a
;
packet
.
input_b
=
input_b
;
packet
.
input_c
=
input_c
;
packet
.
save_position
=
save_position
;
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_MOUNT_CONTROL
,
(
const
char
*
)
&
packet
,
15
);
#endif
}
#endif
// MESSAGE MOUNT_CONTROL UNPACKING
/**
* @brief Get field target_system from mount_control message
*
* @return System ID
*/
static
inline
uint8_t
mavlink_msg_mount_control_get_target_system
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
0
);
}
/**
* @brief Get field target_component from mount_control message
*
* @return Component ID
*/
static
inline
uint8_t
mavlink_msg_mount_control_get_target_component
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
1
);
}
/**
* @brief Get field input_a from mount_control message
*
* @return pitch(deg*100) or lat, depending on mount mode
*/
static
inline
int32_t
mavlink_msg_mount_control_get_input_a
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_int32_t
(
msg
,
2
);
}
/**
* @brief Get field input_b from mount_control message
*
* @return roll(deg*100) or lon depending on mount mode
*/
static
inline
int32_t
mavlink_msg_mount_control_get_input_b
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_int32_t
(
msg
,
6
);
}
/**
* @brief Get field input_c from mount_control message
*
* @return yaw(deg*100) or alt (in cm) depending on mount mode
*/
static
inline
int32_t
mavlink_msg_mount_control_get_input_c
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_int32_t
(
msg
,
10
);
}
/**
* @brief Get field save_position from mount_control message
*
* @return if "1" it will save current trimmed position on EEPROM (just valid for NEUTRAL and LANDING)
*/
static
inline
uint8_t
mavlink_msg_mount_control_get_save_position
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
14
);
}
/**
* @brief Decode a mount_control message into a struct
*
* @param msg The message to decode
* @param mount_control C-struct to decode the message contents into
*/
static
inline
void
mavlink_msg_mount_control_decode
(
const
mavlink_message_t
*
msg
,
mavlink_mount_control_t
*
mount_control
)
{
#if MAVLINK_NEED_BYTE_SWAP
mount_control
->
target_system
=
mavlink_msg_mount_control_get_target_system
(
msg
);
mount_control
->
target_component
=
mavlink_msg_mount_control_get_target_component
(
msg
);
mount_control
->
input_a
=
mavlink_msg_mount_control_get_input_a
(
msg
);
mount_control
->
input_b
=
mavlink_msg_mount_control_get_input_b
(
msg
);
mount_control
->
input_c
=
mavlink_msg_mount_control_get_input_c
(
msg
);
mount_control
->
save_position
=
mavlink_msg_mount_control_get_save_position
(
msg
);
#else
memcpy
(
mount_control
,
_MAV_PAYLOAD
(
msg
),
15
);
#endif
}
mavlink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_mount_status.h
0 → 100644
View file @
3d751338
// MESSAGE MOUNT_STATUS PACKING
#define MAVLINK_MSG_ID_MOUNT_STATUS 158
typedef
struct
__mavlink_mount_status_t
{
uint8_t
target_system
;
///< System ID
uint8_t
target_component
;
///< Component ID
int32_t
pointing_a
;
///< pitch(deg*100) or lat, depending on mount mode
int32_t
pointing_b
;
///< roll(deg*100) or lon depending on mount mode
int32_t
pointing_c
;
///< yaw(deg*100) or alt (in cm) depending on mount mode
}
mavlink_mount_status_t
;
#define MAVLINK_MSG_ID_MOUNT_STATUS_LEN 14
#define MAVLINK_MSG_ID_158_LEN 14
#define MAVLINK_MESSAGE_INFO_MOUNT_STATUS { \
"MOUNT_STATUS", \
5, \
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mount_status_t, target_system) }, \
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mount_status_t, target_component) }, \
{ "pointing_a", NULL, MAVLINK_TYPE_INT32_T, 0, 2, offsetof(mavlink_mount_status_t, pointing_a) }, \
{ "pointing_b", NULL, MAVLINK_TYPE_INT32_T, 0, 6, offsetof(mavlink_mount_status_t, pointing_b) }, \
{ "pointing_c", NULL, MAVLINK_TYPE_INT32_T, 0, 10, offsetof(mavlink_mount_status_t, pointing_c) }, \
} \
}
/**
* @brief Pack a mount_status 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 target_system System ID
* @param target_component Component ID
* @param pointing_a pitch(deg*100) or lat, depending on mount mode
* @param pointing_b roll(deg*100) or lon depending on mount mode
* @param pointing_c yaw(deg*100) or alt (in cm) depending on mount mode
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_mount_status_pack
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
uint8_t
target_system
,
uint8_t
target_component
,
int32_t
pointing_a
,
int32_t
pointing_b
,
int32_t
pointing_c
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
14
];
_mav_put_uint8_t
(
buf
,
0
,
target_system
);
_mav_put_uint8_t
(
buf
,
1
,
target_component
);
_mav_put_int32_t
(
buf
,
2
,
pointing_a
);
_mav_put_int32_t
(
buf
,
6
,
pointing_b
);
_mav_put_int32_t
(
buf
,
10
,
pointing_c
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
14
);
#else
mavlink_mount_status_t
packet
;
packet
.
target_system
=
target_system
;
packet
.
target_component
=
target_component
;
packet
.
pointing_a
=
pointing_a
;
packet
.
pointing_b
=
pointing_b
;
packet
.
pointing_c
=
pointing_c
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
14
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_MOUNT_STATUS
;
return
mavlink_finalize_message
(
msg
,
system_id
,
component_id
,
14
);
}
/**
* @brief Pack a mount_status 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param target_system System ID
* @param target_component Component ID
* @param pointing_a pitch(deg*100) or lat, depending on mount mode
* @param pointing_b roll(deg*100) or lon depending on mount mode
* @param pointing_c yaw(deg*100) or alt (in cm) depending on mount mode
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_mount_status_pack_chan
(
uint8_t
system_id
,
uint8_t
component_id
,
uint8_t
chan
,
mavlink_message_t
*
msg
,
uint8_t
target_system
,
uint8_t
target_component
,
int32_t
pointing_a
,
int32_t
pointing_b
,
int32_t
pointing_c
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
14
];
_mav_put_uint8_t
(
buf
,
0
,
target_system
);
_mav_put_uint8_t
(
buf
,
1
,
target_component
);
_mav_put_int32_t
(
buf
,
2
,
pointing_a
);
_mav_put_int32_t
(
buf
,
6
,
pointing_b
);
_mav_put_int32_t
(
buf
,
10
,
pointing_c
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
14
);
#else
mavlink_mount_status_t
packet
;
packet
.
target_system
=
target_system
;
packet
.
target_component
=
target_component
;
packet
.
pointing_a
=
pointing_a
;
packet
.
pointing_b
=
pointing_b
;
packet
.
pointing_c
=
pointing_c
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
14
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_MOUNT_STATUS
;
return
mavlink_finalize_message_chan
(
msg
,
system_id
,
component_id
,
chan
,
14
);
}
/**
* @brief Encode a mount_status struct into a 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 mount_status C-struct to read the message contents from
*/
static
inline
uint16_t
mavlink_msg_mount_status_encode
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
const
mavlink_mount_status_t
*
mount_status
)
{
return
mavlink_msg_mount_status_pack
(
system_id
,
component_id
,
msg
,
mount_status
->
target_system
,
mount_status
->
target_component
,
mount_status
->
pointing_a
,
mount_status
->
pointing_b
,
mount_status
->
pointing_c
);
}
/**
* @brief Send a mount_status message
* @param chan MAVLink channel to send the message
*
* @param target_system System ID
* @param target_component Component ID
* @param pointing_a pitch(deg*100) or lat, depending on mount mode
* @param pointing_b roll(deg*100) or lon depending on mount mode
* @param pointing_c yaw(deg*100) or alt (in cm) depending on mount mode
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static
inline
void
mavlink_msg_mount_status_send
(
mavlink_channel_t
chan
,
uint8_t
target_system
,
uint8_t
target_component
,
int32_t
pointing_a
,
int32_t
pointing_b
,
int32_t
pointing_c
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
14
];
_mav_put_uint8_t
(
buf
,
0
,
target_system
);
_mav_put_uint8_t
(
buf
,
1
,
target_component
);
_mav_put_int32_t
(
buf
,
2
,
pointing_a
);
_mav_put_int32_t
(
buf
,
6
,
pointing_b
);
_mav_put_int32_t
(
buf
,
10
,
pointing_c
);
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_MOUNT_STATUS
,
buf
,
14
);
#else
mavlink_mount_status_t
packet
;
packet
.
target_system
=
target_system
;
packet
.
target_component
=
target_component
;
packet
.
pointing_a
=
pointing_a
;
packet
.
pointing_b
=
pointing_b
;
packet
.
pointing_c
=
pointing_c
;
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_MOUNT_STATUS
,
(
const
char
*
)
&
packet
,
14
);
#endif
}
#endif
// MESSAGE MOUNT_STATUS UNPACKING
/**
* @brief Get field target_system from mount_status message
*
* @return System ID
*/
static
inline
uint8_t
mavlink_msg_mount_status_get_target_system
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
0
);
}
/**
* @brief Get field target_component from mount_status message
*
* @return Component ID
*/
static
inline
uint8_t
mavlink_msg_mount_status_get_target_component
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
1
);
}
/**
* @brief Get field pointing_a from mount_status message
*
* @return pitch(deg*100) or lat, depending on mount mode
*/
static
inline
int32_t
mavlink_msg_mount_status_get_pointing_a
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_int32_t
(
msg
,
2
);
}
/**
* @brief Get field pointing_b from mount_status message
*
* @return roll(deg*100) or lon depending on mount mode
*/
static
inline
int32_t
mavlink_msg_mount_status_get_pointing_b
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_int32_t
(
msg
,
6
);
}
/**
* @brief Get field pointing_c from mount_status message
*
* @return yaw(deg*100) or alt (in cm) depending on mount mode
*/
static
inline
int32_t
mavlink_msg_mount_status_get_pointing_c
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_int32_t
(
msg
,
10
);
}
/**
* @brief Decode a mount_status message into a struct
*
* @param msg The message to decode
* @param mount_status C-struct to decode the message contents into
*/
static
inline
void
mavlink_msg_mount_status_decode
(
const
mavlink_message_t
*
msg
,
mavlink_mount_status_t
*
mount_status
)
{
#if MAVLINK_NEED_BYTE_SWAP
mount_status
->
target_system
=
mavlink_msg_mount_status_get_target_system
(
msg
);
mount_status
->
target_component
=
mavlink_msg_mount_status_get_target_component
(
msg
);
mount_status
->
pointing_a
=
mavlink_msg_mount_status_get_pointing_a
(
msg
);
mount_status
->
pointing_b
=
mavlink_msg_mount_status_get_pointing_b
(
msg
);
mount_status
->
pointing_c
=
mavlink_msg_mount_status_get_pointing_c
(
msg
);
#else
memcpy
(
mount_status
,
_MAV_PAYLOAD
(
msg
),
14
);
#endif
}
mavlink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_radio.h
0 → 100644
View file @
3d751338
// MESSAGE RADIO PACKING
#define MAVLINK_MSG_ID_RADIO 166
typedef
struct
__mavlink_radio_t
{
uint8_t
rssi
;
///< local signal strength
uint8_t
remrssi
;
///< remote signal strength
uint8_t
txbuf
;
///< how full the tx buffer is as a percentage
uint8_t
noise
;
///< background noise level
uint8_t
remnoise
;
///< remote background noise level
uint16_t
rxerrors
;
///< receive errors
uint16_t
fixed
;
///< count of error corrected packets
}
mavlink_radio_t
;
#define MAVLINK_MSG_ID_RADIO_LEN 9
#define MAVLINK_MSG_ID_166_LEN 9
#define MAVLINK_MESSAGE_INFO_RADIO { \
"RADIO", \
7, \
{ { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_radio_t, rssi) }, \
{ "remrssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_radio_t, remrssi) }, \
{ "txbuf", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_radio_t, txbuf) }, \
{ "noise", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_radio_t, noise) }, \
{ "remnoise", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_radio_t, remnoise) }, \
{ "rxerrors", NULL, MAVLINK_TYPE_UINT16_T, 0, 5, offsetof(mavlink_radio_t, rxerrors) }, \
{ "fixed", NULL, MAVLINK_TYPE_UINT16_T, 0, 7, offsetof(mavlink_radio_t, fixed) }, \
} \
}
/**
* @brief Pack a radio 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 rssi local signal strength
* @param remrssi remote signal strength
* @param txbuf how full the tx buffer is as a percentage
* @param noise background noise level
* @param remnoise remote background noise level
* @param rxerrors receive errors
* @param fixed count of error corrected packets
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_radio_pack
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
uint8_t
rssi
,
uint8_t
remrssi
,
uint8_t
txbuf
,
uint8_t
noise
,
uint8_t
remnoise
,
uint16_t
rxerrors
,
uint16_t
fixed
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
9
];
_mav_put_uint8_t
(
buf
,
0
,
rssi
);
_mav_put_uint8_t
(
buf
,
1
,
remrssi
);
_mav_put_uint8_t
(
buf
,
2
,
txbuf
);
_mav_put_uint8_t
(
buf
,
3
,
noise
);
_mav_put_uint8_t
(
buf
,
4
,
remnoise
);
_mav_put_uint16_t
(
buf
,
5
,
rxerrors
);
_mav_put_uint16_t
(
buf
,
7
,
fixed
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
9
);
#else
mavlink_radio_t
packet
;
packet
.
rssi
=
rssi
;
packet
.
remrssi
=
remrssi
;
packet
.
txbuf
=
txbuf
;
packet
.
noise
=
noise
;
packet
.
remnoise
=
remnoise
;
packet
.
rxerrors
=
rxerrors
;
packet
.
fixed
=
fixed
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
9
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_RADIO
;
return
mavlink_finalize_message
(
msg
,
system_id
,
component_id
,
9
);
}
/**
* @brief Pack a radio 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param rssi local signal strength
* @param remrssi remote signal strength
* @param txbuf how full the tx buffer is as a percentage
* @param noise background noise level
* @param remnoise remote background noise level
* @param rxerrors receive errors
* @param fixed count of error corrected packets
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_radio_pack_chan
(
uint8_t
system_id
,
uint8_t
component_id
,
uint8_t
chan
,
mavlink_message_t
*
msg
,
uint8_t
rssi
,
uint8_t
remrssi
,
uint8_t
txbuf
,
uint8_t
noise
,
uint8_t
remnoise
,
uint16_t
rxerrors
,
uint16_t
fixed
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
9
];
_mav_put_uint8_t
(
buf
,
0
,
rssi
);
_mav_put_uint8_t
(
buf
,
1
,
remrssi
);
_mav_put_uint8_t
(
buf
,
2
,
txbuf
);
_mav_put_uint8_t
(
buf
,
3
,
noise
);
_mav_put_uint8_t
(
buf
,
4
,
remnoise
);
_mav_put_uint16_t
(
buf
,
5
,
rxerrors
);
_mav_put_uint16_t
(
buf
,
7
,
fixed
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
9
);
#else
mavlink_radio_t
packet
;
packet
.
rssi
=
rssi
;
packet
.
remrssi
=
remrssi
;
packet
.
txbuf
=
txbuf
;
packet
.
noise
=
noise
;
packet
.
remnoise
=
remnoise
;
packet
.
rxerrors
=
rxerrors
;
packet
.
fixed
=
fixed
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
9
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_RADIO
;
return
mavlink_finalize_message_chan
(
msg
,
system_id
,
component_id
,
chan
,
9
);
}
/**
* @brief Encode a radio struct into a 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 radio C-struct to read the message contents from
*/
static
inline
uint16_t
mavlink_msg_radio_encode
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
const
mavlink_radio_t
*
radio
)
{
return
mavlink_msg_radio_pack
(
system_id
,
component_id
,
msg
,
radio
->
rssi
,
radio
->
remrssi
,
radio
->
txbuf
,
radio
->
noise
,
radio
->
remnoise
,
radio
->
rxerrors
,
radio
->
fixed
);
}
/**
* @brief Send a radio message
* @param chan MAVLink channel to send the message
*
* @param rssi local signal strength
* @param remrssi remote signal strength
* @param txbuf how full the tx buffer is as a percentage
* @param noise background noise level
* @param remnoise remote background noise level
* @param rxerrors receive errors
* @param fixed count of error corrected packets
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static
inline
void
mavlink_msg_radio_send
(
mavlink_channel_t
chan
,
uint8_t
rssi
,
uint8_t
remrssi
,
uint8_t
txbuf
,
uint8_t
noise
,
uint8_t
remnoise
,
uint16_t
rxerrors
,
uint16_t
fixed
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
9
];
_mav_put_uint8_t
(
buf
,
0
,
rssi
);
_mav_put_uint8_t
(
buf
,
1
,
remrssi
);
_mav_put_uint8_t
(
buf
,
2
,
txbuf
);
_mav_put_uint8_t
(
buf
,
3
,
noise
);
_mav_put_uint8_t
(
buf
,
4
,
remnoise
);
_mav_put_uint16_t
(
buf
,
5
,
rxerrors
);
_mav_put_uint16_t
(
buf
,
7
,
fixed
);
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_RADIO
,
buf
,
9
);
#else
mavlink_radio_t
packet
;
packet
.
rssi
=
rssi
;
packet
.
remrssi
=
remrssi
;
packet
.
txbuf
=
txbuf
;
packet
.
noise
=
noise
;
packet
.
remnoise
=
remnoise
;
packet
.
rxerrors
=
rxerrors
;
packet
.
fixed
=
fixed
;
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_RADIO
,
(
const
char
*
)
&
packet
,
9
);
#endif
}
#endif
// MESSAGE RADIO UNPACKING
/**
* @brief Get field rssi from radio message
*
* @return local signal strength
*/
static
inline
uint8_t
mavlink_msg_radio_get_rssi
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
0
);
}
/**
* @brief Get field remrssi from radio message
*
* @return remote signal strength
*/
static
inline
uint8_t
mavlink_msg_radio_get_remrssi
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
1
);
}
/**
* @brief Get field txbuf from radio message
*
* @return how full the tx buffer is as a percentage
*/
static
inline
uint8_t
mavlink_msg_radio_get_txbuf
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
2
);
}
/**
* @brief Get field noise from radio message
*
* @return background noise level
*/
static
inline
uint8_t
mavlink_msg_radio_get_noise
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
3
);
}
/**
* @brief Get field remnoise from radio message
*
* @return remote background noise level
*/
static
inline
uint8_t
mavlink_msg_radio_get_remnoise
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
4
);
}
/**
* @brief Get field rxerrors from radio message
*
* @return receive errors
*/
static
inline
uint16_t
mavlink_msg_radio_get_rxerrors
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint16_t
(
msg
,
5
);
}
/**
* @brief Get field fixed from radio message
*
* @return count of error corrected packets
*/
static
inline
uint16_t
mavlink_msg_radio_get_fixed
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint16_t
(
msg
,
7
);
}
/**
* @brief Decode a radio message into a struct
*
* @param msg The message to decode
* @param radio C-struct to decode the message contents into
*/
static
inline
void
mavlink_msg_radio_decode
(
const
mavlink_message_t
*
msg
,
mavlink_radio_t
*
radio
)
{
#if MAVLINK_NEED_BYTE_SWAP
radio
->
rssi
=
mavlink_msg_radio_get_rssi
(
msg
);
radio
->
remrssi
=
mavlink_msg_radio_get_remrssi
(
msg
);
radio
->
txbuf
=
mavlink_msg_radio_get_txbuf
(
msg
);
radio
->
noise
=
mavlink_msg_radio_get_noise
(
msg
);
radio
->
remnoise
=
mavlink_msg_radio_get_remnoise
(
msg
);
radio
->
rxerrors
=
mavlink_msg_radio_get_rxerrors
(
msg
);
radio
->
fixed
=
mavlink_msg_radio_get_fixed
(
msg
);
#else
memcpy
(
radio
,
_MAV_PAYLOAD
(
msg
),
9
);
#endif
}
mavlink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_sensor_offsets.h
0 → 100644
View file @
3d751338
// MESSAGE SENSOR_OFFSETS PACKING
#define MAVLINK_MSG_ID_SENSOR_OFFSETS 150
typedef
struct
__mavlink_sensor_offsets_t
{
int16_t
mag_ofs_x
;
///< magnetometer X offset
int16_t
mag_ofs_y
;
///< magnetometer Y offset
int16_t
mag_ofs_z
;
///< magnetometer Z offset
float
mag_declination
;
///< magnetic declination (radians)
int32_t
raw_press
;
///< raw pressure from barometer
int32_t
raw_temp
;
///< raw temperature from barometer
float
gyro_cal_x
;
///< gyro X calibration
float
gyro_cal_y
;
///< gyro Y calibration
float
gyro_cal_z
;
///< gyro Z calibration
float
accel_cal_x
;
///< accel X calibration
float
accel_cal_y
;
///< accel Y calibration
float
accel_cal_z
;
///< accel Z calibration
}
mavlink_sensor_offsets_t
;
#define MAVLINK_MSG_ID_SENSOR_OFFSETS_LEN 42
#define MAVLINK_MSG_ID_150_LEN 42
#define MAVLINK_MESSAGE_INFO_SENSOR_OFFSETS { \
"SENSOR_OFFSETS", \
12, \
{ { "mag_ofs_x", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_sensor_offsets_t, mag_ofs_x) }, \
{ "mag_ofs_y", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_sensor_offsets_t, mag_ofs_y) }, \
{ "mag_ofs_z", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_sensor_offsets_t, mag_ofs_z) }, \
{ "mag_declination", NULL, MAVLINK_TYPE_FLOAT, 0, 6, offsetof(mavlink_sensor_offsets_t, mag_declination) }, \
{ "raw_press", NULL, MAVLINK_TYPE_INT32_T, 0, 10, offsetof(mavlink_sensor_offsets_t, raw_press) }, \
{ "raw_temp", NULL, MAVLINK_TYPE_INT32_T, 0, 14, offsetof(mavlink_sensor_offsets_t, raw_temp) }, \
{ "gyro_cal_x", NULL, MAVLINK_TYPE_FLOAT, 0, 18, offsetof(mavlink_sensor_offsets_t, gyro_cal_x) }, \
{ "gyro_cal_y", NULL, MAVLINK_TYPE_FLOAT, 0, 22, offsetof(mavlink_sensor_offsets_t, gyro_cal_y) }, \
{ "gyro_cal_z", NULL, MAVLINK_TYPE_FLOAT, 0, 26, offsetof(mavlink_sensor_offsets_t, gyro_cal_z) }, \
{ "accel_cal_x", NULL, MAVLINK_TYPE_FLOAT, 0, 30, offsetof(mavlink_sensor_offsets_t, accel_cal_x) }, \
{ "accel_cal_y", NULL, MAVLINK_TYPE_FLOAT, 0, 34, offsetof(mavlink_sensor_offsets_t, accel_cal_y) }, \
{ "accel_cal_z", NULL, MAVLINK_TYPE_FLOAT, 0, 38, offsetof(mavlink_sensor_offsets_t, accel_cal_z) }, \
} \
}
/**
* @brief Pack a sensor_offsets 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 mag_ofs_x magnetometer X offset
* @param mag_ofs_y magnetometer Y offset
* @param mag_ofs_z magnetometer Z offset
* @param mag_declination magnetic declination (radians)
* @param raw_press raw pressure from barometer
* @param raw_temp raw temperature from barometer
* @param gyro_cal_x gyro X calibration
* @param gyro_cal_y gyro Y calibration
* @param gyro_cal_z gyro Z calibration
* @param accel_cal_x accel X calibration
* @param accel_cal_y accel Y calibration
* @param accel_cal_z accel Z calibration
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_sensor_offsets_pack
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
int16_t
mag_ofs_x
,
int16_t
mag_ofs_y
,
int16_t
mag_ofs_z
,
float
mag_declination
,
int32_t
raw_press
,
int32_t
raw_temp
,
float
gyro_cal_x
,
float
gyro_cal_y
,
float
gyro_cal_z
,
float
accel_cal_x
,
float
accel_cal_y
,
float
accel_cal_z
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
42
];
_mav_put_int16_t
(
buf
,
0
,
mag_ofs_x
);
_mav_put_int16_t
(
buf
,
2
,
mag_ofs_y
);
_mav_put_int16_t
(
buf
,
4
,
mag_ofs_z
);
_mav_put_float
(
buf
,
6
,
mag_declination
);
_mav_put_int32_t
(
buf
,
10
,
raw_press
);
_mav_put_int32_t
(
buf
,
14
,
raw_temp
);
_mav_put_float
(
buf
,
18
,
gyro_cal_x
);
_mav_put_float
(
buf
,
22
,
gyro_cal_y
);
_mav_put_float
(
buf
,
26
,
gyro_cal_z
);
_mav_put_float
(
buf
,
30
,
accel_cal_x
);
_mav_put_float
(
buf
,
34
,
accel_cal_y
);
_mav_put_float
(
buf
,
38
,
accel_cal_z
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
42
);
#else
mavlink_sensor_offsets_t
packet
;
packet
.
mag_ofs_x
=
mag_ofs_x
;
packet
.
mag_ofs_y
=
mag_ofs_y
;
packet
.
mag_ofs_z
=
mag_ofs_z
;
packet
.
mag_declination
=
mag_declination
;
packet
.
raw_press
=
raw_press
;
packet
.
raw_temp
=
raw_temp
;
packet
.
gyro_cal_x
=
gyro_cal_x
;
packet
.
gyro_cal_y
=
gyro_cal_y
;
packet
.
gyro_cal_z
=
gyro_cal_z
;
packet
.
accel_cal_x
=
accel_cal_x
;
packet
.
accel_cal_y
=
accel_cal_y
;
packet
.
accel_cal_z
=
accel_cal_z
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
42
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_SENSOR_OFFSETS
;
return
mavlink_finalize_message
(
msg
,
system_id
,
component_id
,
42
);
}
/**
* @brief Pack a sensor_offsets 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param mag_ofs_x magnetometer X offset
* @param mag_ofs_y magnetometer Y offset
* @param mag_ofs_z magnetometer Z offset
* @param mag_declination magnetic declination (radians)
* @param raw_press raw pressure from barometer
* @param raw_temp raw temperature from barometer
* @param gyro_cal_x gyro X calibration
* @param gyro_cal_y gyro Y calibration
* @param gyro_cal_z gyro Z calibration
* @param accel_cal_x accel X calibration
* @param accel_cal_y accel Y calibration
* @param accel_cal_z accel Z calibration
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_sensor_offsets_pack_chan
(
uint8_t
system_id
,
uint8_t
component_id
,
uint8_t
chan
,
mavlink_message_t
*
msg
,
int16_t
mag_ofs_x
,
int16_t
mag_ofs_y
,
int16_t
mag_ofs_z
,
float
mag_declination
,
int32_t
raw_press
,
int32_t
raw_temp
,
float
gyro_cal_x
,
float
gyro_cal_y
,
float
gyro_cal_z
,
float
accel_cal_x
,
float
accel_cal_y
,
float
accel_cal_z
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
42
];
_mav_put_int16_t
(
buf
,
0
,
mag_ofs_x
);
_mav_put_int16_t
(
buf
,
2
,
mag_ofs_y
);
_mav_put_int16_t
(
buf
,
4
,
mag_ofs_z
);
_mav_put_float
(
buf
,
6
,
mag_declination
);
_mav_put_int32_t
(
buf
,
10
,
raw_press
);
_mav_put_int32_t
(
buf
,
14
,
raw_temp
);
_mav_put_float
(
buf
,
18
,
gyro_cal_x
);
_mav_put_float
(
buf
,
22
,
gyro_cal_y
);
_mav_put_float
(
buf
,
26
,
gyro_cal_z
);
_mav_put_float
(
buf
,
30
,
accel_cal_x
);
_mav_put_float
(
buf
,
34
,
accel_cal_y
);
_mav_put_float
(
buf
,
38
,
accel_cal_z
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
42
);
#else
mavlink_sensor_offsets_t
packet
;
packet
.
mag_ofs_x
=
mag_ofs_x
;
packet
.
mag_ofs_y
=
mag_ofs_y
;
packet
.
mag_ofs_z
=
mag_ofs_z
;
packet
.
mag_declination
=
mag_declination
;
packet
.
raw_press
=
raw_press
;
packet
.
raw_temp
=
raw_temp
;
packet
.
gyro_cal_x
=
gyro_cal_x
;
packet
.
gyro_cal_y
=
gyro_cal_y
;
packet
.
gyro_cal_z
=
gyro_cal_z
;
packet
.
accel_cal_x
=
accel_cal_x
;
packet
.
accel_cal_y
=
accel_cal_y
;
packet
.
accel_cal_z
=
accel_cal_z
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
42
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_SENSOR_OFFSETS
;
return
mavlink_finalize_message_chan
(
msg
,
system_id
,
component_id
,
chan
,
42
);
}
/**
* @brief Encode a sensor_offsets struct into a 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 sensor_offsets C-struct to read the message contents from
*/
static
inline
uint16_t
mavlink_msg_sensor_offsets_encode
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
const
mavlink_sensor_offsets_t
*
sensor_offsets
)
{
return
mavlink_msg_sensor_offsets_pack
(
system_id
,
component_id
,
msg
,
sensor_offsets
->
mag_ofs_x
,
sensor_offsets
->
mag_ofs_y
,
sensor_offsets
->
mag_ofs_z
,
sensor_offsets
->
mag_declination
,
sensor_offsets
->
raw_press
,
sensor_offsets
->
raw_temp
,
sensor_offsets
->
gyro_cal_x
,
sensor_offsets
->
gyro_cal_y
,
sensor_offsets
->
gyro_cal_z
,
sensor_offsets
->
accel_cal_x
,
sensor_offsets
->
accel_cal_y
,
sensor_offsets
->
accel_cal_z
);
}
/**
* @brief Send a sensor_offsets message
* @param chan MAVLink channel to send the message
*
* @param mag_ofs_x magnetometer X offset
* @param mag_ofs_y magnetometer Y offset
* @param mag_ofs_z magnetometer Z offset
* @param mag_declination magnetic declination (radians)
* @param raw_press raw pressure from barometer
* @param raw_temp raw temperature from barometer
* @param gyro_cal_x gyro X calibration
* @param gyro_cal_y gyro Y calibration
* @param gyro_cal_z gyro Z calibration
* @param accel_cal_x accel X calibration
* @param accel_cal_y accel Y calibration
* @param accel_cal_z accel Z calibration
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static
inline
void
mavlink_msg_sensor_offsets_send
(
mavlink_channel_t
chan
,
int16_t
mag_ofs_x
,
int16_t
mag_ofs_y
,
int16_t
mag_ofs_z
,
float
mag_declination
,
int32_t
raw_press
,
int32_t
raw_temp
,
float
gyro_cal_x
,
float
gyro_cal_y
,
float
gyro_cal_z
,
float
accel_cal_x
,
float
accel_cal_y
,
float
accel_cal_z
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
42
];
_mav_put_int16_t
(
buf
,
0
,
mag_ofs_x
);
_mav_put_int16_t
(
buf
,
2
,
mag_ofs_y
);
_mav_put_int16_t
(
buf
,
4
,
mag_ofs_z
);
_mav_put_float
(
buf
,
6
,
mag_declination
);
_mav_put_int32_t
(
buf
,
10
,
raw_press
);
_mav_put_int32_t
(
buf
,
14
,
raw_temp
);
_mav_put_float
(
buf
,
18
,
gyro_cal_x
);
_mav_put_float
(
buf
,
22
,
gyro_cal_y
);
_mav_put_float
(
buf
,
26
,
gyro_cal_z
);
_mav_put_float
(
buf
,
30
,
accel_cal_x
);
_mav_put_float
(
buf
,
34
,
accel_cal_y
);
_mav_put_float
(
buf
,
38
,
accel_cal_z
);
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_SENSOR_OFFSETS
,
buf
,
42
);
#else
mavlink_sensor_offsets_t
packet
;
packet
.
mag_ofs_x
=
mag_ofs_x
;
packet
.
mag_ofs_y
=
mag_ofs_y
;
packet
.
mag_ofs_z
=
mag_ofs_z
;
packet
.
mag_declination
=
mag_declination
;
packet
.
raw_press
=
raw_press
;
packet
.
raw_temp
=
raw_temp
;
packet
.
gyro_cal_x
=
gyro_cal_x
;
packet
.
gyro_cal_y
=
gyro_cal_y
;
packet
.
gyro_cal_z
=
gyro_cal_z
;
packet
.
accel_cal_x
=
accel_cal_x
;
packet
.
accel_cal_y
=
accel_cal_y
;
packet
.
accel_cal_z
=
accel_cal_z
;
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_SENSOR_OFFSETS
,
(
const
char
*
)
&
packet
,
42
);
#endif
}
#endif
// MESSAGE SENSOR_OFFSETS UNPACKING
/**
* @brief Get field mag_ofs_x from sensor_offsets message
*
* @return magnetometer X offset
*/
static
inline
int16_t
mavlink_msg_sensor_offsets_get_mag_ofs_x
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_int16_t
(
msg
,
0
);
}
/**
* @brief Get field mag_ofs_y from sensor_offsets message
*
* @return magnetometer Y offset
*/
static
inline
int16_t
mavlink_msg_sensor_offsets_get_mag_ofs_y
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_int16_t
(
msg
,
2
);
}
/**
* @brief Get field mag_ofs_z from sensor_offsets message
*
* @return magnetometer Z offset
*/
static
inline
int16_t
mavlink_msg_sensor_offsets_get_mag_ofs_z
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_int16_t
(
msg
,
4
);
}
/**
* @brief Get field mag_declination from sensor_offsets message
*
* @return magnetic declination (radians)
*/
static
inline
float
mavlink_msg_sensor_offsets_get_mag_declination
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_float
(
msg
,
6
);
}
/**
* @brief Get field raw_press from sensor_offsets message
*
* @return raw pressure from barometer
*/
static
inline
int32_t
mavlink_msg_sensor_offsets_get_raw_press
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_int32_t
(
msg
,
10
);
}
/**
* @brief Get field raw_temp from sensor_offsets message
*
* @return raw temperature from barometer
*/
static
inline
int32_t
mavlink_msg_sensor_offsets_get_raw_temp
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_int32_t
(
msg
,
14
);
}
/**
* @brief Get field gyro_cal_x from sensor_offsets message
*
* @return gyro X calibration
*/
static
inline
float
mavlink_msg_sensor_offsets_get_gyro_cal_x
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_float
(
msg
,
18
);
}
/**
* @brief Get field gyro_cal_y from sensor_offsets message
*
* @return gyro Y calibration
*/
static
inline
float
mavlink_msg_sensor_offsets_get_gyro_cal_y
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_float
(
msg
,
22
);
}
/**
* @brief Get field gyro_cal_z from sensor_offsets message
*
* @return gyro Z calibration
*/
static
inline
float
mavlink_msg_sensor_offsets_get_gyro_cal_z
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_float
(
msg
,
26
);
}
/**
* @brief Get field accel_cal_x from sensor_offsets message
*
* @return accel X calibration
*/
static
inline
float
mavlink_msg_sensor_offsets_get_accel_cal_x
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_float
(
msg
,
30
);
}
/**
* @brief Get field accel_cal_y from sensor_offsets message
*
* @return accel Y calibration
*/
static
inline
float
mavlink_msg_sensor_offsets_get_accel_cal_y
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_float
(
msg
,
34
);
}
/**
* @brief Get field accel_cal_z from sensor_offsets message
*
* @return accel Z calibration
*/
static
inline
float
mavlink_msg_sensor_offsets_get_accel_cal_z
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_float
(
msg
,
38
);
}
/**
* @brief Decode a sensor_offsets message into a struct
*
* @param msg The message to decode
* @param sensor_offsets C-struct to decode the message contents into
*/
static
inline
void
mavlink_msg_sensor_offsets_decode
(
const
mavlink_message_t
*
msg
,
mavlink_sensor_offsets_t
*
sensor_offsets
)
{
#if MAVLINK_NEED_BYTE_SWAP
sensor_offsets
->
mag_ofs_x
=
mavlink_msg_sensor_offsets_get_mag_ofs_x
(
msg
);
sensor_offsets
->
mag_ofs_y
=
mavlink_msg_sensor_offsets_get_mag_ofs_y
(
msg
);
sensor_offsets
->
mag_ofs_z
=
mavlink_msg_sensor_offsets_get_mag_ofs_z
(
msg
);
sensor_offsets
->
mag_declination
=
mavlink_msg_sensor_offsets_get_mag_declination
(
msg
);
sensor_offsets
->
raw_press
=
mavlink_msg_sensor_offsets_get_raw_press
(
msg
);
sensor_offsets
->
raw_temp
=
mavlink_msg_sensor_offsets_get_raw_temp
(
msg
);
sensor_offsets
->
gyro_cal_x
=
mavlink_msg_sensor_offsets_get_gyro_cal_x
(
msg
);
sensor_offsets
->
gyro_cal_y
=
mavlink_msg_sensor_offsets_get_gyro_cal_y
(
msg
);
sensor_offsets
->
gyro_cal_z
=
mavlink_msg_sensor_offsets_get_gyro_cal_z
(
msg
);
sensor_offsets
->
accel_cal_x
=
mavlink_msg_sensor_offsets_get_accel_cal_x
(
msg
);
sensor_offsets
->
accel_cal_y
=
mavlink_msg_sensor_offsets_get_accel_cal_y
(
msg
);
sensor_offsets
->
accel_cal_z
=
mavlink_msg_sensor_offsets_get_accel_cal_z
(
msg
);
#else
memcpy
(
sensor_offsets
,
_MAV_PAYLOAD
(
msg
),
42
);
#endif
}
mavlink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_set_mag_offsets.h
0 → 100644
View file @
3d751338
// MESSAGE SET_MAG_OFFSETS PACKING
#define MAVLINK_MSG_ID_SET_MAG_OFFSETS 151
typedef
struct
__mavlink_set_mag_offsets_t
{
uint8_t
target_system
;
///< System ID
uint8_t
target_component
;
///< Component ID
int16_t
mag_ofs_x
;
///< magnetometer X offset
int16_t
mag_ofs_y
;
///< magnetometer Y offset
int16_t
mag_ofs_z
;
///< magnetometer Z offset
}
mavlink_set_mag_offsets_t
;
#define MAVLINK_MSG_ID_SET_MAG_OFFSETS_LEN 8
#define MAVLINK_MSG_ID_151_LEN 8
#define MAVLINK_MESSAGE_INFO_SET_MAG_OFFSETS { \
"SET_MAG_OFFSETS", \
5, \
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_set_mag_offsets_t, target_system) }, \
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_set_mag_offsets_t, target_component) }, \
{ "mag_ofs_x", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_set_mag_offsets_t, mag_ofs_x) }, \
{ "mag_ofs_y", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_set_mag_offsets_t, mag_ofs_y) }, \
{ "mag_ofs_z", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_set_mag_offsets_t, mag_ofs_z) }, \
} \
}
/**
* @brief Pack a set_mag_offsets 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 target_system System ID
* @param target_component Component ID
* @param mag_ofs_x magnetometer X offset
* @param mag_ofs_y magnetometer Y offset
* @param mag_ofs_z magnetometer Z offset
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_set_mag_offsets_pack
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
uint8_t
target_system
,
uint8_t
target_component
,
int16_t
mag_ofs_x
,
int16_t
mag_ofs_y
,
int16_t
mag_ofs_z
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
8
];
_mav_put_uint8_t
(
buf
,
0
,
target_system
);
_mav_put_uint8_t
(
buf
,
1
,
target_component
);
_mav_put_int16_t
(
buf
,
2
,
mag_ofs_x
);
_mav_put_int16_t
(
buf
,
4
,
mag_ofs_y
);
_mav_put_int16_t
(
buf
,
6
,
mag_ofs_z
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
8
);
#else
mavlink_set_mag_offsets_t
packet
;
packet
.
target_system
=
target_system
;
packet
.
target_component
=
target_component
;
packet
.
mag_ofs_x
=
mag_ofs_x
;
packet
.
mag_ofs_y
=
mag_ofs_y
;
packet
.
mag_ofs_z
=
mag_ofs_z
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
8
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_SET_MAG_OFFSETS
;
return
mavlink_finalize_message
(
msg
,
system_id
,
component_id
,
8
);
}
/**
* @brief Pack a set_mag_offsets 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param target_system System ID
* @param target_component Component ID
* @param mag_ofs_x magnetometer X offset
* @param mag_ofs_y magnetometer Y offset
* @param mag_ofs_z magnetometer Z offset
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_set_mag_offsets_pack_chan
(
uint8_t
system_id
,
uint8_t
component_id
,
uint8_t
chan
,
mavlink_message_t
*
msg
,
uint8_t
target_system
,
uint8_t
target_component
,
int16_t
mag_ofs_x
,
int16_t
mag_ofs_y
,
int16_t
mag_ofs_z
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
8
];
_mav_put_uint8_t
(
buf
,
0
,
target_system
);
_mav_put_uint8_t
(
buf
,
1
,
target_component
);
_mav_put_int16_t
(
buf
,
2
,
mag_ofs_x
);
_mav_put_int16_t
(
buf
,
4
,
mag_ofs_y
);
_mav_put_int16_t
(
buf
,
6
,
mag_ofs_z
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
8
);
#else
mavlink_set_mag_offsets_t
packet
;
packet
.
target_system
=
target_system
;
packet
.
target_component
=
target_component
;
packet
.
mag_ofs_x
=
mag_ofs_x
;
packet
.
mag_ofs_y
=
mag_ofs_y
;
packet
.
mag_ofs_z
=
mag_ofs_z
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
8
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_SET_MAG_OFFSETS
;
return
mavlink_finalize_message_chan
(
msg
,
system_id
,
component_id
,
chan
,
8
);
}
/**
* @brief Encode a set_mag_offsets struct into a 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 set_mag_offsets C-struct to read the message contents from
*/
static
inline
uint16_t
mavlink_msg_set_mag_offsets_encode
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
const
mavlink_set_mag_offsets_t
*
set_mag_offsets
)
{
return
mavlink_msg_set_mag_offsets_pack
(
system_id
,
component_id
,
msg
,
set_mag_offsets
->
target_system
,
set_mag_offsets
->
target_component
,
set_mag_offsets
->
mag_ofs_x
,
set_mag_offsets
->
mag_ofs_y
,
set_mag_offsets
->
mag_ofs_z
);
}
/**
* @brief Send a set_mag_offsets message
* @param chan MAVLink channel to send the message
*
* @param target_system System ID
* @param target_component Component ID
* @param mag_ofs_x magnetometer X offset
* @param mag_ofs_y magnetometer Y offset
* @param mag_ofs_z magnetometer Z offset
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static
inline
void
mavlink_msg_set_mag_offsets_send
(
mavlink_channel_t
chan
,
uint8_t
target_system
,
uint8_t
target_component
,
int16_t
mag_ofs_x
,
int16_t
mag_ofs_y
,
int16_t
mag_ofs_z
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
8
];
_mav_put_uint8_t
(
buf
,
0
,
target_system
);
_mav_put_uint8_t
(
buf
,
1
,
target_component
);
_mav_put_int16_t
(
buf
,
2
,
mag_ofs_x
);
_mav_put_int16_t
(
buf
,
4
,
mag_ofs_y
);
_mav_put_int16_t
(
buf
,
6
,
mag_ofs_z
);
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_SET_MAG_OFFSETS
,
buf
,
8
);
#else
mavlink_set_mag_offsets_t
packet
;
packet
.
target_system
=
target_system
;
packet
.
target_component
=
target_component
;
packet
.
mag_ofs_x
=
mag_ofs_x
;
packet
.
mag_ofs_y
=
mag_ofs_y
;
packet
.
mag_ofs_z
=
mag_ofs_z
;
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_SET_MAG_OFFSETS
,
(
const
char
*
)
&
packet
,
8
);
#endif
}
#endif
// MESSAGE SET_MAG_OFFSETS UNPACKING
/**
* @brief Get field target_system from set_mag_offsets message
*
* @return System ID
*/
static
inline
uint8_t
mavlink_msg_set_mag_offsets_get_target_system
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
0
);
}
/**
* @brief Get field target_component from set_mag_offsets message
*
* @return Component ID
*/
static
inline
uint8_t
mavlink_msg_set_mag_offsets_get_target_component
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_uint8_t
(
msg
,
1
);
}
/**
* @brief Get field mag_ofs_x from set_mag_offsets message
*
* @return magnetometer X offset
*/
static
inline
int16_t
mavlink_msg_set_mag_offsets_get_mag_ofs_x
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_int16_t
(
msg
,
2
);
}
/**
* @brief Get field mag_ofs_y from set_mag_offsets message
*
* @return magnetometer Y offset
*/
static
inline
int16_t
mavlink_msg_set_mag_offsets_get_mag_ofs_y
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_int16_t
(
msg
,
4
);
}
/**
* @brief Get field mag_ofs_z from set_mag_offsets message
*
* @return magnetometer Z offset
*/
static
inline
int16_t
mavlink_msg_set_mag_offsets_get_mag_ofs_z
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_int16_t
(
msg
,
6
);
}
/**
* @brief Decode a set_mag_offsets message into a struct
*
* @param msg The message to decode
* @param set_mag_offsets C-struct to decode the message contents into
*/
static
inline
void
mavlink_msg_set_mag_offsets_decode
(
const
mavlink_message_t
*
msg
,
mavlink_set_mag_offsets_t
*
set_mag_offsets
)
{
#if MAVLINK_NEED_BYTE_SWAP
set_mag_offsets
->
target_system
=
mavlink_msg_set_mag_offsets_get_target_system
(
msg
);
set_mag_offsets
->
target_component
=
mavlink_msg_set_mag_offsets_get_target_component
(
msg
);
set_mag_offsets
->
mag_ofs_x
=
mavlink_msg_set_mag_offsets_get_mag_ofs_x
(
msg
);
set_mag_offsets
->
mag_ofs_y
=
mavlink_msg_set_mag_offsets_get_mag_ofs_y
(
msg
);
set_mag_offsets
->
mag_ofs_z
=
mavlink_msg_set_mag_offsets_get_mag_ofs_z
(
msg
);
#else
memcpy
(
set_mag_offsets
,
_MAV_PAYLOAD
(
msg
),
8
);
#endif
}
mavlink/include/mavlink/v0.9/ardupilotmega/mavlink_msg_simstate.h
0 → 100644
View file @
3d751338
// MESSAGE SIMSTATE PACKING
#define MAVLINK_MSG_ID_SIMSTATE 164
typedef
struct
__mavlink_simstate_t
{
float
roll
;
///< Roll angle (rad)
float
pitch
;
///< Pitch angle (rad)
float
yaw
;
///< Yaw angle (rad)
float
xacc
;
///< X acceleration m/s/s
float
yacc
;
///< Y acceleration m/s/s
float
zacc
;
///< Z acceleration m/s/s
float
xgyro
;
///< Angular speed around X axis rad/s
float
ygyro
;
///< Angular speed around Y axis rad/s
float
zgyro
;
///< Angular speed around Z axis rad/s
}
mavlink_simstate_t
;
#define MAVLINK_MSG_ID_SIMSTATE_LEN 36
#define MAVLINK_MSG_ID_164_LEN 36
#define MAVLINK_MESSAGE_INFO_SIMSTATE { \
"SIMSTATE", \
9, \
{ { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_simstate_t, roll) }, \
{ "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_simstate_t, pitch) }, \
{ "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_simstate_t, yaw) }, \
{ "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_simstate_t, xacc) }, \
{ "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_simstate_t, yacc) }, \
{ "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_simstate_t, zacc) }, \
{ "xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_simstate_t, xgyro) }, \
{ "ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_simstate_t, ygyro) }, \
{ "zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_simstate_t, zgyro) }, \
} \
}
/**
* @brief Pack a simstate 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 roll Roll angle (rad)
* @param pitch Pitch angle (rad)
* @param yaw Yaw angle (rad)
* @param xacc X acceleration m/s/s
* @param yacc Y acceleration m/s/s
* @param zacc Z acceleration m/s/s
* @param xgyro Angular speed around X axis rad/s
* @param ygyro Angular speed around Y axis rad/s
* @param zgyro Angular speed around Z axis rad/s
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_simstate_pack
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
float
roll
,
float
pitch
,
float
yaw
,
float
xacc
,
float
yacc
,
float
zacc
,
float
xgyro
,
float
ygyro
,
float
zgyro
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
36
];
_mav_put_float
(
buf
,
0
,
roll
);
_mav_put_float
(
buf
,
4
,
pitch
);
_mav_put_float
(
buf
,
8
,
yaw
);
_mav_put_float
(
buf
,
12
,
xacc
);
_mav_put_float
(
buf
,
16
,
yacc
);
_mav_put_float
(
buf
,
20
,
zacc
);
_mav_put_float
(
buf
,
24
,
xgyro
);
_mav_put_float
(
buf
,
28
,
ygyro
);
_mav_put_float
(
buf
,
32
,
zgyro
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
36
);
#else
mavlink_simstate_t
packet
;
packet
.
roll
=
roll
;
packet
.
pitch
=
pitch
;
packet
.
yaw
=
yaw
;
packet
.
xacc
=
xacc
;
packet
.
yacc
=
yacc
;
packet
.
zacc
=
zacc
;
packet
.
xgyro
=
xgyro
;
packet
.
ygyro
=
ygyro
;
packet
.
zgyro
=
zgyro
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
36
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_SIMSTATE
;
return
mavlink_finalize_message
(
msg
,
system_id
,
component_id
,
36
);
}
/**
* @brief Pack a simstate 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 was sent over
* @param msg The MAVLink message to compress the data into
* @param roll Roll angle (rad)
* @param pitch Pitch angle (rad)
* @param yaw Yaw angle (rad)
* @param xacc X acceleration m/s/s
* @param yacc Y acceleration m/s/s
* @param zacc Z acceleration m/s/s
* @param xgyro Angular speed around X axis rad/s
* @param ygyro Angular speed around Y axis rad/s
* @param zgyro Angular speed around Z axis rad/s
* @return length of the message in bytes (excluding serial stream start sign)
*/
static
inline
uint16_t
mavlink_msg_simstate_pack_chan
(
uint8_t
system_id
,
uint8_t
component_id
,
uint8_t
chan
,
mavlink_message_t
*
msg
,
float
roll
,
float
pitch
,
float
yaw
,
float
xacc
,
float
yacc
,
float
zacc
,
float
xgyro
,
float
ygyro
,
float
zgyro
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
36
];
_mav_put_float
(
buf
,
0
,
roll
);
_mav_put_float
(
buf
,
4
,
pitch
);
_mav_put_float
(
buf
,
8
,
yaw
);
_mav_put_float
(
buf
,
12
,
xacc
);
_mav_put_float
(
buf
,
16
,
yacc
);
_mav_put_float
(
buf
,
20
,
zacc
);
_mav_put_float
(
buf
,
24
,
xgyro
);
_mav_put_float
(
buf
,
28
,
ygyro
);
_mav_put_float
(
buf
,
32
,
zgyro
);
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
buf
,
36
);
#else
mavlink_simstate_t
packet
;
packet
.
roll
=
roll
;
packet
.
pitch
=
pitch
;
packet
.
yaw
=
yaw
;
packet
.
xacc
=
xacc
;
packet
.
yacc
=
yacc
;
packet
.
zacc
=
zacc
;
packet
.
xgyro
=
xgyro
;
packet
.
ygyro
=
ygyro
;
packet
.
zgyro
=
zgyro
;
memcpy
(
_MAV_PAYLOAD_NON_CONST
(
msg
),
&
packet
,
36
);
#endif
msg
->
msgid
=
MAVLINK_MSG_ID_SIMSTATE
;
return
mavlink_finalize_message_chan
(
msg
,
system_id
,
component_id
,
chan
,
36
);
}
/**
* @brief Encode a simstate struct into a 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 simstate C-struct to read the message contents from
*/
static
inline
uint16_t
mavlink_msg_simstate_encode
(
uint8_t
system_id
,
uint8_t
component_id
,
mavlink_message_t
*
msg
,
const
mavlink_simstate_t
*
simstate
)
{
return
mavlink_msg_simstate_pack
(
system_id
,
component_id
,
msg
,
simstate
->
roll
,
simstate
->
pitch
,
simstate
->
yaw
,
simstate
->
xacc
,
simstate
->
yacc
,
simstate
->
zacc
,
simstate
->
xgyro
,
simstate
->
ygyro
,
simstate
->
zgyro
);
}
/**
* @brief Send a simstate message
* @param chan MAVLink channel to send the message
*
* @param roll Roll angle (rad)
* @param pitch Pitch angle (rad)
* @param yaw Yaw angle (rad)
* @param xacc X acceleration m/s/s
* @param yacc Y acceleration m/s/s
* @param zacc Z acceleration m/s/s
* @param xgyro Angular speed around X axis rad/s
* @param ygyro Angular speed around Y axis rad/s
* @param zgyro Angular speed around Z axis rad/s
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static
inline
void
mavlink_msg_simstate_send
(
mavlink_channel_t
chan
,
float
roll
,
float
pitch
,
float
yaw
,
float
xacc
,
float
yacc
,
float
zacc
,
float
xgyro
,
float
ygyro
,
float
zgyro
)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char
buf
[
36
];
_mav_put_float
(
buf
,
0
,
roll
);
_mav_put_float
(
buf
,
4
,
pitch
);
_mav_put_float
(
buf
,
8
,
yaw
);
_mav_put_float
(
buf
,
12
,
xacc
);
_mav_put_float
(
buf
,
16
,
yacc
);
_mav_put_float
(
buf
,
20
,
zacc
);
_mav_put_float
(
buf
,
24
,
xgyro
);
_mav_put_float
(
buf
,
28
,
ygyro
);
_mav_put_float
(
buf
,
32
,
zgyro
);
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_SIMSTATE
,
buf
,
36
);
#else
mavlink_simstate_t
packet
;
packet
.
roll
=
roll
;
packet
.
pitch
=
pitch
;
packet
.
yaw
=
yaw
;
packet
.
xacc
=
xacc
;
packet
.
yacc
=
yacc
;
packet
.
zacc
=
zacc
;
packet
.
xgyro
=
xgyro
;
packet
.
ygyro
=
ygyro
;
packet
.
zgyro
=
zgyro
;
_mav_finalize_message_chan_send
(
chan
,
MAVLINK_MSG_ID_SIMSTATE
,
(
const
char
*
)
&
packet
,
36
);
#endif
}
#endif
// MESSAGE SIMSTATE UNPACKING
/**
* @brief Get field roll from simstate message
*
* @return Roll angle (rad)
*/
static
inline
float
mavlink_msg_simstate_get_roll
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_float
(
msg
,
0
);
}
/**
* @brief Get field pitch from simstate message
*
* @return Pitch angle (rad)
*/
static
inline
float
mavlink_msg_simstate_get_pitch
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_float
(
msg
,
4
);
}
/**
* @brief Get field yaw from simstate message
*
* @return Yaw angle (rad)
*/
static
inline
float
mavlink_msg_simstate_get_yaw
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_float
(
msg
,
8
);
}
/**
* @brief Get field xacc from simstate message
*
* @return X acceleration m/s/s
*/
static
inline
float
mavlink_msg_simstate_get_xacc
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_float
(
msg
,
12
);
}
/**
* @brief Get field yacc from simstate message
*
* @return Y acceleration m/s/s
*/
static
inline
float
mavlink_msg_simstate_get_yacc
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_float
(
msg
,
16
);
}
/**
* @brief Get field zacc from simstate message
*
* @return Z acceleration m/s/s
*/
static
inline
float
mavlink_msg_simstate_get_zacc
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_float
(
msg
,
20
);
}
/**
* @brief Get field xgyro from simstate message
*
* @return Angular speed around X axis rad/s
*/
static
inline
float
mavlink_msg_simstate_get_xgyro
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_float
(
msg
,
24
);
}
/**
* @brief Get field ygyro from simstate message
*
* @return Angular speed around Y axis rad/s
*/
static
inline
float
mavlink_msg_simstate_get_ygyro
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_float
(
msg
,
28
);
}
/**
* @brief Get field zgyro from simstate message
*
* @return Angular speed around Z axis rad/s
*/
static
inline
float
mavlink_msg_simstate_get_zgyro
(
const
mavlink_message_t
*
msg
)
{
return
_MAV_RETURN_float
(
msg
,
32
);
}
/**
* @brief Decode a simstate message into a struct
*
* @param msg The message to decode
* @param simstate C-struct to decode the message contents into
*/
static
inline
void
mavlink_msg_simstate_decode
(
const
mavlink_message_t
*
msg
,
mavlink_simstate_t
*
simstate
)
{
#if MAVLINK_NEED_BYTE_SWAP
simstate
->
roll
=
mavlink_msg_simstate_get_roll
(
msg
);
simstate
->
pitch
=
mavlink_msg_simstate_get_pitch
(
msg
);
simstate
->
yaw
=
mavlink_msg_simstate_get_yaw
(
msg
);
simstate
->
xacc
=
mavlink_msg_simstate_get_xacc
(
msg
);
simstate
->
yacc
=
mavlink_msg_simstate_get_yacc
(
msg
);
simstate
->
zacc
=
mavlink_msg_simstate_get_zacc
(
msg
);
simstate
->
xgyro
=
mavlink_msg_simstate_get_xgyro
(
msg
);
simstate
->
ygyro
=
mavlink_msg_simstate_get_ygyro
(
msg
);
simstate
->
zgyro
=
mavlink_msg_simstate_get_zgyro
(
msg
);
#else
memcpy
(
simstate
,
_MAV_PAYLOAD
(
msg
),
36
);
#endif
}
Prev
1
2
3
4
5
…
21
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment