Move FeliCa IDm/PMm display to the new NFC-F info screen

The goal is to gradually split out NfcWorkerEventReadFelica into more specific decoders, and have the generic NFC-F info screen display info for tags that don't have a specific decoder, similar to how NFC-A works currently.
This commit is contained in:
dogtopus
2023-03-09 21:43:29 -04:00
parent b521761990
commit a2cd122f78
10 changed files with 264 additions and 15 deletions

View File

@@ -8,13 +8,15 @@
#define TAG "FeliCa"
bool felica_check_ic_type(uint8_t* PMm) {
uint8_t ic_type = PMm[0];
uint8_t rom_type = PMm[1];
uint8_t rom_type = PMm[0];
uint8_t ic_type = PMm[1];
bool is_valid_ic = false;
if(ic_type == 0xff) { // RC-S967 in nfc-dep
is_valid_ic = true;
} else if(ic_type == 0xf0 || ic_type == 0xf2) { // Lite(S)
} else if(ic_type == 0xf2) { // RC-S732?
is_valid_ic = true;
} else if(ic_type == 0xf0 || ic_type == 0xf1) { // Lite(S)
is_valid_ic = true;
} else if(ic_type == 0xe1) { // RC-S967 in plug mode
is_valid_ic = true;

View File

@@ -1,6 +1,15 @@
#include "./felica.h"
#include <furi.h>
static const uint32_t TIME_CONSTANT_US = 302;
uint_least32_t felica_estimate_timing_us(uint_least8_t timing, uint_least8_t units) {
uint_least32_t base_cost_factor = 1 + (timing & 0x7);
uint_least32_t unit_cost_factor = 1 + ((timing >> 3) & 0x7);
uint_least32_t scale = 1 << ((timing >> 6) * 2);
return TIME_CONSTANT_US * scale * (base_cost_factor + unit_cost_factor * units);
}
FuriString* felica_get_system_name(FelicaSystem* system) {
uint16_t code = system->code;

View File

@@ -1,4 +1,5 @@
#include "./felica.h"
uint_least32_t felica_estimate_timing_us(uint_least8_t timing, uint_least8_t units);
FuriString* felica_get_system_name(FelicaSystem* system);
FuriString* felica_get_service_name(FelicaService* service);