YW_ComInitial
(
int PortIndex,
int Baud
)
打开读卡器串口,使用用串口读卡器,485读卡器,还有USB转串口的读卡器
PortIndex: COM口序号
Baud:串口波特率
int stdcall YW_ComInitial(int PortIndex, int Baud);
function YW_ComInitial(PortIndex: Integer; Bound: Integer): Integer;stdcall;external YOWOREADERDLL;
Public Declare Function YW_ComInitial Lib "YW60x.dll" (ByVal PortIndex As Long, ByVal Bound As Long) As Long
public int YW_ComInitial(int PortIndex, int Baud)
{
int ret;
try
{
JNative fuc = new JNative("YW60x.dll", "YW_ComInitial");
fuc.setRetVal(Type.INT);
fuc.setParameter(0, PortIndex);
fuc.setParameter(1,Baud);
fuc.invoke();
ret = fuc.getRetValAsInt();
}
catch(NativeException e)
{
ret = -1;
}
catch(IllegalAccessException e)
{
ret = -2;
}
return ret;
}
[DllImport("YW60x.dll")]
public static extern int YW_ComInitial(int PortIndex, int Bound);
public FUNCTION long YW_ComInitial(long PortIndex , long Baud) library "YW60x.dll"