app.c 830 B

123456789101112131415161718192021222324252627282930313233
  1. #include <web_crawler_e.h>
  2. #include <flipper_http.h>
  3. #include <web_crawler_storage.h>
  4. #include <web_crawler_free.h>
  5. #include <web_crawler_callback.h>
  6. #include <web_crawler_i.h>
  7. /**
  8. * @brief Entry point for the WebCrawler application.
  9. * @param p Input parameter - unused
  10. * @return 0 to indicate success, -1 on failure
  11. */
  12. int32_t web_crawler_app(void* p) {
  13. UNUSED(p);
  14. WebCrawlerApp* app = web_crawler_app_alloc();
  15. if(!app) {
  16. FURI_LOG_E(TAG, "Failed to allocate WebCrawlerApp");
  17. return -1;
  18. }
  19. if(!flipper_http_ping()) {
  20. FURI_LOG_E(TAG, "Failed to ping the device");
  21. return -1;
  22. }
  23. // Run the application
  24. view_dispatcher_run(app->view_dispatcher);
  25. // Free resources after the application loop ends
  26. web_crawler_app_free(app);
  27. return 0;
  28. }