Events

Table of Contents

EDNETP_EVENT_STATE (0)
EDNETP_EVENT_ATTR (1)
EDNETP_EVENT_LOGIN (2)
EDNETP_EVENT_CONNECT (3)
EDNETP_EVENT_SHUTDOWN (4)
EDNETP_EVENT_HOST_EVENT (5)
EDNETP_EVENT_PRESET (6)
EDNETP_EVENT_PTZ (7)
EDNETP_EVENT_CHANNEL_PROPERTY (8)
EDNETP_EVENT_CHANNEL_STATE (9)
EDNETP_EVENT_BACKGROUND (10)
EDNETP_EVENT_PHONE_COMMAND (11)
EDNETP_EVENT_PHONE_STATE (12)
EDNETP_EVENT_SEARCH_COMMAND (13)
EDNETP_EVENT_SEARCH_INFO (14)
EDNETP_EVENT_REPLAY_COMMAND (15)
EDNETP_EVENT_REPLAY_INFO (16)
EDNETP_EVENT_STILL_IMAGE (17)
EDNETP_EVENT_LOG_LEVEL (98)
EDNETP_EVENT_LOG_MESSAGE (99)

The type of event is integer number. (You can lookup these numbers in ednetp-const.js in web client javascript examples) The parameter data is a string and event-specific.

EDNETP_EVENT_STATE (0)

Describes the state of connection to the remote server. Data format is 'state', where state is a integer value (see EDNETP_ATTR_STATE(2))

This event is receive-only.

EDNETP_EVENT_ATTR (1)

Changes the value of a attribute, or notified when it is changed. Data format is 'attr:value', where attr is a integer value and value is a string. (see Attributes)

EDNETP_EVENT_LOGIN (2)

Sets login information. Data format is host:port:user:password, where host is the remote host address, port is a port number, user is user name and password is password.

For example, 'demo.nvrsw.com:8081:guest:guest' is valid login information.

This event is send-only.

EDNETP_EVENT_CONNECT (3)

Starts to connect to the remote server with login information.

This event is send-only.

EDNETP_EVENT_SHUTDOWN (4)

Disconnects from the remote server.

This event is send-only.

EDNETP_EVENT_HOST_EVENT (5)

Sends device events, or notified from the remote server. Date format is 'event:device', where event is a event type, and device is a device number.

For example, the motion detection of camera 2 event is '1:2'.

The list of event types is following:

EDNETP_DEVICE_GENERAL (0)

EDNETP_DEVICE_PTZ (1)

Pan/Tilt/Zoom for the camera device

EDNETP_DEVICE_MOTION (2)

Motion detection for the camera device

EDNETP_DEVICE_ALARM (3)

Relay devices

EDNETP_DEVICE_SENSOR (4)

Sensor devices

EDNETP_DEVICE_DISK (5)

Disk error

EDNETP_DEVICE_VIDEO_LOSS (6)

Video signal loss for the camera device

EDNETP_DEVICE_RAID (7)

RAID device error

EDNETP_DEVICE_VIDEO_RECOVER (8)

Video signal recover for the camera device

EDNETP_DEVICE_EXTERNAL (0x40)

External events

EDNETP_DEVICE_ANALOG (0x41)

Analog input devices

EDNETP_DEVICE_CUSTOM (0x80)

EDNETP_EVENT_PRESET (6)

Sends preset information for the camera. Data format is 'camera:command:preset-no', where camera is a camera number, command is a preset command type, preset-no is a preset number.

For example, to set the preset 2 of camera 3 with the current position, data is '2:0:2'.

This event is send-only.

The list of available preset commands is following:

EDNETP_PRESET_COMMAND_SET (0)

Set current camera position to the preset number

EDNETP_PRESET_COMMAND_MOVE (1)

Move camera to the preset number

EDNETP_PRESET_COMMAND_RESET (2)

Reset the preset number

EDNETP_EVENT_PTZ (7)

Controls Pan/Tilt/Zoom devices on the remote server. Data format is 'camera:command', where camera is a camera number, and command is a command type.

For example, zoom in camera 1 is '0:10'.

This event is send-only.

The list of available PTZ commands is following:

EDNETP_PTZ_COMMAND_LEFT_UP (0)

Moves the camera left and up

EDNETP_PTZ_COMMAND_UP (1)

Moves the camera up

EDNETP_PTZ_COMMAND_RIGHT_UP (2)

Moves the camera right and up

EDNETP_PTZ_COMMAND_LEFT (3)

Moves the camera left

EDNETP_PTZ_COMMAND_STOP (4)

Stops the camera moving

EDNETP_PTZ_COMMAND_RIGHT (5)

Moves the camera right

