Skip to content

Commit

Permalink
fixup! feat: add experimental CoAP server implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Jul 2, 2023
1 parent 59c858e commit 01bb70e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion example/coap_server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ FutureOr<void> main() async {
..respond(
request,
payload: Uint8List.fromList(utf8.encode('Hello World')),
responseCode: CoapCode.content,
responseCode: ResponseCode.content,
contentFormat: CoapMediaType.applicationTdJson,
)
..close();
Expand Down
6 changes: 3 additions & 3 deletions lib/src/coap_server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ abstract class CoapServer extends Stream<CoapRequest> {

void respond(
final CoapRequest request, {
required final CoapCode responseCode,
required final ResponseCode responseCode,
final Uint8List? payload,
final CoapMediaType? contentFormat,
});
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 01bb70e

Please sign in to comment.