public static async Task <T> RequestAsync <T>(this ICoapClient client, CoapRequest request, CancellationToken cancellationToken) { var response = await client.RequestAsync(request, cancellationToken); var message = Encoding.UTF8.GetString(response.Payload); return(JsonSerializer.Deserialize <T>(message)); }
public CoapObserveResponse(CoapResponse response, ICoapClient client) { Response = response ?? throw new System.ArgumentNullException(nameof(response)); _client = client ?? throw new System.ArgumentNullException(nameof(client)); }
public CoapClientInstance(ICoapClient coapClient) { _coapClient = coapClient ?? throw new global::System.ArgumentNullException(nameof(coapClient)); }
public Gateway(ICoapClient coapClient, GatewaySettings settings) { _coapClient = coapClient ?? throw new ArgumentNullException(nameof(coapClient)); _settings = settings ?? throw new ArgumentNullException(nameof(settings)); }