aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/test/card_emu_tests.c
AgeCommit message (Collapse)AuthorFilesLines
2018-07-30cardem: use TC_ETU to trigger ATR sendingKévin Redon1-0/+7
this changes how ATR is handled. the ATR is also printed when set (as important debug information). the test is also updated to correspond to the new mechanism ( simulating the timeout before sending the ATR) Change-Id: I69df797e2feadffa9f5f977cb71b69386cee7cd0
2017-05-09Convert to new generalized SIMTRACE2 USB protocolHarald Welte1-18/+24
The current protocol was card-emulation specific. The new protocol is generic/flexible enough to accommodate both tracing and card emulation, as well as modem control and other future extensions.
2017-05-07migrate from req_ctx to msgbHarald Welte1-41/+62
We now generalize the USB communiction and abandon the 'req_ctx' structure inherited from openpcd. Instead we use the libosmocore 'msgb' structure to handle incoming and outgoing USB tranfers. We also use linuxlist-based msgb-queues for each endpoint.
2017-02-27fix compilation of card_emu_testsHarald Welte1-2/+6
2016-03-18ensure usb_msg_hdr contains raw message lengthHarald Welte1-4/+5
we want to ensure that the length of every (current or future) message can be determined by looking at cardemu_usb_msg_hdr.msg_len, rather than having a length that is relative to the respective specific command.
2016-02-26implement forwarding of PTS/PPS from emulator to host PC + test caseHarald Welte1-0/+42
2016-02-25card_emu_test: Verify content of emulator->reader bytesHarald Welte1-26/+32
2016-02-25card_emu_tests: Verify context of USB request contextsHarald Welte1-14/+36
when the emulator has received some data, don't just check that we see it coming up on teh USB side, but actually also check the content of those messages
2016-02-24card_emu_tests: move test cases into functionsHarald Welte1-82/+76
2016-02-24card_emu_test: Add test for card-TX (reader-RX) APDUHarald Welte1-31/+71
2016-02-24update card_emu_tests to recent card_emu changesHarald Welte1-17/+18
2015-11-14card_emu: Correctly handle SW after reader -> card data phaseHarald Welte1-2/+7
2015-11-14card_emu_test: test APDUs with both Rx and Tx data phaseHarald Welte1-16/+58
2015-11-14card_emu_tests: extend first TPDU test to sending PB + SW in responseHarald Welte1-1/+68
2015-11-09initial commit of more code towards card emulationHarald Welte1-0/+160
I couldn't help but to spend my sunday on working towards card emulation, including * various state machines in the target about ISO7816 states * tc_etu timer import from simtrace1 * req_ctx import from simtrace1 (needs renaming and simplifiation) * USB protocol description as cardemu_prot.h * some host-based testing code to test the state machines The code seems to work fine throughout card reset, sending ATR and receiving the TPDU header of the first APDU, up to the point where it marks the TPDU header as to-be-transmitted over th bulk-in endpoint. Sending the ATR must be done inside the firmware for timing requirements. From that point onwards, the host needs to respond at the very least with a procedure byte, and some indication whether or not the card emulator should continue to transmit data (card->reader), or receive data (reader->card). The code is intentionally not hooked up yet with the USB logic nor with the UART. I want host-based testing completed before doing that.