Contents


Event List

Event List
Camera Event DI
Camera Event DO
Camera Event Motion
Camera Event PIR
Camera Event Tampering
Camera Connection Status
Camera Recording Status
Fan Status Event
Storage Connection Event
Storage Capacity Event
Storage Void Event
NVR Event DI
NVR Event DO


Event Overview

Event related structure:

       enum EDeviceType : uint
       {
           unknown,
           camera,
           IOBox,
       }

       enum EEventType : uint
       {
           unknown,
           DI,
           DO,
           motion,
           PIR,
           tampering,
           videoLoss,
           fanStatus,
           storageConn,
           storageCap,
           storageVoid,
       }

       public struct TEventInfo
       {
           [MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_NODEUNIT_LEN + 1)]
           public string deviceID;
           [MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_EVENT_TIME_LEN + 1)]
           public string time;
           [MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_EVENT_ARGS_LEN + 1)]
           public string args;
           public EDeviceType deviceType;
           public EEventType eventType;
           public byte init;
           public byte trigger;
           public int index;
       }
deviceID   : Device ID, camera starts with "C_", IOBox starts with "D_".
time       : Event trigger time. When the trigger device is Camera, it's camera time. When the trigger device is IOBox, it's server time.
args       : Extra information. In motion event the value is percent, in videoLoss event the value is a description string.
deviceType : Device type.
eventType  : Event type.
init       : Mark if it is a initialized event: 0 for normal event, 1 for initialized event.
trigger    : Mark the status of event: 0 for normal, 1 for trigger.
index      : The index value of DI, DO, Motion, and PIR event.

Status event related structure:

        public enum EDeviceType
        {
            unknown = 0,
            camera,
            extDevice,
            station,
            cmsStation
        }

        public enum EDeviceConnectionStatus : uint
        {
            unknown,
            connected,
            disonnected
        }

        public enum ERecordingStatus : uint
        {
            unknown,
            stop,
            start,
        }
 
        [StructLayout(LayoutKind.Sequential, Pack = 4), Serializable]
        public struct TDeviceStatusInfo
        {
            public EDeviceType deviceType;
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_NODEUNIT_LEN + 1)]
            public string deviceID;
            public EDeviceConnectionStatus connectionStatus;
            public ERecordingStatus recordingStatus;
            public IntPtr recordingStatusInfo;
            public bool init;
        } 
 deviceType         : The device type.
 deviceID           : The device ID.
 connectionStatus   : The connection status of device. 
 recordingStatusInfo: If the value is non-zero, it pointer to TDeviceRecordingStatusInfo. 

 

Event Structure Definition

Camera Event DI

Reference to TEventInfo:

deviceID   : Camera ID, it starts with "C_"
time       : Event trigger camera time
args       : Unused
deviceType : It should be EDeviceType.camera
eventType  : It should be EEventType.DI
init       : Mark if it is a initialized event: 0 for normal event, 1 for initialized event
trigger    : Mark the DI status: 0 for falling, 1 for rising
index      : The index value of DI


Camera Event DO

Reference to TEventInfo:

deviceID   : Camera ID, it starts with "C_"
time       : Event trigger camera time
args       : Unused
deviceType : It should be EDeviceType.camera
eventType  : It should be EEventType.DO
init       : Mark if it is a initialized event: 0 for normal event, 1 for initialized event
trigger    : Mark the DO status: 0 for falling, 1 for rising
index      : The index value of DO


Camera Event Motion

Reference to TEventInfo:

deviceID   : Camera ID, it starts with "C_"
time       : Event trigger camera time
args       : Motion trigger percentage
deviceType : It should be EDeviceType.camera
eventType  : It should be EEventType.motion
init       : Unused
trigger    : It should be 1
index      : The index value of motion window


Camera Event PIR

Reference to TEventInfo:

deviceID   : Camera ID, it starts with "C_"
time       : Event trigger camera time
args       : Unused
deviceType : It should be EDeviceType.camera
eventType  : It should be EEventType.PIR
init       : Unused
trigger    : It should be 1
index      : Unused


