diff options
author | cbdev <cb@cbcdn.com> | 2023-06-18 13:07:25 +0200 |
---|---|---|
committer | cbdev <cb@cbcdn.com> | 2023-06-18 13:07:25 +0200 |
commit | f0cb3e813a51034dd0d8051aa7165b926e0d8411 (patch) | |
tree | e59df4e3a79a0a0f625f7f3b4003858a049c8e6c /libyhy.h | |
download | libyhy-f0cb3e813a51034dd0d8051aa7165b926e0d8411.tar.gz libyhy-f0cb3e813a51034dd0d8051aa7165b926e0d8411.tar.bz2 libyhy-f0cb3e813a51034dd0d8051aa7165b926e0d8411.zip |
Initial basic library
Diffstat (limited to 'libyhy.h')
-rw-r--r-- | libyhy.h | 24 |
1 files changed, 24 insertions, 0 deletions
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 <stdlib.h> +#include <stdint.h> +#include <inttypes.h> + +/* 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]); |