SubGHz decoders can provide a one-line string to be used in the history list

This commit is contained in:
Vencislav Atanasov
2024-05-06 22:53:37 +03:00
parent d1194168d6
commit e0a427f281
70 changed files with 80 additions and 2 deletions

View File

@@ -265,7 +265,6 @@ bool subghz_history_add_to_history(
instance->code_last_hash_data = hash_data;
instance->last_update_timestamp = furi_get_tick();
FuriString* text = furi_string_alloc();
SubGhzHistoryItem* item = SubGhzHistoryItemArray_push_raw(instance->history->data);
item->preset = malloc(sizeof(SubGhzRadioPreset));
item->type = decoder_base->protocol->type;
@@ -285,6 +284,15 @@ bool subghz_history_add_to_history(
item->flipper_string = flipper_format_string_alloc();
subghz_protocol_decoder_base_serialize(decoder_base, item->flipper_string, preset);
if(decoder_base->protocol && decoder_base->protocol->decoder &&
decoder_base->protocol->decoder->get_string_brief) {
decoder_base->protocol->decoder->get_string_brief(decoder_base, item->item_str);
instance->last_index_write++;
return true;
}
FuriString* text = furi_string_alloc();
do {
if(!flipper_format_rewind(item->flipper_string)) {
FURI_LOG_E(TAG, "Rewind error");