SMStepSensor Class Reference

Inherits from SMSensor : NSObject
Declared in SMStepSensor.h
SMStepSensor.m

Overview

A sensor for detecting the number of steps that a user has made

Other Methods

– initWithSenseCallback:timeInterval:

Initialises the step sensor with specified callback and repeat time interval

- (id)initWithSenseCallback:(SenseCallback)callback timeInterval:(NSTimeInterval)secs

Parameters

callback

callback for data

secs

seconds between sensing

Return Value

Step sensor

Discussion

Initialises the step sensor with specified callback and repeat time interval

Declared In

SMStepSensor.h

Other Methods

+ isAvailable

Checks whether the sensor is available at runtime

+ (BOOL)isAvailable

Return Value

Sensor available

Discussion

Checks whether the sensor is available at runtime

Declared In

SMSensor.h

– initWithSenseCallback:

Initialises an SMSensor with specified callback.

- (id)initWithSenseCallback:(SenseCallback)callback

Parameters

callback

Callback to send the data to

Return Value

SMSensor Instance

Discussion

Initialises an SMSensor with specified callback.

Note: This class can not be instantiated from outside this library. Use the relevant subclasses for a particular sensor

Declared In

SMSensor.h

– sense

Requests data to be sent from the sensor to the callback as soon as it’s available

- (void)sense

Discussion

Requests data to be sent from the sensor to the callback as soon as it’s available

Declared In

SMSensor.h

Extension Methods

  dateStarted

Date for when this sensor was started

@property (nonatomic, strong) NSDate *dateStarted

Discussion

Date for when this sensor was started

Declared In

SMStepSensor.m

  pedometer

Pedometer sensor

@property (nonatomic, strong) CMPedometer *pedometer

Discussion

Pedometer sensor

Declared In

SMStepSensor.m

  numberOfSteps

Number of steps taken in total

@property (nonatomic) int numberOfSteps

Discussion

Number of steps taken in total

Declared In

SMStepSensor.m

  timer

Timer for repeat scheduling

@property (nonatomic, strong) NSTimer *timer

Discussion

Timer for repeat scheduling

Declared In

SMStepSensor.m