Ftp Server
MAVLink FTP (File Transfer Protocol) server abstraction.
FtpServer is an abstraction. To define its behavior, assign handlers (delegates) for the FTP operations. Once the handlers are set, FtpServer can process client requests.
Use case
Get the FtpServer instance from the server device.
Implement the delegates of the FtpServer.
Now you can use the FtpServer to handle the client’s CRC32 calculation requests.
Delegate | Return Type | Description |
|---|---|---|
|
| Delegate that opens a remote file for reading and returns a read session handle. |
|
| Delegate that opens a remote file for writing and returns a write session handle. |
|
| Delegate that reads file data from an opened read session. |
|
| Delegate that renames (or moves) a file or directory. |
|
| Delegate that terminates a specific session. |
|
| Delegate that resets (terminates) all active sessions. |
|
| Delegate that lists entries in a directory. |
|
| Delegate that creates a new directory. |
|
| Delegate that creates a new file and returns its session handle. |
|
| Delegate that removes a file. |
|
| Delegate that removes a directory. |
|
| Delegate that calculates CRC32 checksum for a file. |
|
| Delegate that truncates a file to a specified length. |
|
| Delegate that performs a burst read from an opened read session. |
|
| Delegate that writes data to an opened write session. |
OpenFileReadDelegate
Parameter | Type | Description |
|---|---|---|
|
| Remote file path. |
|
| Optional cancel token argument. |
OpenFileWriteDelegate
Parameter | Type | Description |
|---|---|---|
|
| Remote file path. |
|
| Optional cancel token argument. |
FileReadDelegate
Parameter | Type | Description |
|---|---|---|
|
| Read request details (session, offset, etc.). |
|
| Memory buffer to read data into. |
|
| Optional cancel token argument. |
RenameDelegate
Parameter | Type | Description |
|---|---|---|
|
| Original path. |
|
| New path. |
|
| Optional cancel token argument. |
TerminateSessionDelegate
Parameter | Type | Description |
|---|---|---|
|
| Session handle to terminate. |
|
| Optional cancel token argument. |
ResetSessionsDelegate
Parameter | Type | Description |
|---|---|---|
|
| Optional cancel token argument. |
ListDirectoryDelegate
Parameter | Type | Description |
|---|---|---|
|
| Directory path. |
|
| Offset to start listing from. |
|
| Memory buffer to write entry list into. |
|
| Optional cancel token argument. |
CreateDirectory
Parameter | Type | Description |
|---|---|---|
|
| Directory path to create. |
|
| Optional cancel token argument. |
CreateFile
Parameter | Type | Description |
|---|---|---|
|
| File path to create. |
|
| Optional cancel token argument. |
RemoveFile
Parameter | Type | Description |
|---|---|---|
|
| File path to remove. |
|
| Optional cancel token argument. |
RemoveDirectory
Parameter | Type | Description |
|---|---|---|
|
| Directory path to remove. |
|
| Optional cancel token argument. |
CalcFileCrc32
Parameter | Type | Description |
|---|---|---|
|
| File path. |
|
| Optional cancel token argument. |
TruncateFile
Parameter | Type | Description |
|---|---|---|
|
| Truncate request details. |
|
| Optional cancel token argument. |
BurstReadFileDelegate
Parameter | Type | Description |
|---|---|---|
|
| Read request details. |
|
| Memory buffer to read data into. |
|
| Optional cancel token argument. |
WriteFile
Parameter | Type | Description |
|---|---|---|
|
| Write request details. |
|
| Memory buffer containing data to write. |
|
| Optional cancel token argument. |
Api
MavlinkFtpServerConfig
Configuration for the MAVLink FTP server.
Property | Type | Default | Description |
|---|---|---|---|
|
|
| Gets or sets the target network ID. |
|
|
| Gets or sets the delay in milliseconds between burst read chunks. |
IFtpServer
MAVLink FTP (File Transfer Protocol) server abstraction.
Property | Type | Description |
|---|---|---|
|
| Sets the handler that renames (or moves) a file/directory. |
|
| Sets the handler that opens a file for reading. |
|
| Sets the handler that opens a file for writing. |
|
| Sets the handler that reads file data from an opened read session. |
|
| Sets the handler that terminates a session. |
|
| Sets the handler that lists directory entries. |
|
| Sets the handler that resets (terminates) all sessions. |
|
| Sets the handler that creates a directory. |
|
| Sets the handler that creates a file. |
|
| Gets or sets the handler that removes a file. |
|
| Sets the handler that removes a directory. |
|
| Sets the handler that calculates CRC32 for a file. |
|
| Sets the handler that truncates a file. |
|
| Sets the handler that performs burst reads. |
|
| Sets the handler that writes file data to an open write session. |