ExOxvif.PTZ (ex_oxvif v0.1.0)

Copy Markdown View Source

PTZ service: pan, tilt and zoom.

Positions and velocities are in the device's generic spaces: pan and tilt in -1.0..1.0, zoom in 0.0..1.0 (positions) or -1.0..1.0 (continuous velocity). Mapping those to degrees is device-specific; read the node's spaces with nodes/2 and the configured limits with configurations/2.

profile is a media profile token (ExOxvif.MediaProfile :token) whose profile has a PTZ configuration.

Summary

Functions

Move to an absolute position. Requires :pan, :tilt and :zoom.

Accepted options for a PTZ configuration token.

List PTZ configurations, including default spaces and position limits.

Start moving at a velocity until stop/3. :pan, :tilt and :zoom default to 0.0.

Move to the home position. Option :speed (0.0..1.0).

List PTZ nodes and the coordinate spaces each supports.

Move by an offset from the current position. :pan, :tilt and :zoom default to 0.0.

Store the current position as the home position.

Store the current position as a preset and return its token.

Current position and movement state.

Stop all pan, tilt and zoom movement.

Functions

absolute_move(session, profile, opts)

@spec absolute_move(ExOxvif.Session.t(), String.t(), keyword()) ::
  :ok | {:error, ExOxvif.Error.t()}

Move to an absolute position. Requires :pan, :tilt and :zoom.

configuration_options(session, config, opts \\ [])

@spec configuration_options(ExOxvif.Session.t(), String.t(), ExOxvif.call_opts()) ::
  {:ok, ExOxvif.PTZ.ConfigurationOptions.t()} | {:error, ExOxvif.Error.t()}

Accepted options for a PTZ configuration token.

configurations(session, opts \\ [])

@spec configurations(ExOxvif.Session.t(), ExOxvif.call_opts()) ::
  {:ok, [ExOxvif.PTZ.Configuration.t()]} | {:error, ExOxvif.Error.t()}

List PTZ configurations, including default spaces and position limits.

continuous_move(session, profile, opts \\ [])

@spec continuous_move(ExOxvif.Session.t(), String.t(), keyword()) ::
  :ok | {:error, ExOxvif.Error.t()}

Start moving at a velocity until stop/3. :pan, :tilt and :zoom default to 0.0.

goto_home(session, profile, opts \\ [])

@spec goto_home(ExOxvif.Session.t(), String.t(), keyword()) ::
  :ok | {:error, ExOxvif.Error.t()}

Move to the home position. Option :speed (0.0..1.0).

goto_preset(session, profile, preset, opts \\ [])

@spec goto_preset(ExOxvif.Session.t(), String.t(), String.t(), ExOxvif.call_opts()) ::
  :ok | {:error, ExOxvif.Error.t()}

Move to a stored preset.

nodes(session, opts \\ [])

@spec nodes(ExOxvif.Session.t(), ExOxvif.call_opts()) ::
  {:ok, [ExOxvif.PTZ.Node.t()]} | {:error, ExOxvif.Error.t()}

List PTZ nodes and the coordinate spaces each supports.

presets(session, profile, opts \\ [])

@spec presets(ExOxvif.Session.t(), String.t(), ExOxvif.call_opts()) ::
  {:ok, [ExOxvif.PTZ.Preset.t()]} | {:error, ExOxvif.Error.t()}

List stored presets.

relative_move(session, profile, opts \\ [])

@spec relative_move(ExOxvif.Session.t(), String.t(), keyword()) ::
  :ok | {:error, ExOxvif.Error.t()}

Move by an offset from the current position. :pan, :tilt and :zoom default to 0.0.

remove_preset(session, profile, preset, opts \\ [])

@spec remove_preset(ExOxvif.Session.t(), String.t(), String.t(), ExOxvif.call_opts()) ::
  :ok | {:error, ExOxvif.Error.t()}

Delete a stored preset.

set_home(session, profile, opts \\ [])

@spec set_home(ExOxvif.Session.t(), String.t(), ExOxvif.call_opts()) ::
  :ok | {:error, ExOxvif.Error.t()}

Store the current position as the home position.

set_preset(session, profile, opts \\ [])

@spec set_preset(ExOxvif.Session.t(), String.t(), keyword()) ::
  {:ok, String.t()} | {:error, ExOxvif.Error.t()}

Store the current position as a preset and return its token.

Options: :name (a new preset's name) and :token (overwrite an existing preset).

status(session, profile, opts \\ [])

@spec status(ExOxvif.Session.t(), String.t(), ExOxvif.call_opts()) ::
  {:ok, ExOxvif.PTZ.Status.t()} | {:error, ExOxvif.Error.t()}

Current position and movement state.

stop(session, profile, opts \\ [])

@spec stop(ExOxvif.Session.t(), String.t(), ExOxvif.call_opts()) ::
  :ok | {:error, ExOxvif.Error.t()}

Stop all pan, tilt and zoom movement.