Updated on 2026-08-14
This commit is contained in:
parent
8c24ae2010
commit
432a46e984
4 changed files with 6 additions and 5 deletions
|
|
@ -38,7 +38,7 @@ abstract class Command<T : CommandResponse> : CardSessionRunnable<T> {
|
|||
abstract fun deserialize(environment: SessionEnvironment, apdu: ResponseApdu): T
|
||||
|
||||
override fun run(session: CardSession, callback: (result: CompletionResult<T>) -> Unit) {
|
||||
Log.i("Command", "Sending ${this::class.java.simpleName}")
|
||||
Log.i("Command", "Initializing ${this::class.java.simpleName}")
|
||||
if (session.environment.handleErrors) {
|
||||
if (performPreCheck(session, callback)) return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class TlvBuilder {
|
|||
|
||||
fun serialize(): ByteArray {
|
||||
Log.v("TLV",
|
||||
"List of encoded TLVs:\n${tlvs.joinToString("\n")}")
|
||||
"Data encoded to TLVs:\n${tlvs.joinToString("\n")}")
|
||||
return tlvs.serialize()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class TlvDecoder(val tlvList: List<Tlv>) {
|
|||
|
||||
init {
|
||||
Log.v("TLV",
|
||||
"List of decoded TLVs:\n${tlvList.joinToString("\n")}")
|
||||
"Decoding data from TLV:\n${tlvList.joinToString("\n")}")
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -57,7 +57,7 @@ class TlvDecoder(val tlvList: List<Tlv>) {
|
|||
if (logError) {
|
||||
Log.e(this::class.simpleName!!, "TLV $tag not found")
|
||||
} else {
|
||||
Log.v(this::class.simpleName!!, "TLV $tag not found")
|
||||
Log.v(this::class.simpleName!!, "TLV $tag not found, but it is not required")
|
||||
}
|
||||
throw TangemSdkError.DecodingFailedMissingTag()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ class NfcReader : CardReader {
|
|||
|
||||
val rawResponse: ByteArray?
|
||||
try {
|
||||
Log.i(this::class.simpleName!!, "Sending data to the card")
|
||||
rawResponse = isoDep?.transceive(data)
|
||||
} catch (exception: TagLostException) {
|
||||
callback?.invoke(CompletionResult.Failure(TangemSdkError.TagLost()))
|
||||
|
|
@ -86,7 +87,7 @@ class NfcReader : CardReader {
|
|||
return
|
||||
}
|
||||
if (rawResponse != null) {
|
||||
Log.i(this::class.simpleName!!, "NFC response is received")
|
||||
Log.i(this::class.simpleName!!, "Data from the card was received")
|
||||
data = null
|
||||
}
|
||||
rawResponse?.let { callback?.invoke(CompletionResult.Success(ResponseApdu(it))) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue