Files
simtrace2/sam3s_example/simtrace/simtrace.h
Christina Quast 4ba4d2230b sniffer functionality fixed buffer
It is possible to use sniffer.py to sniff the phone-simcard-communication.

To be fixed: The buffer size read is fixed and the data is only send
over USB if the buffer max length is reached. which means we don not
get the last bytes of the transaction.
This should be changed in one of the next commits. Maybe the former
simtrace code can give some inspiration on this topic.
2015-03-02 16:14:09 +01:00

40 lines
936 B
C

#ifndef SIMTRACE_H
#define SIMTRACE_H
/* Endpoint numbers */
#define DATAOUT 1
#define DATAIN 2
#define INT 3
#define BUFLEN 64
typedef struct ring_buffer
{
uint8_t buf[BUFLEN*2]; // data buffer
uint8_t idx; // number of items in the buffer
} ring_buffer;
enum confNum {
CFG_NUM_SNIFF = 1, CFG_NUM_PHONE, CFG_NUM_MITM, NUM_CONF
};
// FIXME: static function definitions
extern uint32_t _ISO7816_GetChar( uint8_t *pCharToReceive );
extern uint32_t _ISO7816_SendChar( uint8_t CharToSend );
/* Init functions */
extern void Phone_Master_Init( void );
extern void Sniffer_Init( void );
extern void MITM_init( void );
extern void SIMtrace_USB_Initialize( void );
extern void _ISO7816_Init( void );
/* Run functions */
extern void Sniffer_run( void );
// extern void CCID_run( void );
extern void Phone_run( void );
extern void MITM_run( void );
#endif /* SIMTRACE_H */