Interface IZ21ResponseHandler
- Namespace
- Z21.Core.ResponseHandler
- Assembly
- Z21.Client.dll
public interface IZ21ResponseHandler
Properties
Name
Human-readable command according to the specification.
string Name { get; }
Property Value
Methods
CanHandle(byte[])
Returns true if this response handler can handle the response. False otherwise.
bool CanHandle(byte[] response)
Parameters
responsebyte[]
Returns
Handle(byte[])
void Handle(byte[] response)
Parameters
responsebyte[]
MatchesFrame(byte[], int, params (int Index, byte Value)[])
Length-safe frame matcher shared by every response handler. Returns true only when
response is non-null, at least minimumLength bytes long,
and every (index, value) pair in expected matches. It never throws
on a short or null datagram, replacing the per-handler try/catch (IndexOutOfRangeException)
guard and the duplicated response.Length >= n checks.
bool MatchesFrame(byte[] response, int minimumLength, params (int Index, byte Value)[] expected)