Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sensor System
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Institut für Informatik
QE Research Group
FORTE
Sensor System
Merge requests
!22
Resend Data capabilities
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resend Data capabilities
29-resending-of-data-if-network-connection-was-lost
into
develop
Overview
0
Commits
7
Pipelines
0
Changes
2
Merged
Zoe Pfister
requested to merge
29-resending-of-data-if-network-connection-was-lost
into
develop
2 years ago
Overview
0
Commits
7
Pipelines
0
Changes
2
Expand
Closes
#29 (closed)
0
0
Merge request reports
Viewing commit
6569bee9
Prev
Next
Show latest version
2 files
+
12
−
22
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
Verified
6569bee9
replace serial prints with logging statements
· 6569bee9
Zoe Michaela Dietmar Pfister
authored
2 years ago
host/host_central_mast/lib/ResendManager/ResendManager.cpp
+
4
−
7
Options
@@ -6,21 +6,18 @@
#include
"Utilities.h"
void
ResendManager
::
init
()
{
// log
Serial
.
println
(
"createResendDirectory"
);
createResendDirectory
();
// log
Serial
.
println
(
"getLastResendFileId"
);
uint
lastResendFileId
=
getLastResendFileId
();
nextResendFileId
=
lastResendFileId
+
1
;
Serial
.
println
(
"nextResendFileId:
"
+
String
(
nextResendFileId
)
)
;
esp_log_write
(
ESP_LOG_INFO
,
"ResendManager"
,
"nextResendFileId:
%d"
,
nextResendFileId
);
}
uint
ResendManager
::
getLastResendFileId
()
const
{
// get the next file id to be resend
auto
lastResendFileName
=
getLastFileInDirectory
(
resendDirectoryPath
.
c_str
());
if
(
lastResendFileName
.
has_value
())
{
// if there was a file, get the id from the filename
Serial
.
println
(
"L
ast
r
esend
f
ile
n
ame:
"
+
lastResendFileName
.
value
());
esp_log_write
(
ESP_LOG_INFO
,
"ResendManager"
,
"l
ast
R
esend
F
ile
N
ame:
%s"
,
lastResendFileName
.
value
()
.
c_str
()
);
uint
lastResendFileId
=
std
::
stoul
(
lastResendFileName
.
value
().
c_str
());
return
lastResendFileId
;
}
else
{
@@ -56,9 +53,9 @@ std::optional<ResendPointType> ResendManager::loadNextToBeResendMessage() {
void
ResendManager
::
deleteResendMessage
(
const
String
&
filename
)
{
auto
filePath
=
resendDirectoryPath
+
"/"
+
filename
;
if
(
SD
.
remove
(
filePath
.
c_str
()))
{
Serial
.
println
(
"File deleted "
+
filePath
);
esp_log_write
(
ESP_LOG_INFO
,
"ResendManager"
,
"Deleted file: %s"
,
filePath
.
c_str
()
);
}
else
{
Serial
.
println
(
"D
elete f
a
ile
d "
+
filePath
);
esp_log_write
(
ESP_LOG_ERROR
,
"ResendManager"
,
"Failed to d
elete file
: %s"
,
filePath
.
c_str
()
);
throw
;
}
}
Loading