From 15c1553e42ade05ae318068e46b018c0803744c1 Mon Sep 17 00:00:00 2001 From: Lars Berning <151194+laberning@users.noreply.github.com> Date: Wed, 21 Apr 2021 20:39:27 +0200 Subject: [PATCH] adds an option to configure the ftms device names --- app/ble/FtmsPeripheral.js | 4 ++-- config/default.config.js | 13 +++++++++++-- docs/backlog.md | 1 - 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/app/ble/FtmsPeripheral.js b/app/ble/FtmsPeripheral.js index ea9eae1..bb6100c 100644 --- a/app/ble/FtmsPeripheral.js +++ b/app/ble/FtmsPeripheral.js @@ -14,11 +14,11 @@ import bleno from '@abandonware/bleno' import FitnessMachineService from './ftms/FitnessMachineService.js' import DeviceInformationService from './ftms/DeviceInformationService.js' +import config from '../tools/ConfigManager.js' import log from 'loglevel' function createFtmsPeripheral (controlCallback, options) { - const peripheralName = options?.simulateIndoorBike ? 'OpenRowingBike' : 'OpenRowingMonitor' - // const peripheralName = options?.simulateIndoorBike ? 'OpenRowingBike' : 'S1 Comms 1' + const peripheralName = options?.simulateIndoorBike ? config.ftmsBikePeripheralName : config.ftmsRowerPeripheralName const fitnessMachineService = new FitnessMachineService(options, controlPointCallback) const deviceInformationService = new DeviceInformationService() diff --git a/config/default.config.js b/config/default.config.js index f272d66..d3f9a27 100644 --- a/config/default.config.js +++ b/config/default.config.js @@ -7,8 +7,9 @@ !!! Note that changes to this file will be OVERWRITTEN when you update to a new version of Open Rowing Monitor. !!! - To change the settings you should modify the 'config.js' in this folder. If 'config.js' does not - exist, you can use the example file from the 'install' folder. + To change the settings you should modify the 'config.js' in this folder. Simply copy the + options that you would like to change into that file. If 'config.js' does not exist, you + can use the example file from the 'install' folder. */ import rowerProfiles from './rowerProfiles.js' @@ -25,6 +26,14 @@ export default { // supported modes: FTMS, FTMSBIKE, PM5 bluetoothMode: 'FTMS', + // defines the name that is used to announce the FTMS Rower via Bluetooth Low Energy (BLE) + // some rowing training applications expect that the rowing device is announced with a certain name + ftmsRowerPeripheralName: 'OpenRowingMonitor', + + // defines the name that is used to announce the FTMS Bike via Bluetooth Low Energy (BLE) + // most bike training applications are fine with any device name + ftmsBikePeripheralName: 'OpenRowingBike', + // the rower specific settings. Either choose a profile from config/rowerProfiles.js or // define the settings individually. If you find good settings for a new rowing device // please send them to us (together with a raw recording of 10 strokes) so we can add diff --git a/docs/backlog.md b/docs/backlog.md index 258533a..59b6fa6 100644 --- a/docs/backlog.md +++ b/docs/backlog.md @@ -4,7 +4,6 @@ This is the very minimalistic Backlog for further development of this project. ## Soon -* add a configuration option to change the FMTS device name * add support for ANT+ heart rate monitors with USB dongles * add an option to the installation script to directly attach a touchscreen to the Raspberry Pi and automatically show WebUI on this in kiosk mode * validate FTMS with more training applications and harden implementation (i.e. Holofit and Coxswain)