configServer.h
1.55 KB
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
#ifndef CONFIG_SERVER_H
#define CONFIG_SERVER_H
#include "libwismart.h"
#include "lwip/opt.h"
#include "lwip/tcp.h"
#include "lwip/udp.h"
#include "lwip/sys.h"
#include "lwip/api.h"
#include "ch.h"
#include "fsdata.c"
#define CONFIG_SERVER_DBG(fmt,...) if(1){printf("[SRV] "fmt"\r\n", ##__VA_ARGS__);}else{({});}
#define CONFIG_SERVER_DBG_WARNING(fmt,...) if(1){printf("[SRV_WARNING] "fmt"\r\n", ##__VA_ARGS__);}else{({});}
//void create_keys(void);
void configServer_start(uint8_t enableApScan);
void configServer_connect(void);
uint32_t condigServer_dynamicCb(char* varName, char** varValue, uint8_t* varAllocType);
void configServer_buildResources(void);
void configServer_setClientParameters(void);
void configServer_reboot(void);
void configServer_rebootTimerHandler(void *arg);
int configServer_hex2bin(char *hex, char *buf, size_t hexLen);
uint32_t configServer_dynamicCb(char* varName, char** varValue, uint8_t* varAllocType);
typedef struct {
char user[64];
char password[64];
char localization[32];
} config_params_t;
extern wismart_registryKey_t geo;
#define SECURITY_TYPE_OPEN "open"
#define SECURITY_TYPE_WPA "wpa"
#define SECURITY_TYPE_WEP1 "wep1"
#define SECURITY_TYPE_WEP2 "wep2"
#define SECURITY_TYPE_WEP3 "wep3"
#define SECURITY_TYPE_WEP4 "wep4"
#define CONFIG_SERVER_MIME_TYPE_HTML "text/html; charset=UTF-8"
#define CONFIG_SERVER_MIME_TYPE_CSS "text/css; charset=UTF-8"
#define CONFIG_SERVER_MIME_TYPE_PNG "image/png"
#endif