SMAccelerometerSensor Class Reference

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

Overview

A sensor for reading accelerometer information from the device

The data returned from this sensor is in the form of the SM3DMotionSensorData class.

Other Methods

– initWithSenseCallback:timeInterval:

Initialises the accelerometer 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

Accelerometer sensor

Discussion

Initialises the accelerometer sensor with specified callback and repeat time interval

Declared In

SMAccelerometerSensor.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

  motionManager

Instance of the motion manager to read data from

@property (nonatomic, strong) CMMotionManager *motionManager

Discussion

Instance of the motion manager to read data from

Declared In

SMAccelerometerSensor.m

  currentData

Latest data received from the sensor

@property (atomic, strong) SM3DMotionSensorData *currentData

Discussion

Latest data received from the sensor

Declared In

SMAccelerometerSensor.m

  operationQueue

Operation queue for receiving data

@property (nonatomic, strong) NSOperationQueue *operationQueue

Discussion

Operation queue for receiving data

Declared In

SMAccelerometerSensor.m