Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
f4f033ec
Commit
f4f033ec
authored
Sep 18, 2017
by
Beat K�¼ng
Committed by
Beat Küng
Sep 18, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FileManager: add createDirectory method
parent
c5ba28a9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
FileManager.cc
src/uas/FileManager.cc
+21
-0
FileManager.h
src/uas/FileManager.h
+4
-0
No files found.
src/uas/FileManager.cc
View file @
f4f033ec
...
...
@@ -406,6 +406,9 @@ void FileManager::receiveMessage(mavlink_message_t message)
}
else
if
(
request
->
hdr
.
req_opcode
==
kCmdCreateFile
)
{
_emitErrorMessage
(
tr
(
"Nak received creating file, error: %1"
).
arg
(
errorString
(
request
->
data
[
0
])));
return
;
}
else
if
(
request
->
hdr
.
req_opcode
==
kCmdCreateDirectory
)
{
_emitErrorMessage
(
tr
(
"Nak received creating directory, error: %1"
).
arg
(
errorString
(
request
->
data
[
0
])));
return
;
}
else
{
// Generic Nak handling
if
(
request
->
hdr
.
req_opcode
==
kCmdReadFile
||
request
->
hdr
.
req_opcode
==
kCmdBurstReadFile
)
{
...
...
@@ -584,6 +587,24 @@ void FileManager::uploadPath(const QString& toPath, const QFileInfo& uploadFile)
_sendRequest
(
&
request
);
}
void
FileManager
::
createDirectory
(
const
QString
&
directory
)
{
if
(
_currentOperation
!=
kCOIdle
){
_emitErrorMessage
(
tr
(
"UAS File manager busy. Try again later"
));
return
;
}
_currentOperation
=
kCOCreateDir
;
Request
request
;
request
.
hdr
.
session
=
0
;
request
.
hdr
.
opcode
=
kCmdCreateDirectory
;
request
.
hdr
.
offset
=
0
;
request
.
hdr
.
size
=
0
;
_fillRequestWithString
(
&
request
,
directory
);
_sendRequest
(
&
request
);
}
QString
FileManager
::
errorString
(
uint8_t
errorCode
)
{
switch
(
errorCode
)
{
...
...
src/uas/FileManager.h
View file @
f4f033ec
...
...
@@ -61,6 +61,9 @@ public:
/// Upload the specified file to the specified location
void
uploadPath
(
const
QString
&
toPath
,
const
QFileInfo
&
uploadFile
);
/// Create a remote directory
void
createDirectory
(
const
QString
&
directory
);
signals:
// Signals associated with the listDirectory method
...
...
@@ -174,6 +177,7 @@ private:
kCOBurst
,
// waiting for Burst response
kCOWrite
,
// waiting for Write response
kCOCreate
,
// waiting for Create response
kCOCreateDir
,
// waiting for Create Directory response
};
bool
_sendOpcodeOnlyCmd
(
uint8_t
opcode
,
OperationState
newOpState
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment