3 #define MAVLINK_MSG_ID_STATUSTEXT 253
11 #define MAVLINK_MSG_ID_STATUSTEXT_LEN 51
12 #define MAVLINK_MSG_ID_253_LEN 51
14 #define MAVLINK_MSG_ID_STATUSTEXT_CRC 83
15 #define MAVLINK_MSG_ID_253_CRC 83
17 #define MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN 50
19 #define MAVLINK_MESSAGE_INFO_STATUSTEXT { \
22 { { "severity", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_statustext_t, severity) }, \
23 { "text", NULL, MAVLINK_TYPE_CHAR, 50, 1, offsetof(mavlink_statustext_t, text) }, \
38 static inline uint16_t mavlink_msg_statustext_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
39 uint8_t severity,
const char *text)
41 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
42 char buf[MAVLINK_MSG_ID_STATUSTEXT_LEN];
43 _mav_put_uint8_t(buf, 0, severity);
44 _mav_put_char_array(buf, 1, text, 50);
45 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_STATUSTEXT_LEN);
49 mav_array_memcpy(packet.
text, text,
sizeof(
char)*50);
50 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_STATUSTEXT_LEN);
53 msg->msgid = MAVLINK_MSG_ID_STATUSTEXT;
55 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC);
57 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_STATUSTEXT_LEN);
71 static inline uint16_t mavlink_msg_statustext_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
72 mavlink_message_t* msg,
73 uint8_t severity,
const char *text)
75 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
76 char buf[MAVLINK_MSG_ID_STATUSTEXT_LEN];
77 _mav_put_uint8_t(buf, 0, severity);
78 _mav_put_char_array(buf, 1, text, 50);
79 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_STATUSTEXT_LEN);
83 mav_array_memcpy(packet.
text, text,
sizeof(
char)*50);
84 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_STATUSTEXT_LEN);
87 msg->msgid = MAVLINK_MSG_ID_STATUSTEXT;
89 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC);
91 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_STATUSTEXT_LEN);
103 static inline uint16_t mavlink_msg_statustext_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_statustext_t* statustext)
105 return mavlink_msg_statustext_pack(system_id, component_id, msg, statustext->
severity, statustext->
text);
117 static inline uint16_t mavlink_msg_statustext_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_statustext_t* statustext)
119 return mavlink_msg_statustext_pack_chan(system_id, component_id, chan, msg, statustext->
severity, statustext->
text);
129 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
131 static inline void mavlink_msg_statustext_send(mavlink_channel_t chan, uint8_t severity,
const char *text)
133 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
134 char buf[MAVLINK_MSG_ID_STATUSTEXT_LEN];
135 _mav_put_uint8_t(buf, 0, severity);
136 _mav_put_char_array(buf, 1, text, 50);
137 #if MAVLINK_CRC_EXTRA
138 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, buf, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC);
140 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, buf, MAVLINK_MSG_ID_STATUSTEXT_LEN);
145 mav_array_memcpy(packet.
text, text,
sizeof(
char)*50);
146 #if MAVLINK_CRC_EXTRA
147 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, (
const char *)&packet, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC);
149 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, (
const char *)&packet, MAVLINK_MSG_ID_STATUSTEXT_LEN);
154 #if MAVLINK_MSG_ID_STATUSTEXT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
162 static inline void mavlink_msg_statustext_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t severity,
const char *text)
164 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
165 char *buf = (
char *)msgbuf;
166 _mav_put_uint8_t(buf, 0, severity);
167 _mav_put_char_array(buf, 1, text, 50);
168 #if MAVLINK_CRC_EXTRA
169 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, buf, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC);
171 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, buf, MAVLINK_MSG_ID_STATUSTEXT_LEN);
176 mav_array_memcpy(packet->
text, text,
sizeof(
char)*50);
177 #if MAVLINK_CRC_EXTRA
178 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, (
const char *)packet, MAVLINK_MSG_ID_STATUSTEXT_LEN, MAVLINK_MSG_ID_STATUSTEXT_CRC);
180 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STATUSTEXT, (
const char *)packet, MAVLINK_MSG_ID_STATUSTEXT_LEN);
196 static inline uint8_t mavlink_msg_statustext_get_severity(
const mavlink_message_t* msg)
198 return _MAV_RETURN_uint8_t(msg, 0);
206 static inline uint16_t mavlink_msg_statustext_get_text(
const mavlink_message_t* msg,
char *text)
208 return _MAV_RETURN_char_array(msg, text, 50, 1);
217 static inline void mavlink_msg_statustext_decode(
const mavlink_message_t* msg,
mavlink_statustext_t* statustext)
219 #if MAVLINK_NEED_BYTE_SWAP
220 statustext->
severity = mavlink_msg_statustext_get_severity(msg);
221 mavlink_msg_statustext_get_text(msg, statustext->
text);
223 memcpy(statustext, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_STATUSTEXT_LEN);
uint8_t severity
Severity of status. Relies on the definitions within RFC-5424. See enum MAV_SEVERITY.
Definition: mavlink_msg_statustext.h:7
Definition: mavlink_msg_statustext.h:5
char text[50]
Status text message, without null termination character.
Definition: mavlink_msg_statustext.h:8