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); } } }