void memory_getDeviceLabel(char *str, size_t len) { const char *label = storage_getLabel(); if (label && is_valid_ascii((const uint8_t*)label, strlen(label))) { snprintf(str, len, "KeepKey - %s", label); } else { strlcpy(str, "KeepKey", len); } }
void layoutSignMessage(const uint8_t *msg, uint32_t len) { const char **str; if (!is_valid_ascii(msg, len)) { str = split_message_hex(msg, len); layoutDialogSwipe(&bmp_icon_question, _("Cancel"), _("Confirm"), _("Sign binary message?"), str[0], str[1], str[2], str[3], NULL, NULL); } else { str = split_message(msg, len, 20); layoutDialogSwipe(&bmp_icon_question, _("Cancel"), _("Confirm"), _("Sign message?"), str[0], str[1], str[2], str[3], NULL, NULL); } }
void layoutVerifyMessage(const uint8_t *msg, uint32_t len) { const char **str; if (!is_valid_ascii(msg, len)) { str = split_message_hex(msg, len); layoutDialogSwipe(&bmp_icon_info, _("Cancel"), _("Confirm"), _("Verified binary message"), str[0], str[1], str[2], str[3], NULL, NULL); } else { str = split_message(msg, len, 20); layoutDialogSwipe(&bmp_icon_info, _("Cancel"), _("Confirm"), _("Verified message"), str[0], str[1], str[2], str[3], NULL, NULL); } }
/** ******************************************************************************************** Function Name : process_lcd() Description : Input : Void Output : Void Note : ********************************************************************************************** */ void process_lcd(void) { S8 key; static U8 position = 0; key = xgetkey(); if(is_valid_ascii(key)) { lcd_gotoxy(LINE2, position); lcd_putchar(key); if(position == MAX_CHAR_IN_ONE_LINE) { lcd_clear(); position = 0; } position++; } }
void layoutConfirmOpReturn(const uint8_t *data, uint32_t size) { const char **str; if (!is_valid_ascii(data, size)) { str = split_message_hex(data, size); } else { str = split_message(data, size, 20); } layoutDialogSwipe(&bmp_icon_question, _("Cancel"), _("Confirm"), NULL, _("Confirm OP_RETURN:"), str[0], str[1], str[2], str[3], NULL ); }