Commit Graph

2548 Commits

Author SHA1 Message Date
Jeremy Lakeman
4b9817218d Improve mavlink packet synchronisation
- backtrack when decoding fails
- assume locally built heartbeats may split a valid remote packet
2013-09-20 14:41:50 +09:30
Jeremy Lakeman
f7bffbfabe Simplify packet debug logging 2013-09-20 14:41:50 +09:30
Jeremy Lakeman
2e6d3878e8 Add golay [12,24] FEC routines 2013-09-20 14:41:50 +09:30
Jeremy Lakeman
504aa92711 Send a sync immediately on importing a new bundle 2013-09-20 14:41:50 +09:30
Jeremy Lakeman
38fe34e6e5 Bump rhizome idle timeout for congested links 2013-09-20 14:41:50 +09:30
Jeremy Lakeman
926665e860 Ask for explanation of SIDs over point to point links 2013-09-20 14:41:50 +09:30
Jeremy Lakeman
d3b1ccd20e Reduce size of rhizome sync announce packets 2013-09-20 14:41:50 +09:30
Jeremy Lakeman
56d3609a3f Reduce frequency of mavlink heartbeat messages 2013-09-20 14:41:50 +09:30
Jeremy Lakeman
9f1407043a Reduce rhizome MDP debug messages 2013-09-20 14:41:49 +09:30
Jeremy Lakeman
ed21200289 Improve config description 2013-09-20 14:41:35 +09:30
Jeremy Lakeman
bc538f8bf3 Fix format for 64bit compilers 2013-09-20 14:39:44 +09:30
Andrew Bettison
4851eaf536 Issue #20: remove unique socket names from tests
The recent work on abstract local socket names means that every instance has
its own unique abstract socket name anyway, so there is no need for test
scripts to use $TFWUNIQUE in MDP and Monitor socket names to avoid
intereference when run concurrently.
2013-09-20 14:24:55 +09:30
Andrew Bettison
cc96e08e9d Issue #20: Improve socket name handling
The recently added cmp_sockaddr() function does not call stat(2) any
more to compare local AF_UNIX socket address paths, so not it is stable
enough to use for ordering sockaddr structs.

New function: real_sockaddr() converts the file path of a local AF_UNIX
file socket using realpath(3).  The MDP client uses it on the sender
address of every MDP reply packet it receives to ensure that symlinks in
the instance path do not cause MDP client failures.

Rename recently added socket_setname() function: make_local_sockaddr().
2013-09-20 14:07:19 +09:30
Andrew Bettison
17347dbe3f Issue #20: Merge branch 'daniel' into 'development'
Discard Daniel's work from 2012 in favour of the recent work on the
'development' branch which achieves the same thing in more or less the
same fashion, and was informed by the work on his branch.
2013-09-19 17:56:16 +09:30
Andrew Bettison
ae61a4f35c Issue #20: Make abstract sockets work
Finish the work started by Daniel in 2012, by using abstract local
AF_UNIX sockets on platforms that support them (Linux, Android).

Fix all sorts of bugs and issues that prevented the existing MDP and
Monitor client and server code from working with abstract socket names.
2013-09-19 17:26:06 +09:30
Andrew Bettison
4937757d36 Improve Serval instance path operations
Replace form_serval_instance_path(), which takes a single 'path'
argument, with formf_serval_instance_path() and
vformf_serval_instance_path(), which take printf(3)-like arguments.
This supports more flexible instance path file names.

FORM_SERVAL_INSTANCE_PATH() macro works as before, but reimplemented
2013-09-19 17:19:37 +09:30
Andrew Bettison
f3cd0d8718 Improve socket function prototypes and macros
Remove '__whence' argument name from all struct __sourceloc prototype
arguments

Parentheses around macro arguments

Use __WHENCE__ instead of __HERE__ in macros
2013-09-19 16:37:34 +09:30
Andrew Bettison
a4704dfd3c Add strbuf_va_vprintf() convenience macro 2013-09-19 16:34:02 +09:30
Andrew Bettison
5c84b2ffd5 Fix Rom's socket cleanup-on-start code
Fix buffer overflow bug: replace call to sprintf(3) with call to
FORM_SERVAL_INSTANCE_PATH()

Fix file descriptor leak bug: add missing closedir(3) call

Use lstat() instead of stat() to avoid warnings on broken sym links

Use WARNF_perror() where appropriate in preference to WARNF()

