SwiftySensorsWahoo 0.3.2

SwiftySensorsWahoo 0.3.2

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Jul 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by Joel Stewart.



  • By
  • Kinetic

Wahoo Extension for Swifty Sensors

This Swifty Sensor extension adds a Wahoo Trainer Characteristic to the Cycling Power Service for controlling Wahoo Trainers (KICKR and KICKR SNAP).

Installation

Manual

Coming Soon

Swift Package Manager

Coming Soon

Usage

When setting up your SensorManager, simply activate the Wahoo Trainer Characteristic.

import SwiftySensors
import SwiftySensorsWahoo

// Customize what services you want to scan for
SensorManager.instance.setServicesToScanFor([
    CyclingPowerService.self
])

CyclingPowerService.WahooTrainer.activate()

If a CyclingPowerService has a Wahoo Trainer Characteristic, you can get (check for) a reference to it:

guard let wahooTrainer: CyclingPowerService.WahooTrainer = cyclingPowerService.characteristic() { else return }

The Wahoo Trainer Characteristic provides methods to control the Trainer:

let targetWatts: UInt16 = 150
wahooTrainer.setResistanceErg(targetWatts)

let trainerLevel: UInt8 = 3
wahooTrainer.setResistanceLevel(trainerLevel)

Known bugs

There is an occassional crash when disconnecting from a Wahoo Trainer.

ToDos

Further reverse engineering of the Wahoo spec.