#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]);