| | |
| | | #define MAX 1024 |
| | | #define fileread_buf 128 |
| | | |
| | | volatile time_t last_alarmout; |
| | | |
| | | typedef std::map<std::string, int> hcnetsdk_user_t; // decoder_ip, userid |
| | | hcnetsdk_user_t g_hcnetsdk_user; |
| | | |
| | |
| | | if(NET_DVR_SetAlarmOut(lUserID,camConfig.lAlarmOutPort,1) == FALSE){ |
| | | printf("NET_DVR_SetAlarmOut failed, err: %d\n", NET_DVR_GetLastError()); |
| | | } |
| | | last_alarmout = time(NULL); |
| | | |
| | | sleep(3); |
| | | |
| | | //解除警报 |
| | | NET_DVR_SetAlarmOut(lUserID,camConfig.lAlarmOutPort,0); |
| | | if (time(NULL) - last_alarmout >= 3) |
| | | { |
| | | //解除警报 |
| | | NET_DVR_SetAlarmOut(lUserID,camConfig.lAlarmOutPort,0); |
| | | } |
| | | } |
| | | |
| | | int hcnetsdk_alarm_popwin(LONG lUserID, const HCNetCameraConfig& camConfig) |
| | |
| | | timer.it_interval.tv_usec=250000; |
| | | /*Start a virtual timer.It counts down whenever this process is executing.*/ |
| | | |
| | | setitimer(ITIMER_VIRTUAL,&timer,NULL); |
| | | //setitimer(ITIMER_VIRTUAL,&timer,NULL); |
| | | |
| | | |
| | | |
| | | |
| | | while(1) |
| | | sleep(1); |
| | | while ( 1 ) |
| | | { |
| | | zclock_sleep(250); |
| | | timer_handler(0); |
| | | } |
| | | } |
| | | |
| | | void* createServerthread_hcnetsdk(void* arg) |