Added a major refactoring to include Emulated interface.

It works in combination with virtualsmarcard module (vpcd). It properly installed, it creates a virtual reader that can be interfaced via PCSC+vcpd. At user app level, it has no difference of having a physical smart card.

At this moment, it only works emulating a CCID interface.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2023-01-09 18:06:21 +01:00
parent 2d511df5d8
commit 4919eb980f
24 changed files with 617 additions and 141 deletions

View File

@@ -142,6 +142,7 @@ uint16_t set_res_sw(uint8_t sw1, uint8_t sw2) {
return make_uint16_t(sw1, sw2);
}
#ifndef ENABLE_EMULATION
void apdu_thread() {
card_init_core1();
while (1) {
@@ -171,6 +172,7 @@ void apdu_thread() {
current_app = NULL;
}
}
#endif
void apdu_finish() {
apdu.rdata[apdu.rlen] = apdu.sw >> 8;