Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
LoRaWAN benchmark
RIOT - IM880B
Commits
21e7c6c5
Commit
21e7c6c5
authored
Apr 26, 2019
by
Guillaume Gonnet
Browse files
Save OTAA join response to EEPROM.
parent
8bfc3d37
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
11 deletions
+16
-11
Makefile
Makefile
+1
-0
src/app/providers/otaa.c
src/app/providers/otaa.c
+15
-11
No files found.
Makefile
View file @
21e7c6c5
...
...
@@ -48,6 +48,7 @@ USEMODULE += loramac-crypto
# Application dependencies.
USEMODULE
+=
$(DRIVER)
USEMODULE
+=
random
USEMODULE
+=
periph_eeprom
USEMODULE
+=
periph_uart
...
...
src/app/providers/otaa.c
View file @
21e7c6c5
...
...
@@ -11,23 +11,28 @@ This project is under the MIT license
#include "app.h"
#include <debug.h>
#include <periph/eeprom.h>
// Configure LoRaMAC driver with provider information.
void
pvd_otaa_enable
(
provider_t
*
pvd
)
{
// TODO: read join response and frame counter from EEPROM.
pvd_otta_t
*
otaa
=
pvd
->
data
;
uint8_t
data
[
32
];
(
void
)
pvd
;
// Replay OTAA with join message from EEPROM.
eeprom_read
(
otaa
->
eeprom_addr
,
data
,
32
);
lorariot_replay_otaa
(
data
);
// TODO: read frame counter from EEPROM.
// lorariot_replay_otaa();
}
// Save frame counter from last uplink message.
void
pvd_otaa_update
(
provider_t
*
pvd
)
{
// TODO.
// TODO
: save frame counter
.
(
void
)
pvd
;
}
...
...
@@ -47,17 +52,16 @@ void pvd_otaa_reset(provider_t *pvd)
PANIC
(
"Can't join network using OTAA"
);
}
// Save OTAA join response data.
uint8_t
*
data
=
loraraiot_retrieve_otaa
();
eeprom_write
(
otaa
->
eeprom_addr
,
data
,
32
);
// TODO: save join response.
(
void
)
data
;
// TODO: save frame counter.
// Resend the join message to port 6.
lorariot_mcps_t
mcps
=
LORARIOT_CONFIRMED
(
DR_0
);
// TODO: fill msg with join data.
mcps
.
buffer
=
data
;
mcps
.
len
=
32
;
mcps
.
port
=
10
;
lorariot_send
(
&
mcps
);
}
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