Communication API
As API that configures the SSL communication, there are communication interfaces include LAN, USB, and RS485. To get real-time device connectivity and search results, please register the callback function via the BS2_SetDeviceEventListener function.
BS2_SetDeviceEventListener
Registers the callback function that gets called when finding a BioStar device from the subnet or the device's network connection status changes.
BS2_SearchDevices
Searches BioStar devices from the subnet and refresh the available device list in current Context. Use the BS2GetDevices function to get the device list.
BS2_SearchDevicesEx
DEPRECATED
BS2_SearchDeviceByIP
+ v2.9.13 Searches for a device at a specific IPv4 address and updates the list of devices available in the current context. The list of devices can be obtained via the BS2GetDevices function.
BS2_GetDevices
Gets the information of the devices that are being managed.
BS2_ConnectDevice
Attempts connection with the device based on the given device identifier.
BS2_ConnectDeviceIPV6
Connects the device in IPv6 mode using the device identifier.
BS2_ConnectDeviceViaIP
Attempts connection to the stated IP address and port number.
BS2_DisconnectDevice
Disconnects the connection with the device.
BS2_SetKeepAliveTimeout
Sets the keep-alive timeout.
BS2_SetNotificationListener
Sets the notification listener.
BS2_SetServerPort
Sets the server Port.
BS2_SetSSLServerPort
Sets the SSL server port. If you set as 0, port is not open.
BS2_GetServerPort
+ v2.6.3 Retrieves server port setting.
BS2_GetSSLServerPort
+ v2.6.3 Retrieves SSL Server Port.
BS2_IsConnected
Checks device connection status.
BS2_IsAutoConnection
Check whether automatic connection is configured.
BS2_SetAutoConnection
Set auto connection.
BS2_GetEnableIPV4
+ v2.6.3 Gets IPv4 connection mode.
BS2_SetEnableIPV4
+ v2.6.3 Sets IPv4 connection mode.
BS2_GetEnableIPV6
+ v2.6.3 Gets IPv6 connection mode.
BS2_SetEnableIPV6
+ v2.6.3 Sets IPv6 connection mode.
BS2_SetServerPortIPV6
+ v2.6.3 Sets server port when connecting IPv6 server mode.
BS2_GetServerPortIPV6
+ v2.6.3 Gets server port when connecting IPv6 server mode.
BS2_SetSSLServerPortIPV6
+ v2.6.3 Sets server port when connecting IPv6 server mode using SSL.
BS2_GetSSLServerPortIPV6
+ v2.6.3 Gets server port when connecting IPv6 server mode using SSL.
BS2_SetDefaultResponseTimeout
+ v2.6.3 Sets default response timeout between device and server. It defines timeout of API except some APIs such as connection(hardcoded 3s) and BS2_GetFilteredLog(300s).
BS2_GetDefaultResponseTimeout
+ v2.6.3 Gets default response timeout between device and server. It defines timeout of API except some APIs such as connection(hardcoded 3s) and BS2_GetFilteredLog(300s).
BS2_GetSocketRetryCount
+ v2.9.1 During normal TCP/IP socket communication, if an error occurs while reading and writing packets from the socket in the communication section, the SDK automatically retries a certain number of times.
BS2_SetSocketRetryCount
+ v2.9.1 During normal TCP/IP socket communication, if an error occurs while reading and writing packets from the socket in the communication section, the SDK automatically retries a certain number of times.
BS2_GetSocketSSLRetryCount
+ v2.9.1 During SSL socket communication, if an error occurs while reading and writing packets from the socket in the communication section, the SDK automatically retries a certain number of times.
BS2_SetSocketSSLRetryCount
+ v2.9.1 During SSL socket communication, if an error occurs while reading and writing packets from the socket in the communication section, the SDK automatically retries a certain number of times.
BS2_SetDefaultLongResponseTimeout
+ v2.9.12 Directly modify the packet response timeout for APIs with long response times from the device, such as BS2ScanCard, BS2WriteCard, BS2EraseCard.
BS2_GetDefaultLongResponseTimeout
+ v2.9.12 Directly modify the packet response timeout for APIs with long response times from the device, such as BS2ScanCard, BS2WriteCard, BS2EraseCard.
Callback Function
typedef void (*OnDeviceFound)(uint32_t deviceId);
typedef void (*OnDeviceAccepted)(BS2_DEVICE_ID deviceId);
typedef void (*OnDeviceConnected)(uint32_t deviceId);
typedef void (*OnDeviceDisconnected)(uint32_t deviceId);
typedef void (*OnAlarmFired)(BS2_DEVICE_ID deviceId, const BS2Event* event);
typedef void (*OnInputDetected)(BS2_DEVICE_ID deviceId, const BS2Event* event);
typedef void (*OnConfigChanged)(BS2_DEVICE_ID deviceId, uint32_t configMask);
-
OnDeviceFoundCallback function that is called when a new BioStar device is found in Subnet.
-
OnDeviceAcceptedCallback function that is called when the BioStar device requests a connection to the BioStar application.
-
OnDeviceConnectedCallback function that is called when the device and the BioStar application are connected.
-
OnDeviceDisconnectedCallback function that is called when the connection between the device and the BioStar application is lost.
-
OnAlarmFiredCallback function that is called when an alarm set in the Zone occurs.
-
OnInputDetectedCallback function that is called when an input signal is generated.
-
OnConfigChangedCallback function that is called when the configuration is changed by manipulating the terminal.