mavlink: only enable FTP if -x flag is provided

This commit is contained in:
Beat Küng 2017-08-24 13:51:09 +02:00
parent 12f1c342d0
commit dd4be8aecf
3 changed files with 12 additions and 4 deletions

View File

@ -2604,7 +2604,7 @@ Mavlink::display_status()
(double)_mavlink_ulog->maximum_data_rate() * 100.);
}
printf("\taccepting commands: %s\n", (accepting_commands()) ? "YES" : "NO");
printf("\taccepting commands: %s, FTP enabled: %s\n", accepting_commands() ? "YES" : "NO", _ftp_on ? "YES" : "NO");
printf("\tMAVLink version: %i\n", _protocol_version);
printf("\ttransport protocol: ");

View File

@ -476,6 +476,8 @@ public:
void set_uorb_main_fd(int fd, unsigned int interval);
bool ftp_enabled() const { return _ftp_on; }
protected:
Mavlink *next;

View File

@ -2483,8 +2483,10 @@ MavlinkReceiver::receive_thread(void *arg)
/* handle packet with parameter component */
_parameters_manager.handle_message(&msg);
/* handle packet with ftp component */
_mavlink_ftp.handle_message(&msg);
if (_mavlink->ftp_enabled()) {
/* handle packet with ftp component */
_mavlink_ftp.handle_message(&msg);
}
/* handle packet with log component */
_mavlink_log_handler.handle_message(&msg);
@ -2507,7 +2509,11 @@ MavlinkReceiver::receive_thread(void *arg)
_mission_manager.check_active_mission();
_mission_manager.send(t);
_parameters_manager.send(t);
_mavlink_ftp.send(t);
if (_mavlink->ftp_enabled()) {
_mavlink_ftp.send(t);
}
_mavlink_log_handler.send(t);
last_send_update = t;