diff --git a/lib/src/core/implementation/exposed_thing.dart b/lib/src/core/implementation/exposed_thing.dart index 1d3357d0..f517819a 100644 --- a/lib/src/core/implementation/exposed_thing.dart +++ b/lib/src/core/implementation/exposed_thing.dart @@ -288,27 +288,38 @@ class ExposedThing implements scripting_api.ExposedThing, ExposableThing { } @override - Future handleReadAllProperties( - List propertyNames, - PropertyContentMap inputs, { + Future handleReadAllProperties({ int? formIndex, Map? uriVariables, Object? data, - }) { - // TODO: implement handleReadAllProperties - throw UnimplementedError(); - } + }) async => + handleReadMultipleProperties( + thingDescription.properties?.keys.toList() ?? [], + ); @override Future handleReadMultipleProperties( - List propertyNames, - Content input, { + List propertyNames, { int? formIndex, Map? uriVariables, Object? data, - }) { - // TODO: implement handleReadMultipleProperties - throw UnimplementedError(); + }) async { + final contentMapEntries = await Future.wait( + propertyNames.map( + (propertyName) async { + final content = await handleReadProperty( + propertyName, + formIndex: formIndex, + uriVariables: uriVariables, + data: data, + ); + + return MapEntry(propertyName, content); + }, + ), + ); + + return Map.fromEntries(contentMapEntries); } @override diff --git a/lib/src/core/protocol_interfaces/exposable_thing.dart b/lib/src/core/protocol_interfaces/exposable_thing.dart index 653b4e66..109d8177 100644 --- a/lib/src/core/protocol_interfaces/exposable_thing.dart +++ b/lib/src/core/protocol_interfaces/exposable_thing.dart @@ -26,17 +26,14 @@ abstract interface class ExposableThing { /// Handles a `readmultipleproperties` operation triggered by a TD consumer. Future handleReadMultipleProperties( - List propertyNames, - Content input, { + List propertyNames, { int? formIndex, Map? uriVariables, Object? data, }); /// Handles a `readallproperties` operation triggered by a TD consumer. - Future handleReadAllProperties( - List propertyNames, - PropertyContentMap inputs, { + Future handleReadAllProperties({ int? formIndex, Map? uriVariables, Object? data,