3 #define MAVLINK_MSG_ID_DATA_STREAM 67
12 #define MAVLINK_MSG_ID_DATA_STREAM_LEN 4
13 #define MAVLINK_MSG_ID_67_LEN 4
15 #define MAVLINK_MSG_ID_DATA_STREAM_CRC 21
16 #define MAVLINK_MSG_ID_67_CRC 21
20 #define MAVLINK_MESSAGE_INFO_DATA_STREAM { \
23 { { "message_rate", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_data_stream_t, message_rate) }, \
24 { "stream_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_data_stream_t, stream_id) }, \
25 { "on_off", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_data_stream_t, on_off) }, \
41 static inline uint16_t mavlink_msg_data_stream_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
42 uint8_t stream_id, uint16_t message_rate, uint8_t on_off)
44 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
45 char buf[MAVLINK_MSG_ID_DATA_STREAM_LEN];
46 _mav_put_uint16_t(buf, 0, message_rate);
47 _mav_put_uint8_t(buf, 2, stream_id);
48 _mav_put_uint8_t(buf, 3, on_off);
50 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA_STREAM_LEN);
57 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA_STREAM_LEN);
60 msg->msgid = MAVLINK_MSG_ID_DATA_STREAM;
62 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC);
64 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DATA_STREAM_LEN);
79 static inline uint16_t mavlink_msg_data_stream_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
80 mavlink_message_t* msg,
81 uint8_t stream_id,uint16_t message_rate,uint8_t on_off)
83 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
84 char buf[MAVLINK_MSG_ID_DATA_STREAM_LEN];
85 _mav_put_uint16_t(buf, 0, message_rate);
86 _mav_put_uint8_t(buf, 2, stream_id);
87 _mav_put_uint8_t(buf, 3, on_off);
89 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DATA_STREAM_LEN);
96 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DATA_STREAM_LEN);
99 msg->msgid = MAVLINK_MSG_ID_DATA_STREAM;
100 #if MAVLINK_CRC_EXTRA
101 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC);
103 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DATA_STREAM_LEN);
115 static inline uint16_t mavlink_msg_data_stream_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_data_stream_t* data_stream)
117 return mavlink_msg_data_stream_pack(system_id, component_id, msg, data_stream->
stream_id, data_stream->
message_rate, data_stream->
on_off);
129 static inline uint16_t mavlink_msg_data_stream_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_data_stream_t* data_stream)
131 return mavlink_msg_data_stream_pack_chan(system_id, component_id, chan, msg, data_stream->
stream_id, data_stream->
message_rate, data_stream->
on_off);
142 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
144 static inline void mavlink_msg_data_stream_send(mavlink_channel_t chan, uint8_t stream_id, uint16_t message_rate, uint8_t on_off)
146 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
147 char buf[MAVLINK_MSG_ID_DATA_STREAM_LEN];
148 _mav_put_uint16_t(buf, 0, message_rate);
149 _mav_put_uint8_t(buf, 2, stream_id);
150 _mav_put_uint8_t(buf, 3, on_off);
152 #if MAVLINK_CRC_EXTRA
153 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, buf, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC);
155 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, buf, MAVLINK_MSG_ID_DATA_STREAM_LEN);
163 #if MAVLINK_CRC_EXTRA
164 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, (
const char *)&packet, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC);
166 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, (
const char *)&packet, MAVLINK_MSG_ID_DATA_STREAM_LEN);
171 #if MAVLINK_MSG_ID_DATA_STREAM_LEN <= MAVLINK_MAX_PAYLOAD_LEN
179 static inline void mavlink_msg_data_stream_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t stream_id, uint16_t message_rate, uint8_t on_off)
181 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
182 char *buf = (
char *)msgbuf;
183 _mav_put_uint16_t(buf, 0, message_rate);
184 _mav_put_uint8_t(buf, 2, stream_id);
185 _mav_put_uint8_t(buf, 3, on_off);
187 #if MAVLINK_CRC_EXTRA
188 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, buf, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC);
190 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, buf, MAVLINK_MSG_ID_DATA_STREAM_LEN);
198 #if MAVLINK_CRC_EXTRA
199 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, (
const char *)packet, MAVLINK_MSG_ID_DATA_STREAM_LEN, MAVLINK_MSG_ID_DATA_STREAM_CRC);
201 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DATA_STREAM, (
const char *)packet, MAVLINK_MSG_ID_DATA_STREAM_LEN);
217 static inline uint8_t mavlink_msg_data_stream_get_stream_id(
const mavlink_message_t* msg)
219 return _MAV_RETURN_uint8_t(msg, 2);
227 static inline uint16_t mavlink_msg_data_stream_get_message_rate(
const mavlink_message_t* msg)
229 return _MAV_RETURN_uint16_t(msg, 0);
237 static inline uint8_t mavlink_msg_data_stream_get_on_off(
const mavlink_message_t* msg)
239 return _MAV_RETURN_uint8_t(msg, 3);
248 static inline void mavlink_msg_data_stream_decode(
const mavlink_message_t* msg,
mavlink_data_stream_t* data_stream)
250 #if MAVLINK_NEED_BYTE_SWAP
251 data_stream->
message_rate = mavlink_msg_data_stream_get_message_rate(msg);
252 data_stream->
stream_id = mavlink_msg_data_stream_get_stream_id(msg);
253 data_stream->
on_off = mavlink_msg_data_stream_get_on_off(msg);
255 memcpy(data_stream, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_DATA_STREAM_LEN);
uint8_t on_off
1 stream is enabled, 0 stream is stopped.
Definition: mavlink_msg_data_stream.h:9
uint16_t message_rate
The requested interval between two messages of this type.
Definition: mavlink_msg_data_stream.h:7
Definition: mavlink_msg_data_stream.h:5
uint8_t stream_id
The ID of the requested data stream.
Definition: mavlink_msg_data_stream.h:8