Communication API > 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.
#include "BS_API.h" int BS2_SetDeviceEventListener(void* context, OnDeviceFound ptrDeviceFound, OnDeviceAccepted ptrDeviceAccepted, OnDeviceConnected ptrDeviceConnected, OnDeviceDisconnected ptrDeviceDisconnected);
context
: ContextptrDeviceFound
: Callback function that is called when a new device has been foundptrDeviceAccepted
: Callback function that is called when a device requests to connect to the BioStar applicationptrDeviceConnected
: Callback function that is called when the device is connectedptrDeviceDisconnected
: 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.