\App\IqrfNetModule\ModelsDiscoveryManager

Tool for running discovery process in an IQMESH network

Summary

Methods
Properties
Constants
__construct()
run()
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

run()

run(int  $txPower = 6, int  $maxAddress) : array

Runs IQMESH discovery process The time when the response is delivered depends highly on the number of network devices, the network topology, and RF mode, thus, it is not predictable. It can take from a few seconds to many minutes.

Parameters

int $txPower

TX Power used for discovery.

int $maxAddress

Nonzero value specifies maximum node address to be part of the discovery process. This feature allows splitting all node devices into two parts: [1] devices having an address from 1 to MaxAddr will be part of the discovery process thus they become routers, [2] devices having an address from MaxAddr+1 to 239 will not be routers. See IQRF OS documentation for more information. The value of this parameter is ignored at demo version. A value 5 is always used instead.

Throws

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

Returns

array —

API request and response