Skip to content

Commit

Permalink
Merge pull request #37 from DocSystem/dev
Browse files Browse the repository at this point in the history
Better location parsing on Navigo cards
  • Loading branch information
luu176 authored Jan 29, 2025
2 parents 557409a + e2b3b85 commit c599a1f
Show file tree
Hide file tree
Showing 144 changed files with 1,240 additions and 652 deletions.
48 changes: 48 additions & 0 deletions api/calypso/cards/intercode.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,54 @@ const char* get_intercode_string_transition_type(int transition) {
}
}

const char* get_intercode_string_transport_type(int type) {
switch(type) {
case URBAN_BUS:
return "Urban Bus";
case INTERURBAN_BUS:
return "Interurban Bus";
case METRO:
return "Metro";
case TRAM:
return "Tram";
case COMMUTER_TRAIN:
return "Train";
case PARKING:
return "Parking";
default:
return "Unknown";
}
}

const char* get_intercode_string_pay_method(int pay_method) {
switch(pay_method) {
case 0x30:
return "Apple Pay/Google Pay";
case 0x80:
return "Debit PME";
case 0x90:
return "Cash";
case 0xA0:
return "Mobility Check";
case 0xB3:
return "Payment Card";
case 0xA4:
return "Check";
case 0xA5:
return "Vacation Check";
case 0xB7:
return "Telepayment";
case 0xD0:
return "Remote Payment";
case 0xD7:
return "Voucher, Prepayment, Exchange Voucher, Travel Voucher";
case 0xD9:
return "Discount Voucher";
default:
return "Unknown";
}
}

const char* get_intercode_string_event_result(int result) {
switch(result) {
case 0x0:
Expand Down
4 changes: 4 additions & 0 deletions api/calypso/cards/intercode.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ CalypsoApp* get_intercode_structure_counter();

const char* get_intercode_string_transition_type(int transition);

const char* get_intercode_string_transport_type(int type);

const char* get_intercode_string_pay_method(int pay_method);

const char* get_intercode_string_event_result(int result);

const char* get_intercode_string_version(int version);
Expand Down
Loading

0 comments on commit c599a1f

Please sign in to comment.