fix: remove hardcoded keys and load them from NVS + script + key reset
This commit is contained in:
parent
7a07bb2522
commit
20fa0bc034
7 changed files with 31 additions and 36 deletions
13
src/config.h
13
src/config.h
|
|
@ -1,13 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#define MAX_RESTART 1
|
||||
#define MAX_FATAL_RESTART 3
|
||||
|
||||
uint64_t joinEUI = 0x911b5c62b4dc2079;
|
||||
uint64_t devEUI = 0x0586fe41112d83d9;
|
||||
uint8_t appKey[] = {
|
||||
0x81, 0x24, 0xbe, 0x86, 0x59, 0x06, 0xa4, 0x4f,
|
||||
0xe7, 0x39, 0xd6, 0x0f, 0xd6, 0x88, 0x91, 0xcc};
|
||||
uint8_t nwkKey[] = {
|
||||
0xb8, 0x30, 0x20, 0xf2, 0x52, 0x3b, 0xd2, 0xb0,
|
||||
0x1d, 0x12, 0xe1, 0xb9, 0xe7, 0xe1, 0xb0, 0xde};
|
||||
12
src/main.cpp
12
src/main.cpp
|
|
@ -4,15 +4,13 @@
|
|||
#include <GazDisplay.h>
|
||||
#include "config.h"
|
||||
|
||||
#define MAX_RESTART 1
|
||||
#define MAX_FATAL_RESTART 3
|
||||
|
||||
RTC_DATA_ATTR uint8_t fatalRestartCount = 0;
|
||||
RTC_DATA_ATTR uint8_t restartCount = 0;
|
||||
|
||||
ITransmitter* transmitter = new LoRaTransmitter(
|
||||
joinEUI,
|
||||
devEUI,
|
||||
nwkKey,
|
||||
appKey
|
||||
);
|
||||
ITransmitter* transmitter;
|
||||
|
||||
void fatalError(const char* msg){
|
||||
Serial.printf("[FATAL] %s\n", msg);
|
||||
|
|
@ -57,6 +55,8 @@ void setup() {
|
|||
Serial.begin(115200);
|
||||
delay(2000);
|
||||
|
||||
transmitter = new LoRaTransmitter();
|
||||
|
||||
if (displayInit() != DisplayError::OK){
|
||||
nonCriticalError("Initialisation du périphérique d'affichage échouée");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue