Status and Event Notifications

Requirements:
Tutorial 1 – Connecting to the Base

 

Subscribing


It is important to understand that OCAdapter shows you what the Ocularis Base has registered. The OCAdapter does not actually connect to the underlying NVRs unless explicitly instructed to do so. A connection to the underlying recorders is no longer necessary to obtain the events and statuses in the system.

No events will propagate from the NVRs to the OCAdapter unless

  • The underlying NVR is connected
  • Events have been enabled on the underlying NVR
  • The Event Proxy is running and connected to the NVR
  • Events have been configured in the Ocularis Administrator application.

No statuses will propagate from the NVRs to the OCAdapter unless

  • The underlying NVR is connected
  • The Event Proxy is running and connected to the NVR

You will need to instruct OCAdapter that you want it to connect and provide events. You should do this prior to attempting to access the events with OCCamera.Events(). The call to subscribe to event notification is _adapter.SubscribeOcularisEvents();.

Just as you did for events, you will need to instruct OCAdapter that you want to receive status notifications from the recorders and cameras. The call to subscribe to status notifications is _adapter.SubscribeStatusUpdates();. This should be called prior to attaching to the event delegate handler if you want to receive initial statuses.

 

Attaching to Receive Notifications


The initial statuses of the recorder and its cameras will be delivered when you attached to the event/status event delegate handler _adapter.OnOcularisUpdate. Events arrive as they happen. Note: Old events will also arrive unless they are purged via the Ocularis Administrator application.

 

Receiving


The receiving event function looks like this. You can decipher the message from it’s type.

 

Get Status of All or One Device


You can query the system to receive the latest status of all or one device.

 

Cleanup


As always, it’s good to clean up after oneself. Calling _adapter.Logout() shutdowns the event mechanism in the OCAdapter, and releases other resources. Detaching from the event delegate is good practice also.

 

System Types and System States – OcularisInterface.ISystemStatus


 

Camera Event Types – MessageTypes.OcularisEventTypes


Currently only MotionDetectionInput is sent for a MotionStart event. (10.12.15)

 

Moving to 5.1 Events


If you were using OnCameraStatusChanged(ICamera camera, CAMERA_STATUS newstatus) for RC-C camera status,
use OnOcularisUpdate(OCSystemStatus status)

where status is…

If you were using OnAlert(IAlert alert) for camera events,
use OnOcularisUpdate(OCCameraEvent cameraEvent)

where cameraEvent is…