app.c 736 B

1234567891011121314151617181920212223242526272829
  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. UNUSED(p);
  10. app_instance = web_crawler_app_alloc();
  11. if(!app_instance) {
  12. FURI_LOG_E(TAG, "Failed to allocate WebCrawlerApp");
  13. return -1;
  14. }
  15. if(!flipper_http_ping()) {
  16. FURI_LOG_E(TAG, "Failed to ping the device");
  17. return -1;
  18. }
  19. // Run the application
  20. view_dispatcher_run(app_instance->view_dispatcher);
  21. // Free resources after the application loop ends
  22. web_crawler_app_free(app_instance);
  23. return 0;
  24. }