Skip to content

Commit 7296663

Browse files
committed
chore!: upgrade coap dependency
1 parent 8dd87ea commit 7296663

File tree

4 files changed

+9
-17
lines changed

4 files changed

+9
-17
lines changed

example/coaps_readproperty.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final Map<Uri, PskCredentials> _pskCredentialsStore = {
2121
PskCredentials? _pskCredentialsCallback(
2222
Uri uri,
2323
Form? form,
24-
Uint8List? identityHint,
24+
String? identityHint,
2525
) {
2626
final key = Uri(scheme: uri.scheme, host: uri.host);
2727

lib/src/binding_coap/coap_client.dart

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import 'dart:typed_data';
1010
import 'package:coap/coap.dart' as coap;
1111
import 'package:coap/config/coap_config_default.dart';
1212
import 'package:dcaf/dcaf.dart';
13-
import 'package:typed_data/typed_buffers.dart';
1413

1514
import '../core/content.dart';
1615
import '../core/credentials/ace_credentials.dart';
@@ -98,14 +97,13 @@ final class CoapClient implements ProtocolClient {
9897
coap.BlockSize? block1Size,
9998
coap.BlockSize? block2Size,
10099
}) async {
101-
final payload = Uint8Buffer();
102-
if (content != null) {
103-
payload.addAll((await content.byteBuffer).asUint8List());
104-
}
100+
final payload = (await content?.byteBuffer)?.asUint8List();
105101

106-
final request = coap.CoapRequest(requestMethod)
107-
..payload = payload
108-
..uriPath = uri.path
102+
final request = coap.CoapRequest(
103+
uri,
104+
requestMethod,
105+
payload: payload,
106+
)
109107
..accept = accept
110108
..contentFormat = format;
111109

@@ -117,10 +115,6 @@ final class CoapClient implements ProtocolClient {
117115
request.block2 = coap.Block2Option.fromParts(0, block2Size);
118116
}
119117

120-
if (uri.query.isNotEmpty) {
121-
request.uriQuery = uri.query;
122-
}
123-
124118
return request;
125119
}
126120

lib/src/core/security_provider.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
//
55
// SPDX-License-Identifier: BSD-3-Clause
66

7-
import 'dart:typed_data';
8-
97
import 'package:dcaf/dcaf.dart';
108

119
import '../definitions/form.dart';
@@ -31,7 +29,7 @@ import 'credentials/psk_credentials.dart';
3129
typedef ClientPskCallback = PskCredentials? Function(
3230
Uri uri,
3331
Form? form,
34-
Uint8List? identityHint,
32+
String? identityHint,
3533
);
3634

3735
/// Function signature for an asynchronous callback for providing client

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dev_dependencies:
1717

1818
dependencies:
1919
cbor: ^5.1.2
20-
coap: ^8.0.0
20+
coap: ^9.0.0
2121
collection: ^1.16.0
2222
curie: ^0.1.0
2323
dcaf: ^0.1.0

0 commit comments

Comments
 (0)