Subversion Repositories Projects

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1702 - 1
// MESSAGE WAYPOINT_CLEAR_ALL PACKING
2
 
3
#define MAVLINK_MSG_ID_WAYPOINT_CLEAR_ALL 45
4
 
5
typedef struct __mavlink_waypoint_clear_all_t
6
{
7
 uint8_t target_system; ///< System ID
8
 uint8_t target_component; ///< Component ID
9
} mavlink_waypoint_clear_all_t;
10
 
11
#define MAVLINK_MSG_ID_WAYPOINT_CLEAR_ALL_LEN 2
12
#define MAVLINK_MSG_ID_45_LEN 2
13
 
14
 
15
 
16
#define MAVLINK_MESSAGE_INFO_WAYPOINT_CLEAR_ALL { \
17
        "WAYPOINT_CLEAR_ALL", \
18
        2, \
19
        {  { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_waypoint_clear_all_t, target_system) }, \
20
         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_waypoint_clear_all_t, target_component) }, \
21
         } \
22
}
23
 
24
 
25
/**
26
 * @brief Pack a waypoint_clear_all message
27
 * @param system_id ID of this system
28
 * @param component_id ID of this component (e.g. 200 for IMU)
29
 * @param msg The MAVLink message to compress the data into
30
 *
31
 * @param target_system System ID
32
 * @param target_component Component ID
33
 * @return length of the message in bytes (excluding serial stream start sign)
34
 */
35
static inline uint16_t mavlink_msg_waypoint_clear_all_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
36
                                                       uint8_t target_system, uint8_t target_component)
37
{
38
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
39
        char buf[2];
40
        _mav_put_uint8_t(buf, 0, target_system);
41
        _mav_put_uint8_t(buf, 1, target_component);
42
 
43
        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2);
44
#else
45
        mavlink_waypoint_clear_all_t packet;
46
        packet.target_system = target_system;
47
        packet.target_component = target_component;
48
 
49
        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2);
50
#endif
51
 
52
        msg->msgid = MAVLINK_MSG_ID_WAYPOINT_CLEAR_ALL;
53
        return mavlink_finalize_message(msg, system_id, component_id, 2);
54
}
55
 
56
/**
57
 * @brief Pack a waypoint_clear_all message on a channel
58
 * @param system_id ID of this system
59
 * @param component_id ID of this component (e.g. 200 for IMU)
60
 * @param chan The MAVLink channel this message was sent over
61
 * @param msg The MAVLink message to compress the data into
62
 * @param target_system System ID
63
 * @param target_component Component ID
64
 * @return length of the message in bytes (excluding serial stream start sign)
65
 */
66
static inline uint16_t mavlink_msg_waypoint_clear_all_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
67
                                                           mavlink_message_t* msg,
68
                                                           uint8_t target_system,uint8_t target_component)
69
{
70
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
71
        char buf[2];
72
        _mav_put_uint8_t(buf, 0, target_system);
73
        _mav_put_uint8_t(buf, 1, target_component);
74
 
75
        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2);
76
#else
77
        mavlink_waypoint_clear_all_t packet;
78
        packet.target_system = target_system;
79
        packet.target_component = target_component;
80
 
81
        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2);
82
#endif
83
 
84
        msg->msgid = MAVLINK_MSG_ID_WAYPOINT_CLEAR_ALL;
85
        return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 2);
86
}
87
 
88
/**
89
 * @brief Encode a waypoint_clear_all struct into a message
90
 *
91
 * @param system_id ID of this system
92
 * @param component_id ID of this component (e.g. 200 for IMU)
93
 * @param msg The MAVLink message to compress the data into
94
 * @param waypoint_clear_all C-struct to read the message contents from
95
 */
96
static inline uint16_t mavlink_msg_waypoint_clear_all_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_waypoint_clear_all_t* waypoint_clear_all)
97
{
98
        return mavlink_msg_waypoint_clear_all_pack(system_id, component_id, msg, waypoint_clear_all->target_system, waypoint_clear_all->target_component);
99
}
100
 
101
/**
102
 * @brief Send a waypoint_clear_all message
103
 * @param chan MAVLink channel to send the message
104
 *
105
 * @param target_system System ID
106
 * @param target_component Component ID
107
 */
108
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
109
 
110
static inline void mavlink_msg_waypoint_clear_all_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component)
111
{
112
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
113
        char buf[2];
114
        _mav_put_uint8_t(buf, 0, target_system);
115
        _mav_put_uint8_t(buf, 1, target_component);
116
 
117
        _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WAYPOINT_CLEAR_ALL, buf, 2);
118
#else
119
        mavlink_waypoint_clear_all_t packet;
120
        packet.target_system = target_system;
121
        packet.target_component = target_component;
122
 
123
        _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WAYPOINT_CLEAR_ALL, (const char *)&packet, 2);
124
#endif
125
}
126
 
127
#endif
128
 
129
// MESSAGE WAYPOINT_CLEAR_ALL UNPACKING
130
 
131
 
132
/**
133
 * @brief Get field target_system from waypoint_clear_all message
134
 *
135
 * @return System ID
136
 */
137
static inline uint8_t mavlink_msg_waypoint_clear_all_get_target_system(const mavlink_message_t* msg)
138
{
139
        return _MAV_RETURN_uint8_t(msg,  0);
140
}
141
 
142
/**
143
 * @brief Get field target_component from waypoint_clear_all message
144
 *
145
 * @return Component ID
146
 */
147
static inline uint8_t mavlink_msg_waypoint_clear_all_get_target_component(const mavlink_message_t* msg)
148
{
149
        return _MAV_RETURN_uint8_t(msg,  1);
150
}
151
 
152
/**
153
 * @brief Decode a waypoint_clear_all message into a struct
154
 *
155
 * @param msg The message to decode
156
 * @param waypoint_clear_all C-struct to decode the message contents into
157
 */
158
static inline void mavlink_msg_waypoint_clear_all_decode(const mavlink_message_t* msg, mavlink_waypoint_clear_all_t* waypoint_clear_all)
159
{
160
#if MAVLINK_NEED_BYTE_SWAP
161
        waypoint_clear_all->target_system = mavlink_msg_waypoint_clear_all_get_target_system(msg);
162
        waypoint_clear_all->target_component = mavlink_msg_waypoint_clear_all_get_target_component(msg);
163
#else
164
        memcpy(waypoint_clear_all, _MAV_PAYLOAD(msg), 2);
165
#endif
166
}