Skip to content

Commit 342e71a

Browse files
committed
fix: Increase nfc transmit timeout to 120000
Some commands would end-up in an invalid state, showing the log below. This is strange at least. Even if it times-out the success should be false. Either way..5sec seems not enough for some commands. ``` KeycardChannelUnifiedQtNfc::transmit() - invalid response from target ```
1 parent f581845 commit 342e71a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/channel/backends/keycard_channel_unified_qt_nfc.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,9 +332,10 @@ QByteArray KeycardChannelUnifiedQtNfc::transmit(const QByteArray& apdu)
332332
}
333333
}
334334

335-
// Wait for completion with 5-second timeout
336-
// Returns false if tag is lost or timeout occurs
337-
success = target->waitForRequestCompleted(requestId, 5000);
335+
// Wait for completion with 120-second timeout
336+
// Returns false if tag is lost
337+
// The timeout is huge, but the goal is not to timeout here, but to wait for the command to complete or the nfc tag to disconnect.
338+
success = target->waitForRequestCompleted(requestId, 120000);
338339

339340
if (!success) {
340341
qWarning() << "KeycardChannelUnifiedQtNfc::transmit() - request failed (tag lost or timeout)";

0 commit comments

Comments
 (0)