BatteryPowerState

@available(swift 4.0)
public struct BatteryPowerState : Codable, Hashable

Battery Power State Information

  • If Power State is supported

    See more

    Declaration

    Swift

    public enum StateSupport : UInt8, Codable
  • Provides Discharge Status

    See more

    Declaration

    Swift

    public enum DischargeStatus : UInt8, Codable
  • Charging Status

    See more

    Declaration

    Swift

    public enum ChargingStatus : UInt8, Codable
  • Battery Level

    See more

    Declaration

    Swift

    public enum Level : UInt8, Codable
  • State Information

    If State Information is present or not

    Declaration

    Swift

    private(set) public var stateInfo: StateSupport { get }
  • Discharge Status

    Declaration

    Swift

    private(set) public var dischargeInfo: DischargeStatus { get }
  • Charge Status

    Describes both if the devices is Chargeable and if Charging

    Declaration

    Swift

    private(set) public var chargeInfo: ChargingStatus { get }
  • Level of the Battery

    Declaration

    Swift

    private(set) public var batteryLevel: Level { get }
  • Raw Value

    Declaration

    Swift

    public var rawValue: UInt8 { get }
  • Creates a BatteryPowerState Object

    Declaration

    Swift

    public init(_ value: UInt8)

    Parameters

    value

    Raw Data

  • Creates a BatteryPowerState Object

    Declaration

    Swift

    public init(stateInfo: StateSupport, dischargeInfo: DischargeStatus, chargeInfo: ChargingStatus, batteryLevel: Level)

    Parameters

    stateInfo

    StateSupport enum

    dischargeInfo

    DischargeStatus eum

    chargeInfo

    ChargingStatus enum

    batteryLevel

    Level enum