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
WFConnectorSettings Class Reference

Provides a means of persisting settings for the WFConnector. More...

#import <WFConnectorSettings.h>

+ Inheritance diagram for WFConnectorSettings:
+ Collaboration diagram for WFConnectorSettings:

Instance Methods

(WFConnectionParams *) - connectionParamsForSensorType:
 Retrieves the connection parameters for the specified sensor type. More...
 
(NSArray *) - deviceParamsForSensorType:
 Returns an array of device params for the specified sensor type. More...
 
(BOOL- removeDeviceParams:forSensorType:
 Removes the specified connection parameters from the paired sensors store. More...
 
(BOOL- saveConnectionInfo:
 Saves the parameters for the specified WFSensorConnection in the paired sensor store. More...
 
(void) - setApplicationName:forSensor:subType:
 Saves the application name used for the given sensor and sensor subtype. More...
 

Properties

NSSet * antBridgeWhitelist
 
NSTimeInterval bikeCoastingTimeout
 The bike coasting timeout, in seconds. More...
 
float bikeWheelCircumference
 Specifies the bike wheel circumference, in meters. More...
 
NSTimeInterval discoveryTimeout
 Gets or sets the device discovery timeout, in seconds. More...
 
BOOL isAntBridgeAutoEnabled
 Gets or sets a flag indicating whether the ANT Bridge should be automatically enabled when it becomes available. More...
 
NSTimeInterval searchTimeout
 Gets or sets the search timeout, in seconds. More...
 
NSString * staleDataString
 The string returned by data formatting methods when data for the sensor is considered "stale". More...
 
NSTimeInterval staleDataTimeout
 The stale data timeout, in seconds. More...
 
BOOL useMetricUnits
 Specifies whether the data formatting methods use metric units. More...
 

Detailed Description

Provides a means of persisting settings for the WFConnector.

This class provides methods to store and retrieve connection parameters for paired sensors. When a new connection is made, the WFSensorConnection for that connection can be passed to the saveConnectionInfo: (WFConnectorSettings) method. This method will persist the connection parameters for use in connection requests at a later time. The connectionParamsForSensorType: (WFConnectorSettings) method is used to retrieve these connection parameters (for up to four previously-paired devices).

Method Documentation

- (WFConnectionParams*) connectionParamsForSensorType: (WFSensorType_t sensorType

Retrieves the connection parameters for the specified sensor type.

Parameters
sensorTypeThe type of sensor for which to retrieve connection params.
Returns
A WFConnectionParams instance suitable for initiating a connection to any of up to four previously paired sensors. If no previously paired sensors exist, the WFConnectionParams returned will be suitable for initiating a wildcard connection to the specified sensor type.
- (NSArray*) deviceParamsForSensorType: (WFSensorType_t sensorType

Returns an array of device params for the specified sensor type.

Parameters
sensorTypeThe type of sensor for which to retrieve params.
Returns
An array of WFDeviceParams representing the connection parameters of up to four previously paired devices. If no previously paired devices exist, an empty array is returned.
- (BOOL) removeDeviceParams: (WFDeviceParams *)  devParams
forSensorType: (WFSensorType_t sensorType 

Removes the specified connection parameters from the paired sensors store.

Parameters
devParamsThe device connection parameters to be removed.
sensorTypeThe type of sensor for which the pairing params are to be removed.
Returns
TRUE if the params were removed, otherwise FALSE.
- (BOOL) saveConnectionInfo: (WFSensorConnection *)  connectionInfo

Saves the parameters for the specified WFSensorConnection in the paired sensor store.

Up to four sensors may be paired for any sensor type. The latest connection parameters are stored at the top of the array. When a new connection is saved, in the case where four connections were previously saved, the oldest is dropped. If a connection is saved, but had been saved previously, it is moved to the top of the array. This essentially means that the four latest connections are stored.

Parameters
connectionInfoThe connection to be stored.
Returns
TRUE if the params were stored, otherwise FALSE.
- (void) setApplicationName: (NSString *)  name
forSensor: (WFSensorType_t sensorType
subType: (WFSensorSubType_t subType 

Saves the application name used for the given sensor and sensor subtype.

This application name is used for devices that show confirmation of connection feeback and by default use the Apps display name. Although for some devices like the Casio watch you may want to set a custom name as it has a limit of 5 characters.

Property Documentation

- (NSSet*) antBridgeWhitelist
readwritenonatomicassign
- (NSTimeInterval) bikeCoastingTimeout
readwritenonatomicassign

The bike coasting timeout, in seconds.

If no data is received for this duration, the bike is considered to be coasting. When coasting, the data formatters will return the WFConnectorSettings::staleDataString for instantaneous values.

Note
The default value is 3 seconds.
- (float) bikeWheelCircumference
readwritenonatomicassign

Specifies the bike wheel circumference, in meters.

This value is used to determine speed and distance in the bike sensors.

Note
The default value is 2.07 m (207 cm).
- (NSTimeInterval) discoveryTimeout
readwritenonatomicassign

Gets or sets the device discovery timeout, in seconds.

This value may be persisted and used in the device discovery request to specify the discovery timeout.

- (BOOL) isAntBridgeAutoEnabled
readwritenonatomicassign

Gets or sets a flag indicating whether the ANT Bridge should be automatically enabled when it becomes available.

If TRUE, the ANT Bridge will be automatically configured and enabled when a Wahoo Fitness BTLE device supporting the ANT Bridge functionallity is connected. If FALSE, the application must explicitly enable the ANT Bridge via the enableAntBridge: (WFHardwareConnector) method.

Note
This property only affects Wahoo Fitness BTLE devices which support the ANT Bridge, such as the RFLKT+.
- (NSTimeInterval) searchTimeout
readwritenonatomicassign

Gets or sets the search timeout, in seconds.

A value of 0 disables the search timeout.

This value may be persisted and used in a connection request to specify the timeout for the searh.

- (NSString*) staleDataString
readwritenonatomicassign

The string returned by data formatting methods when data for the sensor is considered "stale".

Note
The default value is "--".
See also
WFConnectorSettings::staleDataTimeout
- (NSTimeInterval) staleDataTimeout
readwritenonatomicassign

The stale data timeout, in seconds.

If the time since the latest data was received from the sensor exceeds this value, the data for that sensor will be considered "stale". In this case, the data formatting methods for that sensor type will return the WFConnectorSettings::staleDataString for instantaneous data types.

An example of a data formatting method for an instantaneous data type is the formattedSpeed: (WFBikeSpeedCadenceData) method. The WFConnectorSettings::staleDataString is used for this type when data is in the "stale" condition. An example data formatting method for an accumulated data type is the formattedDistance: (WFBikeSpeedCadenceData) method. The value for this type is returned, whether or not data is considered stale.

Note
The default value is 5 seconds.
- (BOOL) useMetricUnits
readwritenonatomicassign

Specifies whether the data formatting methods use metric units.

If this value is true, data is formatted using metric units, otherwise, imperial units are used.

Note
The default value is FALSE.