Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ieee802154-radio-eval
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
cm-projects
ieee802154-radio-eval
Commits
967385a8
Commit
967385a8
authored
7 years ago
by
Robert Hartung
Browse files
Options
Downloads
Patches
Plain Diff
Optimizes eval packet and removes include for fmt.h
parent
3e95e496
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
software/main.c
+4
-21
4 additions, 21 deletions
software/main.c
with
4 additions
and
21 deletions
software/main.c
+
4
−
21
View file @
967385a8
...
...
@@ -33,12 +33,11 @@
#include
"net/gnrc.h"
#include
"net/gnrc/netreg.h"
#include
"net/gnrc/netif/ieee802154.h"
#include
"fmt.h"
#define SEND_INTERVAL (1)
#define RCV_QUEUE_SIZE (4)
#define MAX_PAYLOAD_LENGTH (128)
#define MAGIC_STRING
(
"IBREVAL"
)
#define MAGIC_STRING "IBREVAL
\0
"
#ifndef NODE_ID
#error NODE_ID undefined
...
...
@@ -51,7 +50,7 @@ char send_thread_stack[256];
static
gnrc_netif_t
*
ieee802154_netif
=
NULL
;
typedef
struct
{
char
magic_string
[
7
];
char
magic_string
[
8
];
uint8_t
node_id
;
uint16_t
seq_nr
;
uint8_t
temp
;
...
...
@@ -76,15 +75,7 @@ static void _dump(gnrc_pktsnip_t *pkt) {
case
GNRC_NETTYPE_NETIF
:
hdr
=
snip
->
data
;
printf
(
"HDR: %d %d %d
\n
"
,
hdr
->
rssi
,
hdr
->
lqi
,
hdr
->
crc_valid
);
/*
print("HDR: ", 5);
print_u32_dec((uint32_t)hdr->rssi);
print(" ", 1);
print_u32_dec((uint32_t)hdr->lqi);
print(" ", 1);
print_u32_dec((uint32_t)hdr->crc_valid);
print("\n", 1);
*/
packet
=
(
eval_message_t
*
)
payload
->
data
;
if
(
hdr
->
crc_valid
&&
strcmp
(
packet
->
magic_string
,
MAGIC_STRING
)
==
0
)
{
...
...
@@ -96,29 +87,21 @@ static void _dump(gnrc_pktsnip_t *pkt) {
}
data
=
(
uint8_t
*
)
payload
->
data
;
/*
print("Contents(", 9);
print_u32_dec((uint32_t)len);
print("Contents)", 1);
*/
printf
(
"Contents(%02d):"
,
len
);
for
(
uint8_t
i
=
0
;
i
<
len
;
i
++
)
{
//print_byte_hex(data[i]);
printf
(
" %02X"
,
data
[
i
]);
}
//print(" | ", 3);
printf
(
" | "
);
for
(
uint8_t
i
=
0
;
i
<
len
;
i
++
)
{
if
(
data
[
i
]
>=
' '
&&
data
[
i
]
<=
'~'
)
{
printf
(
"%c"
,
data
[
i
]);
//print((char*)&data[i], 1);
}
else
{
printf
(
"."
);
//print(".", 1);
}
}
puts
(
""
);
}
break
;
default
:
printf
(
"snip of type %d
\n
"
,
snip
->
type
);
...
...
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