EDNETP_PTZ_COMMAND_LEFT_DOWN (6)

Moves the camera left and down

EDNETP_PTZ_COMMAND_DOWN (7)

Moves the camera down

EDNETP_PTZ_COMMAND_RIGHT_DOWN (8)

Moves the camera right and down

EDNETP_PTZ_COMMAND_ZOOM_IN (9)

Zoom in

EDNETP_PTZ_COMMAND_ZOOM_OUT (10)

Zoom out

EDNETP_PTZ_COMMAND_FOCUS_FAR (11)

Sets focus far

EDNETP_PTZ_COMMAND_FOCUS_NEAR (12)

Sets focus near

EDNETP_PTZ_COMMAND_AUTOPAN_ON (13)

Turns on auto-pan

EDNETP_PTZ_COMMAND_AUTOPAN_OFF (14)

Turns off auto-pan

EDNETP_PTZ_COMMAND_LIGHT_ON (15)

Turns on the light

EDNETP_PTZ_COMMAND_LIGHT_OFF (16)

Turns off the light

EDNETP_EVENT_CHANNEL_PROPERTY (8)

Describes the property of the channel. Date format is 'channel-no:property-name:value', where channel is a channel number, property-name is a property number and value is the value of the property.

For example, the name of audio channel 128 is '128:name:audio1'.

This event is receive-only.

EDNETP_EVENT_CHANNEL_STATE (9)

Describes the state of the channel. Date format is 'channel-no:state', where channel-no is a channel number, and state is a bitwise integer value.

This event is receive-only.

EDNETP_EVENT_BACKGROUND (10)

Not yet supported.

EDNETP_EVENT_PHONE_COMMAND (11)

Sends phone (bidirectional audio communication) commands to the remote server. Data format is 'audio-channel:command-no', where audio-channel is a audio channel number, and command-no is a phone command.

This event is send-only.

The list of available phone commands is following:

EDNETP_PHONE_COMMAND_CALL (0)

Calls the audio channel. When the remote accepts the call, real communication is established.

EDNETP_PHONE_COMMAND_BROADCAST (1)

Makes the audio channel speakable forcibly.

EDNETP_PHONE_COMMAND_ACCEPT (2)

Accepts the call from the remote.

EDNETP_PHONE_COMMAND_IGNORE (3)

Ignores the call from the remote.

EDNETP_PHONE_COMMAND_LISTEN (4)

Starts to listen to the remote audio channel.

EDNETP_PHONE_COMMAND_NOT_LISTEN (5)

Stops to listen to the remote audio channel.

EDNETP_PHONE_COMMAND_SPEAK (6)

Make the audio channel speakable.

EDNETP_PHONE_COMMAND_NOT_SPEAK (7)

Make the audio channel not speakable.

EDNETP_EVENT_PHONE_STATE (12)

Descirbes the phone status. Data format is 'audio-channel:state-no:boolean-value', where audio-chnannel is a audio channel number, state-no is a state type, and boolean-value is the value of the state.

This event is receive-only.

The list of phone states is following:

EDNETP_PHONE_STATE_NORMAL (0)

None

EDNETP_PHONE_STATE_CALL (1)

Requsted the call to the remote audio channel

EDNETP_PHONE_STATE_REQUESTED (2)

Received the call from the remote audio channel

EDNETP_PHONE_STATE_IGNORED (3)

Ignored the call from the remote audio channel

EDNETP_PHONE_STATE_REMOTE_LISTEN (4)

The remote audio channel is listening to the local channel

EDNETP_PHONE_STATE_REMOTE_SPEAK (5)

The remote audio channel is speaking to the local channel

EDNETP_PHONE_STATE_LISTEN (6)

Listening to the remote audio channel

EDNETP_PHONE_STATE_SPEAK (7)

Speaking to the remote audio channel

EDNETP_EVENT_SEARCH_COMMAND (13)

Sends requests for searching recorded file on the remote server. Date format is 'camera:command:parameter', where camera is a camera number, command is the search command, and parameter is the parameter of the command.

This event is send-only.

The list of available search commands is following:

EDNETP_SEARCH_COMMAND_DATE (0)

Requests for recorded date list.

EDNETP_SEARCH_COMMAND_TIME (1)

Requests for recorded time list in the specified day. parameter must contain the day in YYYY-MM-DD format.

EDNETP_EVENT_SEARCH_INFO (14)

Describes the response of searching recorded file on the remote server. Date format is 'camera:search-info:parameter', where camera is a camera number, search-info is the search information, and parameter is the parameter of the information.

This event is receive-only.

The list of the search information is following:

EDNETP_SEARCH_INFO_DATE_DATA (0)

