Server API > BS2_SetOsdpStandardDeviceStatusListener


BS2_SetOsdpStandardDeviceStatusListener

[+ 2.9.1] OSDP 장치의 상태변화를 감지하는 listener 함수를 등록합니다.

함수

#include "BS_API.h"
 
int BS2_SetOsdpStandardDeviceStatusListener(void* context, OnOsdpStandardDeviceStatusChanged ptrOsdpStandardDeviceStatus);

파라미터

반환값

성공적으로 수행될 경우 BS_SDK_SUCCESS를 반환하고, 에러가 발생할 경우 상응하는 에러 코드를 반환합니다.

샘플코드(C++)

sample_bs2_setosdpstandarddevicestatuslistener.cpp
int sdkResult = BS2_SetOsdpStandardDeviceStatusListener(context_, fpOsdpStandardDeviceStatusChanged);
if (BS_SDK_SUCCESS != sdkResult)
	printf("BS2_SetOsdpStandardDeviceStatusListener call failed: %d", sdkResult);
 
return sdkResult;

샘플코드(C#)

sample_bs2_setosdpstandarddevicestatuslistener.cs
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;