summaryrefslogtreecommitdiff
path: root/pegoda
diff options
context:
space:
mode:
authorlaforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede>2006-06-23 20:26:40 +0000
committerlaforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede>2006-06-23 20:26:40 +0000
commit7a398f0b121d787ffc45d1371aa5f6e438576e9b (patch)
tree3e8623ddbe6dd5b42189268eaeaaaaf846f574a6 /pegoda
parent23f5e7e37a16f05fda562f9c1208fb63c5dc9996 (diff)
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
Diffstat (limited to 'pegoda')
-rw-r--r--pegoda/pegoda.c14
1 files changed, 10 insertions, 4 deletions
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);
}
personal git repositories of Harald Welte. Your mileage may vary