#ifndef SERVER_H_ #define SERVER_H_ #include "lwip/ip4_addr.h" #include "lwip/pbuf.h" #define STARTFILE 0x7fc6 #define ENDFILE 0x0464 #define DEFAULTHOST "picokb" #define DEFAULTPASS "password" #define MAX_POST_PARAM_LEN 63+1 typedef struct { uint16_t header; char ssid[32+1]; char pass[63+1]; char host[63+1]; bool manual; ip4_addr_t ip; ip4_addr_t mask; ip4_addr_t gw; uint16_t footer; } net_config; void run_http_server(); const char * reboot_cgi(int iIndex, int iNumParams, char *pcParam[], char *pcValue[]); uint16_t __time_critical_func(ssi_handler)(int iIndex, char *pcInsert, int iInsertLen); void set_indicator(uint8_t const* buffer); void send_indicators(void); void urldecode(char *urlstring, char *dest); bool net_config_load(net_config *wifi); void net_config_write(net_config *wifi); char *find_post_param(struct pbuf *p, const char *param, char *buf, size_t len); const void ws_receive_handler(uint8_t *data, uint16_t len); const void ws_open_handler(struct ws_state * wss); #define FLASH_TARGET_OFFSET ((PICO_FLASH_SIZE_BYTES) - FLASH_SECTOR_SIZE) #endif