web_crawler_storage.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 \
  8. STORAGE_EXT_PATH_PREFIX "/apps_data/" http_tag \
  9. "/" // add the file name to the end (e.g. "received_data.txt")
  10. // Function to save settings: path, SSID, and password
  11. void save_settings(
  12. const char* path,
  13. const char* ssid,
  14. const char* password,
  15. const char* file_rename,
  16. const char* file_type,
  17. const char* http_method,
  18. const char* headers,
  19. const char* payload);
  20. // Function to load settings (the variables must be opened in the order they were saved)
  21. bool load_settings(
  22. char* path,
  23. size_t path_size,
  24. char* ssid,
  25. size_t ssid_size,
  26. char* password,
  27. size_t password_size,
  28. char* file_rename,
  29. size_t file_rename_size,
  30. char* file_type,
  31. size_t file_type_size,
  32. char* http_method,
  33. size_t http_method_size,
  34. char* headers,
  35. size_t headers_size,
  36. char* payload,
  37. size_t payload_size,
  38. WebCrawlerApp* app);
  39. bool delete_received_data(WebCrawlerApp* app);
  40. bool rename_received_data(
  41. const char* old_name,
  42. const char* new_name,
  43. const char* file_type,
  44. const char* old_file_type);
  45. #endif // WEB_CRAWLER_STORAGE_H