mirror of
https://github.com/RfidResearchGroup/ChameleonMini.git
synced 2026-05-12 11:20:37 -07:00
Add new log type for sniffing log
(cherry picked from commit e63396e)
This commit is contained in:
@@ -454,7 +454,7 @@ void Sniff14443ACodecTask(void)
|
||||
|
||||
if (DemodBitCount >= ISO14443A_MIN_BITS_PER_FRAME) {
|
||||
// For logging data
|
||||
LogEntry(LOG_INFO_CODEC_RX_DATA, CodecBuffer, (DemodBitCount+7)/8);
|
||||
LogEntry(LOG_INFO_CODEC_SNI_READER_DATA, CodecBuffer, (DemodBitCount+7)/8);
|
||||
LEDHook(LED_CODEC_RX, LED_PULSE);
|
||||
|
||||
TrafficSource = TRAFFIC_CARD;
|
||||
@@ -515,8 +515,8 @@ void Sniff14443ACodecTask(void)
|
||||
CodecBuffer2[BitCount / 8] = CardSampleR >> (8 - (BitCount % 8));
|
||||
|
||||
// BitCount = removeParityBits(CodecBuffer, BitCount);
|
||||
|
||||
LogEntry(LOG_INFO_CODEC_RX_DATA_W_PARITY, CodecBuffer2, (BitCount + 7) / 8);
|
||||
LEDHook(LED_CODEC_RX, LED_PULSE);
|
||||
LogEntry(LOG_INFO_CODEC_SNI_CARD_DATA_W_PARITY, CodecBuffer2, (BitCount + 7) / 8);
|
||||
|
||||
// Disable card sniffing and enable reader sniffing
|
||||
CardSniffDeinit();
|
||||
|
||||
@@ -23,6 +23,14 @@ typedef enum {
|
||||
LOG_INFO_CODEC_RX_DATA_W_PARITY = 0x42, ///< Currently active codec received data.
|
||||
LOG_INFO_CODEC_TX_DATA_W_PARITY = 0x43, ///< Currently active codec sent data.
|
||||
|
||||
LOG_INFO_CODEC_SNI_READER_DATA = 0x44, //< Sniffing codec receive data from reader
|
||||
LOG_INFO_CODEC_SNI_READER_DATA_W_PARITY = 0x45, //< Sniffing codec receive data from reader
|
||||
|
||||
LOG_INFO_CODEC_SNI_CARD_DATA = 0x46, //< Sniffing codec receive data from card
|
||||
LOG_INFO_CODEC_SNI_CARD_DATA_W_PARITY = 0x47, //< Sniffing codec receive data from card
|
||||
|
||||
|
||||
|
||||
/* App */
|
||||
LOG_INFO_APP_CMD_READ = 0x80, ///< Application processed read command.
|
||||
LOG_INFO_APP_CMD_WRITE = 0x81, ///< Application processed write command.
|
||||
|
||||
@@ -25,6 +25,12 @@ eventTypes = {
|
||||
0x42: { 'name': 'CODEC RX W/PARITY', 'decoder': binaryDecoder },
|
||||
0x43: { 'name': 'CODEC TX W/PARITY', 'decoder': binaryDecoder },
|
||||
|
||||
0x44: { 'name': 'CODEC RX SNI READER', 'decoder': binaryDecoder },
|
||||
0x45: { 'name': 'CODEC RX SNI READER W/PARITY', 'decoder': binaryDecoder },
|
||||
0x46: { 'name': 'CODEC RX SNI CARD', 'decoder': binaryDecoder },
|
||||
0x47: { 'name': 'CODEC RX SNI CARD W/PARITY', 'decoder': binaryDecoder },
|
||||
|
||||
|
||||
0x80: { 'name': 'APP READ', 'decoder': binaryDecoder },
|
||||
0x81: { 'name': 'APP WRITE', 'decoder': binaryDecoder },
|
||||
0x84: { 'name': 'APP INC', 'decoder': binaryDecoder },
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ def verboseLog(text):
|
||||
|
||||
def formatText(log):
|
||||
formatString = '{timestamp:0>5d} ms <{deltaTimestamp:>+6d} ms>:'
|
||||
formatString += '{eventName:<16} ({dataLength:<3} bytes) [{data}]\n'
|
||||
formatString += '{eventName:<28} ({dataLength:<3} bytes)\t[{data}]\n'
|
||||
text = ''
|
||||
|
||||
for logEntry in log:
|
||||
|
||||
Reference in New Issue
Block a user