SensorConfiguration

public struct SensorConfiguration

The sensor configuration indicates which sensors are enabled, which are disabled, and what the current sample period is. The wearable device will send sensor configuration values as its configuration changes. Client applications can configure the wearable device by changing the sensor configuration.

At startup all available sensors are disabled. Clients will need to enable the desired sensors at the desired sample period. Upon BLE disconnection all sensors enabled by the client are automatically disabled.

  • Returns the sample period for enabled sensors, if any sensors are enabled. If no sensors are enabled, returns nil.

    Changing this value updates the sample period of all enabled sensors. If no sensors are enabled, changing this value has no effect. Changing this value to nil disables all enabled sensors.

    Declaration

    Swift

    public var enabledSensorsSamplePeriod: SamplePeriod? { get set }
  • Returns true if the specified sensor is defined in this sensor configuration object and has a non-zero sample period. Returns false otherwise.

    Declaration

    Swift

    public func isEnabled(sensor: SensorType) -> Bool
  • Returns the sample period, in milliseconds, for the specified sensor. Returns 0 if the specified sensor is disabled or is not defined in this sensor configuration object.

    Declaration

    Swift

    public func samplePeriod(for sensor: SensorType) -> SamplePeriod?
  • An array containing all of the sensors defined in this sensor configuration object.

    Declaration

    Swift

    public var allSensors: [SensorType] { get }
  • An array containing the currently enabled sensors.

    Declaration

    Swift

    public var enabledSensors: [SensorType] { get }
  • An array containing the currently disabled sensors.

    Declaration

    Swift

    public var disabledSensors: [SensorType] { get }
  • Disables all sensors.

    Declaration

    Swift

    public mutating func disableAll()
  • Disables the specified sensor.

    Declaration

    Swift

    public mutating func disable(sensor: SensorType)
  • Enables the specified sensor at the specified sample period. Note that all sensors must have the same sample period. Thus, if other sensors are enabled at a different sample period, this function changes all enabled sensors to use the specified sample period.

    Declaration

    Swift

    public mutating func enable(sensor: SensorType, at period: SamplePeriod)
  • Declaration

    Swift

    public var debugDescription: String { get }
  • Declaration

    Swift

    public static func == (lhs: SensorConfiguration, rhs: SensorConfiguration) -> Bool