CSSensorStore Class Reference

Inherits from NSObject
Conforms to CSDataStore
Declared in CSSensorStore.h

Overview

Handles sensor data storing and uploading. Start all sensors and data providers.

Data is stored locally for 30 days. After a succesfull upload, older data is removed.

  allAvailableSensorClasses

@property (readonly) NSArray *allAvailableSensorClasses

  sensors

@property (readonly) NSArray *sensors

  sender

@property (readonly) CSSender *sender

+ sharedSensorStore

+ (CSSensorStore *)sharedSensorStore

+ device

+ (NSDictionary *)device

– init

- (id)init

– loginChanged

- (void)loginChanged

– setEnabled:

- (void)setEnabled:(BOOL)enable

– enabledChanged:

- (void)enabledChanged:(id)notification

– setSyncRate:

- (void)setSyncRate:(int)newRate

– addSensor:

- (void)addSensor:(CSSensor *)sensor

– getDataForSensor:onlyFromDevice:nrLastPoints:

- (NSArray *)getDataForSensor:(NSString *)name onlyFromDevice:(bool)onlyFromDevice nrLastPoints:(NSInteger)nrLastPoints

– getLocalDataForSensor:from:to:andOrder:withLimit:

Retrieve data from a sensor that is stored locally between a certain time interval

- (NSArray *)getLocalDataForSensor:(NSString *)name from:(NSDate *)startDate to:(NSDate *)endDate andOrder:(NSString *)order withLimit:(int)nrOfPoints

Parameters

name

The name of the sensor as an NSString

startDate

The date and time of the first datapoint to look for (inclusive)

endDate

The data and time of the last datapoint to look for (exclusive)

order

Whether the returning datapoints are ordered in an ascending or descending way. Valid values are ‘ASC’ and ‘DESC’

nrOfPoints

Limit to the nr of points that will be returned. This will take into account the ordering to select only the latest (descending) or first (ascending)

Return Value

An array with dictionaries of time-value pairs

Declared In

CSSensorStore.h

– removeLocalData

- (void)removeLocalData

– getLocalDataForSensor:andDeviceType:from:to:

Retrieve data from a sensor and device type combination that is stored locally between a certain time interval

- (NSArray *)getLocalDataForSensor:(NSString *)sensorName andDeviceType:(NSString *)deviceType from:(NSDate *)startDate to:(NSDate *)endDate

Parameters

sensorName

The name of the sensor as an NSString

deviceType

The name of the device type as an NSString

startDate

The date and time of the first datapoint to look for (inclusive)

endDate

The data and time of the last datapoint to look for (exclusive)

Return Value

An array with dictionaries of time-value pairs

Declared In

CSSensorStore.h

– giveFeedbackOnState:from:to:label:

- (void)giveFeedbackOnState:(NSString *)state from:(NSDate *)from to:(NSDate *)to label:(NSString *)label

– forceDataFlush

- (void)forceDataFlush

– forceDataFlushAndBlock

- (void)forceDataFlushAndBlock

– generalSettingChanged:

- (void)generalSettingChanged:(NSNotification *)notification

– requestLocationPermission

- (void)requestLocationPermission

– locationPermissionState

- (CLAuthorizationStatus)locationPermissionState