mavlink_msg_rosflight_output_raw.h
Go to the documentation of this file.
1 // MESSAGE ROSFLIGHT_OUTPUT_RAW PACKING
2 
3 #define MAVLINK_MSG_ID_ROSFLIGHT_OUTPUT_RAW 190
4 
6 {
7  uint64_t stamp; /*< */
8  float values[8]; /*< */
10 
11 #define MAVLINK_MSG_ID_ROSFLIGHT_OUTPUT_RAW_LEN 40
12 #define MAVLINK_MSG_ID_190_LEN 40
13 
14 #define MAVLINK_MSG_ID_ROSFLIGHT_OUTPUT_RAW_CRC 230
15 #define MAVLINK_MSG_ID_190_CRC 230
16 
17 #define MAVLINK_MSG_ROSFLIGHT_OUTPUT_RAW_FIELD_VALUES_LEN 8
18 
19 #define MAVLINK_MESSAGE_INFO_ROSFLIGHT_OUTPUT_RAW { \
20  "ROSFLIGHT_OUTPUT_RAW", \
21  2, \
22  { { "stamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_rosflight_output_raw_t, stamp) }, \
23  { "values", NULL, MAVLINK_TYPE_FLOAT, 8, 8, offsetof(mavlink_rosflight_output_raw_t, values) }, \
24  } \
25 }
26 
27 
38 static inline uint16_t mavlink_msg_rosflight_output_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
39  uint64_t stamp, const float *values)
40 {
41 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
43  _mav_put_uint64_t(buf, 0, stamp);
44  _mav_put_float_array(buf, 8, values, 8);
46 #else
48  packet.stamp = stamp;
49  mav_array_memcpy(packet.values, values, sizeof(float)*8);
51 #endif
52 
54 #if MAVLINK_CRC_EXTRA
56 #else
57  return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ROSFLIGHT_OUTPUT_RAW_LEN);
58 #endif
59 }
60 
71 static inline uint16_t mavlink_msg_rosflight_output_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
72  mavlink_message_t* msg,
73  uint64_t stamp,const float *values)
74 {
75 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
77  _mav_put_uint64_t(buf, 0, stamp);
78  _mav_put_float_array(buf, 8, values, 8);
80 #else
82  packet.stamp = stamp;
83  mav_array_memcpy(packet.values, values, sizeof(float)*8);
85 #endif
86 
88 #if MAVLINK_CRC_EXTRA
90 #else
91  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ROSFLIGHT_OUTPUT_RAW_LEN);
92 #endif
93 }
94 
103 static inline uint16_t mavlink_msg_rosflight_output_raw_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_rosflight_output_raw_t* rosflight_output_raw)
104 {
105  return mavlink_msg_rosflight_output_raw_pack(system_id, component_id, msg, rosflight_output_raw->stamp, rosflight_output_raw->values);
106 }
107 
117 static inline uint16_t mavlink_msg_rosflight_output_raw_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_rosflight_output_raw_t* rosflight_output_raw)
118 {
119  return mavlink_msg_rosflight_output_raw_pack_chan(system_id, component_id, chan, msg, rosflight_output_raw->stamp, rosflight_output_raw->values);
120 }
121 
129 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
130 
131 static inline void mavlink_msg_rosflight_output_raw_send(mavlink_channel_t chan, uint64_t stamp, const float *values)
132 {
133 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
135  _mav_put_uint64_t(buf, 0, stamp);
136  _mav_put_float_array(buf, 8, values, 8);
137 #if MAVLINK_CRC_EXTRA
139 #else
140  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROSFLIGHT_OUTPUT_RAW, buf, MAVLINK_MSG_ID_ROSFLIGHT_OUTPUT_RAW_LEN);
141 #endif
142 #else
144  packet.stamp = stamp;
145  mav_array_memcpy(packet.values, values, sizeof(float)*8);
146 #if MAVLINK_CRC_EXTRA
148 #else
149  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROSFLIGHT_OUTPUT_RAW, (const char *)&packet, MAVLINK_MSG_ID_ROSFLIGHT_OUTPUT_RAW_LEN);
150 #endif
151 #endif
152 }
153 
154 #if MAVLINK_MSG_ID_ROSFLIGHT_OUTPUT_RAW_LEN <= MAVLINK_MAX_PAYLOAD_LEN
155 /*
156  This varient of _send() can be used to save stack space by re-using
157  memory from the receive buffer. The caller provides a
158  mavlink_message_t which is the size of a full mavlink message. This
159  is usually the receive buffer for the channel, and allows a reply to an
160  incoming message with minimum stack space usage.
161  */
162 static inline void mavlink_msg_rosflight_output_raw_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t stamp, const float *values)
163 {
164 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
165  char *buf = (char *)msgbuf;
166  _mav_put_uint64_t(buf, 0, stamp);
167  _mav_put_float_array(buf, 8, values, 8);
168 #if MAVLINK_CRC_EXTRA
170 #else
171  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROSFLIGHT_OUTPUT_RAW, buf, MAVLINK_MSG_ID_ROSFLIGHT_OUTPUT_RAW_LEN);
172 #endif
173 #else
175  packet->stamp = stamp;
176  mav_array_memcpy(packet->values, values, sizeof(float)*8);
177 #if MAVLINK_CRC_EXTRA
179 #else
180  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ROSFLIGHT_OUTPUT_RAW, (const char *)packet, MAVLINK_MSG_ID_ROSFLIGHT_OUTPUT_RAW_LEN);
181 #endif
182 #endif
183 }
184 #endif
185 
186 #endif
187 
188 // MESSAGE ROSFLIGHT_OUTPUT_RAW UNPACKING
189 
190 
196 static inline uint64_t mavlink_msg_rosflight_output_raw_get_stamp(const mavlink_message_t* msg)
197 {
198  return _MAV_RETURN_uint64_t(msg, 0);
199 }
200 
206 static inline uint16_t mavlink_msg_rosflight_output_raw_get_values(const mavlink_message_t* msg, float *values)
207 {
208  return _MAV_RETURN_float_array(msg, values, 8, 8);
209 }
210 
217 static inline void mavlink_msg_rosflight_output_raw_decode(const mavlink_message_t* msg, mavlink_rosflight_output_raw_t* rosflight_output_raw)
218 {
219 #if MAVLINK_NEED_BYTE_SWAP
220  rosflight_output_raw->stamp = mavlink_msg_rosflight_output_raw_get_stamp(msg);
221  mavlink_msg_rosflight_output_raw_get_values(msg, rosflight_output_raw->values);
222 #else
223  memcpy(rosflight_output_raw, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_ROSFLIGHT_OUTPUT_RAW_LEN);
224 #endif
225 }
#define _mav_put_uint64_t(buf, wire_offset, b)
Definition: protocol.h:149
static void mav_array_memcpy(void *dest, const void *src, size_t n)
Definition: protocol.h:176


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Wed Jul 3 2019 19:59:25