app.c 797 B

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