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
0011339a
Verified
Commit
0011339a
authored
2 years ago
by
Zoe Michaela Dietmar Pfister
Browse files
Options
Downloads
Patches
Plain Diff
Minor changes as suggested by markus
parent
ad91360c
No related branches found
No related tags found
2 merge requests
!39
Merge Develop into Main
,
!25
Minor additions to host
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
host/host_central_mast/src/main.cpp
+5
-4
5 additions, 4 deletions
host/host_central_mast/src/main.cpp
with
5 additions
and
4 deletions
host/host_central_mast/src/main.cpp
+
5
−
4
View file @
0011339a
...
@@ -60,11 +60,8 @@ void on_data_sent(const uint8_t *mac_addr, esp_now_send_status_t status) {
...
@@ -60,11 +60,8 @@ void on_data_sent(const uint8_t *mac_addr, esp_now_send_status_t status) {
}
}
void
on_data_recv
(
const
uint8_t
*
mac
,
const
uint8_t
*
incomingData
,
int
len
)
{
void
on_data_recv
(
const
uint8_t
*
mac
,
const
uint8_t
*
incomingData
,
int
len
)
{
esp_log_write
(
ESP_LOG_INFO
,
TAG_ESPNOW
,
"Message received
\n
"
);
esp_log_write
(
ESP_LOG_INFO
,
TAG_ESPNOW
,
"Message received
\n
"
);
// copy received data to a char array
char
data
[
len
];
memcpy
(
data
,
incomingData
,
len
);
esp_log_write
(
ESP_LOG_DEBUG
,
TAG_ESPNOW
,
"Raw received Data: %s
\n
"
,
data
);
if
(
!
esp_now_is_peer_exist
(
mac
))
{
if
(
!
esp_now_is_peer_exist
(
mac
))
{
esp_now_peer_info_t
client
=
{};
esp_now_peer_info_t
client
=
{};
...
@@ -86,6 +83,10 @@ void on_data_recv(const uint8_t *mac, const uint8_t *incomingData, int len) {
...
@@ -86,6 +83,10 @@ void on_data_recv(const uint8_t *mac, const uint8_t *incomingData, int len) {
esp_err_t
success
=
esp_now_send
(
mac
,
(
uint8_t
*
)
&
response
,
sizeof
(
response
));
esp_err_t
success
=
esp_now_send
(
mac
,
(
uint8_t
*
)
&
response
,
sizeof
(
response
));
esp_log_write
(
ESP_LOG_DEBUG
,
TAG_ESPNOW
,
(
success
==
ESP_OK
)
?
"Response sent
\n
"
:
"Failed to respond
\n
"
);
esp_log_write
(
ESP_LOG_DEBUG
,
TAG_ESPNOW
,
(
success
==
ESP_OK
)
?
"Response sent
\n
"
:
"Failed to respond
\n
"
);
char
data
[
len
];
memcpy
(
data
,
incomingData
,
len
);
esp_log_write
(
ESP_LOG_DEBUG
,
TAG_ESPNOW
,
"Raw received Data: %s
\n
"
,
data
);
DynamicJsonDocument
doc
=
parseReceivedJsonData
(
data
);
DynamicJsonDocument
doc
=
parseReceivedJsonData
(
data
);
String
macAddress
=
getMacAddressAsString
(
mac
);
String
macAddress
=
getMacAddressAsString
(
mac
);
...
...
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