Skip to content

Commit

Permalink
refactor(coap_client): use config for requests directly
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Jan 9, 2022
1 parent e5e1ff5 commit 1602f23
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/src/binding_coap/coap_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -218,24 +218,21 @@ class CoapClient extends ProtocolClient {

@override
Future<Content> readResource(Form form) async {
final request =
_createRequest(form, OperationType.readproperty, _coapConfig);
final request = _createRequest(form, OperationType.readproperty);
return await request.resolveInteraction(null);
}

@override
Future<void> writeResource(Form form, Content content) async {
final request =
_createRequest(form, OperationType.writeproperty, _coapConfig);
final request = _createRequest(form, OperationType.writeproperty);
final input = await _getInputFromContent(content);
await request.resolveInteraction(input);
return;
}

@override
Future<Content> invokeResource(Form form, Content content) async {
final request =
_createRequest(form, OperationType.invokeaction, _coapConfig);
final request = _createRequest(form, OperationType.invokeaction);
final input = await _getInputFromContent(content);
return await request.resolveInteraction(input);
}
Expand Down

0 comments on commit 1602f23

Please sign in to comment.