• R/O
  • SSH
  • HTTPS

felicalib: Commit


Commit MetaInfo

Revision79 (tree)
Zeit2008-03-06 22:19:24
Autortmurakam

Log Message

add edy support

Ändern Zusammenfassung

Diff

--- trunk/src/edy/edy.c (revision 78)
+++ trunk/src/edy/edy.c (revision 79)
@@ -47,7 +47,7 @@
4747 static int read2b(uint8 *p);
4848
4949 // サービスコード
50-#define SERVICE_EDY 0x1317
50+#define SERVICE_EDY 0x170f
5151
5252
5353 int _tmain(int argc, _TCHAR *argv[])
@@ -59,27 +59,28 @@
5959
6060 p = pasori_open(NULL);
6161 if (!p) {
62- fprintf(stderr, "PaSoRi open failed.\n");
63- exit(1);
62+ fprintf(stderr, "PaSoRi open failed.\n");
63+ exit(1);
6464 }
6565 pasori_init(p);
6666
6767 f = felica_polling(p, POLLING_EDY, 0, 0);
6868 if (!f) {
69- fprintf(stderr, "Polling card failed.\n");
70- exit(1);
69+ fprintf(stderr, "Polling card failed.\n");
70+ exit(1);
7171 }
7272
7373 printf("IDm: ");
7474 for (i = 0; i < 8; i++) {
75- printf("%02x", f->IDm[i]);
75+ printf("%02x", f->IDm[i]);
7676 }
77+ printf("\n");
7778
7879 for (i = 0; ; i++) {
79- if (felica_read_without_encryption02(f, SERVICE_EDY, 0, (uint8)i, data)) {
80- break;
81- }
82- edy_dump(data);
80+ if (felica_read_without_encryption02(f, SERVICE_EDY, 0, (uint8)i, data)) {
81+ break;
82+ }
83+ edy_dump(data);
8384 }
8485
8586 return 0;
@@ -115,8 +116,8 @@
115116 break;
116117 }
117118
118- printf("金額:%d ", value);
119- printf("残高:%d ", balance);
119+ printf("金額:%-5d ", value);
120+ printf("残高:%-5d ", balance);
120121 printf("連番:%d\n", seq);
121122 }
122123
Show on old repository browser