Code for autonomous ground vehicle, Data Bus, 3rd place winner in 2012 Sparkfun AVC.
Dependencies: Watchdog mbed Schedule SimpleFilter LSM303DLM PinDetect DebounceIn Servo
mavlink_msg_request_rc_channels.h
00001 // MESSAGE REQUEST_RC_CHANNELS PACKING 00002 00003 #define MAVLINK_MSG_ID_REQUEST_RC_CHANNELS 221 00004 00005 typedef struct __mavlink_request_rc_channels_t 00006 { 00007 uint8_t enabled; ///< True: start sending data; False: stop sending data 00008 00009 } mavlink_request_rc_channels_t; 00010 00011 00012 00013 /** 00014 * @brief Pack a request_rc_channels message 00015 * @param system_id ID of this system 00016 * @param component_id ID of this component (e.g. 200 for IMU) 00017 * @param msg The MAVLink message to compress the data into 00018 * 00019 * @param enabled True: start sending data; False: stop sending data 00020 * @return length of the message in bytes (excluding serial stream start sign) 00021 */ 00022 static inline uint16_t mavlink_msg_request_rc_channels_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, uint8_t enabled) 00023 { 00024 uint16_t i = 0; 00025 msg->msgid = MAVLINK_MSG_ID_REQUEST_RC_CHANNELS; 00026 00027 i += put_uint8_t_by_index(enabled, i, msg->payload); // True: start sending data; False: stop sending data 00028 00029 return mavlink_finalize_message(msg, system_id, component_id, i); 00030 } 00031 00032 /** 00033 * @brief Pack a request_rc_channels message 00034 * @param system_id ID of this system 00035 * @param component_id ID of this component (e.g. 200 for IMU) 00036 * @param chan The MAVLink channel this message was sent over 00037 * @param msg The MAVLink message to compress the data into 00038 * @param enabled True: start sending data; False: stop sending data 00039 * @return length of the message in bytes (excluding serial stream start sign) 00040 */ 00041 static inline uint16_t mavlink_msg_request_rc_channels_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, uint8_t enabled) 00042 { 00043 uint16_t i = 0; 00044 msg->msgid = MAVLINK_MSG_ID_REQUEST_RC_CHANNELS; 00045 00046 i += put_uint8_t_by_index(enabled, i, msg->payload); // True: start sending data; False: stop sending data 00047 00048 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, i); 00049 } 00050 00051 /** 00052 * @brief Encode a request_rc_channels struct into a message 00053 * 00054 * @param system_id ID of this system 00055 * @param component_id ID of this component (e.g. 200 for IMU) 00056 * @param msg The MAVLink message to compress the data into 00057 * @param request_rc_channels C-struct to read the message contents from 00058 */ 00059 static inline uint16_t mavlink_msg_request_rc_channels_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_request_rc_channels_t* request_rc_channels) 00060 { 00061 return mavlink_msg_request_rc_channels_pack(system_id, component_id, msg, request_rc_channels->enabled); 00062 } 00063 00064 /** 00065 * @brief Send a request_rc_channels message 00066 * @param chan MAVLink channel to send the message 00067 * 00068 * @param enabled True: start sending data; False: stop sending data 00069 */ 00070 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS 00071 00072 static inline void mavlink_msg_request_rc_channels_send(mavlink_channel_t chan, uint8_t enabled) 00073 { 00074 mavlink_message_t msg; 00075 mavlink_msg_request_rc_channels_pack_chan(mavlink_system.sysid, mavlink_system.compid, chan, &msg, enabled); 00076 mavlink_send_uart(chan, &msg); 00077 } 00078 00079 #endif 00080 // MESSAGE REQUEST_RC_CHANNELS UNPACKING 00081 00082 /** 00083 * @brief Get field enabled from request_rc_channels message 00084 * 00085 * @return True: start sending data; False: stop sending data 00086 */ 00087 static inline uint8_t mavlink_msg_request_rc_channels_get_enabled(const mavlink_message_t* msg) 00088 { 00089 return (uint8_t)(msg->payload)[0]; 00090 } 00091 00092 /** 00093 * @brief Decode a request_rc_channels message into a struct 00094 * 00095 * @param msg The message to decode 00096 * @param request_rc_channels C-struct to decode the message contents into 00097 */ 00098 static inline void mavlink_msg_request_rc_channels_decode(const mavlink_message_t* msg, mavlink_request_rc_channels_t* request_rc_channels) 00099 { 00100 request_rc_channels->enabled = mavlink_msg_request_rc_channels_get_enabled(msg); 00101 }
Generated on Tue Jul 12 2022 14:09:26 by 1.7.2