Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports
Path: blob/main/japanese/edyvalue/files/patch-EdyValue.c
18161 views
1
--- EdyValue.c.orig Sat Jan 6 16:36:29 2007
2
+++ EdyValue.c Sun Jan 21 02:36:09 2007
3
@@ -1,6 +1,7 @@
4
#include <stdio.h>
5
#include <stdlib.h>
6
#include "libpasori.h"
7
+#include "libpasori_command.h"
8
#define TRUE 1
9
#define FALSE 0
10
11
@@ -19,21 +20,25 @@
12
return (FALSE);
13
}
14
15
-int main(void){
16
+int main(int argc, char **argv){
17
pasori* p;
18
felica* f;
19
int i;
20
- int m;
21
- int year, month, day;
22
+ unsigned int month, day;
23
uint8 b[16];
24
25
- p = pasori_open(NULL);
26
+ char* devpath = NULL;
27
+ if (argc == 2) {
28
+ devpath = argv[1];
29
+ }
30
+ p = pasori_open(devpath);
31
if(!p){
32
printf("error\n");
33
exit(-1);
34
}
35
pasori_init(p);
36
f = felica_polling(p,0xFE00,0,0);
37
+ if (f) {
38
printf("*** Edy Value ***\n");
39
i=0;
40
while(!felica_read_without_encryption02(f,0x170F,0,i,b)){
41
@@ -79,6 +84,8 @@
42
printf(" --> % 5d Yen (rest) ",b[14]*256+b[15]);
43
printf("%02X%02X%02X\n",b[1],b[2],b[3]);
44
i++;
45
+ }
46
+ free(f);
47
}
48
pasori_close(p);
49
return 0;
50
51