Package apple.matter

Class MTRBaseDevice

  • All Implemented Interfaces:
    NSObject

    public class MTRBaseDevice
    extends NSObject
    • Constructor Detail

      • MTRBaseDevice

        protected MTRBaseDevice​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static MTRBaseDevice allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(@NotNull
                                                                   @NotNull java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(@NotNull
                                                                   @NotNull java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(@NotNull
                                                                                 @NotNull java.lang.Object aTarget,
                                                                                 @NotNull
                                                                                 @NotNull org.moe.natj.objc.SEL aSelector,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        @NotNull
        public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        @NotNull
        public static @NotNull org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • deregisterReportHandlersWithQueueCompletion

        public void deregisterReportHandlersWithQueueCompletion​(@NotNull
                                                                @NotNull dispatch_queue_t queue,
                                                                @NotNull
                                                                @NotNull MTRBaseDevice.Block_deregisterReportHandlersWithQueueCompletion completion)
        Deregister all local report handlers for a remote device This method is applicable only for a remote device. For a local device, the stack has to be shutdown to stop report handlers. There could be multiple clients accessing a node through a remote controller object and hence it is not appropriate for one of those clients to shut down the entire stack to stop receiving reports. API-Since: 16.4
      • description_static

        public static java.lang.String description_static()
      • deviceWithNodeIDController

        @NotNull
        public static @NotNull MTRBaseDevice deviceWithNodeIDController​(@NotNull
                                                                        @NotNull NSNumber nodeID,
                                                                        @NotNull
                                                                        @NotNull MTRDeviceController controller)
        Create a device object with the given node id and controller. This will always succeed, even if there is no such node id on the controller's fabric, but attempts to actually use the MTRBaseDevice will fail (asynchronously) in that case. API-Since: 16.4
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • invokeCommandWithEndpointIDClusterIDCommandIDCommandFieldsTimedInvokeTimeoutQueueCompletion

        public void invokeCommandWithEndpointIDClusterIDCommandIDCommandFieldsTimedInvokeTimeoutQueueCompletion​(@NotNull
                                                                                                                @NotNull NSNumber endpointID,
                                                                                                                @NotNull
                                                                                                                @NotNull NSNumber clusterID,
                                                                                                                @NotNull
                                                                                                                @NotNull NSNumber commandID,
                                                                                                                @NotNull
                                                                                                                @NotNull java.lang.Object commandFields,
                                                                                                                @Nullable
                                                                                                                @Nullable NSNumber timeoutMs,
                                                                                                                @NotNull
                                                                                                                @NotNull dispatch_queue_t queue,
                                                                                                                @NotNull
                                                                                                                @NotNull MTRBaseDevice.Block_invokeCommandWithEndpointIDClusterIDCommandIDCommandFieldsTimedInvokeTimeoutQueueCompletion completion)
        Invoke a command with a designated command path
        Parameters:
        commandFields - command fields object. The object must be a data-value NSDictionary object as described in the MTRDeviceResponseHandler. The attribute must be a Structure, i.e., the NSDictionary MTRTypeKey key must have the value MTRStructureValueType.
        timeoutMs - timeout in milliseconds for timed invoke, or nil.
        completion - response handler will receive either values or error. A path-specific error status from the command invocation will result in an error being passed to the completion, so values will only be passed in when the command succeeds. API-Since: 16.4
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        @NotNull
        public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(@NotNull
                                                                                             @NotNull java.lang.String key)
      • openCommissioningWindowWithDiscriminatorDurationQueueCompletion

        public void openCommissioningWindowWithDiscriminatorDurationQueueCompletion​(@NotNull
                                                                                    @NotNull NSNumber discriminator,
                                                                                    @NotNull
                                                                                    @NotNull NSNumber duration,
                                                                                    @NotNull
                                                                                    @NotNull dispatch_queue_t queue,
                                                                                    @NotNull
                                                                                    @NotNull MTRBaseDevice.Block_openCommissioningWindowWithDiscriminatorDurationQueueCompletion completion)
        Open a commissioning window on the device, using a random setup passcode. On success, completion will be called on queue with the MTRSetupPayload that can be used to commission the device.
        Parameters:
        discriminator - The discriminator to use for the commissionable advertisement.
        duration - Duration, in seconds, during which the commissioning window will be open. API-Since: 17.0
      • openCommissioningWindowWithSetupPasscodeDiscriminatorDurationQueueCompletion

        public void openCommissioningWindowWithSetupPasscodeDiscriminatorDurationQueueCompletion​(@NotNull
                                                                                                 @NotNull NSNumber setupPasscode,
                                                                                                 @NotNull
                                                                                                 @NotNull NSNumber discriminator,
                                                                                                 @NotNull
                                                                                                 @NotNull NSNumber duration,
                                                                                                 @NotNull
                                                                                                 @NotNull dispatch_queue_t queue,
                                                                                                 @NotNull
                                                                                                 @NotNull MTRBaseDevice.Block_openCommissioningWindowWithSetupPasscodeDiscriminatorDurationQueueCompletion completion)
        Open a commissioning window on the device. On success, completion will be called on queue with the MTRSetupPayload that can be used to commission the device.
        Parameters:
        setupPasscode - The setup passcode to use for the commissioning window. See MTRSetupPayload's generateRandomSetupPasscode for generating a valid random passcode.
        discriminator - The discriminator to use for the commissionable advertisement.
        duration - Duration, in seconds, during which the commissioning window will be open. API-Since: 16.2
      • readAttributePathsEventPathsParamsQueueCompletion

        public void readAttributePathsEventPathsParamsQueueCompletion​(@Nullable
                                                                      @Nullable NSArray<? extends MTRAttributeRequestPath> attributePaths,
                                                                      @Nullable
                                                                      @Nullable NSArray<? extends MTREventRequestPath> eventPaths,
                                                                      @Nullable
                                                                      @Nullable MTRReadParams params,
                                                                      @NotNull
                                                                      @NotNull dispatch_queue_t queue,
                                                                      @NotNull
                                                                      @NotNull MTRBaseDevice.Block_readAttributePathsEventPathsParamsQueueCompletion completion)
        Reads multiple attribute or event paths from the device. Nil is treated as an empty array for attributePaths and eventPaths. Lists of attribute and event paths to read can be provided via attributePaths and eventPaths. The completion will be called with an error if the entire read interaction fails. Otherwise it will be called with an array of values. This array may be empty (e.g. if no paths matched the wildcard paths passed in, or if empty lists of paths were passed in) or may include per-path errors if particular paths failed. If the sum of the lengths of attributePaths and eventPaths exceeds 9, the read may fail due to the device not supporting that many read paths. API-Since: 17.0
      • readAttributesWithEndpointIDClusterIDAttributeIDParamsQueueCompletion

        public void readAttributesWithEndpointIDClusterIDAttributeIDParamsQueueCompletion​(@Nullable
                                                                                          @Nullable NSNumber endpointID,
                                                                                          @Nullable
                                                                                          @Nullable NSNumber clusterID,
                                                                                          @Nullable
                                                                                          @Nullable NSNumber attributeID,
                                                                                          @Nullable
                                                                                          @Nullable MTRReadParams params,
                                                                                          @NotNull
                                                                                          @NotNull dispatch_queue_t queue,
                                                                                          @NotNull
                                                                                          @NotNull MTRBaseDevice.Block_readAttributesWithEndpointIDClusterIDAttributeIDParamsQueueCompletion completion)
        Reads attributes from the device. Nil values for endpointID, clusterID, attributeID indicate wildcards (e.g. nil attributeID means "read all the attributes from the endpoint(s) and cluster(s) that match endpointID/clusterID"). If all of endpointID, clusterID, attributeID are non-nil, a single attribute will be read. If all of endpointID, clusterID, attributeID are nil, all attributes on the device will be read. A non-nil attributeID along with a nil clusterID will only succeed if the attribute ID is for a global attribute that applies to all clusters. The completion will be called with an error if the entire read interaction fails. Otherwise it will be called with values, which may be empty (e.g. if no paths matched the wildcard) or may include per-path errors if particular paths failed. API-Since: 16.4
      • readEventsWithEndpointIDClusterIDEventIDParamsQueueCompletion

        public void readEventsWithEndpointIDClusterIDEventIDParamsQueueCompletion​(@Nullable
                                                                                  @Nullable NSNumber endpointID,
                                                                                  @Nullable
                                                                                  @Nullable NSNumber clusterID,
                                                                                  @Nullable
                                                                                  @Nullable NSNumber eventID,
                                                                                  @Nullable
                                                                                  @Nullable MTRReadParams params,
                                                                                  @NotNull
                                                                                  @NotNull dispatch_queue_t queue,
                                                                                  @NotNull
                                                                                  @NotNull MTRBaseDevice.Block_readEventsWithEndpointIDClusterIDEventIDParamsQueueCompletion completion)
        Reads events from the device. Nil values for endpointID, clusterID, eventID indicate wildcards (e.g. nil eventID means "read all the events from the endpoint(s) and cluster(s) that match endpointID/clusterID"). If all of endpointID, clusterID, eventID are non-nil, all the matching instances of a single event will be read. If all of endpointID, clusterID, eventID are nil, all events on the device will be read. The completion will be called with an error if the entire read interaction fails. Otherwise it will be called with values, which may be empty (e.g. if no paths matched the wildcard) or may include per-path errors if particular paths failed. API-Since: 16.4
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • sessionTransportType

        public byte sessionTransportType()
        The transport used by the current session with this device, or `MTRTransportTypeUndefined` if no session is currently active. API-Since: 16.4
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • subscribeToAttributesWithEndpointIDClusterIDAttributeIDParamsQueueReportHandlerSubscriptionEstablished

        public void subscribeToAttributesWithEndpointIDClusterIDAttributeIDParamsQueueReportHandlerSubscriptionEstablished​(@Nullable
                                                                                                                           @Nullable NSNumber endpointID,
                                                                                                                           @Nullable
                                                                                                                           @Nullable NSNumber clusterID,
                                                                                                                           @Nullable
                                                                                                                           @Nullable NSNumber attributeID,
                                                                                                                           @Nullable
                                                                                                                           @Nullable MTRSubscribeParams params,
                                                                                                                           @NotNull
                                                                                                                           @NotNull dispatch_queue_t queue,
                                                                                                                           @NotNull
                                                                                                                           @NotNull MTRBaseDevice.Block_subscribeToAttributesWithEndpointIDClusterIDAttributeIDParamsQueueReportHandlerSubscriptionEstablished_5 reportHandler,
                                                                                                                           @Nullable
                                                                                                                           @Nullable MTRBaseDevice.Block_subscribeToAttributesWithEndpointIDClusterIDAttributeIDParamsQueueReportHandlerSubscriptionEstablished_6 subscriptionEstablished)
        Subscribes to the specified attributes on the device. Nil values for endpointID, clusterID, attributeID indicate wildcards (e.g. nil attributeID means "subscribe to all the attributes from the endpoint(s) and cluster(s) that match endpointID/clusterID"). If all of endpointID, clusterID, attributeID are non-nil, a single attribute will be subscribed to. If all of endpointID, clusterID, attributeID are nil, all attributes on the device will be subscribed to. A non-nil attributeID along with a nil clusterID will only succeed if the attribute ID is for a global attribute that applies to all clusters. The reportHandler will be called with an error if the subscription fails entirely. The reportHandler will be called with arrays of response-value dictionaries (which may be data or errors) as path-specific data is received. subscriptionEstablished will be called when the subscription is first successfully established (after the initial set of data reports has been delivered to reportHandler). If params allow automatic resubscription, it will be called any time resubscription succeeds. API-Since: 16.4
      • subscribeToEventsWithEndpointIDClusterIDEventIDParamsQueueReportHandlerSubscriptionEstablished

        public void subscribeToEventsWithEndpointIDClusterIDEventIDParamsQueueReportHandlerSubscriptionEstablished​(@Nullable
                                                                                                                   @Nullable NSNumber endpointID,
                                                                                                                   @Nullable
                                                                                                                   @Nullable NSNumber clusterID,
                                                                                                                   @Nullable
                                                                                                                   @Nullable NSNumber eventID,
                                                                                                                   @Nullable
                                                                                                                   @Nullable MTRSubscribeParams params,
                                                                                                                   @NotNull
                                                                                                                   @NotNull dispatch_queue_t queue,
                                                                                                                   @NotNull
                                                                                                                   @NotNull MTRBaseDevice.Block_subscribeToEventsWithEndpointIDClusterIDEventIDParamsQueueReportHandlerSubscriptionEstablished_5 reportHandler,
                                                                                                                   @Nullable
                                                                                                                   @Nullable MTRBaseDevice.Block_subscribeToEventsWithEndpointIDClusterIDEventIDParamsQueueReportHandlerSubscriptionEstablished_6 subscriptionEstablished)
        Subscribes to the specified events on the device. Nil values for endpointID, clusterID, eventID indicate wildcards (e.g. nil eventID means "subscribe to all the events from the endpoint(s) and cluster(s) that match endpointID/clusterID"). If all of endpointID, clusterID, eventID are non-nil, a single event will be subscribed to. If all of endpointID, clusterID, eventID are nil, all events on the device will be subscribed to. The reportHandler will be called with an error if the subscription fails entirely. The reportHandler will be called with arrays of response-value dictionaries (which may be data or errors) as path-specific data is received. subscriptionEstablished will be called when the subscription is first successfully established (after the initial set of data reports has been delivered to reportHandler). If params allow automatic resubscription, it will be called any time resubscription succeeds. API-Since: 16.4
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.
      • version_static

        public static long version_static()
      • writeAttributeWithEndpointIDClusterIDAttributeIDValueTimedWriteTimeoutQueueCompletion

        public void writeAttributeWithEndpointIDClusterIDAttributeIDValueTimedWriteTimeoutQueueCompletion​(@NotNull
                                                                                                          @NotNull NSNumber endpointID,
                                                                                                          @NotNull
                                                                                                          @NotNull NSNumber clusterID,
                                                                                                          @NotNull
                                                                                                          @NotNull NSNumber attributeID,
                                                                                                          @NotNull
                                                                                                          @NotNull java.lang.Object value,
                                                                                                          @Nullable
                                                                                                          @Nullable NSNumber timeoutMs,
                                                                                                          @NotNull
                                                                                                          @NotNull dispatch_queue_t queue,
                                                                                                          @NotNull
                                                                                                          @NotNull MTRBaseDevice.Block_writeAttributeWithEndpointIDClusterIDAttributeIDValueTimedWriteTimeoutQueueCompletion completion)
        Write to attribute in a designated attribute path
        Parameters:
        value - A data-value NSDictionary object as described in MTRDeviceResponseHandler.
        timeoutMs - timeout in milliseconds for timed write, or nil.
        completion - response handler will receive either values or error. A path-specific error status will get turned into an error passed to the completion, so values will only be passed in when the write succeeds. In that case, values will have the format documented in the definition of MTRDeviceResponseHandler and will be an array with a single element which is a dictionary that has a MTRAttributePathKey entry in it, whose value is the attribute path that was successfully written to. API-Since: 16.4