Skip to content

Commit

Permalink
fix(coap_client): correctly set URI path for discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Jul 17, 2022
1 parent ed6ced0 commit 678f423
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/src/binding_coap/coap_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,7 @@ class CoapClient extends ProtocolClient {
// due to a bug in the CoAP library.
final streamController = StreamController<ThingDescription>();
final request = coap.CoapRequest(coap.CoapCode.get, confirmable: false)
// ignore: invalid_use_of_protected_member
..uri = uri
..uriPath = uri.path
..accept = coap.CoapMediaType.applicationTdJson;
final multicastResponseHandler = coap.CoapMulticastResponseHandler(
(data) {
Expand Down Expand Up @@ -406,8 +405,8 @@ class CoapClient extends ProtocolClient {
coap.CoapClient(discoveryUri, _InternalCoapConfig(coapConfig, null));

// TODO(JKRhb): Multicast could be supported here as well.
// ignore: invalid_use_of_protected_member
final request = coap.CoapRequest(coap.CoapCode.get)..uri = discoveryUri;
final request = coap.CoapRequest(coap.CoapCode.get)
..uriPath = discoveryUri.path;
final response = await coapClient.send(request);

coapClient.close();
Expand Down

0 comments on commit 678f423

Please sign in to comment.