Linea-Pro DTDevices SDK。无法获取名为magneticCardEncryptedData委托方法

时间:2018-11-19 16:42:54

标签: ios delegates swift4 barcode-scanner linea-pro

在这里,我要实现的是具有加密委托的Linea-Pro磁卡读卡器。 SDK本身已经提供了委托方法,我正在类中确认该方法,但未得到调用。而委托人func magneticCardData(_ track1: String!, track2: String!, track3: String!)可以被呼叫。有人可以告诉我我想念的东西吗?

class ViewController: UIViewController {    
    private let cardReader = DTDevices.sharedDevice() as! DTDevices
    var params : [AnyHashable: Any] = [:]
    //var keyID: Int32 = -1

    override func viewDidLoad() {
        super.viewDidLoad()
        cardReader.addDelegate(self)
        cardReader.connect()
     }  
}

extension ViewController:DTDeviceDelegate {
    func connectionState(_ state: Int32) {
        if state == CONN_STATES.CONNECTED.rawValue {
            DispatchQueue.main.async {
                do {
                    try self.cardReader.emsrSetEncryption(ALG_EH_ECC,params: self.params)
                }catch let error {
                    print(error.localizedDescription)
                }
            }
        }
    }

    func magneticCardEncryptedData(_ encryption: Int32, tracks: Int32, data: Data!) {
        print(data)
    }

    func magneticCardEncryptedData(_ encryption: Int32, tracks: Int32, data: Data!, track1masked: String!, track2masked: String!, track3: String!) {
        print(data)
    }  
}

0 个答案:

没有答案