diff --git a/lib/src/binding_coap/coap_client.dart b/lib/src/binding_coap/coap_client.dart index 5a518aad..dffa6058 100644 --- a/lib/src/binding_coap/coap_client.dart +++ b/lib/src/binding_coap/coap_client.dart @@ -341,8 +341,11 @@ CoapRequestMethod _requestMethodFromOperationType(OperationType operationType) { // TODO(JKRhb): Handle observe/subscribe case switch (operationType) { case OperationType.readproperty: + case OperationType.readmultipleproperties: + case OperationType.readallproperties: return CoapRequestMethod.get; case OperationType.writeproperty: + case OperationType.writemultipleproperties: return CoapRequestMethod.put; case OperationType.invokeaction: return CoapRequestMethod.post; diff --git a/lib/src/binding_http/http_client.dart b/lib/src/binding_http/http_client.dart index 9c9469b1..5e7acac5 100644 --- a/lib/src/binding_http/http_client.dart +++ b/lib/src/binding_http/http_client.dart @@ -169,8 +169,11 @@ HttpRequestMethod _requestMethodFromOperationType(OperationType operationType) { // TODO(JKRhb): Handle observe/subscribe case switch (operationType) { case OperationType.readproperty: + case OperationType.readmultipleproperties: + case OperationType.readallproperties: return HttpRequestMethod.get; case OperationType.writeproperty: + case OperationType.writemultipleproperties: return HttpRequestMethod.put; case OperationType.invokeaction: return HttpRequestMethod.post; diff --git a/lib/src/core/consumed_thing.dart b/lib/src/core/consumed_thing.dart index a5fdeb38..3fc26310 100644 --- a/lib/src/core/consumed_thing.dart +++ b/lib/src/core/consumed_thing.dart @@ -309,15 +309,15 @@ class ConsumedThing implements scripting_api.ConsumedThing { @override Future readAllProperties([InteractionOptions? options]) { - // TODO(JKRhb): implement readAllProperties - throw UnimplementedError(); + final propertyNames = thingDescription.properties.keys.toList(); + + return _readProperties(propertyNames, options); } @override Future readMultipleProperties(List propertyNames, [InteractionOptions? options]) { - // TODO(JKRhb): implement readMultipleProperties - throw UnimplementedError(); + return _readProperties(propertyNames, options); } @override diff --git a/lib/src/core/operation_type.dart b/lib/src/core/operation_type.dart index f726f0b8..361a9b29 100644 --- a/lib/src/core/operation_type.dart +++ b/lib/src/core/operation_type.dart @@ -27,6 +27,15 @@ enum OperationType { /// Corresponds with the `unobserveproperty` operation type. unobserveproperty, + /// Corresponds with the `readmultipleproperties` operation type. + readmultipleproperties, + + /// Corresponds with the `readallproperties` operation type. + readallproperties, + + /// Corresponds with the `writemultipleproperties` operation type. + writemultipleproperties, + /// Corresponds with the `invokeaction` operation type. invokeaction,