still wip
This commit is contained in:
@@ -2,16 +2,43 @@
|
||||
#define CONFIG_HEADER
|
||||
#include "stdint.h"
|
||||
#include "string.h"
|
||||
#include "meshcore/packetstructs.h"
|
||||
|
||||
#define FLASH_USER_PAGE_ADDR ((const void *)(0x08077F00))
|
||||
|
||||
#define AESKeyCount 8
|
||||
#define CONTACT_COUNT 100
|
||||
|
||||
typedef struct {
|
||||
char name[32];
|
||||
unsigned char pubKey[32];
|
||||
unsigned char secret[32];
|
||||
|
||||
int32_t gps_latitude;
|
||||
int32_t gps_longitude;
|
||||
|
||||
Path path;
|
||||
|
||||
uint8_t flags;
|
||||
uint8_t type;
|
||||
|
||||
uint8_t authenticated;
|
||||
|
||||
uint32_t last_seen_rt; //remote timestamp
|
||||
uint32_t last_seen_lt; //local timestamp
|
||||
|
||||
uint32_t sync_timestamp;
|
||||
} NodeEntry;
|
||||
|
||||
typedef struct {
|
||||
uint32_t magic; // e.g. 0xDEADBEEF
|
||||
uint8_t privkey[32]; // Ed25519 private
|
||||
uint8_t pubkey[32]; // Ed25519 public
|
||||
uint8_t config[128]; // user config
|
||||
char nodeName[20];
|
||||
uint8_t extra[40];
|
||||
uint8_t nodeType;
|
||||
uint8_t aesKeys[AESKeyCount][17];
|
||||
uint8_t password[16];
|
||||
char nodeName[32];
|
||||
NodeEntry contacts[CONTACT_COUNT];
|
||||
uint32_t crc32; // integrity check
|
||||
} PersistentData_t;
|
||||
|
||||
@@ -19,4 +46,10 @@ extern PersistentData_t persistent;
|
||||
|
||||
void saveConfig();
|
||||
void loadConfig();
|
||||
|
||||
void printNodeDB();
|
||||
|
||||
NodeEntry * getNextNode();
|
||||
|
||||
NodeEntry * getNode(uint8_t hash);
|
||||
#endif
|
||||
Reference in New Issue
Block a user