config.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /******************************************************************************
  2. * 2016 IdeasX v0.3.1 Module Firmware
  3. *
  4. * File Name: config.h
  5. * Author: Tyler Berezowsky
  6. * Description: This file is going to need alot of help by a C wizard, but it currently works...I think.
  7. *
  8. * 2016/8/8, v1.0 created this file
  9. *******************************************************************************/
  10. #ifndef __CONFIG_H__
  11. #define ___CONFIG_H__
  12. #include "os_type.h"
  13. #include "user_config.h"
  14. typedef struct{
  15. uint32_t cfg_holder;
  16. uint8_t device_id[16];
  17. uint8_t sta_ssid[STORED_WIFI_APS][64];
  18. uint8_t sta_pwd[STORED_WIFI_APS][64];
  19. AUTH_MODE sta_type[STORED_WIFI_APS];
  20. uint32_t registered_stations;
  21. uint32_t current_station;
  22. uint8_t mqtt_host[64];
  23. uint32_t mqtt_port;
  24. uint8_t mqtt_user[32];
  25. uint8_t mqtt_pass[32];
  26. uint32_t mqtt_keepalive;
  27. uint32_t security;
  28. uint8_t ota_host[64];
  29. uint32_t ota_port;
  30. } SYSCFG;
  31. /*------------------------------------------------------------------------------*/
  32. typedef struct {
  33. uint8 flag;
  34. uint8 pad[3];
  35. } SAVE_FLAG;
  36. /*------------------------------------------------------------------------------*/
  37. /*------------------------------------------------------------------------------*/
  38. // Function Prototypes
  39. /*------------------------------------------------------------------------------*/
  40. void ICACHE_FLASH_ATTR cfg_save();
  41. void ICACHE_FLASH_ATTR cfg_load();
  42. /*------------------------------------------------------------------------------*/
  43. /*------------------------------------------------------------------------------*/
  44. // Allocate Space for System Configuration
  45. /*------------------------------------------------------------------------------*/
  46. extern SYSCFG sysCfg;
  47. /*------------------------------------------------------------------------------*/
  48. #endif /* USER_CONFIG_H_ */