Describes the date information. parameter contains the day in YYYY-MM-DD format.

EDNETP_SEARCH_INFO_TIME_DATA (1)

Describes the time information. parameter contains the time in YYYYMMDD:YYYYMMDD:hhmmss:hhmmss format, which consists of start and finish time of a recorded file.

EDNETP_EVENT_REPLAY_COMMAND (15)

Sends the requests for controlling replay of a recorded file. Date format is 'camera:command:parameter', where camera is a camera number, command is the replay command, and parameter is the additional parameter of the command.

This event is send-only.

The list of available replay commands is following:

EDNETP_REPLAY_COMMAND_START (0)

Starts to replay the recorded file. The parameter must contain the start time and initial pause state (1 or 0) in YYYY-MM-DD:hhmmss:pause format.

EDNETP_REPLAY_COMMAND_PAUSE (1)

Makes a pause to replay.

EDNETP_REPLAY_COMMAND_RESUME (2)

Resumes the replay which are previously paused.

EDNETP_REPLAY_COMMAND_STOP (3)

Stops the replay.

EDNETP_REPLAY_COMMAND_SEEK (4)

Seeks to the specified time in hh:mm:ss format.

EDNETP_REPLAY_COMMAND_PREV_FRAME (5)

Seeks backward in a frame.

EDNETP_REPLAY_COMMAND_NEXT_FRAME (6)

Seeks forward in a frame.

EDNETP_REPLAY_COMMAND_MULTI_SPEED (7)

Changes the speed of the replay. The parameter must contain a integer value in speed format like:

  • EDNETP_REPLAY_PLAY_SPEED_HALF (0)

  • EDNETP_REPLAY_PLAY_SPEED_X1 (1)

  • EDNETP_REPLAY_PLAY_SPEED_X2 (2)

  • EDNETP_REPLAY_PLAY_SPEED_X4 (3)

EDNETP_REPLAY_COMMAND_BACKUP (8)

Downloads the file which are played. The parameter must contain start(1) or cancel(0) downloading command in boolean format.

EDNETP_EVENT_REPLAY_INFO (16)

Describes current replay status. Data format is 'camera:replay-info:parameter', where camera is a camera number, replay-info is the replay information, and parameter is the additional parameter of the information.

This event is receive-only.

The list of the replay information is following:

EDNETP_REPLAY_INFO_START_STOP (0)

Describes the state of start or stop of the replay. If parameter is 1, it's started, otherwise it's stopped.

EDNETP_REPLAY_INFO_RESUME_PAUSE (1)

Describes the state of pause or resume of the replay. If parameter is 1, it's resumed, otherwise it's paused.

EDNETP_REPLAY_INFO_TIME_LINE (2)

Describes the ellapsed time of replaying the current file. parameter contains a time string in hh:mm:ss format.

EDNETP_REPLAY_INFO_MULTI_SPEED (3)

Describes the current replaying speed. parameter contains integer value. (see EDNETP_REPLAY_COMMAND_MULTI_SPEED(7))

EDNETP_REPLAY_INFO_BACKUP (4)

Describes the download status. parameter contains download information in filename:progress:state format, where the last value is the current state like:

  • EDNETP_REPLAY_BACKUP_STATE_NONE (0)

  • EDNETP_REPLAY_BACKUP_STATE_PREPARE (1)

  • EDNETP_REPLAY_BACKUP_STATE_START (2)

  • EDNETP_REPLAY_BACKUP_STATE_CANCEL (3)

  • EDNETP_REPLAY_BACKUP_STATE_COMPLETE (4)

  • EDNETP_REPLAY_BACKUP_STATE_ERROR (5)

EDNETP_EVENT_STILL_IMAGE (17)

Save the still images of the camera which are displayed currently. Data format is 'command:parameter', where command is the action type, and parameter is the additional parameter of the action.

EDNETP_ATTR_STILL_IMAGE_NAME (16) is used for the format of file name and EDNETP_ATTR_STILL_IMAGE_DIR (15) is used for the directory to save them.

This event is send-only.

The list of available commands is following:

EDNETP_STILL_IMAGE_DIALOG (0)

Saves still images after opening the dialog for users to select the directory to save images. parameter may contain default directory to select.

EDNETP_STILL_IMAGE_SAVE (1)

Saves still images directly. parameter must contains camera number to save in camera format.

EDNETP_EVENT_LOG_LEVEL (98)

Changes the level to receive log messages. Data format is 'log-level', where log-level is integer value, if it's 1, it will print only information but if it's 0, it will print debug messages also.

This event is send-only.

EDNETP_EVENT_LOG_MESSAGE (99)

Describes log messages from EDNet OCX. Data contains log message string.

This event is receive-only.