Created
July 28, 2009 09:48
-
-
Save akia/157053 to your computer and use it in GitHub Desktop.
Read felica ID
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Read felica id | |
// http://blog.livedoor.jp/amelabo/archives/862065.html | |
#include <stdio.h> | |
#include "felicalib.h" | |
static void hexdump(uint8 *addr, int n); | |
int main() | |
{ | |
pasori *p; | |
felica *f; | |
p = pasori_open(NULL); | |
if (!p) { | |
printf("PaSoRi open failed."); | |
exit(1); | |
} | |
pasori_init(p); | |
f = felica_polling(p, POLLING_ANY, 0, 0); | |
if (!f) { | |
printf("Polling card failed."); | |
exit(1); | |
} | |
hexdump(f->IDm, 8); | |
felica_free(f); | |
return 0; | |
} | |
static void hexdump(uint8 *addr, int n) | |
{ | |
int i; | |
for (i = 0; i < n; i++) { | |
printf("%02X ", addr[i]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment