\App\IqrfNetModule\ModelsSecurityManager

Tool for setting an access password and an user key

Summary

Methods
Properties
Constants
__construct()
setAccessPassword()
setUserKey()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
setSecurity()
convertToHex()
$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

setAccessPassword()

setAccessPassword(int  $address, string  $password = '', string  $inputFormat = DataFormat::ASCII) : array

Sets an access password

Parameters

int $address

Network device address

string $password

An access password

string $inputFormat

Input data format (ASCII or HEX)

Throws

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

Returns

array —

API request and response

setUserKey()

setUserKey(int  $address, string  $password = '', string  $inputFormat = DataFormat::ASCII) : array

Sets an user key

Parameters

int $address

Network device address

string $password

An user key

string $inputFormat

Input data format (ASCII or HEX)

Throws

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

Returns

array —

API request and response

setSecurity()

setSecurity(int  $address, string  $password, string  $inputFormat, int  $type) : array

Sets IQMESH security

Parameters

int $address

Network device address

string $password

An access password or an user key

string $inputFormat

Input data format (ASCII or HEX)

int $type

Security type (access password, user key)

Throws

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

Returns

array —

API request and response

convertToHex()

convertToHex(string  $password, string  $inputFormat) : int[]

Converts an access password or an user key to HEX format

Parameters

string $password

Access password or user key

string $inputFormat

Input data format (ASCII or HEX)

Throws

\App\IqrfNetModule\Exceptions\UnsupportedInputFormatException

Returns

int[] —

Converted an access password or an user key