Package apple.matter

Class MTRDeviceController

  • All Implemented Interfaces:
    NSObject

    public class MTRDeviceController
    extends NSObject
    • Constructor Detail

      • MTRDeviceController

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

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static MTRDeviceController allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • attestationChallengeForDeviceID

        @Nullable
        public @Nullable NSData attestationChallengeForDeviceID​(@NotNull
                                                                @NotNull NSNumber deviceID)
        Return the attestation challenge for the secure session of the device being commissioned. Attempts to retrieve the attestation challenge for a commissionee with the given Device ID. Returns nil if given Device ID does not match an active commissionee, or if a Secure Session is not availale. API-Since: 16.4
      • automaticallyNotifiesObserversForKey

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

        public boolean cancelCommissioningForNodeIDError​(@NotNull
                                                         @NotNull NSNumber nodeID,
                                                         @Nullable
                                                         @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Cancel commissioning for the given node id. This will shut down any existing commissioning session for that node id. API-Since: 16.4
      • 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()
      • commissionDeviceCommissioningParamsError

        @Deprecated
        public boolean commissionDeviceCommissioningParamsError​(long deviceId,
                                                                @NotNull
                                                                @NotNull MTRCommissioningParameters commissioningParams,
                                                                @Nullable
                                                                @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Deprecated.
        API-Since: 16.1 Deprecated-Since: 16.4 Deprecated-Message: Please use commissionNodeWithID:commissioningParams:error:
      • commissionNodeWithIDCommissioningParamsError

        public boolean commissionNodeWithIDCommissioningParamsError​(@NotNull
                                                                    @NotNull NSNumber nodeID,
                                                                    @NotNull
                                                                    @NotNull MTRCommissioningParameters commissioningParams,
                                                                    @Nullable
                                                                    @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Commission the node with the given node ID. The node ID must match the node ID that was used to set up the commissioning session. API-Since: 16.4
      • computePASEVerifierForSetupPasscodeIterationsSaltError

        @Nullable
        public static @Nullable NSData computePASEVerifierForSetupPasscodeIterationsSaltError​(@NotNull
                                                                                              @NotNull NSNumber setupPasscode,
                                                                                              @NotNull
                                                                                              @NotNull NSNumber iterations,
                                                                                              @NotNull
                                                                                              @NotNull NSData salt,
                                                                                              @Nullable
                                                                                              @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Compute a PASE verifier for the desired setup passcode.
      • computePaseVerifierIterationsSalt

        @Deprecated
        @Nullable
        public @Nullable NSData computePaseVerifierIterationsSalt​(int setupPincode,
                                                                  int iterations,
                                                                  @NotNull
                                                                  @NotNull NSData salt)
        Deprecated.
        API-Since: 16.1 Deprecated-Since: 16.4 Deprecated-Message: Please use computePASEVerifierForSetupPasscode:iterations:salt:error:
      • continueCommissioningDeviceIgnoreAttestationFailureError

        public boolean continueCommissioningDeviceIgnoreAttestationFailureError​(@NotNull
                                                                                @NotNull org.moe.natj.general.ptr.VoidPtr opaqueDeviceHandle,
                                                                                boolean ignoreAttestationFailure,
                                                                                @Nullable
                                                                                @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Call this method after MTRDeviceAttestationDelegate deviceAttestationFailedForController:opaqueDeviceHandle:error: or deviceAttestationCompletedForController:opaqueDeviceHandle:attestationDeviceInfo:error: is called to continue commissioning the device.
      • controllerNodeID

        @Nullable
        public @Nullable NSNumber controllerNodeID()
        Return the Node ID assigned to the controller. Will return nil if the controller is not running (and hence does not know its node id). API-Since: 16.4
      • controllerNodeId

        @Deprecated
        @Nullable
        public @Nullable NSNumber controllerNodeId()
        Deprecated.
        API-Since: 16.1 Deprecated-Since: 16.4 Deprecated-Message: Please use controllerNodeID
      • debugDescription_static

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

        @Nullable
        public static @Nullable MTRReadParams decodeXPCReadParams​(@Nullable
                                                                  @Nullable NSDictionary<java.lang.String,​?> params)
        Returns a deserialized read parameter object from an object received over XPC
      • decodeXPCResponseValues

        @Nullable
        public static @Nullable NSArray<? extends NSDictionary<java.lang.String,​?>> decodeXPCResponseValues​(@Nullable
                                                                                                                  @Nullable NSArray<? extends NSDictionary<java.lang.String,​?>> values)
        Returns a decoded values object from a values object received from XPC for read, write and command interactions
      • decodeXPCSubscribeParams

        @Nullable
        public static @Nullable MTRSubscribeParams decodeXPCSubscribeParams​(@Nullable
                                                                            @Nullable NSDictionary<java.lang.String,​?> params)
        Returns a deserialized subscribe parameter object from an object received over XPC
      • description_static

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

        @Nullable
        public @Nullable MTRBaseDevice deviceBeingCommissionedWithNodeIDError​(@NotNull
                                                                              @NotNull NSNumber nodeID,
                                                                              @Nullable
                                                                              @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Get an MTRBaseDevice for a commissioning session that was set up for the given node ID. Returns nil if no such commissioning session is available. API-Since: 16.4
      • encodeXPCReadParams

        @Nullable
        public static @Nullable NSDictionary<java.lang.String,​?> encodeXPCReadParams​(@NotNull
                                                                                           @NotNull MTRReadParams params)
        Returns a serialized read parameter object to send over XPC
      • encodeXPCResponseValues

        @Nullable
        public static @Nullable NSArray<? extends NSDictionary<java.lang.String,​?>> encodeXPCResponseValues​(@Nullable
                                                                                                                  @Nullable NSArray<? extends NSDictionary<java.lang.String,​?>> values)
        Returns an encoded values object to send over XPC for read, write and command interactions
      • encodeXPCSubscribeParams

        @Nullable
        public static @Nullable NSDictionary<java.lang.String,​?> encodeXPCSubscribeParams​(@Nullable
                                                                                                @Nullable MTRSubscribeParams params)
        Returns a serialized subscribe parameter object to send over XPC
      • fetchAttestationChallengeForDeviceId

        @Deprecated
        @Nullable
        public @Nullable NSData fetchAttestationChallengeForDeviceId​(long deviceId)
        Deprecated.
        API-Since: 16.1 Deprecated-Since: 16.4 Deprecated-Message: Please use attestationChallengeForDeviceID
      • getBaseDeviceQueueCompletionHandler

        @Deprecated
        public boolean getBaseDeviceQueueCompletionHandler​(long deviceID,
                                                           @NotNull
                                                           @NotNull dispatch_queue_t queue,
                                                           @NotNull
                                                           @NotNull MTRDeviceController.Block_getBaseDeviceQueueCompletionHandler completionHandler)
        Deprecated.
        API-Since: 16.1 Deprecated-Since: 16.4 Deprecated-Message: Please use [MTRBaseDevice deviceWithNodeID:controller:]
      • getDeviceBeingCommissionedError

        @Deprecated
        @Nullable
        public @Nullable MTRBaseDevice getDeviceBeingCommissionedError​(long deviceId,
                                                                       @Nullable
                                                                       @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Deprecated.
        API-Since: 16.1 Deprecated-Since: 16.4 Deprecated-Message: Please use deviceBeingCommissionedWithNodeID:error:
      • 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)
      • isRunning

        public boolean isRunning()
        If true, the controller has not been shut down yet.
      • 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)
      • openPairingWindowDurationError

        @Deprecated
        public boolean openPairingWindowDurationError​(long deviceID,
                                                      long duration,
                                                      @Nullable
                                                      @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Deprecated.
        API-Since: 16.1 Deprecated-Since: 16.4 Deprecated-Message: Please use MTRDevice or MTRBaseDevice openCommissioningWindowWithSetupPasscode
      • openPairingWindowWithPINDurationDiscriminatorSetupPINError

        @Deprecated
        @Nullable
        public @Nullable java.lang.String openPairingWindowWithPINDurationDiscriminatorSetupPINError​(long deviceID,
                                                                                                     long duration,
                                                                                                     long discriminator,
                                                                                                     long setupPIN,
                                                                                                     @Nullable
                                                                                                     @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Deprecated.
        API-Since: 16.1 Deprecated-Since: 16.4 Deprecated-Message: Please use MTRDevice or MTRBaseDevice openCommissioningWindowWithSetupPasscode
      • pairDeviceAddressPortSetupPINCodeError

        @Deprecated
        public boolean pairDeviceAddressPortSetupPINCodeError​(long deviceID,
                                                              @NotNull
                                                              @NotNull java.lang.String address,
                                                              char port,
                                                              int setupPINCode,
                                                              @Nullable
                                                              @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Deprecated.
        API-Since: 16.1 Deprecated-Since: 16.4 Deprecated-Message: Please use setupCommissioningSessionWithPayload:newNodeID:error:
      • pairDeviceDiscriminatorSetupPINCodeError

        @Deprecated
        public boolean pairDeviceDiscriminatorSetupPINCodeError​(long deviceID,
                                                                char discriminator,
                                                                int setupPINCode,
                                                                @Nullable
                                                                @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Deprecated.
        API-Since: 16.1 Deprecated-Since: 16.4 Deprecated-Message: Please use setupCommissioningSessionWithPayload:newNodeID:error:
      • pairDeviceOnboardingPayloadError

        @Deprecated
        public boolean pairDeviceOnboardingPayloadError​(long deviceID,
                                                        @NotNull
                                                        @NotNull java.lang.String onboardingPayload,
                                                        @Nullable
                                                        @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Deprecated.
        API-Since: 16.1 Deprecated-Since: 16.4 Deprecated-Message: Please use setupCommissioningSessionWithPayload:newNodeID:error:
      • preWarmCommissioningSession

        public void preWarmCommissioningSession()
        Optionally pre-warm the controller for setting up a commissioning session. This may be called before setupCommissioningSessionWithPayload if it's known that a commissioning attempt will soon take place but the commissioning payload is not known yet. For example this may do a BLE scan in advance so results are ready earlier once the discriminator is known. 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)
      • setDeviceControllerDelegateQueue

        public void setDeviceControllerDelegateQueue​(@NotNull
                                                     @NotNull MTRDeviceControllerDelegate delegate,
                                                     @NotNull
                                                     @NotNull dispatch_queue_t queue)
        Set the Delegate for the device controller as well as the Queue on which the Delegate callbacks will be triggered
      • setNocChainIssuerQueue

        @Deprecated
        public void setNocChainIssuerQueue​(@NotNull
                                           @NotNull MTRNOCChainIssuer nocChainIssuer,
                                           @NotNull
                                           @NotNull dispatch_queue_t queue)
        Deprecated.
        API-Since: 16.1 Deprecated-Since: 16.4 Deprecated-Message: Please set the operationalCertificateIssuer in the MTRDeviceControllerStartupParams instead.
      • setPairingDelegateQueue

        @Deprecated
        public void setPairingDelegateQueue​(@NotNull
                                            @NotNull MTRDevicePairingDelegate delegate,
                                            @NotNull
                                            @NotNull dispatch_queue_t queue)
        Deprecated.
        API-Since: 16.1 Deprecated-Since: 16.4 Deprecated-Message: Please use setDeviceControllerDelegate:
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • setupCommissioningSessionWithDiscoveredDevicePayloadNewNodeIDError

        public boolean setupCommissioningSessionWithDiscoveredDevicePayloadNewNodeIDError​(@NotNull
                                                                                          @NotNull MTRCommissionableBrowserResult discoveredDevice,
                                                                                          @NotNull
                                                                                          @NotNull MTRSetupPayload payload,
                                                                                          @NotNull
                                                                                          @NotNull NSNumber newNodeID,
                                                                                          @Nullable
                                                                                          @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Set up a commissioning session for a device, using the provided discovered result to connect to it. [@error] error indication if the commissioning session establishment can't start at all. The connection information for the device will be retrieved from the discovered device. A device discovered over DNS-SD will use the discovered IPs/ports, while a device discovered over BLE will use the underlying CBPeripheral. Then a PASE session will be established with the device, unless an error occurs. MTRDeviceControllerDelegate will be notified as follows: * Invalid connection information: onStatusUpdate with MTRCommissioningStatusFailed. * Commissioning session setup fails: onPairingComplete with an error. * Commissioning session setup succeeds: onPairingComplete with no error. Once a commissioning session is set up, getDeviceBeingCommissioned can be used to get an MTRBaseDevice and discover what sort of network credentials the device might need, and commissionDevice can be used to commission the device. API-Since: 17.0
        Parameters:
        discoveredDevice - a previously discovered device.
        payload - a setup payload (probably created from a QR code or numeric code onboarding payload).
        newNodeID - the planned node id for the node.
      • setupCommissioningSessionWithPayloadNewNodeIDError

        public boolean setupCommissioningSessionWithPayloadNewNodeIDError​(@NotNull
                                                                          @NotNull MTRSetupPayload payload,
                                                                          @NotNull
                                                                          @NotNull NSNumber newNodeID,
                                                                          @Nullable
                                                                          @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Set up a commissioning session for a device, using the provided setup payload to discover it and connect to it. [@error] error indication if discovery can't start at all (e.g. because the setup payload is invalid). The IP and port for the device will be discovered automatically based on the provided discriminator. Then a PASE session will be established with the device, unless an error occurs. MTRDeviceControllerDelegate will be notified as follows: * Discovery fails: onStatusUpdate with MTRCommissioningStatusFailed. * Discovery succeeds but commissioning session setup fails: onPairingComplete with an error. * Commissioning session setup succeeds: onPairingComplete with no error. Once a commissioning session is set up, getDeviceBeingCommissioned can be used to get an MTRBaseDevice and discover what sort of network credentials the device might need, and commissionDevice can be used to commission the device. API-Since: 16.2
        Parameters:
        payload - a setup payload (probably created from a QR code or numeric code onboarding payload).
        newNodeID - the planned node id for the node.
      • sharedControllerWithIDXpcConnectBlock

        @NotNull
        public static @NotNull MTRDeviceController sharedControllerWithIDXpcConnectBlock​(@Nullable
                                                                                         @Nullable java.lang.Object controllerID,
                                                                                         @NotNull
                                                                                         @NotNull MTRDeviceController.Block_sharedControllerWithIDXpcConnectBlock xpcConnectBlock)
        Returns a shared device controller proxy for the controller object over XPC connection.
        Parameters:
        controllerID - an implementation specific id in case multiple shared device controllers are available over XPC connection
        xpcConnectBlock - block to connect to an XPC listener serving the shared device controllers in an implementation specific way API-Since: 16.4
      • sharedControllerWithIdXpcConnectBlock

        @Deprecated
        @NotNull
        public static @NotNull MTRDeviceController sharedControllerWithIdXpcConnectBlock​(@Nullable
                                                                                         @Nullable java.lang.Object controllerID,
                                                                                         @NotNull
                                                                                         @NotNull MTRDeviceController.Block_sharedControllerWithIdXpcConnectBlock xpcConnectBlock)
        Deprecated.
        API-Since: 16.1 Deprecated-Since: 16.4 Deprecated-Message: Please use sharedControllerWithID:xpcConnectBlock:
      • shutdown

        public void shutdown()
        Shut down the controller. Calls to shutdown after the first one are NO-OPs. This must be called, either directly or via shutting down the MTRDeviceControllerFactory, to avoid leaking the controller.
      • startBrowseForCommissionablesQueue

        public boolean startBrowseForCommissionablesQueue​(@NotNull
                                                          @NotNull MTRCommissionableBrowserDelegate delegate,
                                                          @NotNull
                                                          @NotNull dispatch_queue_t queue)
        Start scanning for commissionable devices. This method will fail if the controller factory is not running or the browse has already been started. API-Since: 17.0
      • stopBrowseForCommissionables

        public boolean stopBrowseForCommissionables()
        Stop scanning for commissionable devices. This method will fail if the controller factory is not running or the browse has not been started. API-Since: 17.0
      • stopDevicePairingError

        @Deprecated
        public boolean stopDevicePairingError​(long deviceID,
                                              @Nullable
                                              @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Deprecated.
        API-Since: 16.1 Deprecated-Since: 16.4 Deprecated-Message: Please use cancelCommissioningForNodeID:error:
      • 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()
      • xpcInterfaceForClientProtocol

        @NotNull
        public static @NotNull NSXPCInterface xpcInterfaceForClientProtocol()
        Returns an NSXPCInterface configured for MTRDeviceControllerClientProtocol. API-Since: 16.5
      • xpcInterfaceForServerProtocol

        @NotNull
        public static @NotNull NSXPCInterface xpcInterfaceForServerProtocol()
        Returns an NSXPCInterface configured for MTRDeviceControllerServerProtocol. API-Since: 16.5