Contents |
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.
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
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
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
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
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
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
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
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
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
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
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
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
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