The Smart Card Detective (SCD)
serial.h
Go to the documentation of this file.
00001 
00036 #ifndef _SERIAL_H_
00037 #define _SERIAL_H_
00038 
00039 #include <avr/io.h>
00040 
00041 #include "scd_logger.h"
00042 
00043 extern uint8_t lcdAvailable;                // if LCD is available
00044 extern uint16_t revision;                   // current SVN revision in BCD
00045 extern uint8_t selected;             // ID of application selected
00046 
00047 
00051 typedef enum {
00052     AT_NONE,        // No command, used for errors
00053     AT_CRST,        // Reset the SCD
00054     AT_CTERM,       // Start the terminal application
00055     AT_CLET,        // Log an EMV transaction
00056     AT_CGEE,        // Get EEPROM contents
00057     AT_CEEE,        // Erase EEPROM contents
00058     AT_CGBM,        // Go into bootloader mode
00059     AT_CCINIT,      // Initialise a card transaction
00060     AT_CCAPDU,      // Send raw terminal CAPDU
00061     AT_CCEND,       // Ends the current card transaction
00062     AT_DUMMY
00063 }AT_CMD;
00064 
00065 
00067 char* ProcessSerialData(const char* data, log_struct_t *logger);
00068 
00070 uint8_t ParseATCommand(const char *data, AT_CMD *command, char **atparams);
00071 
00073 uint8_t SendEEPROMHexVSerial();
00074     
00076 uint8_t TerminalVSerial(log_struct_t *logger);
00077 
00079 uint8_t hexCharsToByte(char c1, char c2);
00080 
00082 char nibbleToHexChar(uint8_t b, uint8_t high);
00083 
00084 #endif // _SERIAL_H_
00085 
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines