summaryrefslogtreecommitdiff
path: root/libyhy.h
blob: 2926e817380c9dd98834f1e912e410c2cc31bf56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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]);