Server API > BS2_SetOsdpStandardDeviceStatusListener
[+2.9.1] Register a listener function that detects state changes of the OSDP device.
#include "BS_API.h" int BS2_SetOsdpStandardDeviceStatusListener(void* context, OnOsdpStandardDeviceStatusChanged ptrOsdpStandardDeviceStatus);
context
: ContextptrOsdpStandardDeviceStatus
: Callback function to receive changed device information when OSDP device state change is detected
If successfully done, BS_SDK_SUCCESS
will be returned. If there is an error, the corresponding error code will be returned.
int sdkResult = BS2_SetOsdpStandardDeviceStatusListener(context_, fpOsdpStandardDeviceStatusChanged); if (BS_SDK_SUCCESS != sdkResult) printf("BS2_SetOsdpStandardDeviceStatusListener call failed: %d", sdkResult); return sdkResult;
cbOnOsdpStandardDeviceStatusChanged = new API.OnOsdpStandardDeviceStatusChanged(onOSDPStandardDeviceStatusChanged); BS2ErrorCode result = (BS2ErrorCode)API.BS2_SetOsdpStandardDeviceStatusListener(sdkContext, cbOnOsdpStandardDeviceStatusChanged); if (BS2ErrorCode.BS_SDK_SUCCESS != result) Console.WriteLine("Got error({0}).", result); return result;