As MoveLab our goal is to facilitate other companies to successfully and effectively launch their connected fitness experiences. As close partner to several of the most progressive fitness brands out there we offer you the most up to date and comprehensive implementations of their hardware.

The Connections Library provides an abstraction layer for Android and iOS to remove the complexity of connecting to physical hardware. We allow you to focus on building your product instead of worrying about the details of, for example, a USB protocol with a rowing machine.

Compatibility

The library is compatible with a variety of equipment each with their own prerequisites and detailed feature set. Below is a global overview of the implementation we support.

Untitled

Most of the compatible equipment will also provide a “fake” implementation preventing the need for the physical device to be present during development.

¹USB connectivity requires specialized hardware from MoveLab Studio

API example

The library allows you to configure the exact compatibility of your application with the different pieces of hardware. After that you scan for available devices with which you connect and lastly consume any data that they generate.

To give you a feeling what this looks like below some snippets. Firstly the configuration of your connections module:

func connectionsModule() -> ConnectionsModule {
    var connectionsModule = ConnectionsModule()

    let bluetoothConnections = BluetoothConnections.create(BluetoothFactory.create())

    connectionsModule.add(
        NohrdBikeServiceModule(bluetoothConnections)
    ) { 
      includeFake = true
    }

    connectionsModule.add(
        HeartRateServiceModule(bluetoothConnections)
    )

    return connectionsModule()
}

After which you’re able to scan for devices

let cancellable = connectionsModule.serviceListProvider
    .addListener { (entries: [ServiceEntry]) in
        print(
            entries
                .filter { $0.service == NohrdBikeService() }
        )
    }

And when you are connected to one of these services you can query, for example, the version number of a NOHRD Bike.

let nohrdBikeConnectionManager = connectionsModule.nohrdBikeConnectionManager()

func read(connectionManager: ConnectionManager<AnyNohrdBikeDataSource>) {
    let dataSource: AnyNohrdBikeDataSource = connectionManager.availableDataSource()
    dataSource.versionInfo { print($0) }
}