web_crawler_storage.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef WEB_CRAWLER_STORAGE_H
  2. #define WEB_CRAWLER_STORAGE_H
  3. #include <web_crawler.h>
  4. #include <furi.h>
  5. #include <storage/storage.h>
  6. #define SETTINGS_PATH STORAGE_EXT_PATH_PREFIX "/apps_data/" http_tag "/settings.bin"
  7. #define RECEIVED_DATA_PATH STORAGE_EXT_PATH_PREFIX "/apps_data/" http_tag "/" // add the file name to the end (e.g. "received_data.txt")
  8. // Function to save settings: path, SSID, and password
  9. void save_settings(
  10. const char *path,
  11. const char *ssid,
  12. const char *password,
  13. const char *file_rename,
  14. const char *file_type,
  15. const char *http_method,
  16. const char *headers,
  17. const char *payload);
  18. // Function to load settings (the variables must be opened in the order they were saved)
  19. bool load_settings(
  20. char *path,
  21. size_t path_size,
  22. char *ssid,
  23. size_t ssid_size,
  24. char *password,
  25. size_t password_size,
  26. char *file_rename,
  27. size_t file_rename_size,
  28. char *file_type,
  29. size_t file_type_size,
  30. char *http_method,
  31. size_t http_method_size,
  32. char *headers,
  33. size_t headers_size,
  34. char *payload,
  35. size_t payload_size,
  36. WebCrawlerApp *app);
  37. bool delete_received_data(WebCrawlerApp *app);
  38. bool rename_received_data(const char *old_name, const char *new_name, const char *file_type, const char *old_file_type);
  39. #endif // WEB_CRAWLER_STORAGE_H