app.c 747 B

1234567891011121314151617181920212223242526272829303132
  1. #include <flip_wifi.h>
  2. #include <alloc/flip_wifi_alloc.h>
  3. // Entry point for the FlipWiFi application
  4. int32_t flip_wifi_main(void *p)
  5. {
  6. // Suppress unused parameter warning
  7. UNUSED(p);
  8. // Initialize the FlipWiFi application
  9. app_instance = flip_wifi_app_alloc();
  10. if (!app_instance)
  11. {
  12. FURI_LOG_E(TAG, "Failed to allocate FlipWiFiApp");
  13. return -1;
  14. }
  15. if (!flipper_http_ping())
  16. {
  17. FURI_LOG_E(TAG, "Failed to ping the device");
  18. return -1;
  19. }
  20. // Run the view dispatcher
  21. view_dispatcher_run(app_instance->view_dispatcher);
  22. // Free the resources used by the FlipWiFi application
  23. flip_wifi_app_free(app_instance);
  24. // Return 0 to indicate success
  25. return 0;
  26. }