summaryrefslogtreecommitdiff
path: root/reader_yhy.c
diff options
context:
space:
mode:
Diffstat (limited to 'reader_yhy.c')
-rw-r--r--reader_yhy.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/reader_yhy.c b/reader_yhy.c
index 7ece702..9cb386f 100644
--- a/reader_yhy.c
+++ b/reader_yhy.c
@@ -42,7 +42,26 @@ int handle(int fd){
}
int scan(){
- printf("Scanning field\n");
+ nfc_tag_info_t card = {
+ 0
+ };
+
+ uint16_t atqa = 0;
+ uint8_t sak = 0;
+
+ if(!yhy_sync_request(reader_fd, 1, &atqa)){
+ return 0;
+ }
+
+ card.uid_length = yhy_sync_anticoll(reader_fd, card.uid, sizeof(card.uid));
+ if(!card.uid_length){
+ return 0;
+ }
+
+ yhy_sync_select(reader_fd, card.uid, card.uid_length, &sak);
+ yhy_sync_hlta(reader_fd);
+
+ reader_tag_present(card);
return 0;
}