From f0cb3e813a51034dd0d8051aa7165b926e0d8411 Mon Sep 17 00:00:00 2001 From: cbdev Date: Sun, 18 Jun 2023 13:07:25 +0200 Subject: Initial basic library --- libyhy.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 libyhy.h (limited to 'libyhy.h') diff --git a/libyhy.h b/libyhy.h new file mode 100644 index 0000000..2926e81 --- /dev/null +++ b/libyhy.h @@ -0,0 +1,24 @@ +#include +#include +#include + +/* Open a device port */ +int yhy_open(char* device); + +/* Synchronous API */ +/* These calls will return data directly, at the cost of blocking execution */ +int yhy_sync_read_version(int fd, char* version, size_t allocated); +int yhy_sync_beep(int fd, uint8_t time); +int yhy_sync_led(int fd, uint8_t led_bits); +int yhy_sync_antenna(int fd, uint8_t enable); + +/* Mifare commands */ +int yhy_sync_request(int fd, uint8_t wakeup, uint16_t* atqa); +int yhy_sync_anticoll(int fd, uint8_t* serial, size_t length); +int yhy_sync_select(int fd, uint8_t* serial, size_t length, uint8_t* sak); +int yhy_sync_hlta(int fd); +int yhy_sync_auth(int fd, uint8_t key_a, uint8_t block, uint8_t key[6]); +int yhy_sync_read(int fd, uint8_t block, uint8_t* data, size_t max_len); +int yhy_sync_write(int fd, uint8_t block, uint8_t data[16]); +int yhy_sync_ulselect(int fd, uint8_t* serial, size_t length); +int yhy_sync_ulwrite(int fd, uint8_t block, uint8_t data[4]); -- cgit v1.2.3