QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
MAVLinkFTP.cc
Go to the documentation of this file.
1#include "MAVLinkFTP.h"
2
4{
5 switch (opCode) {
6 case kCmdNone:
7 return "None";
9 return "Terminate Session";
11 return "Reset Sessions";
13 return "List Directory";
14 case kCmdOpenFileRO:
15 return "Open File RO";
16 case kCmdReadFile:
17 return "Read File";
18 case kCmdCreateFile:
19 return "Create File";
20 case kCmdWriteFile:
21 return "Write File";
22 case kCmdRemoveFile:
23 return "Remove File";
25 return "Create Directory";
27 return "Remove Directory";
28 case kCmdOpenFileWO:
29 return "Open File WO";
31 return "Truncate File";
32 case kCmdRename:
33 return "Rename";
35 return "Calc File CRC32";
37 return "Burst Read File";
38 case kRspAck:
39 return "Ack";
40 case kRspNak:
41 return "Nak";
42 }
43
44 return "Unknown OpCode";
45}
46
48{
49 switch (errorCode) {
50 case kErrNone:
51 return "None";
52 case kErrFail:
53 return "Fail";
54 case kErrFailErrno:
55 return "Fail Errorno";
57 return "Invalid Data Size";
59 return "Invalid Session";
61 return "No Sessions Available";
62 case kErrEOF:
63 return "EOF";
65 return "Unknown Command";
67 return "File Already Exists";
69 return "File Protected";
71 return "File Not Found";
72 }
73
74 return "Unknown Error";
75}
ErrorCode_t
Error codes returned in Nak response PayloadHeader.data[0].
Definition MAVLinkFTP.h:65
@ kErrNoSessionsAvailable
All available Sessions in use.
Definition MAVLinkFTP.h:71
@ kErrFail
Unknown failure.
Definition MAVLinkFTP.h:67
@ kErrEOF
Offset past end of file for List and Read commands.
Definition MAVLinkFTP.h:72
@ kErrUnknownCommand
Unknown command opcode.
Definition MAVLinkFTP.h:73
@ kErrFailFileExists
File exists already.
Definition MAVLinkFTP.h:74
@ kErrInvalidDataSize
PayloadHeader.size is invalid.
Definition MAVLinkFTP.h:69
@ kErrFailErrno
errno sent back in PayloadHeader.data[1]
Definition MAVLinkFTP.h:68
@ kErrInvalidSession
Session is not currently open.
Definition MAVLinkFTP.h:70
@ kErrFailFileNotFound
Definition MAVLinkFTP.h:76
@ kErrFailFileProtected
File is write protected.
Definition MAVLinkFTP.h:75
static QString errorCodeToString(ErrorCode_t errorCode)
Definition MAVLinkFTP.cc:47
@ kCmdRemoveFile
Remove file at <path>
Definition MAVLinkFTP.h:51
@ kCmdRename
Rename <path1> to <path2>
Definition MAVLinkFTP.h:56
@ kCmdWriteFile
Writes <size> bytes to <offset> in <session>
Definition MAVLinkFTP.h:50
@ kCmdCreateFile
Creates file at <path> for writing, returns <session>
Definition MAVLinkFTP.h:49
@ kCmdOpenFileRO
Opens file at <path> for reading, returns <session>
Definition MAVLinkFTP.h:47
@ kCmdRemoveDirectory
Removes Directory at <path>, must be empty.
Definition MAVLinkFTP.h:53
@ kCmdReadFile
Reads <size> bytes from <offset> in <session>
Definition MAVLinkFTP.h:48
@ kCmdTruncateFile
Truncate file at <path> to <offset> length.
Definition MAVLinkFTP.h:55
@ kCmdOpenFileWO
Opens file at <path> for writing, returns <session>
Definition MAVLinkFTP.h:54
@ kCmdResetSessions
Terminates all open Read sessions.
Definition MAVLinkFTP.h:45
@ kCmdNone
ignored, always acked
Definition MAVLinkFTP.h:43
@ kRspAck
Ack response.
Definition MAVLinkFTP.h:60
@ kCmdBurstReadFile
Burst download session file.
Definition MAVLinkFTP.h:58
@ kCmdCreateDirectory
Creates directory at <path>
Definition MAVLinkFTP.h:52
@ kCmdCalcFileCRC32
Calculate CRC32 for file at <path>
Definition MAVLinkFTP.h:57
@ kCmdTerminateSession
Terminates open Read session.
Definition MAVLinkFTP.h:44
@ kRspNak
Nak response.
Definition MAVLinkFTP.h:61
@ kCmdListDirectory
List files in <path> from <offset>
Definition MAVLinkFTP.h:46
static QString opCodeToString(OpCode_t opCode)
Definition MAVLinkFTP.cc:3