ZwRequest<T> constructor
ZwRequest<T> (})
Construct a request to be sent to a device.
If a result is expected as a response
then provide processResponse
to process that result
and optionally specify responseTimeout
if other than 5 seconds.
If a result is expected as an unsolicited request from the device
following this request, then specify a resultKey
and optionally specify resultTimeout
if other than 5 seconds.
After the node receives and processes the unsolicited request
associated with this request, it should call the ZwManager's
processedResult(resultKey
) to signal that this request is complete.
Implementation
ZwRequest(this.logger, this.nodeId, this.data,
{this.processResponse,
this.responseTimeout = const Duration(seconds: 5),
this.resultKey,
this.resultTimeout = const Duration(seconds: 5)}) {
_validate(logger != null, 'missing logger');
_validate(data != null, 'data must not be null');
_validate(processResponse == null || responseTimeout != null,
'must specify responseTimeout with processResponse');
_validate(resultKey == null || resultTimeout != null,
'must specify resultTimeout with resultKey');
}