The Smart Card Detective (SCD)
|
Go to the source code of this file.
Defines | |
#define | WARM_RESET_VALUE 0xAA |
This is a magic value that may be used in detecting a warm reset. | |
#define | MAX_EXCHANGES 50 |
Maximum number of command-response pairs recorded when logging. | |
#define | EEPROM_WARM_RESET 0x0 |
EEPROM address for byte used on warm reset. | |
#define | EEPROM_TIMER_T2 0x4 |
EEPROM address for counter value from T2 - 4 bytes little endian. | |
#define | EEPROM_TEMP_1 0x8 |
Temporary space 1 - use this for any purpose, 4 bytes. | |
#define | EEPROM_TEMP_2 0x12 |
Temporary space 2 - use this for any purpose, 4 bytes. | |
#define | EEPROM_APPLICATION 0x32 |
EEPROM address for selected application. | |
#define | EEPROM_COUNTER 0x40 |
EEPROM address for transaction counter. | |
#define | EEPROM_TLOG_POINTER_HI 0x48 |
EEPROM address for log high address pointer. | |
#define | EEPROM_TLOG_POINTER_LO 0x49 |
EEPROM address for log low address pointer. | |
#define | EEPROM_TLOG_DATA 0x80 |
EEPROM address for transaction log data. | |
#define | EEPROM_MAX_ADDRESS 0xFE0 |
EEPROM maximum allowed address. | |
Functions | |
int | main (void) |
Main function. | |
void | InitSCD () |
Initializes the SCD. | |
uint8_t | SelectApplication () |
Show menu and select application. | |
void | BootloaderJumpCheck (void) __attribute__((naked |
Jump to bootloader if required. | |
void | section (".init3"))) |
void | TestSCDTerminal () |
Tests the SCD-Terminal communication. | |
void | TestSCDICC () |
Tests the SCD-ICC communication. | |
void | SwitchLeds () |
Simple application to switch some LEDs on and off. | |
void | TestHardware () |
Tests the hardware (LEDs, LCD and buttons) | |
Variables | |
char * | appStrings [] |
scd.h Header file
Contains definitions of functions used by the Smart Card Detective
Copyright (C) 2012 Omar Choudary (omar.choudary@cl.cam.ac.uk)
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition in file scd.h.
#define EEPROM_APPLICATION 0x32 |
#define EEPROM_COUNTER 0x40 |
#define EEPROM_MAX_ADDRESS 0xFE0 |
#define EEPROM_TEMP_1 0x8 |
#define EEPROM_TEMP_2 0x12 |
#define EEPROM_TIMER_T2 0x4 |
#define EEPROM_TLOG_DATA 0x80 |
#define EEPROM_TLOG_POINTER_HI 0x48 |
#define EEPROM_TLOG_POINTER_LO 0x49 |
#define EEPROM_WARM_RESET 0x0 |
#define MAX_EXCHANGES 50 |
#define WARM_RESET_VALUE 0xAA |
void BootloaderJumpCheck | ( | void | ) |
Jump to bootloader if required.
void InitSCD | ( | ) |
void section | ( | ".init3" | ) |
uint8_t SelectApplication | ( | ) |
Show menu and select application.
This function shows a menu with the existing applications and allows the user to select one of them.
The different applications are shown on the LCD and the user can use the buttons to scroll between the list and to select the desired application.
void SwitchLeds | ( | ) |
void TestHardware | ( | ) |
void TestSCDICC | ( | ) |
Tests the SCD-ICC communication.
void TestSCDTerminal | ( | ) |
Tests the SCD-Terminal communication.
Self Test methods
This function implements an infinite communication loop between the SCD and my terminal emulator, by continuously replying to the SELECT command for "1PAY.SYS.DDF01"
The main role of this function is to test the correct transfer of bytes between the terminal and the SCD
char* appStrings[] |