summaryrefslogtreecommitdiff
path: root/openpicc/application/iso14443_layer3a.c
diff options
context:
space:
mode:
authorhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-11-22 21:34:42 +0000
committerhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-11-22 21:34:42 +0000
commitba894ea0e3cf9919ab521bd7de1e66b384cca65a (patch)
treee9247ca72b209a97ff9667f38bfd0184ad5473e1 /openpicc/application/iso14443_layer3a.c
parentcb27c68785d658d8a14dcbd23a77456b22a79846 (diff)
Refactor frame print code out and use in iso14443_layer3a
git-svn-id: https://svn.openpcd.org:2342/trunk@345 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'openpicc/application/iso14443_layer3a.c')
-rw-r--r--openpicc/application/iso14443_layer3a.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/openpicc/application/iso14443_layer3a.c b/openpicc/application/iso14443_layer3a.c
index 26a6115..8a6abac 100644
--- a/openpicc/application/iso14443_layer3a.c
+++ b/openpicc/application/iso14443_layer3a.c
@@ -40,9 +40,11 @@ static enum ISO14443_STATES state = STARTING_UP;
#define LAYER3_DEBUG usb_print_string
+extern void main_help_print_buffer(ssc_dma_buffer_t *buffer, int *pktcount);
void iso14443_layer3a_state_machine (void *pvParameters)
{
unsigned long int last_pll_lock = ~0;
+ int pktcount=0;
(void)pvParameters;
while(1) {
ssc_dma_buffer_t* buffer = NULL;
@@ -106,14 +108,14 @@ void iso14443_layer3a_state_machine (void *pvParameters)
case POWERED_OFF:
if(switch_on == 1) {
state=IDLE;
+ ssc_rx_mode_set(SSC_MODE_14443A_SHORT);
+ ssc_rx_start();
continue;
}
break;
case IDLE:
case HALT:
/* Wait for REQA or WUPA (HALT: only WUPA) */
- ssc_rx_mode_set(SSC_MODE_14443A_SHORT);
- ssc_rx_start();
need_receive = 1;
default:
break;
@@ -125,10 +127,16 @@ void iso14443_layer3a_state_machine (void *pvParameters)
buffer->state = PROCESSING;
portEXIT_CRITICAL();
+ DumpStringToUSB("Frame: ");
+ DumpUIntToUSB(*(u_int32_t*)buffer->data);
+ DumpStringToUSB(" ");
+ main_help_print_buffer(buffer, &pktcount);
+
switch(state) {
case IDLE:
case HALT:
-
+ ssc_rx_mode_set(SSC_MODE_14443A_SHORT);
+ ssc_rx_start();
break;
default:
break;
personal git repositories of Harald Welte. Your mileage may vary