@@ -175,14 +175,13 @@ connect(commManager.get(), &CommunicationManager::commandCompleted,
175175
176176``` cpp
177177// Execute command synchronously (blocks until complete)
178- CommandResult executeCommandSync (std::unique_ptr<CardCommand > cmd,
179- int timeoutMs = -1);
178+ CommandResult executeCommandSync (std::unique_ptr<CardCommand > cmd);
180179```
181180
182181**Example:**
183182```cpp
184183auto cmd = std::make_unique<VerifyPINCommand>("123456");
185- CommandResult result = commManager->executeCommandSync(std::move(cmd), 5000 );
184+ CommandResult result = commManager->executeCommandSync(std::move(cmd));
186185
187186if (result.success) {
188187 qDebug() << "PIN verified!";
@@ -637,10 +636,7 @@ QByteArray getData(uint8_t type);
637636QByteArray identify (const QByteArray& challenge = QByteArray());
638637
639638// Wait for card presence
640- bool waitForCard(int timeoutMs = -1);
641-
642- // Set default wait timeout
643- void setDefaultWaitTimeout(int timeoutMs);
639+ bool waitForCard();
644640
645641// Get last error message
646642QString lastError() const;
@@ -1324,15 +1320,15 @@ commManager->startDetection();
13241320``` cpp
13251321// Verify PIN (blocks until complete, but thread-safe!)
13261322auto verifyCmd = std::make_unique<VerifyPINCommand>(" 123456" );
1327- CommandResult result = commManager->executeCommandSync (std::move(verifyCmd), 5000 );
1323+ CommandResult result = commManager->executeCommandSync (std::move(verifyCmd));
13281324
13291325if (result.success) {
13301326 qDebug() << "PIN verified!";
13311327
13321328 // Sign a transaction
13331329 QByteArray hash = /* 32-byte hash * /;
13341330 auto signCmd = std::make_unique<SignCommand >(hash, "m/44'/60'/0'/0/0");
1335- CommandResult signResult = commManager->executeCommandSync(std::move(signCmd), 30000 );
1331+ CommandResult signResult = commManager->executeCommandSync(std::move(signCmd));
13361332
13371333 if (signResult.success) {
13381334 QByteArray signature = signResult.data.toMap()[ "signature"] .toByteArray();
@@ -1398,7 +1394,7 @@ connect(commManager.get(), &CommunicationManager::cardInitialized,
13981394 if (!result.appInfo.initialized) {
13991395 // Initialize new card
14001396 auto initCmd = std::make_unique<InitCommand>("123456", "123456789012", "KeycardDefaultPairing");
1401- CommandResult initResult = commManager->executeCommandSync(std::move(initCmd), 60000 );
1397+ CommandResult initResult = commManager->executeCommandSync(std::move(initCmd));
14021398
14031399 if (!initResult.success) {
14041400 qWarning() << "Init failed:" << initResult.error;
@@ -1681,14 +1677,8 @@ constexpr uint8_t P1StoreDataCash = 0x02; // Cash data
16811677 }
16821678 ```
16831679
1684- 2 . ** Handle platform-specific timeouts:**
1685- ``` cpp
1686- #ifdef Q_OS_IOS
1687- cmdSet->setDefaultWaitTimeout(30000); // 30s for iOS
1688- #else
1689- cmdSet->setDefaultWaitTimeout(60000); // 60s for desktop
1690- #endif
1691- ```
1680+ 2 . ** Use event-driven card waiting:**
1681+ ` waitForCard() ` now waits for channel events (detect/error/detection-stopped) instead of a timeout.
16921682
16931683---
16941684
0 commit comments