PX4 Firmware
PX4 Autopilot Software http://px4.io
mavlink_bridge_header.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * Copyright (c) 2012-2014 PX4 Development Team. All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in
13  * the documentation and/or other materials provided with the
14  * distribution.
15  * 3. Neither the name PX4 nor the names of its contributors may be
16  * used to endorse or promote products derived from this software
17  * without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
26  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  *
32  ****************************************************************************/
33 
34 /**
35  * @file mavlink_bridge_header
36  * MAVLink bridge header for UART access.
37  *
38  * @author Lorenz Meier <lm@inf.ethz.ch>
39  */
40 
41 /* MAVLink adapter header */
42 #ifndef MAVLINK_BRIDGE_HEADER_H
43 #define MAVLINK_BRIDGE_HEADER_H
44 
45 #define MAVLINK_NO_CONVERSION_HELPERS
46 
47 #define MAVLINK_USE_CONVENIENCE_FUNCTIONS
48 
49 /* use efficient approach, see mavlink_helpers.h */
50 #define MAVLINK_SEND_UART_BYTES mavlink_send_uart_bytes
51 
52 #define MAVLINK_START_UART_SEND mavlink_start_uart_send
53 #define MAVLINK_END_UART_SEND mavlink_end_uart_send
54 
55 #define MAVLINK_GET_CHANNEL_BUFFER mavlink_get_channel_buffer
56 #define MAVLINK_GET_CHANNEL_STATUS mavlink_get_channel_status
57 
58 #include <v2.0/mavlink_types.h>
59 #include <unistd.h>
60 
62 
63 /* Struct that stores the communication settings of this system.
64  you can also define / alter these settings elsewhere, as long
65  as they're included BEFORE mavlink.h.
66  So you can set the
67 
68  mavlink_system.sysid = 100; // System ID, 1-255
69  mavlink_system.compid = 50; // Component/Subsystem ID, 1-255
70 
71  Lines also in your main.c, e.g. by reading these parameter from EEPROM.
72  */
73 extern mavlink_system_t mavlink_system;
74 
75 /**
76  * @brief Send multiple chars (uint8_t) over a comm channel
77  *
78  * @param chan MAVLink channel to use, usually MAVLINK_COMM_0 = UART0
79  * @param ch Character to send
80  */
81 void mavlink_send_uart_bytes(mavlink_channel_t chan, const uint8_t *ch, int length);
82 
83 void mavlink_start_uart_send(mavlink_channel_t chan, int length);
84 void mavlink_end_uart_send(mavlink_channel_t chan, int length);
85 
86 extern mavlink_status_t *mavlink_get_channel_status(uint8_t chan);
87 extern mavlink_message_t *mavlink_get_channel_buffer(uint8_t chan);
88 
89 #include <v2.0/standard/mavlink.h>
90 
92 
93 #endif /* MAVLINK_BRIDGE_HEADER_H */
#define __END_DECLS
Definition: visibility.h:59
#define __BEGIN_DECLS
Definition: visibility.h:58