Wahoo Fitness API  3.6.1
Documentation for the iPhone version of the Wahoo Fitness API.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
WFBikePowerConnection Class Reference

Represents a connection to an ANT+ Bike Power sensor. More...

#import <WFBikePowerConnection.h>

+ Inheritance diagram for WFBikePowerConnection:
+ Collaboration diagram for WFBikePowerConnection:

Instance Methods

("Use
WFBikeTrainerSpindownCalibrator
class to initiate the trainer
for a spindown test") 
- __deprecated_msg
 Initiates the trainer for a spinddown test. More...
 
(void) - cpmConnection:didReceiveCalibrationResponse:
 Invoked when a response to the Manual Zero command is received. More...
 
(void) - cpmConnection:didReceiveCalibrationResponse:offset:
 
(void) - cpmConnection:didReceiveCalibrationResponse:offset:temperature:
 
(void) - cpmConnection:didReceiveKurtSetProFlywheelEnabled:spindownEnabled:response:
 
(void) - cpmConnection:didReceiveKurtSpindownResult:
 Invoked when a Kurt InRide Trainer Spindown Result is received. More...
 
(void) - cpmConnection:didReceiveReadCrankLengthResponse:crankLength:
 Invoked when a response to the Read Crank Length command is received. More...
 
(void) - cpmConnection:didReceiveSetCrankLengthResponse:
 Invoked when a response to the Set Crank Length command is received. More...
 
(void) - cpmConnection:didReceiveTrainerInitSpindownResponse:
 
(void) - cpmConnection:didReceiveTrainerInitSpindownResponseWithInfo:
 Invoked when a response to the Trainer Init Spindown command is received. More...
 
(void) - cpmConnection:didReceiveTrainerReadModeResponse:mode:
 
(void) - cpmConnection:didReceiveTrainerReadModeResponse:mode:params:
 
(void) - cpmConnection:didReceiveTrainerReadModeResponse:params:info:
 Invoked when a response to the Read Trainer Mode command is received. More...
 
(void) - cpmConnection:didReceiveTrainerRequestAntConnectionResponse:
 Invoked when a response to the Trainer Request ANT Connection command is received. More...
 
(void) - cpmConnection:didReceiveTrainerSpindownResult:temperature:offset:
 Invoked when a Trainer Spindown Result is received. More...
 
(void) - cpmConnection:didSetTrainerGrade:
 
(void) - cpmConnection:didSetTrainerGrade:info:
 Invoked when a response to the Set Trainer Grade command is received. More...
 
(void) - cpmConnection:didSetTrainerMode:params:info:
 Invoked when a response to the Set Trainer Mode command is received. More...
 
(void) - cpmConnection:didSetTrainerMode:status:
 
(void) - cpmConnection:didSetTrainerRollingResistance:
 
(void) - cpmConnection:didSetTrainerRollingResistance:info:
 Invoked when a response to the Set Trainer Rolling Resistance command is received. More...
 
(void) - cpmConnection:didSetTrainerWheelCircumference:
 
(void) - cpmConnection:didSetTrainerWheelCircumference:info:
 Invoked when a response to the Set Trainer Wheel Circumference command is received. More...
 
(void) - cpmConnection:didSetTrainerWindResistance:
 
(void) - cpmConnection:didSetTrainerWindResistance:info:
 Invoked when a response to the Set Trainer Wind Resistance command is received. More...
 
(void) - cpmConnection:didSetTrainerWindSpeed:
 
(void) - cpmConnection:didSetTrainerWindSpeed:info:
 Invoked when a response to the Set Trainer Wind Speed command is received. More...
 
(void) - disconnect
 Disconnects the sensor. More...
 
(void) - disconnect:
 Disconnects the sensor and for BTLE peripheral, ensures the BTLE connection is closed. More...
 
(WFBikePowerData *) - getBikePowerData
 Returns the latest data available from the sensor. More...
 
(WFBikePowerRawData *) - getBikePowerRawData
 Returns the latest raw (unformatted) data available from the sensor. More...
 
(WFSensorData *) - getData
 Retrieves the most current data available from the sensor. More...
 
(WFSensorData *) - getRawData
 Retrieves the most current raw data available from the sensor. More...
 
(BOOL- hasData
 Returns a boolean value indicating whether new data is available. More...
 
(WFBTLEServiceProcessor *) - serviceProcessorForSensorType:
 Returns a WFBTLEService derived instance which handles BTLE service processing for the specified sensor type. More...
 
(BOOL- setBikePowerCalibration:
 Sends a calibration message to the Bike Power sensor with the calibration data specified in the WFBikePowerCalibrationData_t structure. More...
 
(BOOL- setBikePowerCalibrationOffset:
 Sets the calibration offset value for the power meter sensor. More...
 
(BOOL- setManualZeroCalibration
 Sends the manual zero command to the BTLE bike power sensor. More...
 
(float) - signalEfficiency
 Returns the signal efficiency for the connected sensor. More...
 
(BOOL- trainerReadMode
 Sends request to determine current trainer mode. More...
 
(BOOL- trainerRequestAntConnection:deviceId:useForPower:
 Sends request to establish a connection to an ANT sensor. More...
 
(BOOL- trainerSetErgMode:
 Puts the trainer in Erg Mode. More...
 
(BOOL- trainerSetGrade:
 Sets the hill grade in Sim Mode. More...
 
(BOOL- trainerSetResistanceMode:
 Puts the trainer in Resistance Mode. More...
 
(BOOL- trainerSetRollingResistance:
 Sets the coefficient of rolling resistance (Crr) in Sim Mode. More...
 
(BOOL- trainerSetSimMode:rollingResistance:windResistance:
 Puts the trainer in Sim Mode. More...
 
(BOOL- trainerSetStandardMode:
 Puts the trainer in Standard Mode. More...
 
(BOOL- trainerSetWheelCircumference:
 Sets the rear wheel circumference. More...
 
(BOOL- trainerSetWindResistance:
 Sets the drag coefficient, effective frontal area, and air density as one variable in Sim Mode. More...
 
(BOOL- trainerSetWindSpeed:
 Sets the wind speed in Sim Mode. More...
 

Properties

BOOL autoCalibrate
 Gets or sets a boolean value indicating whether the WFBikePowerConnection should automatically calibrate when calibration data is received from the device. More...
 
id< WFBikeTrainerDelegatebtDelegate
 Specifies the WFBikeTrainerDelegate instance which will handle trainer callback methods for this WFBikePowerConnection. More...
 
WFSensorConnectionStatus_t connectionStatus
 Gets the current connection status. More...
 
id< WFBikePowerDelegatecpmDelegate
 Specifies the WFBikePowerDelegate instance which will handle callback methods for this WFBikePowerConnection. More...
 
id< WFSensorConnectionDelegatedelegate
 Specifies the WFSensorConnectionDelegate instance which will handle callback methods for this WFSensorConnection. More...
 
NSString * deviceIDString
 Returns the Device ID of the connected sensor for both ANT and BTLE. More...
 
WFDeviceInformationdeviceInformation
 
USHORT deviceNumber
 Gets the ANT device ID of the connected sensor. More...
 
NSString * deviceUUIDString
 Specifies the BTLE Device UUID String. More...
 
BOOL didTimeout
 Gets a boolean value indicating whether a connection timeout occurred. More...
 
WFSensorConnectionError_t error
 Get the error status for the connection. More...
 
BOOL hasAntBridgeSupport
 Gets a boolean value indicating whether this WFSensorConnection instance is connected to a device which supports the Wahoo Fitness ANT Bridge. More...
 
BOOL hasError
 TRUE if an error has occured, otherwise FALSE. More...
 
BOOL hasValidParams
 Gets a boolean value indicating whether this WFSensorConnection has valid connection parameters. More...
 
BOOL hasWildcardParams
 Gets a boolean value indicating whether the connection parameters for this WFSensorConnection indicate a wildcard search. More...
 
BOOL isANTConnection
 TRUE if the sensor is a ANT device, otherwise FALSE. More...
 
BOOL isBTLEConnection
 TRUE if the sensor is a BTLE device, otherwise FALSE. More...
 
BOOL isConnected
 TRUE if the sensor is currently connected, otherwise FALSE. More...
 
BOOL isValid
 Gets a boolean value indicating whether this WFSensorConnection instance is valid. More...
 
WFNetworkType_t networkType
 Specifies the network type of this WFSensorConnection (ANT+, BTLE, etc). More...
 
WFSensorSubType_t sensorSubType
 Gets the sensor sub type for this WFSensorConnection. More...
 
WFSensorType_t sensorType
 Gets the sensor type for this WFSensorConnection. More...
 
NSTimeInterval timeSinceLastMessage
 Gets the time since the last ANT message was received (in seconds). More...
 
UCHAR transmissionType
 Gets the ANT transmission type of the connected sensor. More...
 

Detailed Description

Represents a connection to an ANT+ Bike Power sensor.

Method Documentation

- ("Use WFBikeTrainerSpindownCalibrator class to initiate the trainer for a spindown test") __deprecated_msg

Initiates the trainer for a spinddown test.

When this function is called successfully, the trainer is set to Resistance Mode at 0.0% brake. A spinddown test is used to calibrate the trainer and determine power loss due to friction. A spinddown requires the rider to pedal to speeds above 22 mph and let the bike cost down to less than 13 mph.

Returns
TRUE if the command was sent successfully, otherwise FALSE.
- (void) cpmConnection: (WFBikePowerConnection *)  cpmConn
didReceiveCalibrationResponse: (WFCPMCalibrationResponseObject *)  responseObject 
optionalinherited

Invoked when a response to the Manual Zero command is received.

Parameters
cpmConnThe WFBikePowerConnection instance.
ucStatusThe command status code (1 for Success).
errorParamoptional param for some command status
usOffsetThe offset generated by the calibration command.
scTempThe temperature read by the calibration command.
- (void) cpmConnection: (WFBikePowerConnection *)  cpmConn
didReceiveCalibrationResponse: (UCHAR ucStatus
offset: ((unavailable("Use: cpmConnection:didReceiveCalibrationResponse:errorParam:forceOffset:manufactureData:offset:temperature")))  __attribute__ 
optionalinherited
- (void) cpmConnection: (WFBikePowerConnection *)  cpmConn
didReceiveCalibrationResponse: (UCHAR ucStatus
offset: (USHORT usOffset
temperature: ((unavailable("Use: cpmConnection:didReceiveCalibrationResponse:errorParam:forceOffset:manufactureData:offset:temperature")))  __attribute__ 
optionalinherited
- (void) cpmConnection: (WFBikePowerConnection *)  cpmConn
didReceiveKurtSetProFlywheelEnabled: (BOOL proFlywheelEnabled
spindownEnabled: (BOOL spindownEnabled
response: (BOOL bSuccess 
optionalinherited
- (void) cpmConnection: (WFBikePowerConnection *)  cpmConn
didReceiveKurtSpindownResult: (ULONG ulSpindownPeriod 
optionalinherited

Invoked when a Kurt InRide Trainer Spindown Result is received.

Parameters
cpmConnThe WFBikePowerConnection instance.
ulSpindownPeriodThe spindown period, in microseconds.
- (void) cpmConnection: (WFBikePowerConnection *)  cpmConn
didReceiveReadCrankLengthResponse: (UCHAR ucStatus
crankLength: (float)  crankLength 
optionalinherited

Invoked when a response to the Read Crank Length command is received.

Parameters
cpmConnThe WFBikePowerConnection instance.
ucStatusThe command status code (1 for Success).
crankLengthThe crank length, in meters.
- (void) cpmConnection: (WFBikePowerConnection *)  cpmConn
didReceiveSetCrankLengthResponse: (UCHAR ucStatus 
optionalinherited

Invoked when a response to the Set Crank Length command is received.

Parameters
cpmConnThe WFBikePowerConnection instance.
ucStatusThe command status code (1 for Success).
- (void) cpmConnection: (WFBikePowerConnection *)  cpmConn
didReceiveTrainerInitSpindownResponse: ("Use WFBikeTrainerSpindownCalibratorDelegate class to receive spindown progress callbacks")  __deprecated_msg 
optionalinherited
- (void) cpmConnection: (WFBikePowerConnection *)  cpmConn
didReceiveTrainerInitSpindownResponseWithInfo: ("Use WFBikeTrainerSpindownCalibratorDelegate class to receive spindown progress callbacks")  __deprecated_msg 
optionalinherited

Invoked when a response to the Trainer Init Spindown command is received.

Parameters
cpmConnThe WFBikePowerConnection instance.
ucStatusThe command status code (0 for Success).
- (void) cpmConnection: (WFBikePowerConnection *)  cpmConn
didReceiveTrainerReadModeResponse: (UCHAR ucStatus
mode: ((unavailable("Use cpmConnection:didReceiveTrainerReadModeResponse:mode:params")))  __attribute__ 
optionalinherited
- (void) cpmConnection: (WFBikePowerConnection *)  cpmConn
didReceiveTrainerReadModeResponse: (UCHAR ucStatus
mode: (WFBikeTrainerMode_t eMode
params: ("Use cpmConnection:didReceiveTrainerReadModeResponse:params:info:")  __deprecated_msg 
optionalinherited
- (void) cpmConnection: (WFBikePowerConnection *)  cpmConn
didReceiveTrainerReadModeResponse: (WFBikeTrainerMode_t eMode
params: (NSDictionary *)  params
info: (WFBikeTrainerDelegateInfo_t info 
optionalinherited

Invoked when a response to the Read Trainer Mode command is received.

Parameters
cpmConnThe WFBikePowerConnection instance.
ucStatusThe status of the command (0 is Success).
eModeIf the command was successful, the current WFBikeTrainerMode_t.
paramsAn NSDictionary instance containing any parameters associated with the current mode.
- (void) cpmConnection: (WFBikePowerConnection *)  cpmConn
didReceiveTrainerRequestAntConnectionResponse: (UCHAR ucStatus 
optionalinherited

Invoked when a response to the Trainer Request ANT Connection command is received.

Parameters
cpmConnThe WFBikePowerConnection instance.
ucStatusThe command status code (0 for Success).
- (void) cpmConnection: (WFBikePowerConnection *)  cpmConn
didReceiveTrainerSpindownResult: (float)  spindownTime
temperature: (float)  spindownTemperature
offset: ("Use WFBikeTrainerSpindownCalibratorDelegate class to receive spindown progress callbacks")  __deprecated_msg 
optionalinherited

Invoked when a Trainer Spindown Result is received.

Parameters
cpmConnThe WFBikePowerConnection instance.
spindownTimeThe spindown time value.
spindownTemperatureThe spindown temperature value.
spindownOffsetThe zero offset calibration
- (void) cpmConnection: (WFBikePowerConnection *)  cpmConn
didSetTrainerGrade: ("Use cpmConnection:didSetTrainerGrade:info:")  __deprecated_msg 
optionalinherited
- (void) cpmConnection: (WFBikePowerConnection *)  cpmConn
didSetTrainerGrade: (float)  grade
info: (WFBikeTrainerDelegateInfo_t info 
optionalinherited

Invoked when a response to the Set Trainer Grade command is received.

Parameters
cpmConnThe WFBikePowerConnection instance.
gradeThe new trainer grade.
infoStructure containing info regarding the control point command (eg status)
- (void) cpmConnection: (WFBikePowerConnection *)  cpmConn
didSetTrainerMode: (WFBikeTrainerMode_t eMode
params: (NSDictionary *)  params
info: (WFBikeTrainerDelegateInfo_t info 
optionalinherited

Invoked when a response to the Set Trainer Mode command is received.

Parameters
cpmConnThe WFBikePowerConnection instance.
eModeThe WFBikeTrainerMode_t specified in the command.
paramsAn NSDictionary instance containing changed parameters associated with the current mode.
infoStructure containing info regarding the control point command (eg status)
- (void) cpmConnection: (WFBikePowerConnection *)  cpmConn
didSetTrainerMode: (WFBikeTrainerMode_t eMode
status: ("Use cpmConnection:didSetTrainerMode:params:info:")  __deprecated_msg 
optionalinherited
- (void) cpmConnection: (WFBikePowerConnection *)  cpmConn
didSetTrainerRollingResistance: ("Use cpmConnection:didSetTrainerRollingResistance:info:")  __deprecated_msg 
optionalinherited
- (void) cpmConnection: (WFBikePowerConnection *)  cpmConn
didSetTrainerRollingResistance: (float)  rollingResistance
info: (WFBikeTrainerDelegateInfo_t info 
optionalinherited

Invoked when a response to the Set Trainer Rolling Resistance command is received.

Parameters
cpmConnThe WFBikePowerConnection instance.
rollingResistanceThe new rolling resistance.
infoStructure containing info regarding the control point command (eg status)
- (void) cpmConnection: (WFBikePowerConnection *)  cpmConn
didSetTrainerWheelCircumference: ("Use cpmConnection:didSetTrainerWindSpeed:info:")  __deprecated_msg 
optionalinherited
- (void) cpmConnection: (WFBikePowerConnection *)  cpmConn
didSetTrainerWheelCircumference: (USHORT wheelCircumference
info: (WFBikeTrainerDelegateInfo_t info 
optionalinherited

Invoked when a response to the Set Trainer Wheel Circumference command is received.

Parameters
cpmConnThe WFBikePowerConnection instance.
wheelCircumferenceThe new wheel circumference.
infoStructure containing info regarding the control point command (eg status)
- (void) cpmConnection: (WFBikePowerConnection *)  cpmConn
didSetTrainerWindResistance: ("Use cpmConnection:didSetTrainerWindResistance:info:")  __deprecated_msg 
optionalinherited
- (void) cpmConnection: (WFBikePowerConnection *)  cpmConn
didSetTrainerWindResistance: (float)  windResistance
info: (WFBikeTrainerDelegateInfo_t info 
optionalinherited

Invoked when a response to the Set Trainer Wind Resistance command is received.

Parameters
cpmConnThe WFBikePowerConnection instance.
windResistanceThe new wind resistance.
infoStructure containing info regarding the control point command (eg status)
- (void) cpmConnection: (WFBikePowerConnection *)  cpmConn
didSetTrainerWindSpeed: ("Use cpmConnection:didSetTrainerWindSpeed:info:")  __deprecated_msg 
optionalinherited
- (void) cpmConnection: (WFBikePowerConnection *)  cpmConn
didSetTrainerWindSpeed: (float)  windSpeed
info: (WFBikeTrainerDelegateInfo_t info 
optionalinherited

Invoked when a response to the Set Trainer Wind Speed command is received.

Parameters
cpmConnThe WFBikePowerConnection instance.
windSpeedThe new wind speed.
infoStructure containing info regarding the control point command (eg status)
- (void) disconnect

Disconnects the sensor.

- (void) disconnect: (BOOL bKillPeripheralConnection

Disconnects the sensor and for BTLE peripheral, ensures the BTLE connection is closed.

BTLE peripheral connections are held in a "peripheral pool" to facilitate multiple logical connections to the same physical device. Normally, when the last logical connection (WFSensorConnection) is disconnected, the BTLE connection will be held in the pool briefly to reduce the overhead of any subsequent connection requests from the application. To override this behaviour, the disconnect: method may be invoked with the bKillPeripheralConnection parameter set to TRUE. In this case, if the WFSensorConnection requesting the disconnect is the last logical connection to the BTLE peripheral, the BTLE peripheral connection will be closed immediately and the BTLE peripheral will be removed from the pool.

Note
For ANT+ devices, this method behaves exactly the same as the disconnect method, regardless of the value of the bKillPeripheralConnection parameter.
Parameters
bKillPeripheralConnectionTRUE if the underlying BTLE connection should be closed immediately, otherwise FALSE.
- (WFBikePowerData*) getBikePowerData

Returns the latest data available from the sensor.

Note
As of 2.3.0 all the old properties for WFBikePowerData have been deprecated in order to replaced them with new properties that apply to both ANT+ and BTLE sensors. The old properties will remain to work with ANT+ sensors but will not return any data when using a BTLE power sensor. It is recomend that you move to the new properties.
Returns
A WFBikePowerData instance containing data if available, otherwise nil.
- (WFBikePowerRawData*) getBikePowerRawData

Returns the latest raw (unformatted) data available from the sensor.

See also
- getRawData (WFSensorConnection)
Returns
A WFBikePowerRawData instance containing data if available, otherwise nil.
- (WFSensorData*) getData

Retrieves the most current data available from the sensor.

Note
WFSensorData is an abstract base class for all sensor data types. The specific type will be determined by the type of sensor. The instance returned must be cast to the specific type in order to be useful.
Returns
A WFSensorData derived instance containing data if available, otherwise nil.
- (WFSensorData*) getRawData

Retrieves the most current raw data available from the sensor.

Note
This method will return raw (unformatted) data from the sensor. It is made available for applications which require processing of data as close to the original measured values a possible. There may be other rarely used data available via this method as well. For most applications, the getData method should be used instead.

WFSensorData is an abstract base class for all sensor data types. The specific type will be determined by the type of sensor. The instance returned must be cast to the specific type in order to be useful.
Returns
A WFSensorData derived instance containing data if available, otherwise nil.
- (BOOL) hasData

Returns a boolean value indicating whether new data is available.

Returns
TRUE if new data is available since the last time getData was invoked, otherwise FALSE.
- (WFBTLEServiceProcessor*) serviceProcessorForSensorType: (WFSensorType_t eSensorType

Returns a WFBTLEService derived instance which handles BTLE service processing for the specified sensor type.

Parameters
eSensorTypeThe sensor type.
Returns
A WFBTLEService derived instance if successful, otherwise nil.
- (BOOL) setBikePowerCalibration: (WFBikePowerCalibrationData_t *)  pstData

Sends a calibration message to the Bike Power sensor with the calibration data specified in the WFBikePowerCalibrationData_t structure.

Parameters
pstDataA WFBikePowerCalibrationData_t structure containing the calibration information to be sent to the sensor.
Returns
TRUE if the calibration message was sent successfully, otherwise FALSE.
- (BOOL) setBikePowerCalibrationOffset: (USHORT usOffset

Sets the calibration offset value for the power meter sensor.

The calibration offset value for power sensors is not persisted by the Wahoo Fitness API. The application should store any offset value returned after a calibration is performed. This value should be used to set the calibration offset used for power calculations. Use this method after the power sensor has been connected to set the offset.

Note
When the sensor is connected or reset, the calibration offset is reset. This method should be invoked after the sensor is connected, and after a reset operation (see resetAllSensorData (WFHardwareConnector)).
Parameters
usOffsetThe calibration offset value.
Returns
TRUE if the calibration offset was set, otherwise FALSE.
- (BOOL) setManualZeroCalibration

Sends the manual zero command to the BTLE bike power sensor.

Note
This method is only available for Wahoo Fitness BTLE bike power devices. For other types, this method will return FALSE, and will have no effect.
Returns
TRUE if the command was sent successfully, otherwise FALSE.
- (float) signalEfficiency

Returns the signal efficiency for the connected sensor.

Returns
For ANT connections, this property represents the ratio of messages received from the sensor over the number of messages expected (range [0, 1.0]). This value should give a good indication of the reception quality for the sensor. For BTLE connections, this property represents the RSSI (in dBm). If the sensor is not currently connected, the return value is -1.
- (BOOL) trainerReadMode

Sends request to determine current trainer mode.

Returns
TRUE if the command was sent successfully, otherwise FALSE.
- (BOOL) trainerRequestAntConnection: (WFSensorType_t eSensorType
deviceId: (USHORT usDeviceId
useForPower: (BOOL bUseForPower 

Sends request to establish a connection to an ANT sensor.

Parameters
eSensorTypeThe type of ANT sensor to be connected.
usDeviceIdThe ANT Device ID of the sensor to be connected (MAY NOT BE WILDCARD).
bUseForPowerIf TRUE and the eSensorType is a power meter, the power values will be obtained from the ANT sensor rather than internally in the KICKR. If FALSE, ant the eSensorType is a power meter, the power meter will be used for cadence values only. This parameter has no effect if the sensor type is not a power meter.
Returns
TRUE if the command was sent successfully, otherwise FALSE.
- (BOOL) trainerSetErgMode: (USHORT usWatts

Puts the trainer in Erg Mode.

Erg Mode attempts to maintain a constant power output regardless of rider speed. If a new target power is desired, trainerSetErgMode must be called again with new targer power.

Parameters
usWattsThe target power (in Watts).
Returns
TRUE if the command was sent successfully, otherwise FALSE.
- (BOOL) trainerSetGrade: (float)  fGrade

Sets the hill grade in Sim Mode.

Note
Trainer must be in Sim Mode before Setting Grade. Grade will default to zero.
Parameters
fGradeis the slope of the hill (slope = rise / run). Should be from -1.0 : 1.0, where -1.0 is a 45 degree downhill slope, 0.0 is flat ground, and 1.0 is a 45 degree uphil slope.
Returns
TRUE if the command was sent successfully, otherwise FALSE.
- (BOOL) trainerSetResistanceMode: (float)  fpScale

Puts the trainer in Resistance Mode.

Resistance Mode will directly control the strength of the brake and will stay constant regardless of the rider's speed. This mode is similar to a spin bike where the user can increase or decrease the difficulty of their workout.

Parameters
fpScalea float from 0.0 to 1.0 that represents the percentage the brake is turned on (0.0 = brake turned off; 0.256 = 25.6% of brake; 1.0 = 100% brake force).
Returns
TRUE if the command was sent successfully, otherwise FALSE.
- (BOOL) trainerSetRollingResistance: (double)  fCrr

Sets the coefficient of rolling resistance (Crr) in Sim Mode.

Note
Trainer must be in Sim Mode before setting Crr. Crr is unitless. Crr will default to 0.004 when Sim Mode is initialized. This approximates a road bike tire on an asphalt road. The reason for changing Crr would be to simulate a change in road conditions during a ride. Other factors that affect Crr are tire pressure, tire width, and tire material.

Here are some approximate values of Crr for a road bike with common road conditions:

ConditionValue
Wooden Track0.001
Smooth Concrete0.002
Asphalt Road0.004
Rough but Paved Road0.008
Parameters
fCrris the coefficient of rolling resistance (unitless).
Returns
TRUE if the command was sent successfully, otherwise FALSE.
- (BOOL) trainerSetSimMode: (float)  fWeight
rollingResistance: (float)  fCrr
windResistance: (float)  fC 

Puts the trainer in Sim Mode.

Sim Mode is used to simulate real world riding situations. This mode will adjust the brake resistance based on the effects of gravity, rolling resistance, and wind resistance. In order to creat an accurate simulation of real world conditions the following variables must be set: rider & bike weight, coefficient of rolling resistance, coefficient of wind resistance, wind speed, wheel circumference, and grade. If these variables are not set, they will default to an "average" value.

Note
IMPORTANT: the following parameters are set when this function is called; however, the remaining parameters can only be set after the trainer is put in Sim Mode.
Parameters
fWeightrepresents the weight of the combined rider and bicycle in kilograms. The default value for fWeight is 85.0kg. This parameter can not be adjusted without calling trainerSetSimMode again.
fCrris the coefficient of rolling resistance (unitless). Can be reset later by calling trainerSetRollingResistance. Default value is 0.004.
fCis equal to A*Cw*Rho where A is effective frontal area (m^2); Cw is drag coefficent (unitless); and Rho is the air density (kg/m^3). The default value for A*Cw*Rho is 0.60.
Returns
TRUE if the command was sent successfully, otherwise FALSE.
- (BOOL) trainerSetStandardMode: (WFBikeTrainerLevel_t eLevel

Puts the trainer in Standard Mode.

Standard Mode will mimic a normal fluid trainer's resistance curve. As the rider increases their speed the resistance will get progressively higher. When the trainer is not connected to a device that can control it, the trainer will default to this mode on level 2.

Parameters
eLevelA WFBikeTrainerLevel_t type that specifies the intensity of the power curve while in standard mode. The range is 0 to 9 where progression at 0 is easiest and 9 is most difficult.
Returns
TRUE if the command was sent successfully, otherwise FALSE.
- (BOOL) trainerSetWheelCircumference: (float)  mmCircumference

Sets the rear wheel circumference.

Rear wheel circumference defaults to 2096.0mm. This value is typical of a 700x23c road bike tire.

Parameters
mmCircumferenceis the circumference of the rear wheel in mm. Accurate to 0.1mm.
Returns
TRUE if the command was sent successfully, otherwise FALSE.
- (BOOL) trainerSetWindResistance: (float)  fC

Sets the drag coefficient, effective frontal area, and air density as one variable in Sim Mode.

Note
Trainer must be in Sim Mode before setting C. C = A*Cw*Rho where A is effective frontal area (m^2); Cw is drag coefficent (unitless); and Rho is the air density (kg/m^3). C will default to 0.60 when Sim Mode is initialized.
Parameters
fCis the drag coefficient.
Returns
TRUE if the command was sent successfully, otherwise FALSE.
- (BOOL) trainerSetWindSpeed: (float)  mpsWindSpeed

Sets the wind speed in Sim Mode.

Note
Trainer must be in Sim Mode before Setting Wind Speed. Wind Speed will default to zero.
Parameters
mpsWindSpeedis the headwind in meters per second. A negative headwind represents a tailwind. The range for mspWindSpeed is -30.0:30.0.
Returns
TRUE if the command was sent successfully, otherwise FALSE.

Property Documentation

- (BOOL) autoCalibrate
readwritenonatomicassign

Gets or sets a boolean value indicating whether the WFBikePowerConnection should automatically calibrate when calibration data is received from the device.

Note
The default value is TRUE.
- (id<WFBikeTrainerDelegate>) btDelegate
readwritenonatomicretain

Specifies the WFBikeTrainerDelegate instance which will handle trainer callback methods for this WFBikePowerConnection.

- (WFSensorConnectionStatus_t) connectionStatus
readnonatomicassigninherited

Gets the current connection status.

- (id<WFBikePowerDelegate>) cpmDelegate
readwritenonatomicretain

Specifies the WFBikePowerDelegate instance which will handle callback methods for this WFBikePowerConnection.

- (id<WFSensorConnectionDelegate>) delegate
readwritenonatomicretaininherited

Specifies the WFSensorConnectionDelegate instance which will handle callback methods for this WFSensorConnection.

- (NSString*) deviceIDString
readnonatomicassigninherited

Returns the Device ID of the connected sensor for both ANT and BTLE.

- (WFDeviceInformation*) deviceInformation
readnonatomicretaininherited
- (USHORT) deviceNumber
readnonatomicassigninherited

Gets the ANT device ID of the connected sensor.

- (NSString*) deviceUUIDString
readnonatomicassigninherited

Specifies the BTLE Device UUID String.

- (BOOL) didTimeout
readnonatomicassigninherited

Gets a boolean value indicating whether a connection timeout occurred.

- (WFSensorConnectionError_t) error
readnonatomicassigninherited

Get the error status for the connection.

- (BOOL) hasAntBridgeSupport
readnonatomicassigninherited

Gets a boolean value indicating whether this WFSensorConnection instance is connected to a device which supports the Wahoo Fitness ANT Bridge.

See also
- enableAntBridge: (WFHardwareConnector)
WFConnectorSettings::isAntBridgeAutoEnabled
- (BOOL) hasError
readnonatomicassigninherited

TRUE if an error has occured, otherwise FALSE.

- (BOOL) hasValidParams
readnonatomicassigninherited

Gets a boolean value indicating whether this WFSensorConnection has valid connection parameters.

When the WFSensorConnection is initiated as a wildcard search, the connection parameters (WFSensorConnection::deviceNumber, WFSensorConnection::transmissionType, etc.) are not set to a specific device. Once the sensor connection is established, the connection parameters will contain values which uniquely identify the connected sensor. At this point the connection parameters may be persisted and used in the future to establish a connection with this same sensor (pairing).

The value of this property is TRUE when the connection parameters are suitable for uniquely identifying a specific sensor. Otherwise, the value is FALSE.

See also
WFSensorConnection::hasWildcardParams
- (BOOL) hasWildcardParams
readnonatomicassigninherited

Gets a boolean value indicating whether the connection parameters for this WFSensorConnection indicate a wildcard search.

See also
WFSensorConnection::hasValidParams
- (BOOL) isANTConnection
readnonatomicassigninherited

TRUE if the sensor is a ANT device, otherwise FALSE.

- (BOOL) isBTLEConnection
readnonatomicassigninherited

TRUE if the sensor is a BTLE device, otherwise FALSE.

- (BOOL) isConnected
readnonatomicassigninherited

TRUE if the sensor is currently connected, otherwise FALSE.

- (BOOL) isValid
readnonatomicassigninherited

Gets a boolean value indicating whether this WFSensorConnection instance is valid.

The WFSensorConnection is invalidated when the sensor is disconnected, or when the API is reset.

Note
The WFSensorConnection instance returned via the requestSensorConnection: (WFHardwareConnector) method should be retained by the application for retrieving data and managing the connection. The Wahoo API will also maintain a reference to this instance (it may be retrieved by the getSensorConnections: (WFHardwareConnector) method). When the sensor is disconnected, the WFSensorConnection instance is invalidated. At this point, the Wahoo API will release its reference to the instance. Once this happens, the instance may not be used to retrieve data, and any properties of the instance will contain spurious values, and should not be used. An application may check for this state with the WFSensorConnection::isValid property.
- (WFNetworkType_t) networkType
readnonatomicassigninherited

Specifies the network type of this WFSensorConnection (ANT+, BTLE, etc).

- (WFSensorSubType_t) sensorSubType
readnonatomicassigninherited

Gets the sensor sub type for this WFSensorConnection.

- (WFSensorType_t) sensorType
readnonatomicassigninherited

Gets the sensor type for this WFSensorConnection.

- (NSTimeInterval) timeSinceLastMessage
readnonatomicassigninherited

Gets the time since the last ANT message was received (in seconds).

WF_INVALID_DATA_TIME if unknown or invalid.

- (UCHAR) transmissionType
readnonatomicassigninherited

Gets the ANT transmission type of the connected sensor.