app.c 868 B

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