diff options
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]); |