Commit Graph

15 Commits

Author SHA1 Message Date
Harald Welte
9d3e38242c initial commit of more code towards card emulation
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.
2015-11-09 00:50:54 +01:00
Harald Welte
30a53f823a Move Fi/Di calculation functions to separate C file 2015-11-08 14:29:55 +01:00
Christina Quast
2c68f9c825 Makefile: Removed unused object file target tc_etu 2015-05-08 15:37:57 +02:00
Christina Quast
6246000b3a iso7816_uart.c: Do not compile 2015-05-03 14:18:59 +02:00
Christina Quast
be235275fa Added not working PTS parsing to host communication 2015-05-02 17:56:32 +02:00
Christina Quast
c63da3f6d5 Makefile: Check for already opened ttyUSBx
If two ttyUSBx interfaces are read from by ts at the same time,
some letters arrive at one terminal and others in the second one.
Therefore only one terminal should be open at all times.
2015-04-13 22:09:50 +02:00
Christina Quast
2b8a18bf3a Sniffer with ringbuf, works SOMETIMES
* Sniffer uses phone endpoints for communication and the ringbuffer
    routines the phone communication uses
* Most times the Usart1 interrupt is not triggered, and therefore
    no values are recorded
2015-04-12 09:31:36 +02:00
Christina Quast
5c6a299c71 phone.c: Sniffer bus config make switch 2015-04-11 20:03:14 +02:00
Christina Quast
4db82e092f ringbuffer implementation 2015-04-11 18:15:27 +02:00
Christina Quast
e2dddd5885 Renamed simtrace_src to src_simtrace 2015-04-09 17:40:48 +02:00
Christina Quast
55cd8734be Makefile: 'make log' for debug dumps over serial 2015-04-08 00:12:17 +02:00
Christina Quast
4396fee97e Rename simtrace/ to simtrace_src 2015-04-07 21:12:53 +02:00
Christina Quast
b6f77d390c Makefile: Compile silently and show code files used 2015-04-07 20:51:44 +02:00
Christina Quast
29c99b97af Makefile: Enabled iprintf, removed comment 2015-04-07 20:13:44 +02:00
Christina Quast
5a67c0fef3 Renamed main folder to firmware 2015-04-07 18:24:06 +02:00