Camera Event Tampering

Reference to TEventInfo:

deviceID   : Camera ID, it starts with "C_"
time       : Event trigger camera time
args       : Unused
deviceType : It should be EDeviceType.camera
eventType  : It should be EEventType.tampering
init       : Unused
trigger    : It should be 1
index      : Unused


Camera Connection Status

Reference to TDeviceStatusInfo:

deviceType         : It should be EDeviceType.camera
deviceID           : Camera ID, it starts with "C_"
connectionStatus   : Connection status of camera. 
                     It should be EDeviceConnectionStatus.connected or EDeviceConnectionStatus.disconnected
recordingStatus    : Unused
recordingStatusInfo: Unused 
init               : Mark if it is a initialized event: 0 for normal event, 1 for initialized event


Camera Recording Status

Reference to TDeviceStatusInfo:

deviceType         : It should be EDeviceType.camera
deviceID           : Camera ID, it starts with "C_"
connectionStatus   : Unused
recordingStatus    : Recording status of camera.
                     It should be ERecordingStatus.stop or ERecordingStatus.start
recordingStatusInfo: Unused
init               : Mark if it is a initialized event: 0 for normal event, 1 for initialized event


Fan Status Event

Reference to TEventInfo:

deviceID   : Station ID, it starts with "S_". DeviceID will be empty if it is root station
time       : Event trigger server time
args       : Unused
deviceType : It should be EDeviceType.station
eventType  : It should be EEventType.fanStatus
init       : Mark if it is a initialized event: 0 for normal event, 1 for initialized event
trigger    : Mark the fan status: 0 for fine, 1 for error
index      : Fan id


Storage Connection Event

Description:

Is the storage available for recording

Reference to TEventInfo:

deviceID   : Station ID, it starts with "S_". DeviceID will be empty if it is root station
time       : Event trigger server time
args       : Unused
deviceType : It should be EDeviceType.station
eventType  : It should be EEventType.storageConn
init       : Mark if it is a initialized event: 0 for normal event, 1 for initialized event
trigger    : Mark the storage connection status: 0 for available, 1 for unavailable, 2 for degraded
index      : Volume id


Storage Capacity Event

Description:

Is there enough free space on storage for recording

Reference to TEventInfo:

deviceID   : Station ID, it starts with "S_". DeviceID will be empty if it is root station
time       : Event trigger server time
args       : Unused
deviceType : It should be EDeviceType.station
eventType  : It should be EEventType.storageCap
init       : Mark if it is a initialized event: 0 for normal event, 1 for initialized event
trigger    : Mark the storage connection status: 0 for healthy, 1 for exhausted
index      : Unused


Storage Void Event

Description:

Is there recordable volume for cameras

Reference to TEventInfo:

deviceID   : Station ID, it starts with "S_". DeviceID will be empty if it is root station
time       : Event trigger server time
args       : Unused
deviceType : It should be EDeviceType.station
eventType  : It should be EEventType.storageVoid
init       : Mark if it is a initialized event: 0 for normal event, 1 for initialized event
trigger    : Mark there is recordable volume for cameras: 0 for healthy, 1 for exhausted
index      : Unused


NVR Event DI

Reference to TEventInfo:

deviceID   : Station ID, it starts with "S_"
time       : Event trigger camera time
args       : Unused
deviceType : It should be EDeviceType.station
eventType  : It should be EEventType.DI
init       : Mark if it is a initialized event: 0 for normal event, 1 for initialized event
trigger    : Mark the DI status: 0 for falling, 1 for rising
index      : The index value of DI


NVR Event DO

Reference to TEventInfo:

deviceID   : Station ID, it starts with "S_"
time       : Event trigger camera time
args       : Unused
deviceType : It should be EDeviceType.station
eventType  : It should be EEventType.DO
init       : Mark if it is a initialized event: 0 for normal event, 1 for initialized event
trigger    : Mark the DO status: 0 for falling, 1 for rising
index      : The index value of DO