mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 09:38:35 -07:00
Merge remote-tracking branch 'OFW/dev' into dev
This commit is contained in:
@@ -140,6 +140,19 @@ static const IdMapping actransit_zones[] = {
|
||||
};
|
||||
static const size_t kNumACTransitZones = COUNT(actransit_zones);
|
||||
|
||||
// Instead of persisting individual Station IDs, Caltrain saves Zone numbers.
|
||||
// https://www.caltrain.com/stations-zones
|
||||
static const IdMapping caltrain_zones[] = {
|
||||
{.id = 0x0001, .name = "Zone 1"},
|
||||
{.id = 0x0002, .name = "Zone 2"},
|
||||
{.id = 0x0003, .name = "Zone 3"},
|
||||
{.id = 0x0004, .name = "Zone 4"},
|
||||
{.id = 0x0005, .name = "Zone 5"},
|
||||
{.id = 0x0006, .name = "Zone 6"},
|
||||
};
|
||||
|
||||
static const size_t kNumCaltrainZones = COUNT(caltrain_zones);
|
||||
|
||||
//
|
||||
// Full agency+zone mapping.
|
||||
//
|
||||
@@ -150,6 +163,7 @@ static const struct {
|
||||
} agency_zone_map[] = {
|
||||
{.agency_id = 0x0001, .zone_map = actransit_zones, .zone_count = kNumACTransitZones},
|
||||
{.agency_id = 0x0004, .zone_map = bart_zones, .zone_count = kNumBARTZones},
|
||||
{.agency_id = 0x0006, .zone_map = caltrain_zones, .zone_count = kNumCaltrainZones},
|
||||
{.agency_id = 0x0012, .zone_map = muni_zones, .zone_count = kNumMUNIZones}};
|
||||
static const size_t kNumAgencyZoneMaps = COUNT(agency_zone_map);
|
||||
|
||||
|
||||
@@ -582,7 +582,7 @@ bool ndef_parse_record(
|
||||
NdefTnf tnf,
|
||||
const char* type,
|
||||
uint8_t type_len) {
|
||||
FURI_LOG_D(TAG, "payload type: %.*s len: %d", type_len, type, len);
|
||||
FURI_LOG_D(TAG, "payload type: %.*s len: %hu", type_len, type, len);
|
||||
if(!len) {
|
||||
furi_string_cat(ndef->output, "Empty\n");
|
||||
return true;
|
||||
@@ -702,9 +702,9 @@ bool ndef_parse_message(Ndef* ndef, size_t pos, size_t len, size_t message_num,
|
||||
pos += id_len;
|
||||
|
||||
if(smart_poster) {
|
||||
furi_string_cat_printf(ndef->output, "\e*> SP-R%d: ", record_num);
|
||||
furi_string_cat_printf(ndef->output, "\e*> SP-R%zu: ", record_num);
|
||||
} else {
|
||||
furi_string_cat_printf(ndef->output, "\e*> M%d-R%d: ", message_num, record_num);
|
||||
furi_string_cat_printf(ndef->output, "\e*> M%zu-R%zu: ", message_num, record_num);
|
||||
}
|
||||
if(!ndef_parse_record(ndef, pos, payload_len, flags_tnf.type_name_format, type, type_len)) {
|
||||
if(type_was_allocated) free(type);
|
||||
@@ -721,7 +721,7 @@ bool ndef_parse_message(Ndef* ndef, size_t pos, size_t len, size_t message_num,
|
||||
if(smart_poster) {
|
||||
furi_string_cat(ndef->output, "\e*> SP: Empty\n\n");
|
||||
} else {
|
||||
furi_string_cat_printf(ndef->output, "\e*> M%d: Empty\n\n", message_num);
|
||||
furi_string_cat_printf(ndef->output, "\e*> M%zu: Empty\n\n", message_num);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -949,7 +949,7 @@ static bool ndef_mfc_parse(const NfcDevice* device, FuriString* parsed_data) {
|
||||
} else {
|
||||
data_block = 93 + (sector - 32) * 15;
|
||||
}
|
||||
FURI_LOG_D(TAG, "data_block: %d", data_block);
|
||||
FURI_LOG_D(TAG, "data_block: %zu", data_block);
|
||||
size_t data_start = data_block * MF_CLASSIC_BLOCK_SIZE;
|
||||
size_t parsed = ndef_parse_tlv(&ndef, data_start, data_size - data_start, total_parsed);
|
||||
|
||||
@@ -982,7 +982,7 @@ static bool ndef_slix_parse(const NfcDevice* device, FuriString* parsed_data) {
|
||||
const uint16_t block_count = iso15693_3_get_block_count(data);
|
||||
const uint8_t* blocks = simple_array_cget_data(data->block_data);
|
||||
|
||||
// TODO: Find some way to check for other iso15693 NDEF cards and
|
||||
// TODO(-nofl): Find some way to check for other iso15693 NDEF cards and
|
||||
// split this to also support non-slix iso15693 NDEF tags
|
||||
// Rest of the code works on iso15693 too, but uses SLIX layout assumptions
|
||||
if(block_size != SLIX_BLOCK_SIZE) {
|
||||
|
||||
Reference in New Issue
Block a user