Old revisions Add to book Export to PDF Book Creator Add this page to your book Book Creator Remove this page from your book Manage book (0 page(s)) Help This is an old revision of the document! Communication API API that controls the device communication having LAN, USB, RS485 for communication interface. To get the status of the connection and the search results in real-time, register a callback function using the BS2_SetDeviceEventListener function. BS2_SetDeviceEventListener: Sets the device search, network connection, and Event listener. BS2_SearchDevices: Searches BioStar devices from the subnet. BS2_GetDevices: Gets the information of the devices that are being managed. BS2_ConnectDevice: Connects to a device through the device ID. BS2_ConnectDeviceViaIP: Connects to a device through the IP address and Port number. BS2_DisconnectDevice: Disconnects with the device. BS2_SetKeepAliveTimeout: Sets the keep-alive timeout. BS2_SetNotificationListener: Sets the notification listener. BS2_SetServerPort: Sets the server port. 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); 1. OnDeviceFound Callback function that is called when a new BioStar device has been found in the subnet. 2. OnDeviceAccepted Callback function that is called when a BioStar device requests to connect to the BioStar application. 3. OnDeviceConnected Callback function that is called when the device and BioStar application is connected. 4. OnDeviceDisconnected Callback function that is called when the device and BioStar application is disconnected. 5. OnAlarmFired Callback function that is called when the alarm configured to a zone triggers. 6. OnInputDetected Callback function that is called when an input signal is detected. 7. OnConfigChanged Callback function that is called when the configuration of the device is modified.