CharacteristicCyclingSpeedCadence

@available(swift 3.1)
@available(iOS 10.0, tvOS 10.0, watchOS 3.0, macOS 10.12, *)
final public class CharacteristicCyclingSpeedCadence : Characteristic
extension CharacteristicCyclingSpeedCadence: Hashable
extension CharacteristicCyclingSpeedCadence: Equatable

BLE Cadence and Speed Characteristic

The CSC Measurement characteristic (CSC refers to Cycling Speed and Cadence) is a variable length structure containing a Flags field and, based on the contents of the Flags field, may contain one or more additional fields as shown in the tables below.

  • Characteristic Name

    Declaration

    Swift

    public static var name: String { get }
  • Characteristic UUID

    Declaration

    Swift

    public static var uuidString: String { get }
  • Name of the Characteristic

    Declaration

    Swift

    public var name: String { get }
  • Characteristic UUID String

    Declaration

    Swift

    public var uuidString: String { get }
  • Determine if sensor is a wheel or crank sensor

    Declaration

    Swift

    private(set) public var flags: Flags { get }
  • Revolution data and last event timestamp

    Declaration

    Swift

    private(set) public var sampleData: SampleData { get }
  • Determine if sensor is a wheel or crank

    See more

    Declaration

    Swift

    public enum Flags : UInt8
  • Revolution type

    See more

    Declaration

    Swift

    public enum Revolution : Equatable, Hashable
  • Revolution type and timestamp of last revolution type

    See more

    Declaration

    Swift

    public struct SampleData : Equatable, Hashable
  • Init

    Declaration

    Swift

    public init(flags: Flags,
                sampleData: SampleData)

    Parameters

    flags

    Determine if sensor is a wheel or crank sensor

    presentData

    Revolution type and timestamp of last revolution type

  • Decodes Characteristic Data into Characteristic

    Declaration

    Swift

    public class func decode<C>(with data: Data) -> Result<C, BluetoothDecodeError> where C : Characteristic

    Parameters

    data

    Characteristic Data

    Return Value

    Characteristic Result

  • Encodes the Characteristic into Data

    Declaration

    Swift

    public func encode() -> Result<Data, BluetoothEncodeError>

    Return Value

    Characteristic Data Result

  • Hashes the essential components of this value by feeding them into the given hasher.

    Implement this method to conform to the Hashable protocol. The components used for hashing must be the same as the components compared in your type’s == operator implementation. Call hasher.combine(_:) with each of these components.

    Important

    Never call finalize() on hasher. Doing so may become a compile-time error in the future.

    Declaration

    Swift

    public func hash(into hasher: inout Hasher)

    Parameters

    hasher

    The hasher to use when combining the components of this instance.

  • Returns a Boolean value indicating whether two values are equal.

    Equality is the inverse of inequality. For any values a and b, a == b implies that a != b is false.

    Declaration

    Swift

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

    Parameters

    lhs

    A value to compare.

    rhs

    Another value to compare.