Paparazzi UAS
v5.10_stable-5-g83a0da5-dirty
Paparazzi is a free software Unmanned Aircraft System.
|
sw/airborne/subsystems/datalink
), type be sure that you have correctly build the paparazzi project (make
in the main directory)${PAPARAZZI_HOME}/var/export
, to change it: make clean
will only remove the export directorydatalink
in the export directory to your project directory (or untar the file pprz_datalink.tar
)PPRZ_DATALINK_PORT
to your device (ex: PPRZ_DATALINK_PORT=XXX
)PPRZ_DATALINK_DIR
to your extract folderinclude ${PPRZ_DATALINK_DIR}/datalink/pprz_datalink.mk
PPRZ_DATALINK_CFLAGS
to your cflagsPPRZ_DATALINK_SRCS
to your sources (if your project requires a list of object files, you can use PPRZ_DATALINK_OBJS
instead)Device interface You need to provide an interface to send the data. If your device is named XXX
, you need to provide the following functions or macros
XXXCheckFreeSpace(len)
that return true if your device has enough space for len
bytesXXXTransmit(c)
that send a single byte c
using the device XXX
(or store them in a buffer)XXXSendMessage()
that flushs the bytes to send (if needed)XXXChAvailable()
that returns true new characters are available for readingXXXGetch()
taht returns the next character to parseUsually, an UART interface is used for datalink.
datalink.c
), add the following lines: DatalinkEvent()
function in your main loop. This function is non-blocking and calls the decoder on each received byte. Finally the dl_parse_msg
function is called when a complete message is received (checksum is valid).Test file test_dl.cpp
(assuming you already have the Mbed library)
With the makefile: