Home › Forums › Ask the Flomies › ACR31, ACR32 & ACR35 Card reading errors
Tagged: ACR35, reading data
-
AuthorPosts
-
April 26, 2017 at 3:39 am #59619
Hello everyone!
We started developing iOS-application for the following card readers: ACR31, ACR32 & ACR35
Now we observe strange behaviour. Quite often cards are read unstable. Sometimes cards are read out for the second or third time.
Please help, from what for it can occur?
April 26, 2017 at 10:52 am #59621Hi Alexander,
Are you using the Flomio SDK? Are you only reading the tag UUID or are you reading tag data also?
We work primarily with the ACR35. With other NFC readers (like the FloBLE Plus), when a tag is detected there is an alert, unfortunately for the ACR35, to detect a tag it requires periodic polling for tags. This is why a tag will periodically be detected when in range. The solution would be to ignore a tag scan unless it is a new UUID or if a decided time period has passed.Kind Regards,
ScottApril 27, 2017 at 3:14 am #59627Scott
We are using SDK from here
http://www.acs.com.hk/download-driver-unified/6935/ACR3x-EVK-iOS-1.00.zip
or https://github.com/flomio/flomio_ios
for ACR31, ACR32 & ACR35we use only one delegate for data reading (swift encapsulated from example project)
func reader(_ reader: ACRAudioJackReader!, didSend trackData: ACRTrackData!)And sometimes it worked unexpected – wrong data in tracks
public func reader(_ reader: ACRAudioJackReader!, didSend trackData: ACRTrackData!){ if let aesTrackData = trackData as? ACRAesTrackData { let buffer = UnsafeMutablePointer<UInt8>.allocate(capacity: aesTrackData.trackData.count) buffer.initialize(from: aesTrackData.trackData) //<-copying the data let bufferLength: Int? = aesTrackData.trackData.count let decryptedTrackData = UnsafeMutableRawPointer.allocate(bytes: 128, alignedTo: 0) let decryptedTrackDataLength: UnsafeMutablePointer<Int>! = UnsafeMutablePointer<Int>.allocate(capacity: 128) let uint8Ptr = UnsafeMutablePointer<UInt8>.allocate(capacity: aesKey.count) uint8Ptr.initialize(from: aesKey) //<-copying the data let success = decryptData(buffer, dataInLength: bufferLength!, key: uint8Ptr, keyLength: aesKey.count, dataOut: decryptedTrackData, dataOutLength: 128, pBytesReturned: decryptedTrackDataLength) if success { _ = ACRTrack1Data.init(bytes: decryptedTrackData, length: aesTrackData.track1Length) let track2Data = ACRTrack2Data.init(bytes: decryptedTrackData + 79, length: aesTrackData.track2Length) if track2Data != nil { let primaryAccountNumber = track2Data!.primaryAccountNumber let expirationDate = track2Data!.expirationDate let serviceCode = track2Data!.serviceCode //let discretionaryData = track2Data!.discretionaryData let result = String(format: ";%@=%@%@", primaryAccountNumber!, expirationDate!, serviceCode!) if checkCode(barcode: result) { DispatchQueue.main.async { self.showConfirm(barcode: result) } return } } DispatchQueue.main.async { self.showError(error: "card_error".localized) } } else { DispatchQueue.main.async { self.showError(error: "card_error_recognize".localized) } } } }
- This reply was modified 7 years, 8 months ago by Alexander.
- This reply was modified 7 years, 8 months ago by Scott.
- This reply was modified 7 years, 8 months ago by Scott.
- This reply was modified 7 years, 8 months ago by Scott.
- This reply was modified 7 years, 8 months ago by Scott.
- This reply was modified 7 years, 8 months ago by Scott.
April 27, 2017 at 11:10 am #59637I have experienced this error I think. I put it down to a weird threading issue within the ACS driver. Unfortunately, the only solution I have come up with is to delay subsequent reads until there is a response and to remove any relationship between all reads and the UI until after all reads are finished.
If you have any more info about the problem, please post it here. It was a very time consuming issue and one which I don’t think I have completely seen the back of. Bluetooth NFC readers provide better performance with reading and writing APDUs and don’t suffer from the same timing issues.
Kind Regards,
Scott -
AuthorPosts
You must be logged in to reply to this topic.