diff --git a/protos/ftp/ftp.proto b/protos/ftp/ftp.proto index 3ae14386f..2dd0296d1 100644 --- a/protos/ftp/ftp.proto +++ b/protos/ftp/ftp.proto @@ -11,10 +11,6 @@ option java_outer_classname = "FtpProto"; * Implements file transfer functionality using MAVLink FTP. */ service FtpService { - /* - * Resets FTP server in case there are stale open sessions. - */ - rpc Reset(ResetRequest) returns(ResetResponse) { option (mavsdk.options.async_type) = ASYNC; } /* * Downloads a file to local directory. */ @@ -53,28 +49,16 @@ service FtpService { * Compares a local file to a remote file using a CRC32 checksum. */ rpc AreFilesIdentical(AreFilesIdenticalRequest) returns(AreFilesIdenticalResponse) {} - /* - * Set root directory for MAVLink FTP server. - */ - rpc SetRootDirectory(SetRootDirectoryRequest) returns(SetRootDirectoryResponse) { option (mavsdk.options.async_type) = SYNC; } /* * Set target component ID. By default it is the autopilot. */ rpc SetTargetCompid(SetTargetCompidRequest) returns(SetTargetCompidResponse) { option (mavsdk.options.async_type) = SYNC; } - /* - * Get our own component ID. - */ - rpc GetOurCompid(GetOurCompidRequest) returns(GetOurCompidResponse) { option (mavsdk.options.async_type) = SYNC; } -} - -message ResetRequest {} -message ResetResponse { - FtpResult ftp_result = 1; } message SubscribeDownloadRequest { string remote_file_path = 1; // The path of the remote file to download. string local_dir = 2; // The local directory to download to. + bool use_burst = 3; // Use burst for faster downloading. } message DownloadResponse { FtpResult ftp_result = 1; @@ -136,13 +120,6 @@ message AreFilesIdenticalResponse { bool are_identical = 2; // Whether the files are identical. } -message SetRootDirectoryRequest { - string root_dir = 1; // The root directory to set. -} -message SetRootDirectoryResponse { - FtpResult ftp_result = 1; -} - message SetTargetCompidRequest { uint32 compid = 1; // The component ID to set. } @@ -150,11 +127,6 @@ message SetTargetCompidResponse { FtpResult ftp_result = 1; } -message GetOurCompidRequest {} -message GetOurCompidResponse { - uint32 compid = 1; // Our component ID. -} - // Progress data type for file transfer. message ProgressData { uint32 bytes_transferred = 1; // The number of bytes already transferred. diff --git a/protos/ftp_server/ftp_server.proto b/protos/ftp_server/ftp_server.proto new file mode 100644 index 000000000..3696e9866 --- /dev/null +++ b/protos/ftp_server/ftp_server.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; + +package mavsdk.rpc.ftp_server; + +import "mavsdk_options.proto"; + +option java_package = "io.mavsdk.ftp_server"; +option java_outer_classname = "FtpServerProto"; + +// Provide files or directories to transfer. +service FtpServerService { + /* + * 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. + */ + rpc SetRootDir(SetRootDirRequest) returns(SetRootDirResponse) { option (mavsdk.options.async_type) = SYNC; } +} + +message SetRootDirRequest { + string path = 1; // Absolute path of folder +} + +message SetRootDirResponse { + FtpServerResult ftp_server_result = 1; +} + +// Result type. +message FtpServerResult { + // Possible results returned for FTP server requests. + enum Result { + RESULT_UNKNOWN = 0; // Unknown result + RESULT_SUCCESS = 1; // Request succeeded + RESULT_DOES_NOT_EXIST = 2; // Directory does not exist + RESULT_BUSY = 3; // Operations in progress + } + + Result result = 1; // Result enum value + string result_str = 2; // Human-readable English string describing the result +}