uart_terminal_scene_help.c 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #include "../uart_terminal_app_i.h"
  2. void uart_terminal_scene_help_widget_callback(GuiButtonType result, InputType type, void* context) {
  3. UART_TerminalApp* app = context;
  4. if(type == InputTypeShort) {
  5. view_dispatcher_send_custom_event(app->view_dispatcher, result);
  6. }
  7. }
  8. void uart_terminal_scene_help_on_enter(void* context) {
  9. UART_TerminalApp* app = context;
  10. FuriString* temp_str;
  11. temp_str = furi_string_alloc();
  12. furi_string_printf(
  13. temp_str,
  14. "\nUART terminal for Flipper\n\nAT Command is using CR+LF\nSend command is using CR\nmode from Setup\n\nI'm in github: cool4uma\n\nThis app is a modified\nWiFi Marauder companion,\nThanks 0xchocolate(github)\nfor great code and app.\n\n");
  15. furi_string_cat_printf(temp_str, "Press BACK to return\n");
  16. widget_add_text_box_element(
  17. app->widget,
  18. 0,
  19. 0,
  20. 128,
  21. 14,
  22. AlignCenter,
  23. AlignBottom,
  24. "\e#\e! \e!\n",
  25. false);
  26. widget_add_text_box_element(
  27. app->widget,
  28. 0,
  29. 2,
  30. 128,
  31. 14,
  32. AlignCenter,
  33. AlignBottom,
  34. "\e#\e! UART Terminal \e!\n",
  35. false);
  36. widget_add_text_scroll_element(app->widget, 0, 16, 128, 50, furi_string_get_cstr(temp_str));
  37. furi_string_free(temp_str);
  38. view_dispatcher_switch_to_view(app->view_dispatcher, UART_TerminalAppViewHelp);
  39. }
  40. bool uart_terminal_scene_help_on_event(void* context, SceneManagerEvent event) {
  41. UART_TerminalApp* app = context;
  42. bool consumed = false;
  43. UNUSED(app);
  44. UNUSED(event);
  45. return consumed;
  46. }
  47. void uart_terminal_scene_help_on_exit(void* context) {
  48. UART_TerminalApp* app = context;
  49. // Clear views
  50. widget_reset(app->widget);
  51. }