Код: Выделить всё
public void StartListening(string ipAddress, int port, string username, string password, string listenIP, ushort listenPort)
{
if (!NET_DVR_Init())
{
Console.WriteLine("SDK Init failed");
return;
}
NET_DVR_DEVICEINFO_V30 deviceInfo = new NET_DVR_DEVICEINFO_V30();
int userID = NET_DVR_Login_V30(ipAddress, port, username, password, ref deviceInfo);
if (userID < 0)
{
Console.WriteLine("Login failed, error: " + NET_DVR_GetLastError());
NET_DVR_Cleanup();
return;
}
// start listining to the incoming events
var callbackfunc = new ALARM_CALLBACK(OnAlarmReceivedCallBack);
int iListenHandle = NET_DVR_StartListen_V30(listenIP, listenPort, callbackfunc, IntPtr.Zero);
if (iListenHandle < 0)
{
Console.WriteLine("Listen setup failed, error: " + NET_DVR_GetLastError());
NET_DVR_Logout(userID);
NET_DVR_Cleanup();
return;
}
else
{
Console.WriteLine("Listen Setup success");
}
Console.WriteLine("Listening for motion detection events...");
Console.WriteLine("Press any key to close connection");
Console.ReadLine(); // Keep app running
NET_DVR_Logout(userID);
NET_DVR_Cleanup();
}
- Verified login credentials and connection
- Confirmed that the camera is detecting motion
- Monitored the alert stream API to check for event activity
График вооружения: все время
Действия сцепления-> Уведомление Центр наблюдения: true
Host IP : 192.x.x.x
Set Alarm Host Port : 5055
Подробнее здесь: https://stackoverflow.com/questions/797 ... -triggered
Мобильная версия