3 #define MAVLINK_MSG_ID_AUTH_KEY 7
10 #define MAVLINK_MSG_ID_AUTH_KEY_LEN 32
11 #define MAVLINK_MSG_ID_7_LEN 32
13 #define MAVLINK_MSG_ID_AUTH_KEY_CRC 119
14 #define MAVLINK_MSG_ID_7_CRC 119
16 #define MAVLINK_MSG_AUTH_KEY_FIELD_KEY_LEN 32
18 #define MAVLINK_MESSAGE_INFO_AUTH_KEY { \
21 { { "key", NULL, MAVLINK_TYPE_CHAR, 32, 0, offsetof(mavlink_auth_key_t, key) }, \
35 static inline uint16_t mavlink_msg_auth_key_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
38 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
39 char buf[MAVLINK_MSG_ID_AUTH_KEY_LEN];
41 _mav_put_char_array(buf, 0, key, 32);
42 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AUTH_KEY_LEN);
46 mav_array_memcpy(packet.
key, key,
sizeof(
char)*32);
47 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AUTH_KEY_LEN);
50 msg->msgid = MAVLINK_MSG_ID_AUTH_KEY;
52 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC);
54 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_AUTH_KEY_LEN);
67 static inline uint16_t mavlink_msg_auth_key_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
68 mavlink_message_t* msg,
71 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
72 char buf[MAVLINK_MSG_ID_AUTH_KEY_LEN];
74 _mav_put_char_array(buf, 0, key, 32);
75 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AUTH_KEY_LEN);
79 mav_array_memcpy(packet.
key, key,
sizeof(
char)*32);
80 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AUTH_KEY_LEN);
83 msg->msgid = MAVLINK_MSG_ID_AUTH_KEY;
85 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC);
87 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_AUTH_KEY_LEN);
99 static inline uint16_t mavlink_msg_auth_key_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_auth_key_t* auth_key)
101 return mavlink_msg_auth_key_pack(system_id, component_id, msg, auth_key->
key);
113 static inline uint16_t mavlink_msg_auth_key_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_auth_key_t* auth_key)
115 return mavlink_msg_auth_key_pack_chan(system_id, component_id, chan, msg, auth_key->
key);
124 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
126 static inline void mavlink_msg_auth_key_send(mavlink_channel_t chan,
const char *key)
128 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
129 char buf[MAVLINK_MSG_ID_AUTH_KEY_LEN];
131 _mav_put_char_array(buf, 0, key, 32);
132 #if MAVLINK_CRC_EXTRA
133 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, buf, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC);
135 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, buf, MAVLINK_MSG_ID_AUTH_KEY_LEN);
140 mav_array_memcpy(packet.
key, key,
sizeof(
char)*32);
141 #if MAVLINK_CRC_EXTRA
142 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, (
const char *)&packet, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC);
144 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, (
const char *)&packet, MAVLINK_MSG_ID_AUTH_KEY_LEN);
149 #if MAVLINK_MSG_ID_AUTH_KEY_LEN <= MAVLINK_MAX_PAYLOAD_LEN
157 static inline void mavlink_msg_auth_key_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,
const char *key)
159 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
160 char *buf = (
char *)msgbuf;
162 _mav_put_char_array(buf, 0, key, 32);
163 #if MAVLINK_CRC_EXTRA
164 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, buf, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC);
166 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, buf, MAVLINK_MSG_ID_AUTH_KEY_LEN);
171 mav_array_memcpy(packet->
key, key,
sizeof(
char)*32);
172 #if MAVLINK_CRC_EXTRA
173 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, (
const char *)packet, MAVLINK_MSG_ID_AUTH_KEY_LEN, MAVLINK_MSG_ID_AUTH_KEY_CRC);
175 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AUTH_KEY, (
const char *)packet, MAVLINK_MSG_ID_AUTH_KEY_LEN);
191 static inline uint16_t mavlink_msg_auth_key_get_key(
const mavlink_message_t* msg,
char *key)
193 return _MAV_RETURN_char_array(msg, key, 32, 0);
202 static inline void mavlink_msg_auth_key_decode(
const mavlink_message_t* msg,
mavlink_auth_key_t* auth_key)
204 #if MAVLINK_NEED_BYTE_SWAP
205 mavlink_msg_auth_key_get_key(msg, auth_key->
key);
207 memcpy(auth_key, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_AUTH_KEY_LEN);
char key[32]
key
Definition: mavlink_msg_auth_key.h:7
Definition: mavlink_msg_auth_key.h:5