Revision 12ea39cc
Added actual control of tool
toolbox/rfid.c | ||
---|---|---|
1 |
#include <string.h> |
|
1 | 2 |
#include <util/delay.h> |
2 | 3 |
#include "rfid.h" |
3 | 4 |
#include "serial.h" |
... | ... | |
72 | 73 |
} |
73 | 74 |
|
74 | 75 |
void rfid_get_serno(char *buf) { |
76 |
memcpy(buf, serno, sizeof(serno)); |
|
77 |
} |
|
78 |
|
|
79 |
char rfid_check_serno(char *buf) { |
|
80 |
return memcmp(buf, serno, sizeof(serno)) == 0; |
|
81 |
} |
|
82 |
|
|
83 |
char rfid_nonzero() { |
|
75 | 84 |
int i; |
76 |
for (i = 0; i < RFID_SERNO_SIZE; i++) { |
|
77 |
buf[i] = serno[i]; |
|
85 |
for (i = 0; i < sizeof(serno); i++) { |
|
86 |
if (serno[i]) { |
|
87 |
return 1; |
|
88 |
} |
|
78 | 89 |
} |
90 |
return 0; |
|
79 | 91 |
} |
Also available in: Unified diff