ESTSettingConnectivityPower

@interface ESTSettingConnectivityPower : ESTSettingReadWrite <NSCopying>

ESTSettingConnectivityPower represents Connectivity Power value.

  • Designated initializer. Validates provided value internally with +validationErrorForValue:.

    See

    +[ESTSettingConnectablePower validationErrorForValue:]

    Declaration

    Objective-C

    - (nonnull instancetype)initWithValue:(ESTConnectablePowerLevel)power;

    Swift

    init(value power: ESTConnectablePowerLevel)

    Parameters

    power

    Connectivity Power value.

    Return Value

    Initialized object. Nil if validation fails.

  • Returns current value of Connectivity Power setting.

    Declaration

    Objective-C

    - (ESTConnectablePowerLevel)getValue;

    Swift

    func getValue() -> ESTConnectablePowerLevel

    Return Value

    Connectable Power value.

  • Method allows to read value of initialized Connectivity Power setting object.

    Declaration

    Objective-C

    - (void)readValueWithCompletion:
        (nonnull ESTSettingConnectivityPowerCompletionBlock)completion;

    Swift

    func readValue(completion: @escaping ESTSettingConnectivityPowerCompletionBlock)

    Parameters

    completion

    Block to be invoked when operation is complete.

    Return Value

    Initialized operation object.

  • Method allows to create write operation from already initialized Connectivity Power setting object. Value provided during initialization will be used as a desired value.

    Declaration

    Objective-C

    - (void)writeValue:(ESTConnectablePowerLevel)power
            completion:
                (nonnull ESTSettingConnectivityPowerCompletionBlock)completion;

    Swift

    func writeValue(_ power: ESTConnectablePowerLevel, completion: @escaping ESTSettingConnectivityPowerCompletionBlock)

    Parameters

    power

    Power value to be written to the device.

    completion

    Block to be invoked when operation is complete.

    Return Value

    Initialized operation object.

  • Method checks if provided value is allowed. Returns nil if validation passes.

    Declaration

    Objective-C

    + (NSError *_Nullable)validationErrorForValue:(ESTConnectablePowerLevel)power;

    Swift

    class func validationError(forValue power: ESTConnectablePowerLevel) -> Error?

    Parameters

    power

    Power value.

    Return Value

    Error object describing why validation failed. Nil if validation passes.