web_crawler_storage.h 1.4 KB

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