-
Notifications
You must be signed in to change notification settings - Fork 3
/
NVSettings.h
52 lines (43 loc) · 2 KB
/
NVSettings.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*-------------------------------------------------------------------------*
* File: NVSettings.h
*-------------------------------------------------------------------------*
* Description:
*
*-------------------------------------------------------------------------*/
#ifndef NVSETTINGS_H_
#define NVSETTINGS_H_
/*-------------------------------------------------------------------------*
* Includes:
*-------------------------------------------------------------------------*/
#include "HostApp.h"
#include "NVSettings.h"
#include <system/platform.h>
#include <CmdLib/AtCmdLib.h>
/*-------------------------------------------------------------------------*
* Constants:
*-------------------------------------------------------------------------*/
/*-------------------------------------------------------------------------*
* Types:
*-------------------------------------------------------------------------*/
typedef struct {
ATLIBGS_WEB_PROV_SETTINGS webprov;
// This field must be last
uint32_t checksum;
} NVSettings_t ;
/*-------------------------------------------------------------------------*
* Prototypes:
*-------------------------------------------------------------------------*/
uint8_t NVSettingsLoad(NVSettings_t *settings);
uint8_t NVSettingsSave(NVSettings_t *settings);
uint32_t NVSettingsChecksum(const NVSettings_t *settings);
void NVSettingsInit(NVSettings_t *settings);
#define GAINSPAN_SIGNATURE_ADDR sizeof(NVSettings_t) // 0
#define GAINSPAN_SIGNATURE_LEN 8
#define GAINSPAN_SSID_MAX_LEN 20
#define GAINSPAN_SSID_ADDR (GAINSPAN_SIGNATURE_ADDR + GAINSPAN_SIGNATURE_LEN)
#define GAINSPAN_CHANNEL_ADDR (GAINSPAN_SSID_ADDR + GAINSPAN_SSID_MAX_LEN)
#define GAINSPAN_CHANNEL_MAX_LEN 1
#endif // NVSETTINGS_H_
/*-------------------------------------------------------------------------*
* End of File: NVSettings.h
*-------------------------------------------------------------------------*/