new _CameraPicture()

Retrieval of images of a camera defined in HS.
May not be directly instanced. An instance of the class is created by the method HomeServerConnector._Connection#getCameraPicture.

Example

var cp = conn.getCameraPicture("CP@MyCamera");

Methods

destroy()

Enables the object.

Example

cp.destroy(); 

getKey() → String

Returns the key of the object.

Example

var object_key = cp.getKey(); 
Returns

String 

getMeta(callback)

Retrieves the metadata.

Example

Retrieval of metadata.

cp.getMeta(function(err, data) {}); 

Parameter

Name Type Optional Description

callback

function()

 

HomeServerConnector._CameraPicture~getMetaCallback

getPicture(callback)

Returns the current camera image.

Example

Returns an image.

cp.getPicture(function(err, dataUrl) { document.getElementById("img").src = dataUrl; });   

Parameter

Name Type Optional Description

callback

function()

 

HomeServerConnector._CameraPicture~getPictureCallback

Abstract types

inner

getMetaCallback(err, data)

Example

Retrieval of metadata.

cp.getMeta(function(err, data) {}); 

Parameters

Name Type Optional Description

err

(Object or undefined)

 

Error object

data

Object

 

Meta information

Structure

{ 
  "keys":        Array of String,
  "caption":     String,
  "description": String,
  "tags":        Array of String,
  "host":        String,
  "port":        Number,
  "path":        String,
  "width":       Number,
  "height":      Number
}

Explanation

  • keys - List with keys (e.g.: ["CP:6", "CP@MyCamera"]). Contains at least one number.
  • caption - Designation of the object.
  • description - Description of the object.
  • tags - List of tags (e.g.: ["Yard", "Garden"]).
  • host - Address of the camera.
  • port - IP port of the camera.
  • path - URL from which the image is retrieved.
  • width - Width of the image defined in HS/FS Expert.
  • height - Height of the image defined in HS/FS Expert.
inner

getPictureCallback(err, dataUrl)

Example

Returns an image.

cp.getPicture(function(err, dataUrl) { document.getElementById("img").src = dataUrl; });    

Parameters

Name Type Optional Description

err

(Object or undefined)

 

Error object

dataUrl

String

 

A string in the data URL format. For description and format see: Data-URL Wiki-Page.