Overview

When controlling devices using the BioStar 2 Device SDK, many developers encounter issues related to timeout behavior. This article provides a explanation of how timeouts are handled in different SDK API calls to help avoid confusion during implementation. 


Default SDK Timeout 

By default, all SDK APIs adhere to the timeout value defined by the BS2_SetDefaultResponseTimeout() API.
However, as documented in the SDK Knowledge Base, some APIs override this setting and use their own specific timeout values, depending on usability and interaction requirements.
Reference: BS2_SetDefaultResponseTimeout 
 


Some APIs such as connection(hardcoded 3s), BS2_UpdateResource and BS2_GetFilteredLog(300s) are using different timeout value.



Scan Card

When using the BS2_ScanCard function, both the SDK and the device follow the timeout value defined in BS2FingerprintConfig.scanTimeout.

  • For devices without fingerprint capability (such as XPass 2), this value is fixed at 10 seconds.


Write Card

When using BS2_WriteCard, a difference in timeout behavior arises:

  • SDK: Follows the value set by DefaultResponseTimeout

  • Device: Continues to follow BS2FingerprintConfig.scanTimeout

For Station-series devices with an LCD screen, the device will wait for a duration of scanTimeout × 2 when writing a card.


Example Scenario (Scan Card VS Write Card)

On an FaceStation F2 device, consider the following settings:

  • DefaultResponseTimeout = 5 seconds

  • scanTimeout = 10 seconds


If BS2_WriteCard is executed:

  • The SDK occurs a timeout after 5 seconds.

  • Meanwhile, the device continues processing and does not timeout until 20 seconds have passed.
    (Devices with an LED screen, scanTimeout × 2)

This behavior may cause some confusion, but it is designed based on various usability considerations and device specifications. Developers are advised to carefully adjust both DefaultResponseTimeout and scanTimeout to avoid unintended behavior.