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
Commits
0fcc3b94
Commit
0fcc3b94
authored
2 years ago
by
Moritz Perschke
Browse files
Options
Downloads
Patches
Plain Diff
renamed time_milis to epoch_seconds
parent
0ffa95b1
No related branches found
No related tags found
4 merge requests
!39
Merge Develop into Main
,
!19
development into master
,
!17
Inital Host, initial Client
,
!6
Espnow
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
client/client/lib/espnow/src/ESPNow.cpp
+3
-3
3 additions, 3 deletions
client/client/lib/espnow/src/ESPNow.cpp
client/client/lib/espnow/src/ESPNow.hpp
+1
-1
1 addition, 1 deletion
client/client/lib/espnow/src/ESPNow.hpp
with
4 additions
and
4 deletions
client/client/lib/espnow/src/ESPNow.cpp
+
3
−
3
View file @
0fcc3b94
...
...
@@ -39,6 +39,7 @@ void on_data_recv(const uint8_t *mac, const uint8_t *incomingData, int len)
if
(
!
preferences
.
isKey
(
"host"
))
{
preferences
.
putBytes
(
"host"
,
new_config
.
host
,
sizeof
(
new_config
.
host
));
ESP_LOGI
(
TAG
,
"host MAC address saved to flash"
);
// add host to peers
esp_now_peer_info_t
host
;
memset
(
&
host
,
0
,
sizeof
(
host
));
...
...
@@ -48,13 +49,12 @@ void on_data_recv(const uint8_t *mac, const uint8_t *incomingData, int len)
if
(
esp_now_add_peer
(
&
host
)
!=
ESP_OK
){
ESP_LOGE
(
TAG
,
"Adding host to peers failed"
);
}
}
// host change shouldn't be an issue
preferences
.
end
();
// sync time
Time
::
getInstance
().
setTime
(
new_config
.
time_millis
);
// see https://www.esp32.com/viewtopic.php?t=9965, maybe this needs an offset
Serial
.
println
(
"received time: "
+
(
String
)
new_config
.
time_millis
);
Serial
.
println
(
"new time: "
+
(
String
)
Time
::
getInstance
().
getMillis
());
new_config
.
epoch_seconds
);
// see https://www.esp32.com/viewtopic.php?t=9965, maybe this needs an offset
}
esp_err_t
espnow_setup
()
...
...
This diff is collapsed.
Click to expand it.
client/client/lib/espnow/src/ESPNow.hpp
+
1
−
1
View file @
0fcc3b94
...
...
@@ -13,7 +13,7 @@
typedef
struct
config
{
uint8_t
host
[
6
];
long
time_milli
s
;
long
epoch_second
s
;
}
config
;
esp_err_t
espnow_setup
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment