mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
[FL-3677, FL-3798] RFID Improvements (#3524)
* Update saved_info and read_success scenes * Update EM4100 rendering * Update HIDExt rendering * Update Gallagher rendering * Update HidProx rendering * Update IOProx rendering * Update H10301 rendering * Update PAC/Stanley rendering * Add strcasecmp() to API, better manufacturer/name handling * Update Viking rendering * Update FDX-A rendering * Update Pyramid rendering * Update Indala26 rendering * Update Idteck rendering * Update Keri rendering * Update Nexwatch rendering * Update Jablotron rendering * Update Paradox rendering * Truncate long Hex string on scene_read_suceess * Fix formatting * Update AWID rendering * Update FDX-B rendering * Tweak string formatting in various screens * More read_success view tweaks * Fix formatting * Fix Pyramid brief rendering * Reset saved key menu when going back * Reset other menus on back where applicable * Update confirmation scenes * Update emulation scene * Update delete scene * Update raw read info screen * Update raw read scene, fix crash * Update raw read success scene * Update write scene * Always return to SceneSelectKey after saving * Update SceneWriteSuccess and SceneDeleteSuccess * Replace closing parens with dots * FL-3798: Fix special formatting in text_box * Simplify SceneReadSuccess * Fix crash when having a trailing newline in text_box * Bump API symbols version * Make PVS happy * Format sources Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -288,21 +288,33 @@ void protocol_fdx_b_render_data(ProtocolFDXB* protocol, FuriString* result) {
|
||||
uint8_t replacement_number = bit_lib_get_bits(protocol->data, 60, 3);
|
||||
bool animal_flag = bit_lib_get_bit(protocol->data, 63);
|
||||
|
||||
furi_string_printf(result, "ID: %03u-%012llu\r\n", country_code, national_code);
|
||||
furi_string_cat_printf(result, "Animal: %s, ", animal_flag ? "Yes" : "No");
|
||||
furi_string_printf(
|
||||
result,
|
||||
"ID: %03hu-%012llu\n"
|
||||
"Country Code: %hu\n"
|
||||
"Temperature: ",
|
||||
country_code,
|
||||
national_code,
|
||||
country_code);
|
||||
|
||||
float temperature;
|
||||
if(protocol_fdx_b_get_temp(protocol->data, &temperature)) {
|
||||
float temperature_c = (temperature - 32) / 1.8;
|
||||
furi_string_cat_printf(
|
||||
result, "T: %.2fF, %.2fC\r\n", (double)temperature, (double)temperature_c);
|
||||
if(furi_hal_rtc_get_locale_units() == FuriHalRtcLocaleUnitsMetric) {
|
||||
float temperature_c = (temperature - 32.0f) / 1.8f;
|
||||
furi_string_cat_printf(result, "%.2fC", (double)temperature_c);
|
||||
} else {
|
||||
furi_string_cat_printf(result, "%.2fF", (double)temperature);
|
||||
}
|
||||
} else {
|
||||
furi_string_cat_printf(result, "T: ---\r\n");
|
||||
furi_string_cat(result, "---");
|
||||
}
|
||||
|
||||
furi_string_cat_printf(
|
||||
result,
|
||||
"Bits: %X-%X-%X-%X-%X",
|
||||
"\n"
|
||||
"Animal: %s\n"
|
||||
"Bits: %hhX-%hhX-%hhX-%hhX-%hhX",
|
||||
animal_flag ? "Yes" : "No",
|
||||
block_status,
|
||||
rudi_bit,
|
||||
reserved,
|
||||
@@ -317,21 +329,24 @@ void protocol_fdx_b_render_brief_data(ProtocolFDXB* protocol, FuriString* result
|
||||
// 10 bit of country code
|
||||
uint16_t country_code = protocol_fdx_b_get_country_code(protocol->data);
|
||||
|
||||
bool animal_flag = bit_lib_get_bit(protocol->data, 63);
|
||||
|
||||
furi_string_printf(result, "ID: %03u-%012llu\r\n", country_code, national_code);
|
||||
furi_string_cat_printf(result, "Animal: %s, ", animal_flag ? "Yes" : "No");
|
||||
furi_string_printf(
|
||||
result,
|
||||
"ID: %03hu-%012llu\n"
|
||||
"Country: %hu; Temp.: ",
|
||||
country_code,
|
||||
national_code,
|
||||
country_code);
|
||||
|
||||
float temperature;
|
||||
if(protocol_fdx_b_get_temp(protocol->data, &temperature)) {
|
||||
if(furi_hal_rtc_get_locale_units() == FuriHalRtcLocaleUnitsMetric) {
|
||||
float temperature_c = (temperature - 32.0f) / 1.8f;
|
||||
furi_string_cat_printf(result, "T: %.2fC", (double)temperature_c);
|
||||
furi_string_cat_printf(result, "%.2fC", (double)temperature_c);
|
||||
} else {
|
||||
furi_string_cat_printf(result, "T: %.2fF", (double)temperature);
|
||||
furi_string_cat_printf(result, "%.2fF", (double)temperature);
|
||||
}
|
||||
} else {
|
||||
furi_string_cat_printf(result, "T: ---");
|
||||
furi_string_cat(result, "---");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -380,4 +395,4 @@ const ProtocolBase protocol_fdx_b = {
|
||||
.render_data = (ProtocolRenderData)protocol_fdx_b_render_data,
|
||||
.render_brief_data = (ProtocolRenderData)protocol_fdx_b_render_brief_data,
|
||||
.write_data = (ProtocolWriteData)protocol_fdx_b_write_data,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user