eth_save_process.h 846 B

12345678910111213141516171819202122232425262728293031
  1. #pragma once
  2. #include <stdint.h>
  3. #include <storage/storage.h>
  4. typedef struct EthernetSaveConfig {
  5. uint8_t mac[6];
  6. uint8_t ip[4];
  7. uint8_t mask[4];
  8. uint8_t gateway[4];
  9. uint8_t dns[4];
  10. uint8_t ping_ip[4];
  11. File* log_file;
  12. } EthernetSaveConfig;
  13. #define ETHERNET_SAVE_DEFAULT_MAC \
  14. { 0x10, 0x08, 0xDC, 0x47, 0x47, 0x54 }
  15. #define ETHERNET_SAVE_DEFAULT_IP \
  16. { 192, 168, 0, 101 }
  17. #define ETHERNET_SAVE_DEFAULT_MASK \
  18. { 255, 255, 255, 0 }
  19. #define ETHERNET_SAVE_DEFAULT_GATEWAY \
  20. { 192, 168, 0, 1 }
  21. #define ETHERNET_SAVE_DEFAULT_DNS \
  22. { 192, 168, 0, 1 }
  23. #define ETHERNET_SAVE_DEFAULT_PING_IP \
  24. { 8, 8, 8, 8 }
  25. EthernetSaveConfig* ethernet_save_process_malloc();
  26. void ethernet_save_process_free(EthernetSaveConfig* config);
  27. void ethernet_save_process_print(EthernetSaveConfig* config, const char* str);