added write16 function (not working by now)
[rfid/librfid.git] / gemtag / gemtag.h
index fa716f8..dfdfa64 100644 (file)
@@ -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