You can use the BS2_SetDeviceEventListener callback function to check if device is connected or disconnected.
If you configure the ptrDeviceDisconnected with this function, you can find out when the device is disconnected.
The complicated part is that you would have to manage each device's connection with the SDK program.
Registers the callback function that gets called when finding a BioStar device from the subnet or the device's network connection status changes.
#include "BS_API.h" int BS2_SetDeviceEventListener(void* context, OnDeviceFound ptrDeviceFound, OnDeviceAccepted ptrDeviceAccepted, OnDeviceConnected ptrDeviceConnected, OnDeviceDisconnected ptrDeviceDisconnected);
ptrDeviceFound: Callback function that is called when a new device has been found
ptrDeviceAccepted: Callback function that is called when a device requests to connect to the BioStar application
ptrDeviceConnected: Callback function that is called when the device is connected
ptrDeviceDisconnected: Callback function that is called when the device is disconnected
If successfully done,
BS_SDK_SUCCESS will be returned.
If there is an error, the corresponding error code will be returned.