\App\IqrfNetModule\ModelsBondingManager

Tool for managing bonds in an IQMESH network

Summary

Methods
Properties
Constants
__construct()
bondLocal()
bondSmartConnect()
clearAll()
remove()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$request
$wsClient
N/A

Properties

$request

$request : \App\IqrfNetModule\Requests\ApiRequest

Type

normal — JSON API request

$wsClient

$wsClient : \App\IqrfNetModule\Models\WebSocketClient

Type

normal — WebSocket client

Methods

__construct()

__construct(\App\IqrfNetModule\Requests\ApiRequest  $request, \App\IqrfNetModule\Models\WebSocketClient  $wsClient) : mixed

Constructor

Parameters

\App\IqrfNetModule\Requests\ApiRequest $request

JSON API request

\App\IqrfNetModule\Models\WebSocketClient $wsClient

WebSocket client

Returns

mixed

bondLocal()

bondLocal(int  $address) : array

Bonds a node locally

Parameters

int $address

A requested address for the bonded node. If this parameter equals to 0, then the first free address is assigned to the node.

Throws

\App\IqrfNetModule\Exceptions\DpaErrorException
\App\IqrfNetModule\Exceptions\EmptyResponseException
\App\IqrfNetModule\Exceptions\UserErrorException
\Nette\Utils\JsonException

Returns

array —

API request and response

bondSmartConnect()

bondSmartConnect(int  $address, string  $code, int  $testRetries = 1) : array

Bonds a node via IQRF Smart Connect

Parameters

int $address

Address to bond the device to

string $code

Smart connect code of the device

int $testRetries

Maximum number of FRCs used to test whether the Node was successfully bonded.

Throws

\App\IqrfNetModule\Exceptions\DpaErrorException
\App\IqrfNetModule\Exceptions\EmptyResponseException
\App\IqrfNetModule\Exceptions\UserErrorException
\Nette\Utils\JsonException

Returns

array —

API request and response

clearAll()

clearAll(bool  $coordinatorOnly = false) : array

Clears all bonds

Parameters

bool $coordinatorOnly

Removes a bond only in the coordinator

Throws

\App\IqrfNetModule\Exceptions\DpaErrorException
\App\IqrfNetModule\Exceptions\EmptyResponseException
\App\IqrfNetModule\Exceptions\UserErrorException
\Nette\Utils\JsonException

Returns

array —

API request and response

remove()

remove(int  $address, bool  $coordinatorOnly = false) : array

Removes a bond

Parameters

int $address

Address of the node to be removed

bool $coordinatorOnly

Removes a bond only in the coordinator

Throws

\App\IqrfNetModule\Exceptions\DpaErrorException
\App\IqrfNetModule\Exceptions\EmptyResponseException
\App\IqrfNetModule\Exceptions\UserErrorException
\Nette\Utils\JsonException

Returns

array —

API request and response