SMMagnetometerSensor Class Reference

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

Overview

Sensor for getting magnetometer readings from the device

Other Methods

– initWithSenseCallback:timeInterval:

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

Magnetometer sensor

Discussion

Initialises the magnetometer sensor with specified callback and repeat time interval

Declared In

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

  manager

Motion manager for getting the data from

@property (nonatomic, strong) CMMotionManager *manager

Discussion

Motion manager for getting the data from

Declared In

SMMagnetometerSensor.m

  lastX

Last x coordinate

@property (nonatomic) double lastX

Discussion

Last x coordinate

Declared In

SMMagnetometerSensor.m

  lastY

Last y coordinate

@property (nonatomic) double lastY

Discussion

Last y coordinate

Declared In

SMMagnetometerSensor.m

  lastZ

Last z coordinate

@property (nonatomic) double lastZ

Discussion

Last z coordinate

Declared In

SMMagnetometerSensor.m

  queue

Operation queue for receiving the information periodically to

@property (nonatomic, strong) NSOperationQueue *queue

Discussion

Operation queue for receiving the information periodically to

Declared In

SMMagnetometerSensor.m