From d12f5f4770d3b93dff952316516137dfb594de11 Mon Sep 17 00:00:00 2001 From: Christian <6939810+chkr1011@users.noreply.github.com> Date: Sat, 30 Apr 2022 10:59:18 +0200 Subject: [PATCH] Update Program.cs --- Source/CoAP.TestClient/Program.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/CoAP.TestClient/Program.cs b/Source/CoAP.TestClient/Program.cs index 7a253c7..8eff9d3 100644 --- a/Source/CoAP.TestClient/Program.cs +++ b/Source/CoAP.TestClient/Program.cs @@ -14,7 +14,8 @@ static class Program { static async Task Main() { - await SendRequestsToCoapMe(); + await ObserveTradfriLamp(); + //await SendRequestsToCoapMe(); } static async Task RequestInParallelTasks() @@ -272,7 +273,7 @@ static async Task ObserveTradfriLamp() request = new CoapRequestBuilder() .WithMethod(CoapRequestMethod.Get) - .WithPath("15001/65550") + .WithPath("15001/65557") .Build(); response = await coapClient.RequestAsync(request, CancellationToken.None).ConfigureAwait(false); @@ -280,7 +281,7 @@ static async Task ObserveTradfriLamp() request = new CoapRequestBuilder() .WithMethod(CoapRequestMethod.Put) - .WithPath("15001/65550") + .WithPath("15001/65557") .WithPayload("{\"3311\": [{\"5850\": 1}]}") .Build(); @@ -288,12 +289,13 @@ static async Task ObserveTradfriLamp() PrintResponse(response); var observeOptions = new CoapObserveOptionsBuilder() - .WithPath("15001/65550") + .WithPath("15001/65557") .WithResponseHandler(new ResponseHandler()) .Build(); var observeResponse = await coapClient.ObserveAsync(observeOptions, CancellationToken.None).ConfigureAwait(false); + PrintResponse(observeResponse.Response); Console.WriteLine("Observed messages for lamp!");