View Source Hikvision (HikvisionClient v0.1.1)

Hikvision Client

HTTP client that talks to Hikvision Camera/NVR using ISAPI.

installation

Installation

If available in Hex, the package can be installed by adding hikvision_client to your list of dependencies in mix.exs:

def deps do
  [
    {:hikvision_client, "~> 0.1.0"}
  ]
end

usage

Usage

Create an operation

operation = Hikvision.System.status()

And then send the request

config = [scheme: "http", host: "localhost", port: 8200, username: "user", password: "password"]
{:ok, resp} = Hikvision.request(op, config)

A response example will be

%{
  cpus: [
    %{
      description: "2616.00", 
      usage: 0
    }
  ],
  current_device_time: "2023-01-30T15:47:54-05:00",
  device_uptime: 56145,
  file_handles: nil,
  memory: [
    %{
      available: 62.160156, 
      description: "DDR Memory", 
      usage: 179.46875
    }
  ],
  status: ""
 }

Link to this section Summary

Functions

Send a request to the Hikvision device

Link to this section Types

@type error() :: {:error, :unauthorized} | {:error, :server_error} | {:error, map()}
@type success() :: {:ok, map()}

Link to this section Functions

Link to this function

request(operation, config \\ [])

View Source
@spec request(term(), Keyword.t()) :: success() | error()

Send a request to the Hikvision device