[FL-1371][FL-1502] Lfrfid app: fixes. (#555)
* Gui module byte-input: changed api * Gui: changed font height in multiline text according to guideline * Apps lrfid, nfc: changed send and receive icon * App lfrfid: fix text, fix scene switсh * Elements: multiline text framed, fix paddings * Gui: remove duplicate definition of elements_multiline_text_framed * App NFC: update byte_input callback signature * App subghz: fix text lines in capture scene * App subghz: position of the text is aligned with the guidelines and other scenes * App subghz: removed mockup Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
		
							parent
							
								
									f82a4a2260
								
							
						
					
					
						commit
						7734fb4018
					
				| @ -181,7 +181,7 @@ void dolphin_view_hw_mismatch_draw(Canvas* canvas, void* model) { | |||||||
|     canvas_set_font(canvas, FontSecondary); |     canvas_set_font(canvas, FontSecondary); | ||||||
|     snprintf(buffer, 64, "HW target: F%d", api_hal_version_get_hw_target()); |     snprintf(buffer, 64, "HW target: F%d", api_hal_version_get_hw_target()); | ||||||
|     canvas_draw_str(canvas, 5, 27, buffer); |     canvas_draw_str(canvas, 5, 27, buffer); | ||||||
|     canvas_draw_str(canvas, 5, 37, "FW target: " TARGET); |     canvas_draw_str(canvas, 5, 38, "FW target: " TARGET); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| uint32_t dolphin_view_idle_back(void* context) { | uint32_t dolphin_view_idle_back(void* context) { | ||||||
|  | |||||||
| @ -122,7 +122,7 @@ static void text_input_callback(void* context) { | |||||||
|     next_view(context); |     next_view(context); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static void byte_input_callback(void* context, uint8_t* bytes, uint8_t bytes_count) { | static void byte_input_callback(void* context) { | ||||||
|     next_view(context); |     next_view(context); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -81,7 +81,13 @@ uint8_t canvas_height(Canvas* canvas) { | |||||||
| 
 | 
 | ||||||
| uint8_t canvas_current_font_height(Canvas* canvas) { | uint8_t canvas_current_font_height(Canvas* canvas) { | ||||||
|     furi_assert(canvas); |     furi_assert(canvas); | ||||||
|     return u8g2_GetMaxCharHeight(&canvas->fb); |     uint8_t font_height = u8g2_GetMaxCharHeight(&canvas->fb); | ||||||
|  | 
 | ||||||
|  |     if(canvas->fb.font == u8g2_font_haxrcorp4089_tr) { | ||||||
|  |         font_height += 1; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     return font_height; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void canvas_clear(Canvas* canvas) { | void canvas_clear(Canvas* canvas) { | ||||||
|  | |||||||
| @ -196,7 +196,7 @@ void elements_multiline_text_aligned( | |||||||
|     furi_assert(canvas); |     furi_assert(canvas); | ||||||
|     furi_assert(text); |     furi_assert(text); | ||||||
| 
 | 
 | ||||||
|     uint8_t font_height = canvas_current_font_height(canvas) + 2; |     uint8_t font_height = canvas_current_font_height(canvas); | ||||||
|     string_t str; |     string_t str; | ||||||
|     string_init(str); |     string_init(str); | ||||||
|     const char* start = text; |     const char* start = text; | ||||||
| @ -298,10 +298,10 @@ void elements_multiline_text_framed(Canvas* canvas, uint8_t x, uint8_t y, const | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     canvas_set_color(canvas, ColorWhite); |     canvas_set_color(canvas, ColorWhite); | ||||||
|     canvas_draw_box(canvas, x, y - font_y, str_width + 8, font_y * lines + 6); |     canvas_draw_box(canvas, x, y - font_y, str_width + 8, font_y * lines + 4); | ||||||
|     canvas_set_color(canvas, ColorBlack); |     canvas_set_color(canvas, ColorBlack); | ||||||
|     elements_multiline_text(canvas, x + 4, y + 1, text); |     elements_multiline_text(canvas, x + 4, y - 1, text); | ||||||
|     elements_frame(canvas, x, y - font_y, str_width + 8, font_y * lines + 6); |     elements_frame(canvas, x, y - font_y, str_width + 8, font_y * lines + 4); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void elements_slightly_rounded_frame( | void elements_slightly_rounded_frame( | ||||||
|  | |||||||
| @ -101,14 +101,6 @@ void elements_multiline_text(Canvas* canvas, uint8_t x, uint8_t y, const char* t | |||||||
|  */ |  */ | ||||||
| void elements_multiline_text_framed(Canvas* canvas, uint8_t x, uint8_t y, const char* text); | void elements_multiline_text_framed(Canvas* canvas, uint8_t x, uint8_t y, const char* text); | ||||||
| 
 | 
 | ||||||
| /*
 |  | ||||||
|  * Draw framed multiline text |  | ||||||
|  * @param x, y - top left corner coordinates |  | ||||||
|  * @param text - string (possible multiline) |  | ||||||
|  */ |  | ||||||
| 
 |  | ||||||
| void elements_multiline_text_framed(Canvas* canvas, uint8_t x, uint8_t y, const char* text); |  | ||||||
| 
 |  | ||||||
| /*
 | /*
 | ||||||
|  * Draw slightly rounded frame |  * Draw slightly rounded frame | ||||||
|  * @param x, y - top left corner coordinates |  * @param x, y - top left corner coordinates | ||||||
|  | |||||||
| @ -397,7 +397,7 @@ static void byte_input_dec_selected_byte(ByteInputModel* model) { | |||||||
|  */ |  */ | ||||||
| static void byte_input_call_input_callback(ByteInputModel* model) { | static void byte_input_call_input_callback(ByteInputModel* model) { | ||||||
|     if(model->input_callback != NULL) { |     if(model->input_callback != NULL) { | ||||||
|         model->input_callback(model->callback_context, model->bytes, model->bytes_count); |         model->input_callback(model->callback_context); | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -408,7 +408,7 @@ static void byte_input_call_input_callback(ByteInputModel* model) { | |||||||
|  */ |  */ | ||||||
| static void byte_input_call_changed_callback(ByteInputModel* model) { | static void byte_input_call_changed_callback(ByteInputModel* model) { | ||||||
|     if(model->changed_callback != NULL) { |     if(model->changed_callback != NULL) { | ||||||
|         model->changed_callback(model->callback_context, model->bytes, model->bytes_count); |         model->changed_callback(model->callback_context); | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -15,13 +15,13 @@ typedef struct ByteInput ByteInput; | |||||||
|  * @brief callback that is executed on save button press |  * @brief callback that is executed on save button press | ||||||
|  *  |  *  | ||||||
|  */ |  */ | ||||||
| typedef void (*ByteInputCallback)(void* context, uint8_t* bytes, uint8_t bytes_count); | typedef void (*ByteInputCallback)(void* context); | ||||||
| 
 | 
 | ||||||
| /**
 | /**
 | ||||||
|  * @brief callback that is executed when byte buffer is changed |  * @brief callback that is executed when byte buffer is changed | ||||||
|  *  |  *  | ||||||
|  */ |  */ | ||||||
| typedef void (*ByteChangedCallback)(void* context, uint8_t* bytes, uint8_t bytes_count); | typedef void (*ByteChangedCallback)(void* context); | ||||||
| 
 | 
 | ||||||
| /** 
 | /** 
 | ||||||
|  * @brief Allocate and initialize byte input. This byte input is used to enter bytes. |  * @brief Allocate and initialize byte input. This byte input is used to enter bytes. | ||||||
|  | |||||||
| @ -40,7 +40,7 @@ void iButtonSceneAddValue::on_exit(iButtonApp* app) { | |||||||
|     byte_input_set_header_text(byte_input, {0}); |     byte_input_set_header_text(byte_input, {0}); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void iButtonSceneAddValue::byte_input_callback(void* context, uint8_t* bytes, uint8_t bytes_count) { | void iButtonSceneAddValue::byte_input_callback(void* context) { | ||||||
|     iButtonApp* app = static_cast<iButtonApp*>(context); |     iButtonApp* app = static_cast<iButtonApp*>(context); | ||||||
|     iButtonEvent event; |     iButtonEvent event; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -8,5 +8,5 @@ public: | |||||||
|     void on_exit(iButtonApp* app) final; |     void on_exit(iButtonApp* app) final; | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
|     void byte_input_callback(void* context, uint8_t* bytes, uint8_t bytes_count); |     void byte_input_callback(void* context); | ||||||
| }; | }; | ||||||
| @ -11,13 +11,13 @@ void LfRfidAppSceneEmulate::on_enter(LfRfidApp* app, bool need_restore) { | |||||||
| 
 | 
 | ||||||
|     auto popup = app->view_controller.get<PopupVM>(); |     auto popup = app->view_controller.get<PopupVM>(); | ||||||
| 
 | 
 | ||||||
|     popup->set_header("LF emulating", 89, 30, AlignCenter, AlignTop); |     popup->set_header("Emulating", 89, 30, AlignCenter, AlignTop); | ||||||
|     if(strlen(app->worker.key.get_name())) { |     if(strlen(app->worker.key.get_name())) { | ||||||
|         popup->set_text(app->worker.key.get_name(), 89, 43, AlignCenter, AlignTop); |         popup->set_text(app->worker.key.get_name(), 89, 43, AlignCenter, AlignTop); | ||||||
|     } else { |     } else { | ||||||
|         popup->set_text(string_get_cstr(data_string), 89, 43, AlignCenter, AlignTop); |         popup->set_text(string_get_cstr(data_string), 89, 43, AlignCenter, AlignTop); | ||||||
|     } |     } | ||||||
|     popup->set_icon(0, 4, I_RFIDDolphinSend_98x60); |     popup->set_icon(0, 3, I_RFIDDolphinSend_97x61); | ||||||
| 
 | 
 | ||||||
|     app->view_controller.switch_to<PopupVM>(); |     app->view_controller.switch_to<PopupVM>(); | ||||||
|     app->worker.start_emulate(); |     app->worker.start_emulate(); | ||||||
|  | |||||||
| @ -3,8 +3,8 @@ | |||||||
| void LfRfidAppSceneRead::on_enter(LfRfidApp* app, bool need_restore) { | void LfRfidAppSceneRead::on_enter(LfRfidApp* app, bool need_restore) { | ||||||
|     auto popup = app->view_controller.get<PopupVM>(); |     auto popup = app->view_controller.get<PopupVM>(); | ||||||
| 
 | 
 | ||||||
|     popup->set_header("Reading\nLF RFID", 70, 34, AlignLeft, AlignTop); |     popup->set_header("Reading\nLF RFID", 89, 34, AlignCenter, AlignTop); | ||||||
|     popup->set_icon(0, 4, I_RFIDDolphinReceive_98x60); |     popup->set_icon(0, 3, I_RFIDDolphinReceive_97x61); | ||||||
| 
 | 
 | ||||||
|     app->view_controller.switch_to<PopupVM>(); |     app->view_controller.switch_to<PopupVM>(); | ||||||
|     app->worker.start_read(); |     app->worker.start_read(); | ||||||
|  | |||||||
| @ -50,7 +50,7 @@ void LfRfidAppSceneSaveData::on_exit(LfRfidApp* app) { | |||||||
|     app->view_controller.get<ByteInputVM>()->clean(); |     app->view_controller.get<ByteInputVM>()->clean(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void LfRfidAppSceneSaveData::save_callback(void* context, uint8_t* bytes, uint8_t bytes_count) { | void LfRfidAppSceneSaveData::save_callback(void* context) { | ||||||
|     LfRfidApp* app = static_cast<LfRfidApp*>(context); |     LfRfidApp* app = static_cast<LfRfidApp*>(context); | ||||||
|     LfRfidApp::Event event; |     LfRfidApp::Event event; | ||||||
|     event.type = LfRfidApp::EventType::Next; |     event.type = LfRfidApp::EventType::Next; | ||||||
|  | |||||||
| @ -8,7 +8,7 @@ public: | |||||||
|     void on_exit(LfRfidApp* app) final; |     void on_exit(LfRfidApp* app) final; | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
|     static void save_callback(void* context, uint8_t* bytes, uint8_t bytes_count); |     static void save_callback(void* context); | ||||||
|     uint8_t old_key_data[LFRFID_KEY_SIZE] = { |     uint8_t old_key_data[LFRFID_KEY_SIZE] = { | ||||||
|         0xAA, |         0xAA, | ||||||
|         0xAA, |         0xAA, | ||||||
|  | |||||||
| @ -18,7 +18,7 @@ bool LfRfidAppSceneWriteSuccess::on_event(LfRfidApp* app, LfRfidApp::Event* even | |||||||
| 
 | 
 | ||||||
|     if(event->type == LfRfidApp::EventType::Back) { |     if(event->type == LfRfidApp::EventType::Back) { | ||||||
|         app->scene_controller.search_and_switch_to_previous_scene( |         app->scene_controller.search_and_switch_to_previous_scene( | ||||||
|             {LfRfidApp::SceneType::ReadedMenu}); |             {LfRfidApp::SceneType::ReadedMenu, LfRfidApp::SceneType::SelectKey}); | ||||||
|         consumed = true; |         consumed = true; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -12,13 +12,13 @@ void LfRfidAppSceneWrite::on_enter(LfRfidApp* app, bool need_restore) { | |||||||
| 
 | 
 | ||||||
|     auto popup = app->view_controller.get<PopupVM>(); |     auto popup = app->view_controller.get<PopupVM>(); | ||||||
| 
 | 
 | ||||||
|     popup->set_header("LF writing", 89, 30, AlignCenter, AlignTop); |     popup->set_header("Writing", 89, 30, AlignCenter, AlignTop); | ||||||
|     if(strlen(app->worker.key.get_name())) { |     if(strlen(app->worker.key.get_name())) { | ||||||
|         popup->set_text(app->worker.key.get_name(), 89, 43, AlignCenter, AlignTop); |         popup->set_text(app->worker.key.get_name(), 89, 43, AlignCenter, AlignTop); | ||||||
|     } else { |     } else { | ||||||
|         popup->set_text(string_get_cstr(data_string), 89, 43, AlignCenter, AlignTop); |         popup->set_text(string_get_cstr(data_string), 89, 43, AlignCenter, AlignTop); | ||||||
|     } |     } | ||||||
|     popup->set_icon(0, 4, I_RFIDDolphinSend_98x60); |     popup->set_icon(0, 3, I_RFIDDolphinSend_97x61); | ||||||
| 
 | 
 | ||||||
|     app->view_controller.switch_to<PopupVM>(); |     app->view_controller.switch_to<PopupVM>(); | ||||||
|     app->worker.start_write(); |     app->worker.start_write(); | ||||||
|  | |||||||
| @ -1,4 +1,5 @@ | |||||||
| #include "string-element.h" | #include "string-element.h" | ||||||
|  | #include <gui/elements.h> | ||||||
| 
 | 
 | ||||||
| StringElement::StringElement() { | StringElement::StringElement() { | ||||||
| } | } | ||||||
| @ -9,7 +10,7 @@ StringElement::~StringElement() { | |||||||
| void StringElement::draw(Canvas* canvas) { | void StringElement::draw(Canvas* canvas) { | ||||||
|     if(text) { |     if(text) { | ||||||
|         canvas_set_font(canvas, font); |         canvas_set_font(canvas, font); | ||||||
|         canvas_draw_str_aligned(canvas, x, y, horizontal, vertical, text); |         elements_multiline_text_aligned(canvas, x, y, horizontal, vertical, text); | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -29,7 +29,7 @@ const void nfc_scene_emulate_uid_on_enter(void* context) { | |||||||
|             data->uid[6]); |             data->uid[6]); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     popup_set_icon(popup, 0, 4, I_RFIDDolphinSend_98x60); |     popup_set_icon(popup, 0, 3, I_RFIDDolphinSend_97x61); | ||||||
|     popup_set_header(popup, "Emulating UID", 56, 31, AlignLeft, AlignTop); |     popup_set_header(popup, "Emulating UID", 56, 31, AlignLeft, AlignTop); | ||||||
|     popup_set_text(popup, nfc->text_store, 56, 43, AlignLeft, AlignTop); |     popup_set_text(popup, nfc->text_store, 56, 43, AlignLeft, AlignTop); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -18,7 +18,7 @@ const void nfc_scene_read_card_on_enter(void* context) { | |||||||
|     // Setup view
 |     // Setup view
 | ||||||
|     Popup* popup = nfc->popup; |     Popup* popup = nfc->popup; | ||||||
|     popup_set_header(popup, "Detecting\nNFC card", 70, 34, AlignLeft, AlignTop); |     popup_set_header(popup, "Detecting\nNFC card", 70, 34, AlignLeft, AlignTop); | ||||||
|     popup_set_icon(popup, 0, 4, I_RFIDDolphinReceive_98x60); |     popup_set_icon(popup, 0, 3, I_RFIDDolphinReceive_97x61); | ||||||
| 
 | 
 | ||||||
|     // Start worker
 |     // Start worker
 | ||||||
|     nfc_worker_start( |     nfc_worker_start( | ||||||
|  | |||||||
| @ -8,7 +8,7 @@ | |||||||
| 
 | 
 | ||||||
| #define SCENE_SET_ATQA_CUSTOM_EVENT (0UL) | #define SCENE_SET_ATQA_CUSTOM_EVENT (0UL) | ||||||
| 
 | 
 | ||||||
| void nfc_scene_set_atqa_byte_input_callback(void* context, uint8_t* bytes, uint8_t bytes_count) { | void nfc_scene_set_atqa_byte_input_callback(void* context) { | ||||||
|     Nfc* nfc = (Nfc*)context; |     Nfc* nfc = (Nfc*)context; | ||||||
| 
 | 
 | ||||||
|     view_dispatcher_send_custom_event( |     view_dispatcher_send_custom_event( | ||||||
|  | |||||||
| @ -8,7 +8,7 @@ | |||||||
| 
 | 
 | ||||||
| #define SCENE_SET_SAK_CUSTOM_EVENT (0UL) | #define SCENE_SET_SAK_CUSTOM_EVENT (0UL) | ||||||
| 
 | 
 | ||||||
| void nfc_scene_set_sak_byte_input_callback(void* context, uint8_t* bytes, uint8_t bytes_count) { | void nfc_scene_set_sak_byte_input_callback(void* context) { | ||||||
|     Nfc* nfc = (Nfc*)context; |     Nfc* nfc = (Nfc*)context; | ||||||
| 
 | 
 | ||||||
|     view_dispatcher_send_custom_event(nfc->nfc_common.view_dispatcher, SCENE_SET_SAK_CUSTOM_EVENT); |     view_dispatcher_send_custom_event(nfc->nfc_common.view_dispatcher, SCENE_SET_SAK_CUSTOM_EVENT); | ||||||
|  | |||||||
| @ -8,7 +8,7 @@ | |||||||
| 
 | 
 | ||||||
| #define SCENE_SET_UID_CUSTOM_EVENT (0UL) | #define SCENE_SET_UID_CUSTOM_EVENT (0UL) | ||||||
| 
 | 
 | ||||||
| void nfc_scene_set_uid_byte_input_callback(void* context, uint8_t* bytes, uint8_t bytes_count) { | void nfc_scene_set_uid_byte_input_callback(void* context) { | ||||||
|     Nfc* nfc = (Nfc*)context; |     Nfc* nfc = (Nfc*)context; | ||||||
| 
 | 
 | ||||||
|     view_dispatcher_send_custom_event(nfc->nfc_common.view_dispatcher, SCENE_SET_UID_CUSTOM_EVENT); |     view_dispatcher_send_custom_event(nfc->nfc_common.view_dispatcher, SCENE_SET_UID_CUSTOM_EVENT); | ||||||
|  | |||||||
| @ -25,7 +25,7 @@ void ScenedAppSceneByteInput::on_exit(ScenedApp* app) { | |||||||
|     app->view_controller.get<ByteInputVM>()->clean(); |     app->view_controller.get<ByteInputVM>()->clean(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void ScenedAppSceneByteInput::result_callback(void* context, uint8_t* bytes, uint8_t bytes_count) { | void ScenedAppSceneByteInput::result_callback(void* context) { | ||||||
|     ScenedApp* app = static_cast<ScenedApp*>(context); |     ScenedApp* app = static_cast<ScenedApp*>(context); | ||||||
|     ScenedApp::Event event; |     ScenedApp::Event event; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -8,7 +8,7 @@ public: | |||||||
|     void on_exit(ScenedApp* app) final; |     void on_exit(ScenedApp* app) final; | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
|     void result_callback(void* context, uint8_t* bytes, uint8_t bytes_count); |     void result_callback(void* context); | ||||||
| 
 | 
 | ||||||
|     uint8_t data[4] = { |     uint8_t data[4] = { | ||||||
|         0x01, |         0x01, | ||||||
|  | |||||||
| @ -39,10 +39,10 @@ void subghz_capture_draw(Canvas* canvas, SubghzCaptureModel* model) { | |||||||
|         model->real_frequency / 1000000 % 1000, |         model->real_frequency / 1000000 % 1000, | ||||||
|         model->real_frequency / 1000 % 1000, |         model->real_frequency / 1000 % 1000, | ||||||
|         subghz_symbols[model->counter % 4]); |         subghz_symbols[model->counter % 4]); | ||||||
|     canvas_draw_str(canvas, 2, 12, buffer); |     canvas_draw_str(canvas, 0, 8, buffer); | ||||||
| 
 | 
 | ||||||
|     canvas_set_font(canvas, FontSecondary); |     canvas_set_font(canvas, FontSecondary); | ||||||
|     elements_multiline_text(canvas, 0, 24, string_get_cstr(model->text)); |     elements_multiline_text(canvas, 0, 20, string_get_cstr(model->text)); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| bool subghz_capture_input(InputEvent* event, void* context) { | bool subghz_capture_input(InputEvent* event, void* context) { | ||||||
|  | |||||||
| @ -38,7 +38,7 @@ void subghz_static_draw(Canvas* canvas, SubghzStaticModel* model) { | |||||||
| 
 | 
 | ||||||
|     canvas_set_color(canvas, ColorBlack); |     canvas_set_color(canvas, ColorBlack); | ||||||
|     canvas_set_font(canvas, FontPrimary); |     canvas_set_font(canvas, FontPrimary); | ||||||
|     canvas_draw_str(canvas, 2, 12, "CC1101 Static"); |     canvas_draw_str(canvas, 0, 8, "CC1101 Static"); | ||||||
| 
 | 
 | ||||||
|     canvas_set_font(canvas, FontSecondary); |     canvas_set_font(canvas, FontSecondary); | ||||||
|     // Frequency
 |     // Frequency
 | ||||||
| @ -49,9 +49,9 @@ void subghz_static_draw(Canvas* canvas, SubghzStaticModel* model) { | |||||||
|         model->real_frequency / 1000000 % 1000, |         model->real_frequency / 1000000 % 1000, | ||||||
|         model->real_frequency / 1000 % 1000, |         model->real_frequency / 1000 % 1000, | ||||||
|         model->real_frequency % 1000); |         model->real_frequency % 1000); | ||||||
|     canvas_draw_str(canvas, 2, 24, buffer); |     canvas_draw_str(canvas, 0, 20, buffer); | ||||||
|     snprintf(buffer, sizeof(buffer), "Key: %d", model->button); |     snprintf(buffer, sizeof(buffer), "Key: %d", model->button); | ||||||
|     canvas_draw_str(canvas, 2, 36, buffer); |     canvas_draw_str(canvas, 0, 31, buffer); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| bool subghz_static_input(InputEvent* event, void* context) { | bool subghz_static_input(InputEvent* event, void* context) { | ||||||
|  | |||||||
| @ -29,7 +29,7 @@ void subghz_test_basic_draw(Canvas* canvas, SubghzTestBasicModel* model) { | |||||||
| 
 | 
 | ||||||
|     canvas_set_color(canvas, ColorBlack); |     canvas_set_color(canvas, ColorBlack); | ||||||
|     canvas_set_font(canvas, FontPrimary); |     canvas_set_font(canvas, FontPrimary); | ||||||
|     canvas_draw_str(canvas, 2, 12, "CC1101 Basic Test"); |     canvas_draw_str(canvas, 0, 8, "CC1101 Basic Test"); | ||||||
| 
 | 
 | ||||||
|     canvas_set_font(canvas, FontSecondary); |     canvas_set_font(canvas, FontSecondary); | ||||||
|     // Frequency
 |     // Frequency
 | ||||||
| @ -40,7 +40,7 @@ void subghz_test_basic_draw(Canvas* canvas, SubghzTestBasicModel* model) { | |||||||
|         model->real_frequency / 1000000 % 1000, |         model->real_frequency / 1000000 % 1000, | ||||||
|         model->real_frequency / 1000 % 1000, |         model->real_frequency / 1000 % 1000, | ||||||
|         model->real_frequency % 1000); |         model->real_frequency % 1000); | ||||||
|     canvas_draw_str(canvas, 2, 24, buffer); |     canvas_draw_str(canvas, 0, 20, buffer); | ||||||
|     // Path
 |     // Path
 | ||||||
|     char* path_name = "Unknown"; |     char* path_name = "Unknown"; | ||||||
|     if(model->path == ApiHalSubGhzPathIsolate) { |     if(model->path == ApiHalSubGhzPathIsolate) { | ||||||
| @ -53,7 +53,7 @@ void subghz_test_basic_draw(Canvas* canvas, SubghzTestBasicModel* model) { | |||||||
|         path_name = "868MHz"; |         path_name = "868MHz"; | ||||||
|     } |     } | ||||||
|     snprintf(buffer, sizeof(buffer), "Path: %d - %s", model->path, path_name); |     snprintf(buffer, sizeof(buffer), "Path: %d - %s", model->path, path_name); | ||||||
|     canvas_draw_str(canvas, 2, 36, buffer); |     canvas_draw_str(canvas, 0, 31, buffer); | ||||||
|     if(model->status == SubghzTestBasicModelStatusRx) { |     if(model->status == SubghzTestBasicModelStatusRx) { | ||||||
|         snprintf( |         snprintf( | ||||||
|             buffer, |             buffer, | ||||||
| @ -61,9 +61,9 @@ void subghz_test_basic_draw(Canvas* canvas, SubghzTestBasicModel* model) { | |||||||
|             "RSSI: %ld.%ld dBm", |             "RSSI: %ld.%ld dBm", | ||||||
|             (int32_t)(model->rssi), |             (int32_t)(model->rssi), | ||||||
|             (int32_t)fabs(model->rssi * 10) % 10); |             (int32_t)fabs(model->rssi * 10) % 10); | ||||||
|         canvas_draw_str(canvas, 2, 48, buffer); |         canvas_draw_str(canvas, 0, 42, buffer); | ||||||
|     } else { |     } else { | ||||||
|         canvas_draw_str(canvas, 2, 48, "TX"); |         canvas_draw_str(canvas, 0, 42, "TX"); | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -37,7 +37,7 @@ void subghz_test_packet_draw(Canvas* canvas, SubghzTestPacketModel* model) { | |||||||
| 
 | 
 | ||||||
|     canvas_set_color(canvas, ColorBlack); |     canvas_set_color(canvas, ColorBlack); | ||||||
|     canvas_set_font(canvas, FontPrimary); |     canvas_set_font(canvas, FontPrimary); | ||||||
|     canvas_draw_str(canvas, 2, 12, "CC1101 Packet Test"); |     canvas_draw_str(canvas, 0, 8, "CC1101 Packet Test"); | ||||||
| 
 | 
 | ||||||
|     canvas_set_font(canvas, FontSecondary); |     canvas_set_font(canvas, FontSecondary); | ||||||
|     // Frequency
 |     // Frequency
 | ||||||
| @ -48,7 +48,7 @@ void subghz_test_packet_draw(Canvas* canvas, SubghzTestPacketModel* model) { | |||||||
|         model->real_frequency / 1000000 % 1000, |         model->real_frequency / 1000000 % 1000, | ||||||
|         model->real_frequency / 1000 % 1000, |         model->real_frequency / 1000 % 1000, | ||||||
|         model->real_frequency % 1000); |         model->real_frequency % 1000); | ||||||
|     canvas_draw_str(canvas, 2, 24, buffer); |     canvas_draw_str(canvas, 0, 20, buffer); | ||||||
|     // Path
 |     // Path
 | ||||||
|     char* path_name = "Unknown"; |     char* path_name = "Unknown"; | ||||||
|     if(model->path == ApiHalSubGhzPathIsolate) { |     if(model->path == ApiHalSubGhzPathIsolate) { | ||||||
| @ -61,7 +61,7 @@ void subghz_test_packet_draw(Canvas* canvas, SubghzTestPacketModel* model) { | |||||||
|         path_name = "868MHz"; |         path_name = "868MHz"; | ||||||
|     } |     } | ||||||
|     snprintf(buffer, sizeof(buffer), "Path: %d - %s", model->path, path_name); |     snprintf(buffer, sizeof(buffer), "Path: %d - %s", model->path, path_name); | ||||||
|     canvas_draw_str(canvas, 2, 36, buffer); |     canvas_draw_str(canvas, 0, 31, buffer); | ||||||
|     if(model->status == SubghzTestPacketModelStatusRx) { |     if(model->status == SubghzTestPacketModelStatusRx) { | ||||||
|         snprintf( |         snprintf( | ||||||
|             buffer, |             buffer, | ||||||
| @ -69,9 +69,9 @@ void subghz_test_packet_draw(Canvas* canvas, SubghzTestPacketModel* model) { | |||||||
|             "RSSI: %ld.%ld dBm", |             "RSSI: %ld.%ld dBm", | ||||||
|             (int32_t)(model->rssi), |             (int32_t)(model->rssi), | ||||||
|             (int32_t)fabs(model->rssi * 10) % 10); |             (int32_t)fabs(model->rssi * 10) % 10); | ||||||
|         canvas_draw_str(canvas, 2, 48, buffer); |         canvas_draw_str(canvas, 0, 42, buffer); | ||||||
|     } else { |     } else { | ||||||
|         canvas_draw_str(canvas, 2, 48, "TX"); |         canvas_draw_str(canvas, 0, 42, "TX"); | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @ -3,150 +3,150 @@ | |||||||
| #include <gui/icon.h> | #include <gui/icon.h> | ||||||
| 
 | 
 | ||||||
| typedef enum { | typedef enum { | ||||||
| 	I_KeyBackspaceSelected_16x9, | 	A_FX_Sitting_40x27, | ||||||
| 	I_KeySave_24x11, | 	A_MDIB_32x32, | ||||||
| 	I_KeySaveSelected_24x11, | 	A_MDI_32x32, | ||||||
| 	I_KeyBackspace_16x9, | 	A_MDWLB_32x32, | ||||||
| 	I_Battery_26x8, | 	A_MDWL_32x32, | ||||||
| 	I_PlaceholderL_11x13, | 	A_MDWRB_32x32, | ||||||
| 	I_Bluetooth_5x8, | 	A_MDWR_32x32, | ||||||
| 	I_BadUsb_9x8, | 	A_WatchingTV_128x64, | ||||||
| 	I_PlaceholderR_30x13, | 	A_Wink_128x64, | ||||||
| 	I_USBConnected_15x8, |  | ||||||
| 	I_Battery_19x8, |  | ||||||
| 	I_Lock_8x8, |  | ||||||
| 	I_Background_128x11, |  | ||||||
| 	I_Background_128x8, |  | ||||||
| 	I_SDcardFail_11x8, |  | ||||||
| 	I_SDcardMounted_11x8, |  | ||||||
| 	I_Nfc_10px, |  | ||||||
| 	I_ir_10px, |  | ||||||
| 	I_ble_10px, |  | ||||||
| 	I_sub1_10px, |  | ||||||
| 	I_dir_10px, |  | ||||||
| 	I_unknown_10px, |  | ||||||
| 	I_ibutt_10px, |  | ||||||
| 	I_125_10px, | 	I_125_10px, | ||||||
| 	A_iButton_14, | 	I_ble_10px, | ||||||
| 	A_Plugins_14, | 	I_dir_10px, | ||||||
| 	A_Bluetooth_14, | 	I_ibutt_10px, | ||||||
| 	A_Games_14, | 	I_ir_10px, | ||||||
| 	A_Infrared_14, | 	I_Nfc_10px, | ||||||
| 	A_NFC_14, | 	I_sub1_10px, | ||||||
| 	A_FileManager_14, | 	I_unknown_10px, | ||||||
| 	A_Passport_14, |  | ||||||
| 	A_Settings_14, |  | ||||||
| 	A_Power_14, |  | ||||||
| 	A_125khz_14, |  | ||||||
| 	A_GPIO_14, |  | ||||||
| 	A_Tamagotchi_14, |  | ||||||
| 	A_U2F_14, |  | ||||||
| 	A_Sub1ghz_14, |  | ||||||
| 	I_ButtonLeft_4x7, |  | ||||||
| 	I_ButtonRight_4x7, |  | ||||||
| 	I_ButtonRightSmall_3x5, |  | ||||||
| 	I_Empty_1x1, |  | ||||||
| 	I_ButtonCenter_7x7, | 	I_ButtonCenter_7x7, | ||||||
| 	I_ButtonLeftSmall_3x5, | 	I_ButtonLeftSmall_3x5, | ||||||
| 	I_Vol_up_25x27, | 	I_ButtonLeft_4x7, | ||||||
| 	I_Fill_marker_7x7, | 	I_ButtonRightSmall_3x5, | ||||||
| 	I_IrdaArrowUp_4x8, | 	I_ButtonRight_4x7, | ||||||
| 	I_Down_hvr_25x27, | 	I_Empty_1x1, | ||||||
| 	I_Vol_up_hvr_25x27, | 	I_BigBurger_24x24, | ||||||
| 	I_Power_25x27, | 	I_BigGames_24x24, | ||||||
| 	I_Vol_down_25x27, | 	I_BigProfile_24x24, | ||||||
| 	I_IrdaSend_128x64, | 	I_DolphinFirstStart0_70x53, | ||||||
| 	I_Up_hvr_25x27, | 	I_DolphinFirstStart1_59x53, | ||||||
| 	I_Back_15x10, | 	I_DolphinFirstStart2_59x51, | ||||||
| 	I_IrdaSendShort_128x34, | 	I_DolphinFirstStart3_57x48, | ||||||
| 	I_Mute_hvr_25x27, | 	I_DolphinFirstStart4_67x53, | ||||||
| 	I_IrdaLearnShort_128x31, | 	I_DolphinFirstStart5_45x53, | ||||||
| 	I_Down_25x27, | 	I_DolphinFirstStart6_58x54, | ||||||
| 	I_Up_25x27, | 	I_DolphinFirstStart7_61x51, | ||||||
| 	I_Mute_25x27, | 	I_DolphinFirstStart8_56x51, | ||||||
| 	I_Vol_down_hvr_25x27, | 	I_DolphinOkay_41x43, | ||||||
| 	I_Power_hvr_25x27, | 	I_Flipper_young_80x60, | ||||||
| 	I_IrdaLearn_128x64, | 	I_FX_Bang_32x6, | ||||||
| 	I_IrdaArrowDown_4x8, | 	I_FX_SittingB_40x27, | ||||||
| 	A_MDWRB_32x32, | 	I_DolphinExcited_64x63, | ||||||
| 	A_MDWL_32x32, | 	I_DolphinMafia_115x62, | ||||||
| 	A_WatchingTV_128x64, | 	I_DolphinNice_96x59, | ||||||
| 	A_MDWR_32x32, | 	I_DolphinWait_61x59, | ||||||
| 	A_FX_Sitting_40x27, | 	I_iButtonDolphinSuccess_109x60, | ||||||
| 	A_MDI_32x32, | 	I_iButtonDolphinVerySuccess_108x52, | ||||||
| 	A_Wink_128x64, | 	I_iButtonKey_49x44, | ||||||
| 	A_MDIB_32x32, |  | ||||||
| 	A_MDWLB_32x32, |  | ||||||
| 	I_RFIDBigChip_37x36, |  | ||||||
| 	I_RFIDDolphinReceive_98x60, |  | ||||||
| 	I_RFIDDolphinSuccess_108x57, |  | ||||||
| 	I_RFIDDolphinSend_98x60, |  | ||||||
| 	I_DoorRight_70x55, |  | ||||||
| 	I_DoorLocked_10x56, |  | ||||||
| 	I_DoorLeft_70x55, | 	I_DoorLeft_70x55, | ||||||
| 	I_PassportLeft_6x47, |  | ||||||
| 	I_DoorRight_8x56, |  | ||||||
| 	I_DoorLeft_8x56, | 	I_DoorLeft_8x56, | ||||||
|  | 	I_DoorLocked_10x56, | ||||||
|  | 	I_DoorRight_70x55, | ||||||
|  | 	I_DoorRight_8x56, | ||||||
| 	I_LockPopup_100x49, | 	I_LockPopup_100x49, | ||||||
| 	I_PassportBottom_128x17, | 	I_PassportBottom_128x17, | ||||||
| 	I_Medium_chip_22x21, | 	I_PassportLeft_6x47, | ||||||
|  | 	I_Back_15x10, | ||||||
|  | 	I_Down_25x27, | ||||||
|  | 	I_Down_hvr_25x27, | ||||||
|  | 	I_Fill_marker_7x7, | ||||||
|  | 	I_IrdaArrowDown_4x8, | ||||||
|  | 	I_IrdaArrowUp_4x8, | ||||||
|  | 	I_IrdaLearnShort_128x31, | ||||||
|  | 	I_IrdaLearn_128x64, | ||||||
|  | 	I_IrdaSendShort_128x34, | ||||||
|  | 	I_IrdaSend_128x64, | ||||||
|  | 	I_Mute_25x27, | ||||||
|  | 	I_Mute_hvr_25x27, | ||||||
|  | 	I_Power_25x27, | ||||||
|  | 	I_Power_hvr_25x27, | ||||||
|  | 	I_Up_25x27, | ||||||
|  | 	I_Up_hvr_25x27, | ||||||
|  | 	I_Vol_down_25x27, | ||||||
|  | 	I_Vol_down_hvr_25x27, | ||||||
|  | 	I_Vol_up_25x27, | ||||||
|  | 	I_Vol_up_hvr_25x27, | ||||||
|  | 	I_KeyBackspaceSelected_16x9, | ||||||
|  | 	I_KeyBackspace_16x9, | ||||||
|  | 	I_KeySaveSelected_24x11, | ||||||
|  | 	I_KeySave_24x11, | ||||||
|  | 	A_125khz_14, | ||||||
|  | 	A_Bluetooth_14, | ||||||
|  | 	A_FileManager_14, | ||||||
|  | 	A_Games_14, | ||||||
|  | 	A_GPIO_14, | ||||||
|  | 	A_iButton_14, | ||||||
|  | 	A_Infrared_14, | ||||||
|  | 	A_NFC_14, | ||||||
|  | 	A_Passport_14, | ||||||
|  | 	A_Plugins_14, | ||||||
|  | 	A_Power_14, | ||||||
|  | 	A_Settings_14, | ||||||
|  | 	A_Sub1ghz_14, | ||||||
|  | 	A_Tamagotchi_14, | ||||||
|  | 	A_U2F_14, | ||||||
| 	I_EMV_Chip_14x11, | 	I_EMV_Chip_14x11, | ||||||
| 	I_iButtonDolphinVerySuccess_108x52, | 	I_Medium_chip_22x21, | ||||||
| 	I_DolphinMafia_115x62, |  | ||||||
| 	I_iButtonDolphinSuccess_109x60, |  | ||||||
| 	I_DolphinExcited_64x63, |  | ||||||
| 	I_DolphinNice_96x59, |  | ||||||
| 	I_iButtonKey_49x44, |  | ||||||
| 	I_DolphinWait_61x59, |  | ||||||
| 	I_passport_bad2_43x45, |  | ||||||
| 	I_passport_okay1_43x45, |  | ||||||
| 	I_passport_happy3_43x45, |  | ||||||
| 	I_passport_bad1_43x45, | 	I_passport_bad1_43x45, | ||||||
| 	I_passport_happy2_43x45, | 	I_passport_bad2_43x45, | ||||||
| 	I_passport_okay2_43x45, |  | ||||||
| 	I_passport_happy1_43x45, |  | ||||||
| 	I_passport_okay3_43x45, |  | ||||||
| 	I_passport_bad3_43x45, | 	I_passport_bad3_43x45, | ||||||
| 	I_SDQuestion_35x43, | 	I_passport_happy1_43x45, | ||||||
| 	I_SDError_43x35, | 	I_passport_happy2_43x45, | ||||||
| 	I_WalkLB1_32x32, | 	I_passport_happy3_43x45, | ||||||
| 	I_PC_22x29, | 	I_passport_okay1_43x45, | ||||||
| 	I_Home_painting_17x20, | 	I_passport_okay2_43x45, | ||||||
| 	I_Sofa_40x13, | 	I_passport_okay3_43x45, | ||||||
| 	I_WalkRB1_32x32, |  | ||||||
| 	I_WalkL1_32x32, |  | ||||||
| 	I_WalkR1_32x32, |  | ||||||
| 	I_WalkL2_32x32, |  | ||||||
| 	I_WalkR2_32x32, |  | ||||||
| 	I_TV_20x24, |  | ||||||
| 	I_WalkLB2_32x32, |  | ||||||
| 	I_TV_20x20, |  | ||||||
| 	I_WalkRB2_32x32, |  | ||||||
| 	I_Health_16x16, |  | ||||||
| 	I_FaceNopower_29x14, |  | ||||||
| 	I_Battery_16x16, |  | ||||||
| 	I_BatteryBody_52x28, | 	I_BatteryBody_52x28, | ||||||
| 	I_FaceConfused_29x14, | 	I_Battery_16x16, | ||||||
| 	I_FaceCharging_29x14, | 	I_FaceCharging_29x14, | ||||||
|  | 	I_FaceConfused_29x14, | ||||||
|  | 	I_FaceNopower_29x14, | ||||||
| 	I_FaceNormal_29x14, | 	I_FaceNormal_29x14, | ||||||
| 	I_Voltage_16x16, | 	I_Health_16x16, | ||||||
| 	I_Temperature_16x16, | 	I_Temperature_16x16, | ||||||
| 	I_DolphinOkay_41x43, | 	I_Voltage_16x16, | ||||||
| 	I_DolphinFirstStart7_61x51, | 	I_RFIDBigChip_37x36, | ||||||
| 	I_DolphinFirstStart4_67x53, | 	I_RFIDDolphinReceive_97x61, | ||||||
| 	I_DolphinFirstStart3_57x48, | 	I_RFIDDolphinSend_97x61, | ||||||
| 	I_FX_Bang_32x6, | 	I_RFIDDolphinSuccess_108x57, | ||||||
| 	I_Flipper_young_80x60, | 	I_Home_painting_17x20, | ||||||
| 	I_DolphinFirstStart0_70x53, | 	I_PC_22x29, | ||||||
| 	I_DolphinFirstStart2_59x51, | 	I_Sofa_40x13, | ||||||
| 	I_DolphinFirstStart6_58x54, | 	I_TV_20x20, | ||||||
| 	I_FX_SittingB_40x27, | 	I_TV_20x24, | ||||||
| 	I_BigProfile_24x24, | 	I_WalkL1_32x32, | ||||||
| 	I_DolphinFirstStart5_45x53, | 	I_WalkL2_32x32, | ||||||
| 	I_BigGames_24x24, | 	I_WalkLB1_32x32, | ||||||
| 	I_DolphinFirstStart8_56x51, | 	I_WalkLB2_32x32, | ||||||
| 	I_BigBurger_24x24, | 	I_WalkR1_32x32, | ||||||
| 	I_DolphinFirstStart1_59x53, | 	I_WalkR2_32x32, | ||||||
|  | 	I_WalkRB1_32x32, | ||||||
|  | 	I_WalkRB2_32x32, | ||||||
|  | 	I_SDError_43x35, | ||||||
|  | 	I_SDQuestion_35x43, | ||||||
|  | 	I_Background_128x11, | ||||||
|  | 	I_Background_128x8, | ||||||
|  | 	I_BadUsb_9x8, | ||||||
|  | 	I_Battery_19x8, | ||||||
|  | 	I_Battery_26x8, | ||||||
|  | 	I_Bluetooth_5x8, | ||||||
|  | 	I_Lock_8x8, | ||||||
|  | 	I_PlaceholderL_11x13, | ||||||
|  | 	I_PlaceholderR_30x13, | ||||||
|  | 	I_SDcardFail_11x8, | ||||||
|  | 	I_SDcardMounted_11x8, | ||||||
|  | 	I_USBConnected_15x8, | ||||||
| } IconName; | } IconName; | ||||||
| 
 | 
 | ||||||
| Icon * assets_icons_get(IconName name); | Icon * assets_icons_get(IconName name); | ||||||
|  | |||||||
							
								
								
									
										
											BIN
										
									
								
								assets/icons/RFID/RFIDDolphinReceive_97x61.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								assets/icons/RFID/RFIDDolphinReceive_97x61.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 1.4 KiB | 
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 3.0 KiB | 
							
								
								
									
										
											BIN
										
									
								
								assets/icons/RFID/RFIDDolphinSend_97x61.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								assets/icons/RFID/RFIDDolphinSend_97x61.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 1.4 KiB | 
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 3.0 KiB | 
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 SG
						SG