Skip to content

Commit

Permalink
IOS-8883: Improve APDU logging
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Fedorov <[email protected]>
  • Loading branch information
Andrey Fedorov committed Dec 27, 2024
1 parent 3a86439 commit 3d6030c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion TangemSdk/TangemSdk/Common/APDU/ResponseApdu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ public struct ResponseApdu {

extension ResponseApdu: CustomStringConvertible {
public var description: String {
return "<-- RECEIVED [\(data.count + 2) bytes]: \(data) \(sw1) \(sw2) (SW: \(statusWord))"
return "<-- RECEIVED [\(data.count + 2) bytes]: *** \(sw1) \(sw2) (SW: \(statusWord))"
}
}
4 changes: 1 addition & 3 deletions TangemSdk/TangemSdk/Common/Core/CardSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,7 @@ public class CardSession {
completion(.failure(.sessionInactive))
return
}

Log.apdu("Not encrypted apdu: \(apdu)")


reader.tag
.filter { $0 != .none }
.filter {[weak self] tag in
Expand Down
2 changes: 1 addition & 1 deletion TangemSdk/TangemSdk/Common/NFC/NFCReader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ extension NFCReader: CardReader {
} //todo: handle tag lost

let requestTS = Date()
Log.apdu("SEND --> \(apdu)")

return iso7816tag
.sendCommandPublisher(cApdu: apdu)
.combineLatest(self.cancellationPublisher)
Expand Down

0 comments on commit 3d6030c

Please sign in to comment.