X-Git-Url: https://hackdaworld.org/gitweb/?p=rfid%2Flibrfid.git;a=blobdiff_plain;f=gemtag%2Fgemtag.h;h=e5c24bf85474e2f74f8ab1a248973f412c1083f2;hp=fa716f83b462477d5be776e77839953248c808e5;hb=03006df71d07c88b1fd9f01839336801207b7ec4;hpb=229997e05d754107f8d6cfad9dbc5b496c424b72 diff --git a/gemtag/gemtag.h b/gemtag/gemtag.h index fa716f8..e5c24bf 100644 --- a/gemtag/gemtag.h +++ b/gemtag/gemtag.h @@ -1,5 +1,6 @@ /* - * (C) 2006 by Frank Zirkelbach + * (C) 2006 by Harald Welte + * Frank Zirkelbach * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 @@ -44,8 +45,11 @@ 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 +#define LOAD_E2_FAILED 0x0a +#define AUTH_E2_FAILED 0x0b /* gemtag commands */ @@ -119,4 +123,26 @@ 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_e2(struct gemtag_handle *gh,unsigned char authmode, + int sector,unsigned char *key6); +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