Commit Graph

58 Commits

Author SHA1 Message Date
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
Vladimir Ermakov 564c9b7b60 FTP: Add req_opcode field for return request opcode in response message. 2014-09-09 17:02:25 +04:00
Don Gagne 828fb5efd1 Additional FTP command support plus unit test
- Restructured to a flatter class implementation
- Added support for create/remove directory, remove file
- Refactored error codes and command opcodes
- Added unit test support
- Fixed bugs found by unit test
2014-09-02 15:36:32 -07:00
Don Gagne fce0a3b728 Gave up on using bitfields 2014-08-27 21:39:55 -07:00
Don Gagne 0eea110f6f Modified to use new FILE_TRANSFER_PROTOCOL message
- Also corrected system/component id transmit/check
2014-08-27 17:14:49 -07:00
Don Gagne c8ecf59ab7 List command bug fix, easier debugging
- List command was generating bad data size because it was adding
directory entry char to buffer before testing buffer overflow.
- Added MAVLINK_FTP_DEBUG define to easily turn on/off noisier
debugging output
2014-08-12 14:23:26 -07:00
Don Gagne 1d3edfa629 More FTP support
Added:
- sequence numbers
- directory list returns file sizes
- open command returns file size in data
2014-08-10 12:02:10 -07:00
Lorenz Meier 1ac2b307e4 Enable stricter compile mode and ensure the most relevant bits are initialized. Needs more work to avoid the remaining warnings 2014-07-15 18:23:17 +02:00
Lorenz Meier 9f1661f1f8 Silence FTP transactions, be vocal about errors 2014-07-08 09:58:08 +02:00
Lorenz Meier 9a1e920f4b Merge pull request #1137 from DonLakeFlyer/FTPLogging
Better FTP logging
2014-07-07 22:14:30 +02:00
Don Gagne f5c14ff140 Turn off noisier logging 2014-07-07 10:17:39 -07:00
Don Gagne 2a79689224 Fix unused variable warnings 2014-07-06 16:51:06 -07:00
Don Gagne b8ba6400f2 More logging 2014-07-06 16:04:30 -07:00
Don Gagne 91537934c4 Better logging 2014-07-06 14:58:27 -07:00