mavsdk::FtpServer Class Reference ​
#include: ftp_server.h
Provide files or directories to transfer.
Public Types ​
Type | Description |
---|---|
enum Result | Possible results returned for FTP server requests. |
std::function< void(Result)> ResultCallback | Callback type for asynchronous FtpServer calls. |
Public Member Functions ​
Type | Name | Description |
---|---|---|
 | FtpServer (std::shared_ptr< ServerComponent > server_component) | Constructor. Creates the plugin for a ServerComponent instance. |
 | ~FtpServer () override | Destructor (internal use only). |
 | FtpServer (const FtpServer & other) | Copy constructor. |
Result | set_root_dir (std::string path)const | Set root directory. |
const FtpServer & | operator= (const FtpServer &)=delete | Equality operator (object is not copyable). |
Constructor & Destructor Documentation ​
FtpServer() ​
mavsdk::FtpServer::FtpServer(std::shared_ptr< ServerComponent > server_component)
Constructor. Creates the plugin for a ServerComponent instance.
The plugin is typically created as shown below:
auto ftp_server = FtpServer(server_component);
Parameters
- std::shared_ptr< ServerComponent > server_component - The ServerComponent instance associated with this server plugin.
~FtpServer() ​
mavsdk::FtpServer::~FtpServer() override
Destructor (internal use only).
FtpServer() ​
mavsdk::FtpServer::FtpServer(const FtpServer &other)
Copy constructor.
Parameters
- const FtpServer& other -
Member Typdef Documentation ​
typedef ResultCallback ​
using mavsdk::FtpServer::ResultCallback = std::function<void(Result)>
Callback type for asynchronous FtpServer calls.
Member Enumeration Documentation ​
enum Result ​
Possible results returned for FTP server requests.
Value | Description |
---|---|
Unknown | Unknown result. |
Success | Request succeeded. |
DoesNotExist | Directory does not exist. |
Busy | Operations in progress. |
Member Function Documentation ​
set_root_dir() ​
Result mavsdk::FtpServer::set_root_dir(std::string path) const
Set root directory.
This is the directory that can then be accessed by a client. The directory needs to exist when this is called. The permissions are the same as the file permission for the user running the server. The root directory can't be changed while an FTP process is in progress.
This function is blocking.
Parameters
- std::string path -
Returns
 Result - Result of request.
operator=() ​
const FtpServer& mavsdk::FtpServer::operator=(const FtpServer &)=delete
Equality operator (object is not copyable).
Parameters
- const FtpServer& -
Returns
 const FtpServer & -