3 #define MAVLINK_MSG_ID_PING 4
13 #define MAVLINK_MSG_ID_PING_LEN 14
14 #define MAVLINK_MSG_ID_4_LEN 14
16 #define MAVLINK_MSG_ID_PING_CRC 237
17 #define MAVLINK_MSG_ID_4_CRC 237
21 #define MAVLINK_MESSAGE_INFO_PING { \
24 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_ping_t, time_usec) }, \
25 { "seq", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_ping_t, seq) }, \
26 { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_ping_t, target_system) }, \
27 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_ping_t, target_component) }, \
44 static inline uint16_t mavlink_msg_ping_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
45 uint64_t time_usec, uint32_t seq, uint8_t target_system, uint8_t target_component)
47 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
48 char buf[MAVLINK_MSG_ID_PING_LEN];
49 _mav_put_uint64_t(buf, 0, time_usec);
50 _mav_put_uint32_t(buf, 8, seq);
51 _mav_put_uint8_t(buf, 12, target_system);
52 _mav_put_uint8_t(buf, 13, target_component);
54 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PING_LEN);
62 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PING_LEN);
65 msg->msgid = MAVLINK_MSG_ID_PING;
67 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC);
69 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PING_LEN);
85 static inline uint16_t mavlink_msg_ping_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
86 mavlink_message_t* msg,
87 uint64_t time_usec,uint32_t seq,uint8_t target_system,uint8_t target_component)
89 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
90 char buf[MAVLINK_MSG_ID_PING_LEN];
91 _mav_put_uint64_t(buf, 0, time_usec);
92 _mav_put_uint32_t(buf, 8, seq);
93 _mav_put_uint8_t(buf, 12, target_system);
94 _mav_put_uint8_t(buf, 13, target_component);
96 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PING_LEN);
104 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PING_LEN);
107 msg->msgid = MAVLINK_MSG_ID_PING;
108 #if MAVLINK_CRC_EXTRA
109 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC);
111 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PING_LEN);
123 static inline uint16_t mavlink_msg_ping_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_ping_t* ping)
137 static inline uint16_t mavlink_msg_ping_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_ping_t* ping)
151 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
153 static inline void mavlink_msg_ping_send(mavlink_channel_t chan, uint64_t time_usec, uint32_t seq, uint8_t target_system, uint8_t target_component)
155 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
156 char buf[MAVLINK_MSG_ID_PING_LEN];
157 _mav_put_uint64_t(buf, 0, time_usec);
158 _mav_put_uint32_t(buf, 8, seq);
159 _mav_put_uint8_t(buf, 12, target_system);
160 _mav_put_uint8_t(buf, 13, target_component);
162 #if MAVLINK_CRC_EXTRA
163 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, buf, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC);
165 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, buf, MAVLINK_MSG_ID_PING_LEN);
174 #if MAVLINK_CRC_EXTRA
175 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, (
const char *)&packet, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC);
177 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, (
const char *)&packet, MAVLINK_MSG_ID_PING_LEN);
182 #if MAVLINK_MSG_ID_PING_LEN <= MAVLINK_MAX_PAYLOAD_LEN
190 static inline void mavlink_msg_ping_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint32_t seq, uint8_t target_system, uint8_t target_component)
192 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
193 char *buf = (
char *)msgbuf;
194 _mav_put_uint64_t(buf, 0, time_usec);
195 _mav_put_uint32_t(buf, 8, seq);
196 _mav_put_uint8_t(buf, 12, target_system);
197 _mav_put_uint8_t(buf, 13, target_component);
199 #if MAVLINK_CRC_EXTRA
200 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, buf, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC);
202 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, buf, MAVLINK_MSG_ID_PING_LEN);
211 #if MAVLINK_CRC_EXTRA
212 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, (
const char *)packet, MAVLINK_MSG_ID_PING_LEN, MAVLINK_MSG_ID_PING_CRC);
214 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PING, (
const char *)packet, MAVLINK_MSG_ID_PING_LEN);
230 static inline uint64_t mavlink_msg_ping_get_time_usec(
const mavlink_message_t* msg)
232 return _MAV_RETURN_uint64_t(msg, 0);
240 static inline uint32_t mavlink_msg_ping_get_seq(
const mavlink_message_t* msg)
242 return _MAV_RETURN_uint32_t(msg, 8);
250 static inline uint8_t mavlink_msg_ping_get_target_system(
const mavlink_message_t* msg)
252 return _MAV_RETURN_uint8_t(msg, 12);
260 static inline uint8_t mavlink_msg_ping_get_target_component(
const mavlink_message_t* msg)
262 return _MAV_RETURN_uint8_t(msg, 13);
271 static inline void mavlink_msg_ping_decode(
const mavlink_message_t* msg,
mavlink_ping_t* ping)
273 #if MAVLINK_NEED_BYTE_SWAP
274 ping->
time_usec = mavlink_msg_ping_get_time_usec(msg);
275 ping->
seq = mavlink_msg_ping_get_seq(msg);
276 ping->
target_system = mavlink_msg_ping_get_target_system(msg);
279 memcpy(ping, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_PING_LEN);
uint8_t target_component
0: request ping from all receiving components, if greater than 0: message is a ping response and numb...
Definition: mavlink_msg_ping.h:10
uint32_t seq
PING sequence.
Definition: mavlink_msg_ping.h:8
Definition: mavlink_msg_ping.h:5
uint8_t target_system
0: request ping from all receiving systems, if greater than 0: message is a ping response and number ...
Definition: mavlink_msg_ping.h:9
uint64_t time_usec
Unix timestamp in microseconds.
Definition: mavlink_msg_ping.h:7