2021-01-09 22:01:21 +01:00
|
|
|
#ifndef _CONFIG_H_
|
|
|
|
#define _CONFIG_H_
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2021-02-08 14:34:29 +01:00
|
|
|
#include <sha256.h>
|
|
|
|
|
2021-02-16 12:09:08 +01:00
|
|
|
#define CONFIG_MAGIC 0xdead0008
|
2021-01-09 22:01:21 +01:00
|
|
|
|
|
|
|
typedef struct __attribute__((__packed__)) s_configBlock {
|
|
|
|
uint32_t configMagic;
|
|
|
|
char deviceName[16];
|
2021-02-08 11:08:15 +01:00
|
|
|
char ntpServer[48];
|
|
|
|
char deviceId[16];
|
2021-02-08 14:34:29 +01:00
|
|
|
char sharedSecret[SHA256_BLOCK_SIZE];
|
2021-02-08 13:13:05 +01:00
|
|
|
char sinkServer[48];
|
2021-02-16 12:28:31 +01:00
|
|
|
union {
|
2021-02-16 12:31:45 +01:00
|
|
|
struct {
|
|
|
|
uint8_t macAddress[6];
|
|
|
|
} lan;
|
2021-02-16 13:00:10 +01:00
|
|
|
struct {
|
|
|
|
char ssid[48];
|
|
|
|
char key[65]; // the actual key may have up to 64 chars and has to end with a \0
|
|
|
|
} wifi;
|
2021-02-16 12:28:31 +01:00
|
|
|
} networkspecific;
|
2021-02-16 13:05:44 +01:00
|
|
|
uint8_t filler[11];
|
2021-01-09 22:01:21 +01:00
|
|
|
} t_configBlock;
|
|
|
|
|
|
|
|
|
|
|
|
void configInit();
|
|
|
|
t_configBlock* getConfig();
|
|
|
|
|
|
|
|
#endif /* _CONFIG_H_ */
|