Communication API > BS2_SetDeviceEventListener


Subnet에서 BioStar 장치를 찾았거나, 장치의 네트워크 연결 상태가 변경될 때 호출되는 콜백 함수를 등록합니다.

함수

#include "BS_API.h"
 
int BS2_SetDeviceEventListener(void* context, OnDeviceFound ptrDeviceFound, OnDeviceAccepted ptrDeviceAccepted, OnDeviceConnected ptrDeviceConnected, OnDeviceDisconnected ptrDeviceDisconnected);

파라미터

  • [In] context : Context
  • [In] ptrDeviceFound : 새로운 장치를 찾았을 때 호출되는 콜백 함수
  • [In] ptrDeviceAccepted : 장치가 BioStar 애플리케이션과의 연결을 요청할 때 호출되는 콜백 함수
  • [In] ptrDeviceConnected : 장치와 연결되었을 때 호출되는 콜백 함수
  • [In] ptrDeviceDisconnected : 장치의 연결이 끊어졌을 때 호출되는 콜백 함수

반환값

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