yinyitong-zhongyuyuan-dll-hang/src/main/java/com/dpkj/modules/cardReader/utils/CardReaderUtil.java

26 lines
803 B
Java
Raw Normal View History

package com.dpkj.modules.cardReader.utils;
import com.dpkj.common.exception.RRException;
import com.sun.jna.Native;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class CardReaderUtil {
/**
* 获取 多合一读卡器 实例同时注册 CardReaderSdk 控件
*
* @return CardReaderSdk 实例
* @throws RRException 如果注册控件失败抛出此异常
*/
public static CardReaderSdk getCardReaderSDK() throws RRException {
try {
return Native.loadLibrary("SSSE32", CardReaderSdk.class);
} catch (UnsatisfiedLinkError e) {
log.info("[CardReader][AutoReplyPrint2.getCardReaderSDK] SDK注册失败 {}", e.getMessage());
throw new RRException("Failed to load CardReaderSdk library: ", e);
}
}
}