1 // MESSAGE CAMERA_TRIGGER PACKING
3 #define MAVLINK_MSG_ID_CAMERA_TRIGGER 112
5 typedef struct __mavlink_camera_trigger_t
7 uint64_t time_usec
; ///< Timestamp for the image frame in microseconds
8 uint32_t seq
; ///< Image frame sequence
9 } mavlink_camera_trigger_t
;
11 #define MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN 12
12 #define MAVLINK_MSG_ID_112_LEN 12
14 #define MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC 174
15 #define MAVLINK_MSG_ID_112_CRC 174
19 #define MAVLINK_MESSAGE_INFO_CAMERA_TRIGGER { \
22 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_camera_trigger_t, time_usec) }, \
23 { "seq", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_camera_trigger_t, seq) }, \
29 * @brief Pack a camera_trigger message
30 * @param system_id ID of this system
31 * @param component_id ID of this component (e.g. 200 for IMU)
32 * @param msg The MAVLink message to compress the data into
34 * @param time_usec Timestamp for the image frame in microseconds
35 * @param seq Image frame sequence
36 * @return length of the message in bytes (excluding serial stream start sign)
38 static inline uint16_t mavlink_msg_camera_trigger_pack(uint8_t system_id
, uint8_t component_id
, mavlink_message_t
* msg
,
39 uint64_t time_usec
, uint32_t seq
)
41 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
42 char buf
[MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN
];
43 _mav_put_uint64_t(buf
, 0, time_usec
);
44 _mav_put_uint32_t(buf
, 8, seq
);
46 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), buf
, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN
);
48 mavlink_camera_trigger_t packet
;
49 packet
.time_usec
= time_usec
;
52 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), &packet
, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN
);
55 msg
->msgid
= MAVLINK_MSG_ID_CAMERA_TRIGGER
;
57 return mavlink_finalize_message(msg
, system_id
, component_id
, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN
, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC
);
59 return mavlink_finalize_message(msg
, system_id
, component_id
, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN
);
64 * @brief Pack a camera_trigger message on a channel
65 * @param system_id ID of this system
66 * @param component_id ID of this component (e.g. 200 for IMU)
67 * @param chan The MAVLink channel this message will be sent over
68 * @param msg The MAVLink message to compress the data into
69 * @param time_usec Timestamp for the image frame in microseconds
70 * @param seq Image frame sequence
71 * @return length of the message in bytes (excluding serial stream start sign)
73 static inline uint16_t mavlink_msg_camera_trigger_pack_chan(uint8_t system_id
, uint8_t component_id
, uint8_t chan
,
74 mavlink_message_t
* msg
,
75 uint64_t time_usec
,uint32_t seq
)
77 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
78 char buf
[MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN
];
79 _mav_put_uint64_t(buf
, 0, time_usec
);
80 _mav_put_uint32_t(buf
, 8, seq
);
82 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), buf
, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN
);
84 mavlink_camera_trigger_t packet
;
85 packet
.time_usec
= time_usec
;
88 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), &packet
, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN
);
91 msg
->msgid
= MAVLINK_MSG_ID_CAMERA_TRIGGER
;
93 return mavlink_finalize_message_chan(msg
, system_id
, component_id
, chan
, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN
, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC
);
95 return mavlink_finalize_message_chan(msg
, system_id
, component_id
, chan
, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN
);
100 * @brief Encode a camera_trigger struct
102 * @param system_id ID of this system
103 * @param component_id ID of this component (e.g. 200 for IMU)
104 * @param msg The MAVLink message to compress the data into
105 * @param camera_trigger C-struct to read the message contents from
107 static inline uint16_t mavlink_msg_camera_trigger_encode(uint8_t system_id
, uint8_t component_id
, mavlink_message_t
* msg
, const mavlink_camera_trigger_t
* camera_trigger
)
109 return mavlink_msg_camera_trigger_pack(system_id
, component_id
, msg
, camera_trigger
->time_usec
, camera_trigger
->seq
);
113 * @brief Encode a camera_trigger struct on a channel
115 * @param system_id ID of this system
116 * @param component_id ID of this component (e.g. 200 for IMU)
117 * @param chan The MAVLink channel this message will be sent over
118 * @param msg The MAVLink message to compress the data into
119 * @param camera_trigger C-struct to read the message contents from
121 static inline uint16_t mavlink_msg_camera_trigger_encode_chan(uint8_t system_id
, uint8_t component_id
, uint8_t chan
, mavlink_message_t
* msg
, const mavlink_camera_trigger_t
* camera_trigger
)
123 return mavlink_msg_camera_trigger_pack_chan(system_id
, component_id
, chan
, msg
, camera_trigger
->time_usec
, camera_trigger
->seq
);
127 * @brief Send a camera_trigger message
128 * @param chan MAVLink channel to send the message
130 * @param time_usec Timestamp for the image frame in microseconds
131 * @param seq Image frame sequence
133 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
135 static inline void mavlink_msg_camera_trigger_send(mavlink_channel_t chan
, uint64_t time_usec
, uint32_t seq
)
137 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
138 char buf
[MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN
];
139 _mav_put_uint64_t(buf
, 0, time_usec
);
140 _mav_put_uint32_t(buf
, 8, seq
);
142 #if MAVLINK_CRC_EXTRA
143 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_CAMERA_TRIGGER
, buf
, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN
, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC
);
145 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_CAMERA_TRIGGER
, buf
, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN
);
148 mavlink_camera_trigger_t packet
;
149 packet
.time_usec
= time_usec
;
152 #if MAVLINK_CRC_EXTRA
153 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_CAMERA_TRIGGER
, (const char *)&packet
, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN
, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC
);
155 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_CAMERA_TRIGGER
, (const char *)&packet
, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN
);
160 #if MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN <= MAVLINK_MAX_PAYLOAD_LEN
162 This varient of _send() can be used to save stack space by re-using
163 memory from the receive buffer. The caller provides a
164 mavlink_message_t which is the size of a full mavlink message. This
165 is usually the receive buffer for the channel, and allows a reply to an
166 incoming message with minimum stack space usage.
168 static inline void mavlink_msg_camera_trigger_send_buf(mavlink_message_t
*msgbuf
, mavlink_channel_t chan
, uint64_t time_usec
, uint32_t seq
)
170 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
171 char *buf
= (char *)msgbuf
;
172 _mav_put_uint64_t(buf
, 0, time_usec
);
173 _mav_put_uint32_t(buf
, 8, seq
);
175 #if MAVLINK_CRC_EXTRA
176 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_CAMERA_TRIGGER
, buf
, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN
, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC
);
178 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_CAMERA_TRIGGER
, buf
, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN
);
181 mavlink_camera_trigger_t
*packet
= (mavlink_camera_trigger_t
*)msgbuf
;
182 packet
->time_usec
= time_usec
;
185 #if MAVLINK_CRC_EXTRA
186 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_CAMERA_TRIGGER
, (const char *)packet
, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN
, MAVLINK_MSG_ID_CAMERA_TRIGGER_CRC
);
188 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_CAMERA_TRIGGER
, (const char *)packet
, MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN
);
196 // MESSAGE CAMERA_TRIGGER UNPACKING
200 * @brief Get field time_usec from camera_trigger message
202 * @return Timestamp for the image frame in microseconds
204 static inline uint64_t mavlink_msg_camera_trigger_get_time_usec(const mavlink_message_t
* msg
)
206 return _MAV_RETURN_uint64_t(msg
, 0);
210 * @brief Get field seq from camera_trigger message
212 * @return Image frame sequence
214 static inline uint32_t mavlink_msg_camera_trigger_get_seq(const mavlink_message_t
* msg
)
216 return _MAV_RETURN_uint32_t(msg
, 8);
220 * @brief Decode a camera_trigger message into a struct
222 * @param msg The message to decode
223 * @param camera_trigger C-struct to decode the message contents into
225 static inline void mavlink_msg_camera_trigger_decode(const mavlink_message_t
* msg
, mavlink_camera_trigger_t
* camera_trigger
)
227 #if MAVLINK_NEED_BYTE_SWAP
228 camera_trigger
->time_usec
= mavlink_msg_camera_trigger_get_time_usec(msg
);
229 camera_trigger
->seq
= mavlink_msg_camera_trigger_get_seq(msg
);
231 memcpy(camera_trigger
, _MAV_PAYLOAD(msg
), MAVLINK_MSG_ID_CAMERA_TRIGGER_LEN
);