diff options
author | cbdev <cb@cbcdn.com> | 2023-08-23 15:06:55 +0200 |
---|---|---|
committer | cbdev <cb@cbcdn.com> | 2023-08-23 15:06:55 +0200 |
commit | 55ba12aad7a9e368345e327f55ec5ddae4dbdb74 (patch) | |
tree | 62b6641746529a5f62b76b91f2f98ec7aa6bf636 | |
parent | 521558ddca0ef7891d5b6515ed0c87fa4845ea8b (diff) | |
download | libyhy-55ba12aad7a9e368345e327f55ec5ddae4dbdb74.tar.gz libyhy-55ba12aad7a9e368345e327f55ec5ddae4dbdb74.tar.bz2 libyhy-55ba12aad7a9e368345e327f55ec5ddae4dbdb74.zip |
Minimize imports
-rw-r--r-- | libyhy.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -5,9 +5,9 @@ #include <unistd.h> #include <string.h> -#include <stdio.h> #define MIN(a,b) (((a) < (b)) ? (a) : (b)) #ifdef DEBUG + #include <stdio.h> #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); } |