Ftp
public class Ftp
Implements file transfer functionality using MAVLink FTP.
-
Initializes a new
Ftp
plugin.Normally never created manually, but used from the
Drone
helper class instead.Declaration
Swift
public convenience init(address: String = "localhost", port: Int32 = 50051, scheduler: SchedulerType = ConcurrentDispatchQueueScheduler(qos: .background))
Parameters
address
The address of the
MavsdkServer
instance to connect toport
The port of the
MavsdkServer
instance to connect toscheduler
The scheduler to be used by
Observable
s -
Undocumented
See moreDeclaration
Swift
public struct RuntimeFtpError : Error
-
Undocumented
See moreDeclaration
Swift
public struct FtpError : Error
-
Progress data type for file transfer.
See moreDeclaration
Swift
public struct ProgressData : Equatable
-
Result type.
See moreDeclaration
Swift
public struct FtpResult : Equatable
-
Resets FTP server in case there are stale open sessions.
Declaration
Swift
public func reset() -> Completable
-
Downloads a file to local directory.
Declaration
Swift
public func download(remoteFilePath: String, localDir: String) -> Observable<ProgressData>
-
Uploads local file to remote directory.
Declaration
Swift
public func upload(localFilePath: String, remoteDir: String) -> Observable<ProgressData>
-
Lists items from a remote directory.
Declaration
Swift
public func listDirectory(remoteDir: String) -> Single<[String]>
Parameters
remoteDir
The remote directory to list the contents for.
-
Creates a remote directory.
Declaration
Swift
public func createDirectory(remoteDir: String) -> Completable
Parameters
remoteDir
The remote directory to create.
-
Removes a remote directory.
Declaration
Swift
public func removeDirectory(remoteDir: String) -> Completable
Parameters
remoteDir
The remote directory to remove.
-
Removes a remote file.
Declaration
Swift
public func removeFile(remoteFilePath: String) -> Completable
Parameters
remoteFilePath
The path of the remote file to remove.
-
Renames a remote file or remote directory.
Declaration
Swift
public func rename(remoteFromPath: String, remoteToPath: String) -> Completable
Parameters
remoteFromPath
The remote source path.
remoteToPath
The remote destination path.
-
Compares a local file to a remote file using a CRC32 checksum.
Declaration
Swift
public func areFilesIdentical(localFilePath: String, remoteFilePath: String) -> Single<Bool>
Parameters
localFilePath
The path of the local file.
remoteFilePath
The path of the remote file.
-
Set root directory for MAVLink FTP server.
Declaration
Swift
public func setRootDirectory(rootDir: String) -> Completable
Parameters
rootDir
The root directory to set.
-
Set target component ID. By default it is the autopilot.
Declaration
Swift
public func setTargetCompid(compid: UInt32) -> Completable
Parameters
compid
The component ID to set.
-
Get our own component ID.
Declaration
Swift
public func getOurCompid() -> Single<UInt32>