Tuya iOS Smart Life App SDK 5.15.0
WTLSubscribeParams Class Reference

#import <WTLCluster.h>

Inheritance diagram for WTLSubscribeParams:
WTLReadParams

Instance Methods

(BOOL replaceExistingSubscriptions) - API_AVAILABLE
 
(BOOL resubscribeAutomatically) - API_AVAILABLE
 
(NSNumber *minInterval) - API_AVAILABLE
 
(NSNumber *maxInterval) - API_AVAILABLE
 
(BOOL reportEventsUrgently) - API_AVAILABLE
 
(instancetype) - initWithMinInterval:maxInterval:
 
(NSNumber *keepPreviousSubscriptions) - WTL_DEPRECATED
 
(NSNumber *autoResubscribe) - WTL_DEPRECATED
 
(16.1, 16.4) - tvos
 
- Instance Methods inherited from WTLReadParams
(BOOL filterByFabric) - API_AVAILABLE
 
(NSNumber *minEventNumber) - API_AVAILABLE
 
(NSNumber *fabricFiltered) - WTL_DEPRECATED
 

Class Methods

(16.1, 16.4) + tvos
 

Detailed Description

WTLSubscribeParams This is used to control the behavior of attribute/event subscribes. If not provided (i.e. nil passed for the WTLSubscribeParams argument), will be treated as if a default-initialized object was passed in.

Definition at line 120 of file WTLCluster.h.

Method Documentation

◆ API_AVAILABLE [1/5]

- (BOOL replaceExistingSubscriptions) API_AVAILABLE (macos(13.3)) 
(watchos(9.4)) 
(tvos(16.4))   

Whether the subscribe should replace already-existing subscriptions. The default value is YES.

If YES, the subscribe will cancel any existing subscriptions to the target node when it sets up the new one.

If NO, the subscribe will allow any previous subscriptions to remain.

Implements WTLReadParams.

◆ API_AVAILABLE [2/5]

- (BOOL resubscribeAutomatically) API_AVAILABLE (macos(13.3)) 
(watchos(9.4)) 
(tvos(16.4))   

Whether the subscription should automatically try to re-establish if it drops. The default value is YES.

If NO, loss of subscription will simply lead to an error report. Some subscription APIs do not support this value.

If YES, loss of subscription will lead to an automatic resubscription attempt. If this succeeds, the subscriptionEstablished callback will be called again.

Implements WTLReadParams.

◆ API_AVAILABLE [3/5]

- (NSNumber *minInterval) API_AVAILABLE (macos(13.3)) 
(watchos(9.4)) 
(tvos(16.4))   

The minimum time, in seconds, between consecutive reports a server will send for this subscription. This can be used to rate-limit the subscription traffic. Any non-negative value is allowed, including 0.

Implements WTLReadParams.

◆ API_AVAILABLE [4/5]

- (NSNumber *maxInterval) API_AVAILABLE (macos(13.3)) 
(watchos(9.4)) 
(tvos(16.4))   

The suggested maximum time, in seconds, during which the server is allowed to send no reports at all for this subscription. Must be at least as large as minInterval. The server is allowed to use a larger time than this as the maxInterval it selects if it needs to (e.g. to meet its power budget).

Implements WTLReadParams.

◆ API_AVAILABLE [5/5]

- (BOOL reportEventsUrgently) API_AVAILABLE (macos(13.3)) 
(watchos(9.4)) 
(tvos(16.4))   

Controls whether events will be reported urgently. The default value is YES.

If YES, the events will be reported as soon as the minInterval does not prevent it.

If NO, the events will be reported at the maximum interval.

Implements WTLReadParams.

◆ initWithMinInterval:maxInterval:

- (instancetype) initWithMinInterval: (NSNumber *)  minInterval
maxInterval: (NSNumber *)  maxInterval 

Initialize an WTLSubscribeParams. Must provide a minInterval and maxInterval; there are no default values for those.

◆ tvos [1/2]

- (16.1, 16.4) tvos

init and new exist for now, for backwards compatibility, and initialize with minInterval set to 1 and maxInterval set to 0, which will not work on its own. Uses of WTLSubscribeParams that rely on init must all be using (deprecated) APIs that pass in a separate minInterval and maxInterval.

Provided by category WTLSubscribeParams(Deprecated).

◆ tvos [2/2]

+ (16.1, 16.4) tvos

Provided by category WTLSubscribeParams(Deprecated).

◆ WTL_DEPRECATED [1/2]

- (NSNumber *keepPreviousSubscriptions) WTL_DEPRECATED ("Please use replaceExistingSubscriptions") 
(macos(13.0, 13.3)) 
(watchos(9.1, 9.4)) 
(tvos(16.1, 16.4))   

Provided by category WTLSubscribeParams(Deprecated).

◆ WTL_DEPRECATED [2/2]

- (NSNumber *autoResubscribe) WTL_DEPRECATED ("Please use resubscribeAutomatically") 
(macos(13.0, 13.3)) 
(watchos(9.1, 9.4)) 
(tvos(16.1, 16.4))   

Provided by category WTLSubscribeParams(Deprecated).


The documentation for this class was generated from the following file: