⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.txt

📁 Mifare SDK - VB Sample Program
💻 TXT
字号:
USBMiCard.Dll  (Last update : 25 Feb 2008)
------------------------------------------
Windows Dynamic Link Library to interact with Mifare Reader.
Following are the functions provide by the library :

Public Declare Function MifUSB_OpenDevice Lib "UsbMiCard.dll" () As Long
Public Declare Function MifUSB_CloseDevice Lib "UsbMiCard.dll" () As Long

Public Declare Function MifUSB_SetBeep Lib "UsbMiCard.dll" (ByVal nFlag As Integer) As Long
Public Declare Function MifUSB_SetRedLed Lib "UsbMiCard.dll" (ByVal nFlag As Integer) As Long
Public Declare Function MifUSB_SetGreenLed Lib "UsbMiCard.dll" (ByVal nFlag As Integer) As Long

Public Declare Function MifUSB_TransKey Lib "UsbMiCard.dll" (ByVal intSector As Integer, ByRef byteData As udfTransKey) As Long
Public Declare Function MifUSB_GetCardType Lib "UsbMiCard.dll" (ByRef lngCardType As Long) As Long
Public Declare Function MifUSB_GetCardSN Lib "UsbMiCard.dll" (ByRef lngCardSN As Long) As String

Public Declare Function MifUSB_ReadBlock Lib "UsbMiCard.dll" (ByVal intBlock As Integer, ByVal lngCardSN As Long, ByVal intMode As Integer) As String
Public Declare Function MifUSB_ReadBlockEx Lib "UsbMiCard.dll" (ByVal intSector As Integer, ByVal intBlock As Integer, ByVal lngCardSN As Long, ByVal intMode As Integer, ByRef byteData As udfTransKey) As String
Public Declare Function MifUSB_WriteBlock Lib "UsbMiCard.dll" (ByVal intBlock As Integer, ByVal lngCardSN As Long, ByVal intMode As Integer, ByRef byteData As udfBlockData) As Long
Public Declare Function MifUSB_WriteBlockEx Lib "UsbMiCard.dll" (ByVal intSector As Integer, ByVal intBlock As Integer, ByVal lngCardSN As Long, ByVal intMode As Integer, ByRef byteData As udfTransKey, ByRef byteData As udfBlockData) As Long

1. MifUSB_OpenDevice 	: function to handle open the communication with the reader thru USB.
			  this function MUST BE called at the first time before
			  you call the other function.

   long MifUSB_OpenDevice();

   Para	  : none

   Return : 0 = SUCCESS 
	    1 = FAILURE


2. MifUSB_CloseDevice 	: function to handle close the communication

   long MifUSB_OpenDevice();

   Para	  : none

   Return : 0 = SUCCESS 
	    1 = FAILURE


3. MifUSB_SetBeep	: function to turn buzzer / beep on or off.

   long MifUSB_SetBeep(int nFlag);

   Para   : nFlag --> Flag indicator to turn ON (1) or OFF (0)

   Return : 0 = SUCCESS 
	    1 = FAILURE


4. MifUSB_SetRedLed	: function to turn Red LED on or off.

   long MifUSB_SetRedLed(int nFlag);

   Para   : nFlag --> Flag indicator to turn ON (1) or OFF (0)

   Return : 0 = SUCCESS 
	    1 = FAILURE


5. MifUSB_SetGreenLed	: function to turn Green LED on or off.

   long MifUSB_SetGreenLed(int nFlag);

   Para   : nFlag --> Flag indicator to turn ON (1) or OFF (0)

   Return : 0 = SUCCESS 
	    1 = FAILURE


6. MifUSB_GetCardSN 	: function to read the serial number of Mifare Card.

   LPSTR MifUSB_GetCardSN(long lngCardSN);

   Para   : lngCardSN

   Return : card serial number


7. MifUSB_GetCardType 	: function to read the type of Mifare Card.

   long MifUSB_GetCardType(long lngCardType);

   Para   : lngCardType

   Return : card type


8. MifUSB_TransKey 	: function to submit the access key to the reader.

   long MifUSB_TransKey(int nSector, BYTE byteKey);

   Para   : nSector --> sector number on Mifare card (0 ~ 15)
	    byteKey --> the access key for its sector

   Return : 0 = SUCCESS
            1 = FAILURE


9. MifUSB_ReadBlock 	: function to read the data from certain block data on the Mifare card.

   LPSTR MifUSB_ReadBlock(int nBlock, long lngCardSN, int nMode);

   Para   : nBlock    --> given the block data to be read (0 ~ 63)
	    lngCardSN --> the card S/N for current Mifare card
	    nMode     --> 0=KeyA or 1=KeyB

   Return : - NAK = if failure , or
	    - Data on hex format


10. MifUSB_ReadBlockEx 	: function to read the data from certain block data on the Mifare card.

   LPSTR MifUSB_ReadBlockEx(int nSector, int nBlock, long lngCardSN, int nMode, BYTE byteKey);

   Para   : nSector   --> given the sector data to be read (0 ~ 15)
	    nBlock    --> given the block data to be read (0 ~ 3)
	    lngCardSN --> the card S/N for current Mifare card
	    nMode     --> 0=KeyA or 1=KeyB
	    byteKey   --> the access key for read data

   Return : - NAK = if failure , or
	    - Data on hex format


11. MifUSB_WriteBlock 	: function to write the data into Mifare card.

   long MifUSB_WriteBlock(int nBlock, long lngCardSN, int nMode, BYTE byteData);

   Para   : nBlock    --> given the block where the data to be stored (0 ~ 63)
	    lngCardSN --> the card S/N for current Mifare card
	    nMode     --> 0=KeyA or 1=KeyB
	    byteData  --> data to be written on the Mifare card

   Return : 0 = SUCCESS
	    1 = FAILURE



12. MifUSB_WriteBlockEx	: function to write the data into Mifare card.

   long MifUSB_WriteBlockEx(int nSector, int nBlock, long lngCardSN, int nMode, BYTE byteKey, BYTE byteData);

   Para   : nSector   --> given the sector where the data to be stored (0 ~ 15)
	    nBlock    --> given the block where the data to be stored (0 ~ 3)
	    lngCardSN --> the card S/N for current Mifare card
	    nMode     --> 0=KeyA or 1=KeyB
	    byteData  --> data to be written on the Mifare card
	    byteKey   --> the access key for write data

   Return : 0 = SUCCESS
	    1 = FAILURE




⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -