app.c 745 B

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