X-Git-Url: https://hackdaworld.org/gitweb/?p=rfid%2Flibrfid.git;a=blobdiff_plain;f=gemtag%2Fgemtag.h;fp=gemtag%2Fgemtag.h;h=dfdfa64fabb0d68b5c579e9ca87b1f3305632245;hp=fa716f83b462477d5be776e77839953248c808e5;hb=d78e768b132a7fe1e87410cc07daf555271c018b;hpb=229997e05d754107f8d6cfad9dbc5b496c424b72 diff --git a/gemtag/gemtag.h b/gemtag/gemtag.h index fa716f8..dfdfa64 100644 --- a/gemtag/gemtag.h +++ b/gemtag/gemtag.h @@ -44,8 +44,9 @@ struct gemtag_cmd_hdr { #define CMD_FAILED 0x04 #define AUTH_FAILED 0x05 #define READ_FAILED 0x06 -#define NO_PICC 0x07 -#define PICC_SELECT_ERROR 0x08 +#define WRITE_FAILED 0x07 +#define NO_PICC 0x08 +#define PICC_SELECT_ERROR 0x09 /* gemtag commands */ @@ -119,4 +120,23 @@ struct gemtag_cmd_hdr { #define GEMTAG_CMD_PPS_REQUEST 0xa0 #define GEMTAG_CMD_DESELECT 0xa1 + +/* function prototypes */ +int asciidump(unsigned char *data,int len); +int hexdump(unsigned char *data,int len); +struct usb_device *find_device(unsigned short vendor,unsigned short device); +u_int16_t gemtag_calc_crc(unsigned char *data,u_int16_t len); +int gemtag_transceive(struct gemtag_handle *gh,unsigned char cmd, + unsigned char *tx,unsigned int tx_len, + unsigned char *rx,unsigned int *rx_len); +struct gemtag_handle *gemtag_open(void); +int gemtag_close(struct gemtag_handle *gh); +int gemtag_transform_mifare_key(struct gemtag_handle *gh, + unsigned char *key6,unsigned char *key12); +int gemtag_auth_mifare_key(struct gemtag_handle *gh, + unsigned char *key6,int sector); +int gemtag_read16(struct gemtag_handle *gh,int sector,unsigned char *data); +int gemtag_write16(struct gemtag_handle *gh,int sector,unsigned char *data); +int gemtag_select_picc(struct gemtag_handle *gh); + #endif