Commit Graph

71 Commits

Author SHA1 Message Date
Daniel Agar a99f75dde2 Mavlink set last sent timestamp to space out initial publication
- remove QURT defines no longer required
2018-06-09 13:38:44 +02:00
Daniel Agar 651df03f76 RTPS and micro-CDR build system cleanup (#8084) 2017-10-11 13:05:44 -04:00
Daniel Agar 5eb3e695bb fix and enable mavlink ftp tests 2017-09-28 09:29:04 +02:00
Beat Küng 5b85b26351 mavlink_ftp: keep a copy of the last reply & resend it upon duplicated seq num 2017-09-21 07:33:09 +02:00
Beat Küng ea587d585f mavlink_ftp: add & handle kErrFailFileExists error
This error definitions already existed in QGC
2017-09-21 07:33:09 +02:00
Lorenz Meier 37657cf99b MAVLink FTP: Use modern output printing to capture errors in system log 2017-07-29 16:12:41 +02:00
Beat Küng a6c682ce50 mavlink_ftp: fix stack overflow & add root dir prefix
- change memory allocation from stack to a malloc'd buffer. This avoids
  increasing the stack size. And since FTP is rarely used, the buffers
  are only allocated upon use and freed after a time of 2s inactivity.
- adds PX4_ROOTFSDIR as root directory prefix. This does not change
  anything on NuttX, but in SITL it will avoid enumerating the whole
  disk tree when using QGC (which enumerates all files recursively).
2017-07-21 19:59:45 +02:00
Beat Küng 29f23a390f mavlink_ftp: avoid using seekdir()
The provided argument payload->offset is in range [0, num_file_entries-1],
but seekdir might use a completely different range. It is not defined
by the API spec. It is only useful in conjunction with telldir().
2017-07-21 19:59:45 +02:00
Julien Lecoeur 7929287f73 Fix -Werror=format-truncation on GCC 7
Fix formatting

Check snprintf return for error AND overflow
2017-06-26 15:50:44 +02:00
Beat Küng e6c3b29aa6 MavlinkFTP: remove MavlinkStream inheritance 2017-05-18 09:48:14 +02:00
Daniel Agar 6631e72d6f clang-tidy modernize-redundant-void-arg 2017-02-01 22:15:50 -05:00
Lorenz Meier 4fcb4cf0fd MAVLink: Fix FTP file path handling
This was a real issue for long paths and not a flight safety issue for regular users, but could have been an issue for developers trying to use FTP on very deep nested file systems
2017-01-03 14:44:45 +01:00
Daniel Agar 28971caaf3 partially restore mavlink_tests 2017-01-02 10:14:41 +01:00
Julian Oes 8ddda0a8fa mavlink: move the msg id from uint8_t to uint16_t
With mavlink2 new messages are added with msg IDs greated than 255.
Therefore the msg ID types needed to be raised everywhere.
2016-11-09 10:23:34 +01:00
Carlo Wood 03d176d097 Bug fixes, typos, indentation.
Over time I made a few changes unrelated to what I'm really working on.
These changes are hereby committed first. The bug fixes are related to
what I'm doing in that I need them to be fixed for future commits.

Tools/sitl_run.sh: rename label to rcS_dir and fix usage help.
cmake/common/px4_base.cmake: Remove the check on OUT_UNPARSED_ARGUMENTS,
  and a few typos and indentation issues.
cmake/configs/posix_sitl_replay.cmake: Set the correct variable
  (config_sitl_rcS_dir) to the correct directory.
cmake/nuttx/px4_impl_nuttx.cmake: typos and indentation issues,
  and removal of a redundant FORCE (INTERNAL implies FORCE).
cmake/posix/px4_impl_posix.cmake: typos and indentation issues.
cmake/qurt/px4_impl_qurt.cmake: typos and indentation issues.
src/modules/mavlink/mavlink_ftp.cpp : possible strict-aliasing breakage.

NOTES

The second argument passed to sitl_run.sh is the value of
config_sitl_rcS_dir. This fact is missing from the usage help.
I renamed 'label' to 'rcS_dir' to better reflect this.
Also, for the 'replay' config the wrong variable was set causing
the call to sitl_run.sh to skip an argument and fail (ie the
debugger was passed as rcS_dir and so on).

The check on OUT_UNPARSED_ARGUMENTS in px4_parse_function_args
basically causes every passed IN variable to be REQUIRED and is
therefore a bug. The test for the presence of the REQUIRED arguments
follows directly after and is sufficient for this job. This bug went
unnoticed because currently every argument to OPTIONS, ONE_VALUE,
and MULTI_VALUE is actually passed to the function(s) calling
px4_parse_function_args (them being REQUIRED or not).

The changes in mavlink_ftp.cpp are to avoid a possible aliasing bug
and (mostly) to avoid the compiler warning/error: dereferencing type-
punned pointer will break strict-aliasing rules [-Werror=strict-aliasing].
2016-09-13 16:31:08 +02:00
Otávio d03611763a Use readdir instead of readdir_r (#5421)
readdir_r is deprecated since glibc version 2.24 and glibc manual
recomends usage of readdir instead of readdir_r.
Replacing readdir_r by readdir will also not be a problem for Nuttx,
because readdir_r is using readdir and filling parameters with the
return information.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2016-09-03 13:45:40 +02:00
Lorenz Meier 720c445f21 MAVLink: Code style 2016-08-26 23:43:33 +02:00
Lorenz Meier 0a597d0d62 MAVLink: Update to version 2 compaat API 2016-05-19 20:13:32 +02:00
Beat Küng 7ff80463be fix completely wrong file permissions for log files & mavlink ftp (new mode 666) 2016-04-11 11:23:01 +02:00
Mark Charlebois 872a26e6da Fixed passed ot open() for O_CREAT
In nuttx the mode parameter to open is not required but in Linux,
and per the POSIX spec, mode is required if the O_CREAT flag is
passed.

The mode flags are different for NuttX and Linux so a new set of
PX4 defines was added:

PX4_O_MODE_777 - read, write, execute for user, group and other
PX4_O_MODE_666 - read, and write for user, group and other
PX4_O_MODE_600 - read, and write for user

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-06-14 11:26:40 +02:00
Lorenz Meier c9fefe236b Merged release into master 2015-06-13 11:06:01 +02:00
Mark Charlebois 4d1ae6269b POSIX: Added PX4_ROOTFSDIR to file paths
Set a default path relative to current dir for the posix target.

Running make posixrun will create the required directoroes and then run
mainapp from its build location.

PX4_ROOTFSDIR is set to nothing for nuttx.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-06-11 21:36:13 -07:00
Lorenz Meier 3e0c14dea2 MAVLink FTP: Do not list hidden directories by default 2015-06-06 11:35:29 +02:00
Don Gagne 77bd36aa33 Fix opendir failure handling 2015-05-24 20:11:00 +02:00
Don Gagne 4206b030bf Fix opendir failure handling 2015-05-24 10:40:52 -07:00
Lorenz Meier d906fb8f31 Merged master into linux 2015-05-19 21:00:02 +02:00
Lorenz Meier d9d25363b4 mavlink FTP: Remove workaround after QGC side fix 2015-05-19 07:08:19 +02:00
Lorenz Meier e5fad077df Merge master into linux 2015-05-18 23:28:57 +02:00
Lorenz Meier 3032afb803 mavlink FTP: Fix build system error for unit test 2015-05-17 10:48:37 +02:00
Mark Charlebois 36f5d47ed9 Merge remote-tracking branch 'upstream/master' into linux
Signed-off-by: Mark Charlebois <charlebm@gmail.com>

Conflicts:
	src/modules/commander/gyro_calibration.cpp
	src/modules/mavlink/mavlink_ftp.cpp
2015-05-16 15:04:38 -07:00
Lorenz Meier 2432418751 FTP: Better error reporting, ignore hidden directories 2015-05-16 11:37:41 +02:00
Lorenz Meier 97b8e7a20e mavlink FTP: Speed up transfers by longer bursts 2015-05-15 21:14:40 +02:00
Mark Charlebois 12a25e4b63 Merge remote-tracking branch 'upstream/master' into linux
Signed-off-by: Mark Charlebois <charlebm@gmail.com>

Conflicts:
	makefiles/firmware.mk
	src/modules/commander/module.mk
	src/modules/mavlink/mavlink_ftp.h
	src/modules/mavlink/mavlink_tests/module.mk
2015-05-04 16:36:59 -07:00
Don Gagne 46da294ffb New bust mode ftp file download 2015-05-03 19:26:54 -07:00
Mark Charlebois e764c68d0a mavlink: consolidated nuttx and posix changes
Removed nuttx and posix specific files for mavlink_ftp and mavlink_receiver.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-22 11:08:19 -07:00
Mark Charlebois ac0df5c61d Linux: added HRT test, moved tests to linux/tests
Also fixed naming of mavlink files for NuttX build.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:07:00 -07:00
Daniel Agar d511e39ea7 turn on -Werror and fix resulting errors 2014-12-22 17:56:59 -05:00
Vladimir Ermakov 0fbdb8d326 FTP: Return bytes written in payload. 2014-10-05 13:23:57 +04:00
Vladimir Ermakov 56a9d16fc4 FTP: Save errno in _copy_file(). 2014-10-05 13:19:13 +04:00
Vladimir Ermakov ef5a93c09c FTP: Add file checksum calculation command. 2014-09-22 15:19:38 +04:00
Vladimir Ermakov 8eb3100616 FTP: Rename command.
Payload: `<oldpath>\0<newpath>`
See: man 2 rename
2014-09-22 13:48:43 +04:00
Vladimir Ermakov 407a4e0f06 FTP: fix truncate errors. Also correct errno reporting.
Seems that warnx() everytime changes originak errno to EINVAL.
2014-09-17 20:02:32 +04:00
Vladimir Ermakov f55d20a133 FTP: Add truncate command.
Unfortunately NuttX not provides truncate(),
had to be emulated by copying with O_TRUNC flag.
2014-09-17 18:42:00 +04:00
Vladimir Ermakov 72887e14d9 FTP: Implement write command. 2014-09-17 13:04:21 +04:00
Vladimir Ermakov 60c63f4872 FTP: Add new open command for write.
All open commands now return file size.
2014-09-17 10:07:29 +04:00
Vladimir Ermakov 006717734c FTP: Add skip entry information for proper offset calculation. 2014-09-15 21:29:19 +04:00
Don Gagne 981741f8ce Don't send back U or ./.. entries from List command 2014-09-10 13:11:36 -07:00
Vladimir Ermakov 0e3c6060b6 FTP: remove padding zeroing. 2014-09-10 21:36:08 +04:00
Vladimir Ermakov 745707d193 FTP: remove reserved uint32 from header. 2014-09-10 11:22:03 +04:00
Vladimir Ermakov 0d2e250d11 FTP: Remove CRC32 from protocol.
Extra crc not needed because mavlink already has crc16.
2014-09-09 17:36:41 +04:00