Skip to content

Commit

Permalink
Fix up log types
Browse files Browse the repository at this point in the history
  • Loading branch information
martinpaljak committed Oct 27, 2023
1 parent 3962798 commit 9c6b159
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/pro/javacard/nfc4pc/NDEF.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ static Optional<byte[]> getType4(APDUBIBO bibo) {
log.warn("Max read size is {}, limiting to 256", maxReadSize);
maxReadSize = 0x100;
}
log.debug("Max read size: {}", maxReadSize);

// This DOES include the 2 byte header
int payloadSize = getShort(read.getData(), (short) 11);
Expand All @@ -167,7 +168,7 @@ static Optional<byte[]> getType4(APDUBIBO bibo) {
// 2 byte header contains the payload length AFTER the header
int reportedLen = getShort(len.getData(), (short) 0);
if ((reportedLen + 2) != payloadSize) {
log.error("Warning: payload length mismatch");
log.warn("Warning: payload length mismatch: {} in capability, {} in data", payloadSize, reportedLen + 2);
}

ByteArrayOutputStream bos = new ByteArrayOutputStream();
Expand All @@ -179,7 +180,7 @@ static Optional<byte[]> getType4(APDUBIBO bibo) {

ResponseAPDU readResponse = bibo.transceive(new CommandAPDU(0x00, 0xb0, offset >> 8, offset, Math.min(left, maxReadSize)));
if (readResponse.getSW() != 0x9000) {
log.error("Read returned: {}", readResponse.getSW());
log.error("Read returned: {}", Integer.toHexString(readResponse.getSW()));
return Optional.empty();
}
byte[] chunk = readResponse.getData();
Expand Down

0 comments on commit 9c6b159

Please sign in to comment.