Skip to content

ZigWave API

Version: 1.0.0

Status: ⚫⚪⚪

ZigWave interface for Thunder framework.

(Defined with IZigWave in IZigWave.h)

Table of Contents

Introduction

Scope

This document describes purpose and functionality of the ZigWave interface (version 1.0.0). It includes detailed specification about its methods and properties provided.

Case Sensitivity

All identifiers of the interfaces described in this document are case-sensitive. Thus, unless stated otherwise, all keywords, entities, properties, relations and actions should be treated as such.

Acronyms, Abbreviations and Terms

The table below provides and overview of acronyms used in this document and their definitions.

Acronym Description
API Application Programming Interface
HTTP Hypertext Transfer Protocol
JSON JavaScript Object Notation; a data interchange format
JSON-RPC A remote procedure call protocol encoded in JSON

The table below provides and overview of terms and abbreviations used in this document and their definitions.

Term Description
callsign The name given to an instance of a plugin. One plugin can be instantiated multiple times, but each instance the instance name, callsign, must be unique.

References

Ref ID Description
HTTP HTTP specification
JSON-RPC JSON-RPC 2.0 specification
JSON JSON specification
Thunder Thunder API Reference

Description

ZigWave JSON-RPC interface.

Methods

The following methods are provided by the ZigWave interface:

ZigWave interface methods:

Method Description
bind Bind the out from the soure to the in of the destination
unbind Unbind the out from the soure to the in of the destination
metadata Return the Metadata associated with the controller for this instance

bind method

Bind the out from the soure to the in of the destination.

Parameters

Name Type M/O Description
params object mandatory ...
params.source integer mandatory Source to be bound
params.destination integer mandatory Destination to be bound

Result

Name Type M/O Description
result null mandatory Always null

Example

Request

{
  "jsonrpc": "2.0",
  "id": 42,
  "method": "<callsign>.1.bind",
  "params": {
    "source": 0,
    "destination": 0
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": 42,
  "result": null
}

unbind method

Unbind the out from the soure to the in of the destination.

Parameters

Name Type M/O Description
params object mandatory ...
params.source integer mandatory Source to be unbound
params.destination integer mandatory Destination to be unbound

Result

Name Type M/O Description
result null mandatory Always null

Example

Request

{
  "jsonrpc": "2.0",
  "id": 42,
  "method": "<callsign>.1.unbind",
  "params": {
    "source": 0,
    "destination": 0
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": 42,
  "result": null
}

metadata method

Return the Metadata associated with the controller for this instance.

Parameters

This method takes no parameters.

Result

Name Type M/O Description
result object mandatory ...
result.permutable boolean mandatory Permutable or not
result.port string mandatory Port number
result.id integer mandatory Controller Id
result.major integer mandatory Major number
result.minor integer mandatory Minor number
result.nodes integer mandatory Number of Nodes

Example

Request

{
  "jsonrpc": "2.0",
  "id": 42,
  "method": "<callsign>.1.metadata"
}

Response

{
  "jsonrpc": "2.0",
  "id": 42,
  "result": {
    "permutable": false,
    "port": "...",
    "id": 0,
    "major": 0,
    "minor": 0,
    "nodes": 0
  }
}

Properties

The following properties are provided by the ZigWave interface:

ZigWave interface properties:

Property R/W Description
permutable / accept read/write To allow new devices to the network, the controller should be placed into an accepting mode
devices read-only Get the information of available devices

permutable property

Provides access to the to allow new devices to the network, the controller should be placed into an accepting mode. By enabling this mode, the controller can accept new devices.

accept is an alternative name for this property.

The address parameter shall be passed as the index to the property, i.e. permutable@<address>.

Index

Name Type M/O Description
address integer mandatory ...

Value

Name Type M/O Description
(property) object mandatory To allow new devices to the network, the controller should be placed into an accepting mode. By enabling this mode, the controller can accept new devices
(property).value boolean mandatory ...
Name Type M/O Description
(property) boolean mandatory Enabled (true) or Disable (false) the accepting mode

Example

Get Request

{
  "jsonrpc": "2.0",
  "id": 42,
  "method": "<callsign>.1.permutable@0"
}

Get Response

{
  "jsonrpc": "2.0",
  "id": 42,
  "result": false
}

Set Request

{
  "jsonrpc": "2.0",
  "id": 42,
  "method": "<callsign>.1.permutable@0",
  "params": {
    "value": false
  }
}

Set Response

{
    "jsonrpc": "2.0",
    "id": 42,
    "result": "null"
}

devices property

Provides access to the get the information of available devices. An id of 0xFFFFFFFF means all devices available by this plugin.

This property is read-only.

The id parameter shall be passed as the index to the property, i.e. devices@<id>.

Index

Name Type M/O Description
id integer mandatory ...

Value

Name Type M/O Description
(property) array mandatory Get the information of available devices. An id of 0xFFFFFFFF means all devices available by this plugin
(property)[#] object mandatory ...
(property)[#].parent integer mandatory Address of the Parent
(property)[#].address integer mandatory Address of the device
(property)[#].type string mandatory Type of the device (must be one of the following: CONTROLLER, END_DEVICE, ROUTER)
(property)[#].manufacturer integer mandatory Manufactured of this device
(property)[#].metadata string mandatory Metadata associated with this device

Example

Get Request

{
  "jsonrpc": "2.0",
  "id": 42,
  "method": "<callsign>.1.devices@0"
}

Get Response

{
  "jsonrpc": "2.0",
  "id": 42,
  "result": [
    {
      "parent": 0,
      "address": 0,
      "type": "ROUTER",
      "manufacturer": 0,
      "metadata": "..."
    }
  ]
}