struct UnitTestingTrait
A 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.parseError
when parsing fails.Declaration
Swift
init(decoder: TraitDecoder, interactionProxy: (any InteractionProxy)?, metadata: TraitMetadata) throws
Parameters
decoder
The raw data representing this Trait.
interactionProxy
Proxy to the Interaction Client.
metadata
Metadata about this Trait.
-
Writes this object to the given
TraitEncoder
. ThrowsHomeError.encodingFailed
if 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
HomeError
s 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
a
andb
,a == b
implies thata != b
isfalse
.Declaration
Parameters
lhs
A value to compare.
rhs
Another value to compare.
-
Hashes the essential components of this value by feeding them into the given hasher.
Implement this method to conform to the
Hashable
protocol. 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 thehasher
instance 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
test
command 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
testNotHandled
command 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
testSpecific
command 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
testUnknownCommand
command 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
testAddArguments
command 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.TestAddArgumentsCommandResponse
Parameters
arg1
Unsigned 8-bit integer argument. The [int8u][UnitTestingTrait.Attributes.int8u] attribute could be used for this.
arg2
Unsigned 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
testSimpleArgumentRequest
command 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.TestSimpleArgumentRequestCommandResponse
Parameters
arg1
Boolean 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
testStructArrayArgumentRequest
command 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.TestStructArrayArgumentRequestCommandResponse
Parameters
arg1
NestedStructList
list argument.arg2
SimpleStruct
list argument.arg3
SimpleEnum
list argument.arg4
boolean list argument.
arg5
SimpleEnum
argument.arg6
Boolean 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
testStructArgumentRequest
command for this trait.Declaration
Swift
var supportsTestStructArgumentRequestCommand: Bool { get }
-
Unit test command.
Declaration
Swift
func testStructArgumentRequest(arg1: Matter.UnitTestingTrait.SimpleStruct) async throws -> Matter.UnitTestingTrait.TestStructArgumentRequestCommandResponse
Parameters
arg1
SimpleStruct
argument. -
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
testNestedStructArgumentRequest
command for this trait.Declaration
Swift
var supportsTestNestedStructArgumentRequestCommand: Bool { get }
-
Unit test command.
Declaration
Swift
func testNestedStructArgumentRequest(arg1: Matter.UnitTestingTrait.NestedStruct) async throws -> Matter.UnitTestingTrait.TestNestedStructArgumentRequestCommandResponse
Parameters
arg1
NestedStruct
argument. -
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
testListStructArgumentRequest
command for this trait.Declaration
Swift
var supportsTestListStructArgumentRequestCommand: Bool { get }
-
Unit test command.
Declaration
Swift
func testListStructArgumentRequest(arg1: [Matter.UnitTestingTrait.SimpleStruct]) async throws -> Matter.UnitTestingTrait.TestListStructArgumentRequestCommandResponse
Parameters
arg1
SimpleStruct
list 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
testListInt8UArgumentRequest
command for this trait.Declaration
Swift
var supportsTestListInt8UArgumentRequestCommand: Bool { get }
-
Unit test command.
Declaration
Swift
func testListInt8UArgumentRequest(arg1: [UInt8]) async throws -> Matter.UnitTestingTrait.TestListInt8UArgumentRequestCommandResponse
Parameters
arg1
Unsigned 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
testNestedStructListArgumentRequest
command for this trait.Declaration
Swift
var supportsTestNestedStructListArgumentRequestCommand: Bool { get }
-
Unit test command.
Declaration
Swift
func testNestedStructListArgumentRequest(arg1: Matter.UnitTestingTrait.NestedStructList) async throws -> Matter.UnitTestingTrait.TestNestedStructListArgumentRequestCommandResponse
Parameters
arg1
NestedStructList
argument. -
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
testListNestedStructListArgumentRequest
command for this trait.Declaration
Swift
var supportsTestListNestedStructListArgumentRequestCommand: Bool { get }
-
Unit test command.
Declaration
Swift
func testListNestedStructListArgumentRequest(arg1: [Matter.UnitTestingTrait.NestedStructList]) async throws -> Matter.UnitTestingTrait.TestListNestedStructListArgumentRequestCommandResponse
Parameters
arg1
NestedStructList
argument. -
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
testListInt8UReverseRequest
command for this trait.Declaration
Swift
var supportsTestListInt8UReverseRequestCommand: Bool { get }
-
Unit test command.
Declaration
Swift
func testListInt8UReverseRequest(arg1: [UInt8]) async throws -> Matter.UnitTestingTrait.TestListInt8UReverseRequestCommandResponse
Parameters
arg1
Unsigned 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
testEnumsRequest
command 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.TestEnumsRequestCommandResponse
Parameters
arg1
Unsigned 16-bit integer argument.
arg2
SimpleEnum
argument. -
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
testNullableOptionalRequest
command for this trait.Declaration
Swift
var supportsTestNullableOptionalRequestCommand: Bool { get }
-
The batchable version of testNullableOptionalRequest command above.
See also
testNullableOptionalRequest -
Whether the device supports the
testComplexNullableOptionalRequest
command 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.TestComplexNullableOptionalRequestCommandResponse
Parameters
nullableInt
Unsigned 16-bit integer argument.
nullableString
String argument.
nullableStruct
SimpleStruct
argument.nullableList
SimpleEnum
list 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
simpleStructEchoRequest
command for this trait.Declaration
Swift
var supportsSimpleStructEchoRequestCommand: Bool { get }
-
Unit test command.
Declaration
Swift
func simpleStructEchoRequest(arg1: Matter.UnitTestingTrait.SimpleStruct) async throws -> Matter.UnitTestingTrait.SimpleStructEchoRequestCommandResponse
Parameters
arg1
SimpleStruct
argument. -
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
timedInvokeRequest
command 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
testSimpleOptionalArgumentRequest
command 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
testEmitTestEventRequest
command 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.TestEmitTestEventRequestCommandResponse
Parameters
arg1
Unsigned 8-bit integer argument.
arg2
SimpleEnum
argument.arg3
Boolean 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
testEmitTestFabricScopedEventRequest
command for this trait.Declaration
Swift
var supportsTestEmitTestFabricScopedEventRequestCommand: Bool { get }
-
Unit test command.
Declaration
Swift
func testEmitTestFabricScopedEventRequest(arg1: UInt8) async throws -> Matter.UnitTestingTrait.TestEmitTestFabricScopedEventRequestCommandResponse
Parameters
arg1
Unsigned 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
testBatchHelperRequest
command 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
testSecondBatchHelperRequest
command 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
stringEchoRequest
command 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
globalEchoRequest
command for this trait.Declaration
Swift
var supportsGlobalEchoRequestCommand: Bool { get }
-
The batchable version of globalEchoRequest command above.
See also
globalEchoRequest -
Whether the device supports the
testDifferentVendorMeiRequest
command 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
TestEmitTestEventRequestCommand
andTestComplexNullableOptionalRequestCommand
.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