Remove redundant one-line comments
2013-09-19 04:30:40 +09:30
Andrew Bettison
d64d9487c1 Issue #20: improve socket set-up logging 2013-09-19 04:30:40 +09:30
Andrew Bettison
259834a4c1 Issue #20: fix bug in new esocket() function 2013-09-19 04:30:40 +09:30
Andrew Bettison
7453e82a27 Issue #20: improve new socket function logging
__whence argument and function macros
2013-09-19 04:30:40 +09:30
Andrew Bettison
498eba2051 Improve fdqueue.c debug logging 2013-09-19 04:30:40 +09:30
Andrew Bettison
2b3119b49b Issue #20: merge branch 'sockets' into 'development'
Daniel's improvements to the local file/abstract socket code, with many
improvements to bring it up to date.
2013-09-19 04:30:14 +09:30
Andrew Bettison
db7e9004b3 Fix bug in version_string.sh
git describe --dirty does not accept HEAD (committish) arg
2013-09-17 10:51:50 +09:30
Jeremy Lakeman
c13c7799f6 Send mavlink heartbeat every second 2013-09-13 14:37:33 +09:30
Jeremy Lakeman
2a5ba97b48 Add rhizome test over fakeradio 2013-09-13 14:02:35 +09:30
Jeremy Lakeman
7076b5abb9 Protect most mavlink header bytes with FEC 2013-09-13 10:51:52 +09:30
Andrew Bettison
987875969c Improve version_string.sh script
Full --help usage message
Better error handling and reporting
Only considers tags that look like version numbers
Does not create and delete local "START" tag
Lots of options, including --ignore-untracked and --unmodified
Suitable for use in Batphone repository
2013-09-12 17:50:54 +09:30
Jeremy Lakeman
3f123e1875 Send the next packet via stream interface ASAP 2013-09-12 16:14:01 +09:30
Jeremy Lakeman
589c334d5b Fakeradio responds to mavlink heartbeat packets
- attempts to send mavlink packets in one piece
2013-09-12 14:07:08 +09:30
Jeremy Lakeman
6f26594447 Simplify mavlink link frame creation
- build one frame at a time directly from the prepared overlay buffer
2013-09-11 17:15:43 +09:30
Jeremy Lakeman
e29564bc6c Refactor fakeradio
- completely event driven and non-blocking
- modelling of tx & rx serial buffers that will truncate on overfilling
- each radio takes turns to send a packet, with approx TDMA overhead
2013-09-11 15:03:43 +09:30
Jeremy Lakeman
9d7e37cc5e Pass ownership of final packet buffer to broadcast_ensemble 2013-09-11 11:13:33 +09:30
gardners
c120f27e99 tweak debug output 2013-09-10 15:15:00 +09:30
gardners
fa157500b3 Add debug output for mavlink sent and received frames.
debug.interactive_io can be used to pause after sending or receiving a packet.
2013-09-10 15:14:23 +09:30
gardners
6d273eb966 Add Reed-Solomon protection to MAVLink frames. 2013-09-10 14:53:12 +09:30
gardners
c28fdcf558 import Reed-Solomon LGPL implementation for use on packet radio.
Encodes 223 bytes in 255 bytes, allowing upto 16 errors.
2013-09-10 14:53:12 +09:30
Jeremy Lakeman
91fcf8b1b3 Stop announcing BARs via legacy process 2013-09-10 14:53:12 +09:30
gardners
33ad9ae0bc Split debugging info related to ACK's and packet retransmissions 2013-09-10 14:53:12 +09:30
gardners
f02e55c443 add 32bit crc to mavlink frames, and reject those that fail. 2013-09-10 14:53:12 +09:30
gardners
61c219a1f9 implement fragmentation of MDP frames over mavlink serial link. 2013-09-10 14:53:12 +09:30
Jeremy Lakeman
e2c3f1a8fb Improve fakeradio
- block until writes have completed
- implement transfer rate throttling
- add optional bit-flip errors
2013-09-10 14:53:12 +09:30
Andrew Bettison
e8ab8477be Get rid of worse-than-useless keyring debug 2013-09-10 13:28:27 +09:30
gardners
7248e01567 Implement flow of mavlink packets over serial connections
Replaces upper-7 bit slip encoding
Solves reliability of reading radio status messages
2013-09-10 13:07:52 +09:30
gardners
8ff14dce7a import mavlink.c from rfd900 radio firmware to use as basis for
mavlink communications with radios.
2013-09-10 11:54:15 +09:30
gardners
da32f6e6cd don't report radio link every second, even when debugging packetradio.
every 30sec is enough.
2013-09-10 11:54:15 +09:30
gardners
0cbebedc77 Add tx throttling for packet radios
avoids missing data due to lack of flow control.
2013-09-10 11:53:38 +09:30
Andrew Bettison
7add45214c Add [keyring-pin] arg to keyring load command 2013-09-10 11:28:55 +09:30
gardners
2b1ec5232c allow proper reading of RSSI from right antenna 2013-09-10 10:51:04 +09:30