Ejemplo n.º 1
0
        private int AnalyzerDataCallBack(IntPtr lAnalyzerHandle, uint dwEventType, IntPtr pEventInfo, IntPtr pBuffer, uint dwBufSize, IntPtr dwUser, int nSequence, IntPtr reserved)
        {
            if (realLoadID != lAnalyzerHandle)
            {
                return(0);
            }
            switch (dwEventType)
            {
            case (uint)EM_EVENT_IVS_TYPE.ACCESS_CTL:
                NET_DEV_EVENT_ACCESS_CTL_INFO info = (NET_DEV_EVENT_ACCESS_CTL_INFO)Marshal.PtrToStructure(pEventInfo, typeof(NET_DEV_EVENT_ACCESS_CTL_INFO));

                Console.WriteLine("\ncase (uint)EM_EVENT_IVS_TYPE.ACCESS_CTL");
                Console.WriteLine("NET_DEV_EVENT_ACCESS_CTL_INFO:");
                Console.WriteLine("----------------------------------------");
                Console.WriteLine("UTC: " + info.UTC.ToString());
                Console.WriteLine("szUserID: " + info.szUserID);
                Console.WriteLine("szCardName: " + info.szCardName);
                Console.WriteLine("emOpenMethod: " + info.emOpenMethod.ToString());
                Console.WriteLine("emAttendanceState: " + info.emAttendanceState.ToString());

                break;

            default:
                break;
            }

            return(0);
        }
Ejemplo n.º 2
0
        public bool fMessCallBackEx(int lCommand, IntPtr lLoginID, IntPtr pBuf, uint dwBufLen, IntPtr pchDVRIP, int nDVRPort, bool bAlarmAckFlag, int nEventID, IntPtr dwUser)
        {
            //Console.WriteLine("\nNEW EVENT:");
            //Console.WriteLine("lCommand = " + string.Format("0x{x16}", lCommand));
            //Console.WriteLine("pchDVRIP = " + Marshal.PtrToStringAnsi(pchDVRIP));
            //Console.WriteLine("nEventID = " + nEventID);

            switch (lCommand)
            {
            case (int)NetSDKCS.EM_ALARM_TYPE.ALARM_CARD_RECORD:
                NET_DEV_EVENT_ACCESS_CTL_INFO info = (NET_DEV_EVENT_ACCESS_CTL_INFO)Marshal.PtrToStructure(pBuf, typeof(NET_DEV_EVENT_ACCESS_CTL_INFO));
                Console.WriteLine(info.szUserID);
                Console.WriteLine(info.szCardName);
                Console.WriteLine(info.emOpenMethod.ToString());
                Console.WriteLine(info.emAttendanceState.ToString());
                break;
            }
            return(true);
        }