app.c 888 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #include "flip_trader_e.h"
  2. #include "flip_trader_storage.h"
  3. #include "flip_trader_callback.h"
  4. #include "flip_trader_i.h"
  5. #include "flip_trader_free.h"
  6. // Entry point for the FlipTrader application
  7. int32_t flip_trader_app(void *p)
  8. {
  9. // Suppress unused parameter warning
  10. UNUSED(p);
  11. // Initialize the FlipTrader application
  12. FlipTraderApp *app = flip_trader_app_alloc();
  13. // send settings and connect wifi
  14. if (!flipper_http_connect_wifi())
  15. {
  16. FURI_LOG_E(TAG, "Failed to connect to WiFi");
  17. return -1;
  18. }
  19. if (!flipper_http_ping())
  20. {
  21. FURI_LOG_E(TAG, "Failed to ping the device");
  22. return -1;
  23. }
  24. // Run the view dispatcher
  25. view_dispatcher_run(app->view_dispatcher);
  26. // Free the resources used by the FlipTrader application
  27. flip_trader_app_free(app);
  28. // Return 0 to indicate success
  29. return 0;
  30. }