struct UnitTestingTraitA cluster used for testing purposes.
-
List of the event types that are supported by
UnitTestingTrait.Declaration
Swift
static let supportedEventTypes: [any Event.Type] -
List of the commands that are supported by
UnitTestingTrait.Declaration
Swift
static let supportedCommandTypes: [any Command.Type] -
The trait identifier.
Declaration
Swift
static let identifier: String -
Metadata about this
Trait.Declaration
Swift
let metadata: TraitMetadata -
List of attributes for the
UnitTestingTrait.Declaration
Swift
let attributes: Matter.UnitTestingTrait.Attributes -
Creates a new Trait instance using data read from the given
TraitDecoder.Throws
HomeError.parseErrorwhen parsing fails.Declaration
Swift
init(decoder: TraitDecoder, interactionProxy: (any InteractionProxy)?, metadata: TraitMetadata) throwsParameters
decoderThe raw data representing this Trait.
interactionProxyProxy to the Interaction Client.
metadataMetadata about this Trait.
-
Writes this object to the given
TraitEncoder. ThrowsHomeError.encodingFailedif the data could not be encoded.Declaration
Swift
func encode(with encoder: TraitEncoder) throws -
This API provides the ability to invalidate state retrieved through subscriptions to the target device in the cases where state is not being reported correctly, either intentionally (e.g attributes in Matter traits with the “C” quality) or unintentionally due to poor implementations.
When successful, this API will result in a forced read of the convening scope as specified by the sub-class and return the result through existing Trait subscriptions if present and active.
This API is to be used sparingly as it can impact the performance and battery life of the target device. As such, this API may be throttled by the platform. Callers SHALL be prepared to deal with
HomeErrors thrown by this call.Declaration
Swift
func forceRead() async throws -
Attributes for the
UnitTestingTrait.Declaration
Swift
struct Attributes -
Returns a Boolean value indicating whether two values are equal.
Equality is the inverse of inequality. For any values
aandb,a == bimplies thata != bisfalse.Declaration
Parameters
lhsA value to compare.
rhsAnother value to compare.
-
Hashes the essential components of this value by feeding them into the given hasher.
Implement this method to conform to the
Hashableprotocol. The components used for hashing must be the same as the components compared in your type’s==operator implementation. Callhasher.combine(_:)with each of these components.Important
In your implementation of
hash(into:), don’t callfinalize()on thehasherinstance provided, or replace it with a different instance. Doing so may become a compile-time error in the future.Declaration
Swift
func hash(into hasher: inout Hasher) -
SimpleStruct
Declaration
Swift
struct SimpleStruct -
TestFabricScoped
Declaration
Swift
struct TestFabricScoped -
NullablesAndOptionalsStruct`.
Declaration
Swift
struct NullablesAndOptionalsStruct -
NestedStruct
Declaration
Swift
struct NestedStruct -
NestedStructList
Declaration
Swift
struct NestedStructList -
DoubleNestedStructList
Declaration
Swift
struct DoubleNestedStructList -
TestListStructOctet
Declaration
Swift
struct TestListStructOctet -
Whether the device supports the
testcommand for this trait.Declaration
Swift
var supportsTestCommand: Bool { get } -
Simple command without any parameters and without a specific response.
Declaration
Swift
func test() async throws -
The batchable version of test command above.
See also
testDeclaration
Swift
func testBatchable() throws -> BatchableCommand<Void> -
Whether the device supports the
testNotHandledcommand for this trait.Declaration
Swift
var supportsTestNotHandledCommand: Bool { get } -
Simple command without any parameters and without a specific response not handled by the server.
Declaration
Swift
func testNotHandled() async throws -
The batchable version of testNotHandled command above.
See also
testNotHandledDeclaration
Swift
func testNotHandledBatchable() throws -> BatchableCommand<Void> -
Whether the device supports the
testSpecificcommand for this trait.Declaration
Swift
var supportsTestSpecificCommand: Bool { get } -
Simple command without any parameters and with a specific response.
Declaration
Swift
func testSpecific() async throws -> Matter.UnitTestingTrait.TestSpecificCommandResponse -
The batchable version of testSpecific command above.
See also
testSpecificDeclaration
Swift
func testSpecificBatchable() throws -> BatchableCommand<Matter.UnitTestingTrait.TestSpecificCommandResponse> -
Whether the device supports the
testUnknownCommandcommand for this trait.Declaration
Swift
var supportsTestUnknownCommandCommand: Bool { get } -
Simple command that should not be added to the server.
Declaration
Swift
func testUnknownCommand() async throws -
The batchable version of testUnknownCommand command above.
See also
testUnknownCommandDeclaration
Swift
func testUnknownCommandBatchable() throws -> BatchableCommand<Void> -
Whether the device supports the
testAddArgumentscommand for this trait.Declaration
Swift
var supportsTestAddArgumentsCommand: Bool { get } -
Simple command that adds the two arguments passed to it.
Declaration
Swift
func testAddArguments(arg1: UInt8, arg2: UInt8) async throws -> Matter.UnitTestingTrait.TestAddArgumentsCommandResponseParameters
arg1Unsigned 8-bit integer argument. The [int8u][UnitTestingTrait.Attributes.int8u] attribute could be used for this.
arg2Unsigned 8-bit integer argument.
-
The batchable version of testAddArguments command above.
See also
testAddArgumentsDeclaration
Swift
func testAddArgumentsBatchable(arg1: UInt8, arg2: UInt8) throws -> BatchableCommand<Matter.UnitTestingTrait.TestAddArgumentsCommandResponse> -
Whether the device supports the
testSimpleArgumentRequestcommand for this trait.Declaration
Swift
var supportsTestSimpleArgumentRequestCommand: Bool { get } -
Command that takes a boolean argument.
Declaration
Swift
func testSimpleArgumentRequest(arg1: Bool) async throws -> Matter.UnitTestingTrait.TestSimpleArgumentRequestCommandResponseParameters
arg1Boolean argument.
-
The batchable version of testSimpleArgumentRequest command above.
See also
testSimpleArgumentRequestDeclaration
Swift
func testSimpleArgumentRequestBatchable(arg1: Bool) throws -> BatchableCommand<Matter.UnitTestingTrait.TestSimpleArgumentRequestCommandResponse> -
Whether the device supports the
testStructArrayArgumentRequestcommand for this trait.Declaration
Swift
var supportsTestStructArrayArgumentRequestCommand: Bool { get } -
Command that takes various arguments that are arrays, including an array of structs which have a list member.
Declaration
Swift
func testStructArrayArgumentRequest(arg1: [Matter.UnitTestingTrait.NestedStructList], arg2: [Matter.UnitTestingTrait.SimpleStruct], arg3: [Matter.UnitTestingTrait.SimpleEnum], arg4: [Bool], arg5: Matter.UnitTestingTrait.SimpleEnum, arg6: Bool) async throws -> Matter.UnitTestingTrait.TestStructArrayArgumentRequestCommandResponseParameters
arg1NestedStructListlist argument.arg2SimpleStructlist argument.arg3SimpleEnumlist argument.arg4boolean list argument.
arg5SimpleEnumargument.arg6Boolean argument.
-
The batchable version of testStructArrayArgumentRequest command above.
See also
testStructArrayArgumentRequestDeclaration
Swift
func testStructArrayArgumentRequestBatchable(arg1: [Matter.UnitTestingTrait.NestedStructList], arg2: [Matter.UnitTestingTrait.SimpleStruct], arg3: [Matter.UnitTestingTrait.SimpleEnum], arg4: [Bool], arg5: Matter.UnitTestingTrait.SimpleEnum, arg6: Bool) throws -> BatchableCommand<Matter.UnitTestingTrait.TestStructArrayArgumentRequestCommandResponse> -
Whether the device supports the
testStructArgumentRequestcommand for this trait.Declaration
Swift
var supportsTestStructArgumentRequestCommand: Bool { get } -
Unit test command.
Declaration
Swift
func testStructArgumentRequest(arg1: Matter.UnitTestingTrait.SimpleStruct) async throws -> Matter.UnitTestingTrait.TestStructArgumentRequestCommandResponseParameters
arg1SimpleStructargument. -
The batchable version of testStructArgumentRequest command above.
See also
testStructArgumentRequestDeclaration
Swift
func testStructArgumentRequestBatchable(arg1: Matter.UnitTestingTrait.SimpleStruct) throws -> BatchableCommand<Matter.UnitTestingTrait.TestStructArgumentRequestCommandResponse> -
Whether the device supports the
testNestedStructArgumentRequestcommand for this trait.Declaration
Swift
var supportsTestNestedStructArgumentRequestCommand: Bool { get } -
Unit test command.
Declaration
Swift
func testNestedStructArgumentRequest(arg1: Matter.UnitTestingTrait.NestedStruct) async throws -> Matter.UnitTestingTrait.TestNestedStructArgumentRequestCommandResponseParameters
arg1NestedStructargument. -
The batchable version of testNestedStructArgumentRequest command above.
See also
testNestedStructArgumentRequestDeclaration
Swift
func testNestedStructArgumentRequestBatchable(arg1: Matter.UnitTestingTrait.NestedStruct) throws -> BatchableCommand<Matter.UnitTestingTrait.TestNestedStructArgumentRequestCommandResponse> -
Whether the device supports the
testListStructArgumentRequestcommand for this trait.Declaration
Swift
var supportsTestListStructArgumentRequestCommand: Bool { get } -
Unit test command.
Declaration
Swift
func testListStructArgumentRequest(arg1: [Matter.UnitTestingTrait.SimpleStruct]) async throws -> Matter.UnitTestingTrait.TestListStructArgumentRequestCommandResponseParameters
arg1SimpleStructlist argument. -
The batchable version of testListStructArgumentRequest command above.
See also
testListStructArgumentRequestDeclaration
Swift
func testListStructArgumentRequestBatchable(arg1: [Matter.UnitTestingTrait.SimpleStruct]) throws -> BatchableCommand<Matter.UnitTestingTrait.TestListStructArgumentRequestCommandResponse> -
Whether the device supports the
testListInt8UArgumentRequestcommand for this trait.Declaration
Swift
var supportsTestListInt8UArgumentRequestCommand: Bool { get } -
Unit test command.
Declaration
Swift
func testListInt8UArgumentRequest(arg1: [UInt8]) async throws -> Matter.UnitTestingTrait.TestListInt8UArgumentRequestCommandResponseParameters
arg1Unsigned 8-bit integer list argument.
-
The batchable version of testListInt8UArgumentRequest command above.
See also
testListInt8UArgumentRequestDeclaration
Swift
func testListInt8UArgumentRequestBatchable(arg1: [UInt8]) throws -> BatchableCommand<Matter.UnitTestingTrait.TestListInt8UArgumentRequestCommandResponse> -
Whether the device supports the
testNestedStructListArgumentRequestcommand for this trait.Declaration
Swift
var supportsTestNestedStructListArgumentRequestCommand: Bool { get } -
Unit test command.
Declaration
Swift
func testNestedStructListArgumentRequest(arg1: Matter.UnitTestingTrait.NestedStructList) async throws -> Matter.UnitTestingTrait.TestNestedStructListArgumentRequestCommandResponseParameters
arg1NestedStructListargument. -
The batchable version of testNestedStructListArgumentRequest command above.
See also
testNestedStructListArgumentRequestDeclaration
Swift
func testNestedStructListArgumentRequestBatchable(arg1: Matter.UnitTestingTrait.NestedStructList) throws -> BatchableCommand<Matter.UnitTestingTrait.TestNestedStructListArgumentRequestCommandResponse> -
Whether the device supports the
testListNestedStructListArgumentRequestcommand for this trait.Declaration
Swift
var supportsTestListNestedStructListArgumentRequestCommand: Bool { get } -
Unit test command.
Declaration
Swift
func testListNestedStructListArgumentRequest(arg1: [Matter.UnitTestingTrait.NestedStructList]) async throws -> Matter.UnitTestingTrait.TestListNestedStructListArgumentRequestCommandResponseParameters
arg1NestedStructListargument. -
The batchable version of testListNestedStructListArgumentRequest command above.
See also
testListNestedStructListArgumentRequestDeclaration
Swift
func testListNestedStructListArgumentRequestBatchable(arg1: [Matter.UnitTestingTrait.NestedStructList]) throws -> BatchableCommand<Matter.UnitTestingTrait.TestListNestedStructListArgumentRequestCommandResponse> -
Whether the device supports the
testListInt8UReverseRequestcommand for this trait.Declaration
Swift
var supportsTestListInt8UReverseRequestCommand: Bool { get } -
Unit test command.
Declaration
Swift
func testListInt8UReverseRequest(arg1: [UInt8]) async throws -> Matter.UnitTestingTrait.TestListInt8UReverseRequestCommandResponseParameters
arg1Unsigned 8-bit integer list argument.
-
The batchable version of testListInt8UReverseRequest command above.
See also
testListInt8UReverseRequestDeclaration
Swift
func testListInt8UReverseRequestBatchable(arg1: [UInt8]) throws -> BatchableCommand<Matter.UnitTestingTrait.TestListInt8UReverseRequestCommandResponse> -
Whether the device supports the
testEnumsRequestcommand for this trait.Declaration
Swift
var supportsTestEnumsRequestCommand: Bool { get } -
Unit test command.
Declaration
Swift
func testEnumsRequest(arg1: UInt16, arg2: Matter.UnitTestingTrait.SimpleEnum) async throws -> Matter.UnitTestingTrait.TestEnumsRequestCommandResponseParameters
arg1Unsigned 16-bit integer argument.
arg2SimpleEnumargument. -
The batchable version of testEnumsRequest command above.
See also
testEnumsRequestDeclaration
Swift
func testEnumsRequestBatchable(arg1: UInt16, arg2: Matter.UnitTestingTrait.SimpleEnum) throws -> BatchableCommand<Matter.UnitTestingTrait.TestEnumsRequestCommandResponse> -
Whether the device supports the
testNullableOptionalRequestcommand for this trait.Declaration
Swift
var supportsTestNullableOptionalRequestCommand: Bool { get } -
The batchable version of testNullableOptionalRequest command above.
See also
testNullableOptionalRequest -
Whether the device supports the
testComplexNullableOptionalRequestcommand for this trait.Declaration
Swift
var supportsTestComplexNullableOptionalRequestCommand: Bool { get } -
testComplexNullableOptionalRequest(nullableInt:nullableString:nullableStruct:nullableList:optionalArgsProvider:)
Unit test command.
Declaration
Swift
func testComplexNullableOptionalRequest(nullableInt: UInt16?, nullableString: String?, nullableStruct: Matter.UnitTestingTrait.SimpleStruct?, nullableList: [Matter.UnitTestingTrait.SimpleEnum]?, optionalArgsProvider: ((Matter.UnitTestingTrait.TestComplexNullableOptionalRequestCommand.OptionalArgs) -> Void)? = nil) async throws -> Matter.UnitTestingTrait.TestComplexNullableOptionalRequestCommandResponseParameters
nullableIntUnsigned 16-bit integer argument.
nullableStringString argument.
nullableStructSimpleStructargument.nullableListSimpleEnumlist argument. -
testComplexNullableOptionalRequestBatchable(nullableInt:nullableString:nullableStruct:nullableList:optionalArgsProvider:)
The batchable version of testComplexNullableOptionalRequest command above.
See also
testComplexNullableOptionalRequestDeclaration
Swift
func testComplexNullableOptionalRequestBatchable(nullableInt: UInt16?, nullableString: String?, nullableStruct: Matter.UnitTestingTrait.SimpleStruct?, nullableList: [Matter.UnitTestingTrait.SimpleEnum]?, optionalArgsProvider: ((Matter.UnitTestingTrait.TestComplexNullableOptionalRequestCommand.OptionalArgs) -> Void)? = nil) throws -> BatchableCommand<Matter.UnitTestingTrait.TestComplexNullableOptionalRequestCommandResponse> -
Whether the device supports the
simpleStructEchoRequestcommand for this trait.Declaration
Swift
var supportsSimpleStructEchoRequestCommand: Bool { get } -
Unit test command.
Declaration
Swift
func simpleStructEchoRequest(arg1: Matter.UnitTestingTrait.SimpleStruct) async throws -> Matter.UnitTestingTrait.SimpleStructEchoRequestCommandResponseParameters
arg1SimpleStructargument. -
The batchable version of simpleStructEchoRequest command above.
See also
simpleStructEchoRequestDeclaration
Swift
func simpleStructEchoRequestBatchable(arg1: Matter.UnitTestingTrait.SimpleStruct) throws -> BatchableCommand<Matter.UnitTestingTrait.SimpleStructEchoRequestCommandResponse> -
Whether the device supports the
timedInvokeRequestcommand for this trait.Declaration
Swift
var supportsTimedInvokeRequestCommand: Bool { get } -
TimedInvokeRequest command
Declaration
Swift
func timedInvokeRequest() async throws -
The batchable version of timedInvokeRequest command above.
See also
timedInvokeRequestDeclaration
Swift
func timedInvokeRequestBatchable() throws -> BatchableCommand<Void> -
Whether the device supports the
testSimpleOptionalArgumentRequestcommand for this trait.Declaration
Swift
var supportsTestSimpleOptionalArgumentRequestCommand: Bool { get } -
Unit test command.
Declaration
Swift
func testSimpleOptionalArgumentRequest(optionalArgsProvider: ((Matter.UnitTestingTrait.TestSimpleOptionalArgumentRequestCommand.OptionalArgs) -> Void)? = nil) async throws -
The batchable version of testSimpleOptionalArgumentRequest command above.
See also
testSimpleOptionalArgumentRequestDeclaration
Swift
func testSimpleOptionalArgumentRequestBatchable(optionalArgsProvider: ((Matter.UnitTestingTrait.TestSimpleOptionalArgumentRequestCommand.OptionalArgs) -> Void)? = nil) throws -> BatchableCommand<Void> -
Whether the device supports the
testEmitTestEventRequestcommand for this trait.Declaration
Swift
var supportsTestEmitTestEventRequestCommand: Bool { get } -
Unit test command.
Declaration
Swift
func testEmitTestEventRequest(arg1: UInt8, arg2: Matter.UnitTestingTrait.SimpleEnum, arg3: Bool) async throws -> Matter.UnitTestingTrait.TestEmitTestEventRequestCommandResponseParameters
arg1Unsigned 8-bit integer argument.
arg2SimpleEnumargument.arg3Boolean argument.
-
The batchable version of testEmitTestEventRequest command above.
See also
testEmitTestEventRequestDeclaration
Swift
func testEmitTestEventRequestBatchable(arg1: UInt8, arg2: Matter.UnitTestingTrait.SimpleEnum, arg3: Bool) throws -> BatchableCommand<Matter.UnitTestingTrait.TestEmitTestEventRequestCommandResponse> -
Whether the device supports the
testEmitTestFabricScopedEventRequestcommand for this trait.Declaration
Swift
var supportsTestEmitTestFabricScopedEventRequestCommand: Bool { get } -
Unit test command.
Declaration
Swift
func testEmitTestFabricScopedEventRequest(arg1: UInt8) async throws -> Matter.UnitTestingTrait.TestEmitTestFabricScopedEventRequestCommandResponseParameters
arg1Unsigned 8-bit integer argument.
-
The batchable version of testEmitTestFabricScopedEventRequest command above.
See also
testEmitTestFabricScopedEventRequestDeclaration
Swift
func testEmitTestFabricScopedEventRequestBatchable(arg1: UInt8) throws -> BatchableCommand<Matter.UnitTestingTrait.TestEmitTestFabricScopedEventRequestCommandResponse> -
Whether the device supports the
testBatchHelperRequestcommand for this trait.Declaration
Swift
var supportsTestBatchHelperRequestCommand: Bool { get } -
The batchable version of testBatchHelperRequest command above.
See also
testBatchHelperRequestDeclaration
Swift
func testBatchHelperRequestBatchable(sleepBeforeResponseTimeMs: UInt16, sizeOfResponseBuffer: UInt16, fillCharacter: UInt8) throws -> BatchableCommand<Matter.UnitTestingTrait.TestBatchHelperRequestCommandResponse> -
Whether the device supports the
testSecondBatchHelperRequestcommand for this trait.Declaration
Swift
var supportsTestSecondBatchHelperRequestCommand: Bool { get } -
testSecondBatchHelperRequestBatchable(sleepBeforeResponseTimeMs:sizeOfResponseBuffer:fillCharacter:)
The batchable version of testSecondBatchHelperRequest command above.
See also
testSecondBatchHelperRequestDeclaration
Swift
func testSecondBatchHelperRequestBatchable(sleepBeforeResponseTimeMs: UInt16, sizeOfResponseBuffer: UInt16, fillCharacter: UInt8) throws -> BatchableCommand<Matter.UnitTestingTrait.TestSecondBatchHelperRequestCommandResponse> -
Whether the device supports the
stringEchoRequestcommand for this trait.Declaration
Swift
var supportsStringEchoRequestCommand: Bool { get } -
The batchable version of stringEchoRequest command above.
See also
stringEchoRequestDeclaration
Swift
func stringEchoRequestBatchable(payload: Data) throws -> BatchableCommand<Matter.UnitTestingTrait.StringEchoRequestCommandResponse> -
Whether the device supports the
globalEchoRequestcommand for this trait.Declaration
Swift
var supportsGlobalEchoRequestCommand: Bool { get } -
The batchable version of globalEchoRequest command above.
See also
globalEchoRequest -
Whether the device supports the
testCheckCommandFlagscommand for this trait.Declaration
Swift
var supportsTestCheckCommandFlagsCommand: Bool { get } -
The batchable version of testCheckCommandFlags command above.
See also
testCheckCommandFlagsDeclaration
Swift
func testCheckCommandFlagsBatchable() throws -> BatchableCommand<Void> -
Whether the device supports the
testDifferentVendorMeiRequestcommand for this trait.Declaration
Swift
var supportsTestDifferentVendorMeiRequestCommand: Bool { get } -
The batchable version of testDifferentVendorMeiRequest command above.
See also
testDifferentVendorMeiRequestDeclaration
Swift
func testDifferentVendorMeiRequestBatchable(arg1: UInt8) throws -> BatchableCommand<Matter.UnitTestingTrait.TestDifferentVendorMeiRequestCommandResponse> -
A simple enum, as used by commands such as
TestEmitTestEventRequestCommandandTestComplexNullableOptionalRequestCommand.Declaration
Swift
enum SimpleEnum -
Bitmap16MaskMap
Declaration
Swift
struct Bitmap16MaskMap -
Bitmap32MaskMap. Could be used with [nullableBitmap32][UnitTestingTrait.Attributes.nullableBitmap64].
Declaration
Swift
struct Bitmap32MaskMap -
Bitmap64MaskMap. Could be used with [nullableBitmap64].
Declaration
Swift
struct Bitmap64MaskMap -
Bitmap8MaskMap
Declaration
Swift
struct Bitmap8MaskMap -
SimpleBitmap
Declaration
Swift
struct SimpleBitmap