From 55ba12aad7a9e368345e327f55ec5ddae4dbdb74 Mon Sep 17 00:00:00 2001 From: cbdev Date: Wed, 23 Aug 2023 15:06:55 +0200 Subject: Minimize imports --- libyhy.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libyhy.c b/libyhy.c index 041b0b7..77fd89b 100644 --- a/libyhy.c +++ b/libyhy.c @@ -5,9 +5,9 @@ #include #include -#include #define MIN(a,b) (((a) < (b)) ? (a) : (b)) #ifdef DEBUG + #include #define DBG(x) (x) #else #define DBG(x) @@ -100,7 +100,7 @@ enum /*_yhy_command*/ { static void xxd(uint8_t* buf, size_t len){ size_t n; for(n = 0; n < len; n++){ - printf("%02X ", buf[n]); + DBG(printf("%02X ", buf[n])); } } @@ -257,6 +257,7 @@ int yhy_sync_auth(int fd, uint8_t key_a, uint8_t block, uint8_t key[6]){ return yhy_sync(fd, DEFAULT_NODE_ID, YHY_MIFARE_AUTH, (uint8_t*) (&auth_payload), sizeof(auth_payload), NULL, 0); } +//For some reason, this fails with blocks 0 and 10 on all NTAGs int yhy_sync_read(int fd, uint8_t block, uint8_t* data, size_t max_len){ return yhy_sync(fd, DEFAULT_NODE_ID, YHY_MIFARE_READ, &block, 1, data, max_len); } -- cgit v1.2.3