-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only MasterCard tested. Visa support will be added in future. This feature require an Elechouse PN532, it doesn't work with LiLyGo T-Embed CC1101
- Loading branch information
Showing
13 changed files
with
436 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* This file is part of the Capibara zero (https://github.com/CapibaraZero/fw or | ||
* https://capibarazero.github.io/). Copyright (c) 2025 Andrea Canale. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, version 3. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "NFCEMVReadPage.hpp" | ||
#include "../../navigation/NFC/NFCNavigation.hpp" | ||
|
||
#include "gui.hpp" | ||
|
||
NFCEMVReadPage::~NFCEMVReadPage() { | ||
delete card_type; | ||
delete card_number; | ||
delete issue_date; | ||
delete expire; | ||
} | ||
|
||
void NFCEMVReadPage::display() { | ||
grid = new Grid(screen, 5, 1); | ||
card_type = new Text(screen, ST77XX_WHITE, "Scanning EMV..."); | ||
card_number = new Text(screen, ST77XX_WHITE, ""); | ||
issue_date = new Text(screen, ST77XX_WHITE, ""); | ||
expire = new Text(screen, ST77XX_WHITE, ""); | ||
exit_page = new List(screen, "Exit", 2, ST77XX_WHITE, 20, ST77XX_BLUE, goto_home); | ||
grid->add(card_type); | ||
grid->add(card_number); | ||
grid->add(issue_date); | ||
grid->add(expire); | ||
grid->add(exit_page); | ||
grid->set_y_spacing(20); | ||
grid->set_selected(4, true); | ||
grid->display(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* This file is part of the Capibara zero (https://github.com/CapibaraZero/fw or | ||
* https://capibarazero.github.io/). Copyright (c) 2025 Andrea Canale. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, version 3. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "../../i18n.hpp" | ||
#include "../../i18n/NFC/nfc_format_page_keys.h" | ||
#include "../Page.hpp" | ||
#include "Grid.hpp" | ||
#include "List.hpp" | ||
#include "Text.hpp" | ||
|
||
#ifndef NFC_EMV_READ_PAGE_H | ||
#define NFC_EMV_READ_PAGE_H | ||
|
||
class NFCEMVReadPage : public Page { | ||
private: | ||
Text *card_type; | ||
Text *card_number; | ||
Text *issue_date; | ||
Text *expire; | ||
List *exit_page; | ||
|
||
public: | ||
NFCEMVReadPage(uint8_t _position_limit, uint8_t _lower_limit, | ||
uint8_t _position_increment, GFXForms *screen) | ||
: Page(_position_limit, _lower_limit, _position_increment, screen) { | ||
}; | ||
~NFCEMVReadPage(); | ||
void display(); | ||
|
||
void click(int pos, void callback()) { grid->click(pos, callback); }; | ||
void set_selected(int pos, bool status) { grid->set_selected(pos, status); }; | ||
void set_card_type(String type) { | ||
card_type->set_text(type); | ||
} | ||
void set_card_pan(String pan) { | ||
card_number->set_text(pan); | ||
} | ||
void set_card_issue_date(String issuedate) { | ||
issue_date->set_text(issuedate); | ||
} | ||
void set_card_expire_date(String expiredate) { | ||
expire->set_text(expiredate); | ||
} | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.