【General】Setting Callback Function To Receive Exception Messages

サンプルプログラム

//
// Device Network SDK (General)
// API Reference
// NET_DVR_SetExceptionCallBack_V30
// Sample Code of Setting Callback Function to Receive Exception Messages
//
//Register callback function for receiving exception messages

NET_DVR_SetExceptionCallBack_V30(WM_NULL, NULL, g_ExceptionCallBack, NULL);

//Callback function receive exception message
void CALLBACK g_ExceptionCallBack(DWORD dwType, LONG lUserID, LONG lHandle, void *pUser)
{
char tempbuf[256];
ZeroMemo case EXCEPTION_AUDIOEXCHANGE: //Voice talk network exception
sprintf(tempbuf,”Voice talk network exception!!!”);
TRACE(“%s”,tempbuf);”//TODO: close voice talk
break;s”case EXCEPTION_ALARM://Alarm upload network exception
sprintf(tempbuf,”Alarm upload network exception!!!”);
TRACE(“%s”,tempbuf);”//TODO: close alarm upload
break;s”case EXCEPTION_PREVIEW://Network preview exception
sprintf(tempbuf,”Network preview exception!!!”);
TRACE(“%s”,tempbuf);//TODO: close network preview
break;”,case EXCEPTION_SERIAL://Transparent channel transmission exception
sprintf(tempbuf,”Transparent channel transmission exception!!!”);
TRACE(“%s”,tempbuf);
//TODO: close transparent channel
break;s”case EXCEPTION_RECONNECT://Preview reconnect
break;EXCEPTION_RECONNECT://Preview reconnect
break;
default:
break;
}

関連記事