pocsag_pager_scene_about.c 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #include "../pocsag_pager_app_i.h"
  2. #include "../helpers/pocsag_pager_types.h"
  3. void pocsag_pager_scene_about_widget_callback(GuiButtonType result, InputType type, void* context) {
  4. POCSAGPagerApp* app = context;
  5. if(type == InputTypeShort) {
  6. view_dispatcher_send_custom_event(app->view_dispatcher, result);
  7. }
  8. }
  9. void pocsag_pager_scene_about_on_enter(void* context) {
  10. POCSAGPagerApp* app = context;
  11. FuriString* temp_str;
  12. temp_str = furi_string_alloc();
  13. furi_string_printf(temp_str, "\e#%s\n", "Information");
  14. furi_string_cat_printf(temp_str, "Version: %s\n", PCSG_VERSION_APP);
  15. furi_string_cat_printf(temp_str, "Developed by:\n%s\n\n", PCSG_DEVELOPED);
  16. furi_string_cat_printf(temp_str, "Github: %s\n\n", PCSG_GITHUB);
  17. furi_string_cat_printf(temp_str, "\e#%s\n", "Description");
  18. furi_string_cat_printf(
  19. temp_str,
  20. "Receiving POCSAG Pager \nmessages \nDefault frequency is set to\nDAPNET - 439987500\n\nUse Config button to set frequency\nCustom frequencies usually can be found in the end of the list - use right arrow button to scroll to the end\n\nTo add new modulations and\nfrequencies create file\n/pocsag/settings.txt\nAnd copy \nsubghz/assets/setting_user.example\ncontents into new\nsettings.txt\n\n");
  21. furi_string_cat_printf(
  22. temp_str, "Supported protocols:\nPOCSAG 512\nPOCSAG 1200\nPOCSAG 2400\n");
  23. widget_add_text_box_element(
  24. app->widget,
  25. 0,
  26. 0,
  27. 128,
  28. 14,
  29. AlignCenter,
  30. AlignBottom,
  31. "\e#\e! \e!\n",
  32. false);
  33. widget_add_text_box_element(
  34. app->widget,
  35. 0,
  36. 2,
  37. 128,
  38. 14,
  39. AlignCenter,
  40. AlignBottom,
  41. "\e#\e! POCSAG Pager \e!\n",
  42. false);
  43. widget_add_text_scroll_element(app->widget, 0, 16, 128, 50, furi_string_get_cstr(temp_str));
  44. furi_string_free(temp_str);
  45. view_dispatcher_switch_to_view(app->view_dispatcher, POCSAGPagerViewWidget);
  46. }
  47. bool pocsag_pager_scene_about_on_event(void* context, SceneManagerEvent event) {
  48. POCSAGPagerApp* app = context;
  49. bool consumed = false;
  50. UNUSED(app);
  51. UNUSED(event);
  52. return consumed;
  53. }
  54. void pocsag_pager_scene_about_on_exit(void* context) {
  55. POCSAGPagerApp* app = context;
  56. // Clear views
  57. widget_reset(app->widget);
  58. }