信创系统麒麟和统信下使用JAVA做NFC读写器的开发,只需要使用NFC读写器YW-607HC的信创系统的java开发包。 首先需要引用lib库libyw60x.so,要注意的是32为的java仅能引用32位的库,64位的java使用64位的库。 查看接口文件
import java.util.Scanner;
interface Callback {
void findreader(int readerid);
}
public class jyw60x
{
static {
System.loadLibrary("yw60x");
}
public static jyw60x yoworfid =new jyw60x();
public static void main(String[] args) {
short ATQA[]= new short[1];
byte SAK[]=new byte[1];
byte uidlen[]=new byte[1];
byte UID[]=new byte[10];
byte Key[]=new byte[]{(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF};
byte BlockData[]=new byte[16];
byte writeBlockData[]=new byte[]{(byte)0x00,(byte)0x11,(byte)0x22,(byte)0x33,(byte)0x44,(byte)0x55,(byte)0x66,(byte)0x77,(byte)0x88,(byte)0x99,(byte)0xAA,(byte)0xBB,(byte)0xCC,(byte)0xDD,(byte)0xEE,(byte)0xFF};
Scanner scanner = new Scanner(System.in);
System.out.println( "YOWO RFID USB HF Reader Java Demo(JNI)");
System.out.print( "demo function\\n1:read card serial no\\n2:read block data\\n3:write block data\\n4:Scan Reader\\n5:exit\\n ");
System.out.println( "input your selection(1 or 2 or 3 or 4):" );
String selection = scanner.nextLine().trim();
if(selection.equals("1"))
{
int rt =yoworfid.YW_USBHIDInitial();
if(rt<=0)
{
System.out.print("Open reader fail,exit\\n ");
return ;
}
rt =yoworfid.YW_RequestAntiandSelect(1,0x52,0,ATQA,SAK,uidlen, UID);
if(rt<0)
{
System.out.print("request card fail,exit\\n ");
yoworfid.YW_USBHIDFree();
return ;
}
yoworfid.YW_Buzzer(1,5,5,1);
System.out.print("Card SerialNo: " );
HexToStr(UID,uidlen[0]);
yoworfid.YW_USBHIDFree();
}
else if(selection.equals("2"))
{
System.out.print("read block 1 with keymode=A and key=FFFFFFFFFFFF\\n ");
int rt =yoworfid.YW_USBHIDInitial();
if(rt<=0)
{
System.out.print("Open reader fail,exit\\n " );
return ;
}
rt =yoworfid.YW_RequestAntiandSelect(1,(byte)0x52,0,ATQA,SAK,uidlen, UID);
System.out.print("Card SerialNo: " );
HexToStr(UID,uidlen[0]);
if(rt<0)
{
System.out.print( "request card fail,exit\\n ");
yoworfid.YW_USBHIDFree();
return ;
}
if(yoworfid.YW_KeyAuthorization(1,(byte)0x60, 1, Key)<0)
{
System.out.print("Key Error,exit\\n " );
yoworfid.YW_USBHIDFree();
return ;
}
if(yoworfid.YW_ReadaBlock(1,1,16,BlockData)<0)
{
System.out.print("Read block Error,exit\\n ");
yoworfid.YW_USBHIDFree();
return ;
}
yoworfid.YW_Buzzer(1,5,5,1);
System.out.print("block 4 data: ");
HexToStr(BlockData,(byte)16);
yoworfid.YW_USBHIDFree();
}
else if(selection.equals("3"))
{
System.out.print("Write block 1 with keymode=A and key=FFFFFFFFFFFF,data=00112233445566778899AABBCCDDEEFF\\n " );
int rt =yoworfid.YW_USBHIDInitial();
if(rt<=0)
{
System.out.print( "Open reader fail,exit\\n ");
return ;
}
rt =yoworfid.YW_RequestAntiandSelect(1,(byte)0x52,0,ATQA,SAK,uidlen, UID);
System.out.print("Card SerialNo: ");
HexToStr(UID,uidlen[0]);
if(rt<0)
{
System.out.print("request card fail,exit\\n " );
yoworfid.YW_USBHIDFree();
return ;
}
if(yoworfid.YW_KeyAuthorization(1,(byte)0x60, 1, Key)<0)
{
System.out.print("Key Error,exit\\n ");
yoworfid.YW_USBHIDFree();
return ;
}
if(yoworfid.YW_WriteaBlock(1,1,16,writeBlockData)<0)
{
System.out.print("Write block Error,exit\\n ");
yoworfid.YW_USBHIDFree();
return ;
}
yoworfid.YW_Buzzer(1,5,5,1);
System.out.print("Write block 4 data success\\n ");
yoworfid.YW_USBHIDFree();
}
else if(selection.equals("4"))
{
yoworfid.YW_SCANReader(( readerid)->{
short ATQAc[]= new short[1];
byte SAKc[]=new byte[1];
byte uidlenc[]=new byte[1];
byte UIDc[]=new byte[10];
System.out.printf("readerid=%d, ",readerid);
int rt =yoworfid.YW_RequestAntiandSelect(readerid,0x52,0,ATQAc,SAKc,uidlenc, UIDc);
if(rt<0)
{
System.out.print( "request card fail,exit\\n " );
}
else
{
System.out.print( "Card SerialNo: ");
HexToStr(UIDc,uidlenc[0]);
}
});
}
else if(selection.equals("5"))
{
System.out.print("Exit\\n ");
}
else
{
System.out.print("Wrong selection\\n ");
}
}
public static void HexToStr(byte HexArr[], byte ArrLen)
{
for(int i=0;i<ArrLen;i++)
{
System.out.printf("%02X",HexArr[i]);
}
System.out.println();
}
public native int YW_GetDLLVersion(); //1
public native int DES(byte cModel, byte pkey[], byte in[], byte out[]);
public native int DES3(byte cModel, byte pKey[], byte pInData[], byte pOutData[]);
public native int DES3_CBC(byte cModel, byte pKey[],byte pInData[], byte pOutData[], byte pIV[]);
public native int YW_ComInitial(int PortIndex, int Bound);
public native int YW_ComFree();
public native int YW_SCANReader(Callback callback);
public native int YW_USBHIDInitial();
public native int YW_USBHIDInitialEx2(int ReaderID); //3
public native int YW_USBHIDFree();
public native int YW_ComNewBound(int ReaderID,int NewBound);
public native int YW_SetReaderID(int OldID, int NewID);
public native int YW_GetReaderID(int ReaderID);
public native int YW_GetReaderVersion(int ReaderID);
public native int YW_GetReaderSerial(int ReaderID, byte ReaderSerial[]);
public native int YW_GetReaderNo(int ReaderID, byte ReadeNo[]);
public native int YW_Buzzer(int ReaderID,int Time_ON, int Time_OFF, int Cycle);
public native int YW_Led(int ReaderID,int LEDIndex, int Time_ON, int Time_OFF, int Cycle, int LedIndexOn);
public native int YW_LEDDisplay(int ReaderID,int Alignment,byte LEDText[]);
public native int YW_AntennaStatus(int ReaderID, boolean Status);
public native int YW_SearchCardMode(int ReaderID,int Mode);
public native int YW_SearchCardModeEx(int ReaderID,int Mode,int Param);
public native int YW_LFCard_ReadID(int ReaderID, byte CardID[]);
public native int YW_WriteReaderMemory(int ReaderID, int AddrBegin, int DataLen, byte DataToWrite[]);
public native int YW_ReadReaderMemory(int ReaderID, int AddrBegin, int DataLen, byte DataRead[]);
///////////////////////////////////////////////////// Reader Over /
//////////////////////////////////////////////////// ISO 14443 A Start /
public native int YW_HFSelectAntenna(int ReaderID, byte AntennaID);
public native int YW_RequestCard(int ReaderID,byte RequestMode, short CardType[]);
public native int YW_AntiCollide(int ReaderID,byte LenSNO[], byte SNO[]);
public native int YW_CardSelect(int ReaderID,byte LenSNO[], byte SNO[]);
public native int YW_DownLoadKey(int ReaderID,int KeyIndex, byte Key[]);
public native int YW_KeyDown_Authorization(int ReaderID,byte KeyMode, int BlockAddr, byte KeyIndex);
public native int YW_KeyAuthorization(int ReaderID,byte KeyMode, int BlockAddr, byte Key[]);
public native int YW_ReadaBlock(int ReaderID,int BlockAddr, int LenData, byte pData[]);
public native int YW_WriteaBlock(int ReaderID,int BlockAddr, int LenData, byte pData[]);
public native int YW_Purse_Initial(int ReaderID,int BlockAddr, int IniMoney);
public native int YW_Purse_Read(int ReaderID,int BlockAddr, int Money[]);
public native int YW_Purse_Decrease(int ReaderID,int BlockAddr, int Decrement);
public native int YW_Purse_Charge(int ReaderID,int BlockAddr, int Charge);
public native int YW_CardHalt(int ReaderID);
public native int YW_Restore(int ReaderID,int BlockAddr);
public native int YW_Transfer(int ReaderID,int BlockAddr);
public native int YW_AntiCollideAndSelect(int ReaderID,byte ReturnMode, byte CardMem[], byte SNLen[], byte SN[]);
public native int YW_TypeA_Reset(int ReaderID, byte Mode, byte MultiMode, int rtLen[], byte pData[]);
public native int YW_TypeA_COS(int ReaderID, int LenCOS, byte Com_COS[], int rtLen[], byte pData[]);
public native int YW_UltraLightRead(int ReaderID, int BlockID, byte pData[]);
public native int YW_UltraLightWrite(int ReaderID, int BlockID, byte pData[]);
public native int YW_AntiCollide_Level(int ReaderID,int Leveln,byte LenSNO[], byte SNO[]);
public native int YW_SelectCard_Level(int ReaderID,int Leveln,byte SAK[]);
public native int YW_RequestAntiandSelect(int ReaderID,int SearchMode,int RetMode, short ATQA[],byte SAK[],byte LenSNO[],byte SNO[]);
public native int YW_WriteM1MultiBlock(int ReaderID, int StartBlock, int BlockNums, int LenData, byte pData[]);
public native int YW_ReadM1MultiBlock(int ReaderID, int StartBlock, int BlockNums, int LenData[], char pData[]);
//////////////////////////////////////////////////// ISO 14443 A Over /
//////////////////////////////////////////////////// ISO 14443 B Start /
public native int YW_TypeB_Request(int ReaderID, byte Mode, byte Attrib[], int rtLen[], byte pData[]);
public native int YW_TypeB_Reset(int ReaderID, byte Mode, int rtLen[], byte pData[]);
public native int YW_TypeB_ResetEx(int ReaderID, byte Mode, byte Attrib[], int rtLen[], byte pData[]);
public native int YW_TypeB_COS(int ReaderID, int LenCOS, byte Com_COS[], int rtLen[], byte pData[]);
public native int YW_TypeB_Halt(int ReaderID, byte PUPI[]);
public native int YW_AT88RF020_Check(int ReaderID, byte Key[]);
public native int YW_AT88RF020_Read(int ReaderID, int BlockID,byte pData[]);
public native int YW_AT88RF020_Write(int ReaderID, int BlockID, byte pData[]);
public native int YW_AT88RF020_Lock(int ReaderID, byte LockByte[]);
public native int YW_AT88RF020_Count(int ReaderID, byte Signature[]);
public native int YW_AT88RF020_DeSel(int ReaderID);
public native int YW_AT88RF020_ReadMulti(int ReaderID, int BlockID,int BlockNums, int LenData[], byte pData[]);
public native int YW_AT88RF020_WriteMulti(int ReaderID, int BlockID,int BlockNums, int LenData, byte pData[]);
public native int YW_ST_Active(int ReaderID, byte ChipID[]);
public native int YW_ST_DeActive(int ReaderID);
public native int YW_SR176_GetUID(int ReaderID,byte UID[]);
public native int YW_SR176_Read(int ReaderID, int BlockID,byte pData[]);
public native int YW_SR176_Write(int ReaderID, int BlockID,byte pData[]);
public native int YW_SR176_Lock(int ReaderID, byte LockByte);
public native int YW_SR176_LockStatus(int ReaderID, byte LockByte[]);
public native int YW_SR176_ReadMulti(int ReaderID, int BlockID, int BlockNums,int LenData[],byte pData[]);
public native int YW_SR176_WriteMulti(int ReaderID, int BlockID, int BlockNums,int LenData, byte pData[]);
public native int YW_SR512_Read(int ReaderID, int BlockID,byte pData[]);
public native int YW_SR512_Write(int ReaderID, int BlockID, byte pData[]);
public native int YW_SRIX4K_Check(int ReaderID, byte Key[], byte Signature[]);
public native int YW_SR512_GetUID(int ReaderID,byte UID[]);
public native int YW_SR512_Lock(int ReaderID, short LockByte);
public native int YW_SR512_LockStatus(int ReaderID, short LockByte[]);
public native int YW_SR512_ReadMulti(int ReaderID, int BlockID,int BlockNums,int LenData[],byte pData[]);
public native int YW_SR512_WriteMulti(int ReaderID, int BlockID,int BlockNums,int LenData,byte pData[]);
//////////////////////////////////////////////////// ISO 14443 B Over /
//////////////////////////////////////////////////// SAM Start /
public native int YW_SAM_ResetBaud(int ReaderID,int SAMIndex, int BaudIndex);
public native int YW_SAM_PPSBaud(int ReaderID,int SAMIndex, int BaudIndex);
public native int YW_SAM_PPSBaudEx(int ReaderID,int SamIndex, int BaudIndex, int Protocol);
public native int YW_SAM_Reset(int ReaderID,int SAMIndex, int rtLen[], byte pData[]);
public native int YW_SAM_ResetEx(int ReaderID,int SamIndex,byte SAMVoltage, int rtLen[], byte pData[]);
public native int YW_SAM_COS(int ReaderID,int SAMIndex, int LenCOS, byte Com_COS[], int rtLen[], byte pData[]);
//////////////////////////////////////////////////// SAM Over /
//////////////////////////////////////////////////// ISO15693 Start /
public native int YW_ISO15693_Inventory(int ReaderID, byte PData[], byte PLen[]);
public native int YW_ISO15693_Stay_Quiet(int ReaderID, byte PUID[]);
public native int YW_ISO15693_Select(int ReaderID, byte Model, byte PUID[]);
public native int YW_ISO15693_Reset_To_Ready(int ReaderID,byte Model, byte PUID[]);
public native int YW_ISO15693_Read(int ReaderID,byte Model,byte PUID[],byte StartBlockID, byte BlockNums, byte PData[], byte PLen[]);
public native int YW_ISO15693_Write(int ReaderID,byte Model, byte PUID[], byte BlockID,byte DataLen, byte PData[]);
public native int YW_ISO15693_Lock_Block(int ReaderID,byte Model, byte PUID[], byte BlockID);
public native int YW_ISO15693_Write_AFI(int ReaderID,byte Model, byte PUID[], byte AFI);
public native int YW_ISO15693_Lock_AFI(int ReaderID,byte Model, byte PUID[]);
public native int YW_ISO15693_Write_DSFID(int ReaderID,byte Model, byte PUID[], byte DSFID);
public native int YW_ISO15693_Lock_DSFID(int ReaderID,byte Model, byte PUID[]);
public native int YW_ISO15693_Get_System_Information(int ReaderID,byte Model, byte PUID[],byte PData[], byte PLen[]);
public native int YW_ISO15693_Get_Block_Security(int ReaderID,byte Model, byte PUID[],byte StartBlockID, byte BlockNums,byte PData[], byte PLen[]);
public native int YW_ISO15693_Multi_Inventory(int ReaderID, byte AFIEnable, byte AFI, byte PData[], byte PLen[]);
public native int YW_ISO15693_MultiWrite(int ReaderID,byte Model, byte PUID, byte BlockID, byte BlockNums,byte DataLen, byte PData);
//////////////////////////////////////////////////// ISO15693 Over /
//////////////////////////////////////////////////// MFPLUS Start /
public native int YW_MFP_L0_WritePerso(int ReaderID, int Address, byte pData[]);
public native int YW_MFP_L0_CommitPerso(int ReaderID);
public native int YW_MFP_SwitchToLevel(int ReaderID, int DesLevel,byte SwitchKey[]);
public native int YW_MFP_L3_Authorization(int ReaderID, int KeyMode,int BlockID,byte Key[]);
public native int YW_MFP_L3_Read(int ReaderID, int StartBlock,int BlockNums,int DataLen[], byte pData[]);
public native int YW_MFP_L3_Write(int ReaderID, int StartBlock,int BlockNums, byte pData[]);
public native int YW_MFP_L3_Purse_Initial(int ReaderID, int BlockID,int InitialValue);
public native int YW_MFP_L3_Purse_Read(int ReaderID, int BlockID,int Value[]);
public native int YW_MFP_L3_Purse_Charge(int ReaderID, int BlockID,int Value);
public native int YW_MFP_L3_Purse_Decrease(int ReaderID, int BlockID,int Value);
public native int YW_MFP_L3_Purse_Backup(int ReaderID, int BlockID,int DesBlockID);
public native int YW_MFP_Authorization_First(int ReaderID, int AESKeyAddr,byte AESKey[]);
public native int YW_MFP_Authorization_Follow(int ReaderID, int AESKeyAddr,byte AESKey[]);
public native int YW_MFP_CommonRead(int ReaderID, int BlockID, int BlockNums,int DataLen[],byte pData[]);
public native int YW_MFP_CommonWrite(int ReaderID, int BlockID, int BlockNums, byte pData[]);
//////////////////////////////////////////////////// MFPLUS Over /
/////////////// TOPAZ Start /////////////////
public native int YW_TOPAZ_ReadUID(int ReaderID,byte HR0[], byte HR1[],int DataLenRet[], byte pDataRet[]);
public native int YW_TOPAZ_ReadAll(int ReaderID,byte UID[], int DataLenRet[], byte pDataRet[]);
public native int YW_TOPAZ_ReadByte(int ReaderID,byte UID[], byte BlockID, byte ByteAddr, byte pDataRet[]);
public native int YW_TOPAZ_WriteByteAfterErase(int ReaderID,byte UID[], byte BlockID, byte ByteAddr, byte DataWrite, byte pDataRet[]);
public native int YW_TOPAZ_WriteByteWithoutErase(int ReaderID,byte UID[], byte BlockID, byte ByteAddr, byte DataWrite, byte pDataRet[]);
public native int YW_TOPAZ_ReadSegment(int ReaderID,byte UID[], byte Segment, int DataLenRet[],byte pDataRet[]);
public native int YW_TOPAZ_ReadBlock(int ReaderID,byte UID[], byte BlockID, byte pDataRet[]);
public native int YW_TOPAZ_WriteBlockAfterErase(int ReaderID,byte UID[], byte BlockID, byte DataWrite[], byte pDataRet[]);
public native int YW_TOPAZ_WriteBlockWithoutErase(int ReaderID,byte UID[], byte BlockID, byte DataWrite[], byte pDataRet[]);
/////////////// TOPAZ Over /////////////////
/////////////// Felica Start /////////////////
public native int YW_Felica_Polling(int ReaderID, short SystemCode, byte RequestCode, byte Slot,
byte IDM[], byte PMm[], byte RequestData[]);
public native int YW_Felica_RequestService(int ReaderID, byte IDM[],
byte NumbersOfCode, byte NodeList[], byte NodeKeyList[]);
public native int YW_Felica_RequestResponse(int ReaderID, byte IDM[],
byte Mode[]);
public native int YW_Felica_ReadWithoutEncryption(int ReaderID, byte IDM[],
byte NumberofService, byte ServiceCodeList[],
byte NumberofBlock, byte LengthofBlockList, byte BlockList[],
byte Status1[], byte Status2[], byte pBlockData[]);
public native int YW_Felica_WriteWithoutEncryption(int ReaderID, byte IDM[],
byte NumberofService, byte ServiceCodeList[],
byte NumberofBlock, byte LengthofBlockList, byte BlockList[],
byte pBlockData[],
byte Status1[], byte Status2[]);
/////////////// Felica Over /////////////////
/////////////// ChinaIDV2 Start /////////////////
public native int YW_ChinaIDV2_RequestCardNo(int ReaderID, byte LengthOfCardNo[], byte CardNo[]);
/////////////// ChinaIDV2 Over /////////////////
////////////// NTag Start ////////////////////
public native int YW_NTag_GetVersion(int ReaderID,byte pData[]);
public native int YW_NTag_Read(int ReaderID,int StartPage, int DataLen[], byte pData[]);
public native int YW_NTag_FastRead(int ReaderID,int StartPage,int EndPage, int DataLen[], byte pData[]);
public native int YW_NTag_Write(int ReaderID, int PageIndex, byte pData[]);
public native int YW_NTag_CompatibleWrite(int ReaderID, int PageIndex, byte pData[]);
public native int YW_NTag_ReadCounter(int ReaderID, int Counter[]);
public native int YW_NTag_Password_Auth(int ReaderID,byte PWD[], byte AuthResult[]);
public native int YW_NTag_ReadSignature(int ReaderID,byte Signature[]);
////////////// NTag End ////////////////////
//////////////// SLE4442 //
public native int YW_SLE_Reset(int ReaderID,byte pResetInfo[]);
public native int YW_SLE_ReadMainMemory(int ReaderID,byte StartAddr, byte MemLen, byte MemData[]);
public native int YW_SLE_WriteMainMemory(int ReaderID,byte StartAddr, byte MemLen, byte MemData[]);
public native int YW_SLE_ReadPROM(int ReaderID,byte MemData[]);
public native int YW_SLE_WriteProtectedDataMemory(int ReaderID,byte StartAddr, byte MemLen, byte MemData[]);
public native int YW_SLE_ReadSecurityLogic(int ReaderID,byte ErrorCounter[], byte PSC[]);
public native int YW_SLE_WritePSC(int ReaderID,byte PSC[]);
public native int YW_SLE_VerifyPSC(int ReaderID,byte PSC[], byte ErrorCounter[]);
/////////////// SLE4442 END //
//// NFC NDEF //
public native int YW_NDEF_Initial();
public native int YW_NDEF_Free();
public native int YW_NDEF_SetKey(byte Key[]);
public native int YW_NDEF_AddRecord(byte uri, int sLen, byte s[]);
public native int YW_NDEF_GetRecord(int Index, byte uri[],int Len[], byte s[]);
public native int YW_NDEF_ClearRecords();
public native int YW_NDEF_Save(int ReaderID);
public native int YW_NDEF_Read(int ReaderID);
/////////////// NFC NDEF End //
/////////////// Rd627 Begin //
public native int YW_WriteFlash(int ReaderID, int BeginAddr,int len, byte Data[]);
public native int YW_ReadFlash(int ReaderID, int BeginAddr, int BytesCount,int len[], byte Data[] );
public native int YW_Config_WriteFlashEx(int ReaderID, int BeginAddr,int len, byte Data[]);
public native int YW_Config_ReadFlashEx(int ReaderID, int BeginAddr, int BytesCount,int len[], byte Data[] );
public native int YW_Config_Clock_Set(int ReaderID,byte Data[]);
public native int YW_Config_Clock_Get(int ReaderID,byte Data[]);
public native int YW_Config_TimeDisplay_Set(int ReaderID,byte Enable, byte Line, byte Column);
public native int YW_Config_TimeDisplay_Get(int ReaderID,byte Enable[], byte Line[], byte Column[]);
public native int YW_Config_DateDisplay_Set(int ReaderID,byte Enable, byte Line, byte Column);
public native int YW_Config_DateDisplay_Get(int ReaderID,byte Enable[], byte Line[], byte Column[]);
public native int YW_Config_Font_Set(int ReaderID,byte Font[]);
public native int YW_Config_Font_Get(int ReaderID,byte Font[]);
public native int YW_Config_FormPowerOn_Set(int ReaderID,byte config,byte timespan,byte width, byte height, byte line, byte column);
public native int YW_Config_FormPowerOn_Get(int ReaderID,byte config[],byte timespan[],byte width[], byte height[], byte line[], byte column[]);
public native int YW_Config_FormRun_Set(int ReaderID,byte config,byte timespan,byte width, byte height, byte line, byte column);
public native int YW_Config_FormRun_Get(int ReaderID,byte config[],byte timespan[],byte width[], byte height[], byte line[], byte column[]);
public native int YW_Config_TextPowerOn_Set(int ReaderID,byte len,byte Data[]);
public native int YW_Config_TextPowerOn_Get(int ReaderID,byte len,byte Data[]);
public native int YW_Config_TextRun_Set(int ReaderID,byte len, byte Data[]);
public native int YW_Config_TextRun_Get(int ReaderID,byte len, byte Data[]);
public native int YW_Config_ImagePowerOn_Set(int ReaderID,byte width, byte height,byte Data[]);
public native int YW_Config_ImageRun_Set(int ReaderID,byte width, byte height,byte Data[]);
public native int YW_ShowText(int ReaderID,byte Config, byte line, byte column, byte len, byte Data[]);
public native int YW_ShowImageFromFlash(int ReaderID,byte config, byte line, byte column,byte width, byte height, int FlashAddr);
public native int YW_ShowImage(int ReaderID,byte config, byte line, byte column,byte width, byte height, byte Data[]);
public native int YW_ShowEnText(int ReaderID,byte Config, byte line, byte column,byte len, byte Data[]);
public native int YW_ControlLCDBackLight(int ReaderID,byte Config, byte timespan);
public native int YW_ClearLCDByLine(int ReaderID,byte lines);
/////////////// Rd627 End //
/////////////// YOWOCPU //
public native int YW_EY5K_SamReset(int ReaderID, byte SamIndex, byte DataLen[], byte Data[]);
public native int YW_EY5K_SamInitial(int ReaderID, byte SamIndex, byte SamPrivilege,byte Teminate[], byte key[], byte KeyFrom);
public native int YW_EY5K_SamGetInfo(int ReaderID, byte SamIndex,byte Teminate[], int OrderNo[]);
public native int YW_EY5K_Request(int ReaderID,byte CardNo[]);
public native int YW_EY5K_ChangeKey(int ReaderID, byte Oldkey[], byte OldkeyFrom, byte Newkey[], byte NewkeyFrom, byte CardNo[]);
public native int YW_EY5K_ReadPublicFile(int ReaderID, int len[], byte data[]);
public native int YW_EY5K_WritePublicFile(int ReaderID, byte SamIndex, byte data[]);
public native int YW_EY5K_ReadHolderFile(int ReaderID, byte SamIndex, int len[], byte data[]);
public native int YW_EY5K_WriteHolderFile(int ReaderID, byte SamIndex, byte data[]);
public native int YW_EY5K_ReadUserFile(int ReaderID, byte SamIndex,int Addr, int Count, int len[], byte data[]);
public native int YW_EY5K_WriteUserFile(int ReaderID, byte SamIndex,int Addr, int Count, byte data[]);
public native int YW_EY5K_Balance(int ReaderID, int Value[]);
public native int YW_EY5K_Debit(int ReaderID, byte SamIndex, int Value, byte Date[], byte Result[]);
public native int YW_EY5K_Consume(int ReaderID, byte SamIndex, int Value, byte Date[], byte Result[]);
public native int YW_EY5K_Record(int ReaderID,int RecordLen[],byte Record[]);
public native int YW_EY5K_GetStatus(int mode);
};
声明了静态成员rfidreader public static jyw60x yoworfid =new jyw60x(); 在main函数中直接调用yoworfid即可调用所有的api接口。 文件结构如下: 






