From 6239ff5413f211160df7a12ffeeeee5f12fce70e Mon Sep 17 00:00:00 2001 From: Jan Romann Date: Sun, 4 Dec 2022 17:01:36 +0100 Subject: [PATCH] fixup! feat: add experimental CoAP server implementation --- example/coap_server.dart | 2 +- lib/src/coap_server.dart | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/example/coap_server.dart b/example/coap_server.dart index 9307b9ab..69835a6f 100644 --- a/example/coap_server.dart +++ b/example/coap_server.dart @@ -28,7 +28,7 @@ FutureOr main() async { ..respond( request, payload: Uint8List.fromList(utf8.encode('Hello World')), - responseCode: CoapCode.content, + responseCode: ResponseCode.content, contentFormat: CoapMediaType.applicationTdJson, ) ..close(); diff --git a/lib/src/coap_server.dart b/lib/src/coap_server.dart index 65bc3cdd..bafba6e5 100644 --- a/lib/src/coap_server.dart +++ b/lib/src/coap_server.dart @@ -91,7 +91,7 @@ abstract class CoapServer extends Stream { void respond( final CoapRequest request, { - required final CoapCode responseCode, + required final ResponseCode responseCode, final Uint8List? payload, final CoapMediaType? contentFormat, }); @@ -192,13 +192,13 @@ class _CoapUdpServer extends CoapServer { @override void respond( final CoapRequest request, { - required final CoapCode responseCode, + required final ResponseCode responseCode, final Uint8List? payload, final CoapMediaType? contentFormat, }) { final response = CoapResponse.createResponse( request, - CoapCode.content, + ResponseCode.content, CoapMessageType.ack, ) ..id = request.id