\App\IqrfNetModule\ModelsDpaRawManager

Tool for sending and parsing JSON DPA Raw requests and responses

Summary

Methods
Properties
Constants
__construct()
send()
validatePacket()
updateNadr()
parseResponse()
getPacket()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct(\App\IqrfNetModule\Models\DpaRequest  request, \App\IqrfNetModule\Models\WebSocketClient  wsClient) : 

Constructor

Parameters

\App\IqrfNetModule\Models\DpaRequest request

JSON DPA request

\App\IqrfNetModule\Models\WebSocketClient wsClient

WebSocket client

Returns

send()

send(  packet, int|null  timeout = null) : mixed||string|int

Send RAW IQRF packet

Parameters

packet

RAW IQRF packet

int|null timeout

DPA timeout in milliseconds

Throws

\App\IqrfNetModule\Exceptions\EmptyResponseException
\App\IqrfNetModule\Models\JsonException

Returns

mixed||string|int —

DPA request and response

validatePacket()

validatePacket(  packet) : 

Validate DPA packet

Parameters

packet

DPA packet to validate

Returns

Status

updateNadr()

updateNadr(  packet,   nadr) : 

Update NADR in DPA packet

Parameters

packet

DPA packet to modify

nadr

New NADR

Returns

parseResponse()

parseResponse(mixed||string|int  json) : array|null

Parse DPA response

Parameters

mixed||string|int json

JSON DPA response

Throws

\App\IqrfNetModule\Exceptions\EmptyResponseException
\App\IqrfNetModule\Models\JsonException

Returns

array|null —

Parsed response in array

getPacket()

getPacket(mixed||string|int  json,   type) : 

Get a DPA packet from JSON DPA request and response

Parameters

mixed||string|int json

JSON DPA request and response

type

Data type (request|response)

Throws

\App\IqrfNetModule\Models\JsonException

Returns

DPA packet