Browse Source

GCS_MAVLink: add Board option to disable MAVftp in low mem bds/apps

c415-sdk
Hwurzburg 4 years ago committed by Andrew Tridgell
parent
commit
6eca18c08b
  1. 6
      libraries/GCS_MAVLink/GCS_Common.cpp
  2. 8
      libraries/GCS_MAVLink/GCS_FTP.cpp

6
libraries/GCS_MAVLink/GCS_Common.cpp

@ -5065,8 +5065,10 @@ uint64_t GCS_MAVLINK::capabilities() const @@ -5065,8 +5065,10 @@ uint64_t GCS_MAVLINK::capabilities() const
ret |= MAV_PROTOCOL_CAPABILITY_MISSION_FENCE;
}
ret |= MAV_PROTOCOL_CAPABILITY_FTP;
if (!AP_BoardConfig::ftp_disabled()){ //if ftp disable board option is not set
ret |= MAV_PROTOCOL_CAPABILITY_FTP;
}
return ret;
}

8
libraries/GCS_MAVLink/GCS_FTP.cpp

@ -20,6 +20,7 @@ @@ -20,6 +20,7 @@
#include <AP_Filesystem/AP_Filesystem.h>
#include <AP_HAL/utility/sparse-endian.h>
#include <AP_BoardConfig/AP_BoardConfig.h>
extern const AP_HAL::HAL& hal;
@ -29,7 +30,14 @@ struct GCS_MAVLINK::ftp_state GCS_MAVLINK::ftp; @@ -29,7 +30,14 @@ struct GCS_MAVLINK::ftp_state GCS_MAVLINK::ftp;
#define FTP_SESSION_TIMEOUT 3000
bool GCS_MAVLINK::ftp_init(void) {
// check if ftp is disabled for memory savings
if (AP_BoardConfig::ftp_disabled()) {
goto failed;
}
// we can simply check if we allocated everything we need
if (ftp.requests != nullptr) {
return true;
}

Loading…
Cancel
Save