From 7a398f0b121d787ffc45d1371aa5f6e438576e9b Mon Sep 17 00:00:00 2001 From: laforge Date: Fri, 23 Jun 2006 20:26:40 +0000 Subject: fix TX chaining: Don't use/respect toggle bit (block nr) for S-blocks. git-svn-id: https://svn.gnumonks.org/trunk/librfid@1831 e0336214-984f-0b4b-a45f-81c69e1f0ede --- pegoda/pegoda.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'pegoda') diff --git a/pegoda/pegoda.c b/pegoda/pegoda.c index f391d62..8b73755 100644 --- a/pegoda/pegoda.c +++ b/pegoda/pegoda.c @@ -118,7 +118,7 @@ int pegoda_transceive(struct pegoda_handle *ph, memcpy(rx, rxbuf+sizeof(*rxhdr), rc-sizeof(*rxhdr)); - return 0; + return rxhdr->cmd; } struct pegoda_handle *pegoda_open(void) @@ -253,6 +253,7 @@ int main(int argc, char **argv) unsigned char rbuf[256]; unsigned int rlen = sizeof(rbuf); struct pegoda_handle *ph; + int i; ph = pegoda_open(); if (!ph) @@ -284,9 +285,14 @@ int main(int argc, char **argv) pegoda_transceive(ph, PEGODA_CMD_PICC_CASC_SELECT, buf, 5, rbuf, &rlen); - pegoda_auth_key(ph, 0, "\xff\xff\xff\xff\xff\xff"); - pegoda_read16(ph, 0, rbuf); - printf("read16 = %s\n", hexdump(rbuf, 16)); + for (i = 0; i < 16; i++) { + int j; + pegoda_auth_key(ph, i, "\xff\xff\xff\xff\xff\xff"); + for (j = 0; j < 4; j++) { + pegoda_read16(ph, (i*4)+j, rbuf); + printf("read16[%u:%u] = %s\n", i,j,hexdump(rbuf, 16)); + } + } exit(0); } -- cgit v1.2.3