qnx.sensors.Magnetometer

Magnetometer

Properties | Methods | Events


Packageqnx.sensors
Classpublic final class Magnetometer
InheritanceMagnetometer Inheritance flash.events.EventDispatcher

Provides values from the Magnetometer sensor.

Class information:
PlayBook Tablet OS Version: 2.1
Found in:  QNXSensors.ane

See also

MagnetometerEvent



Public Properties

 PropertyDefined By
  isSupported : Boolean
[static] [read-only] Returns true if the Magnetometer is supported on the platform the application is currently running on.
Magnetometer

Public Methods

 MethodDefined By
  
Constructs a Magnetometer object.
Magnetometer
  
Get the default delay of a sensor.
Magnetometer
  
Get the maximum delay of a sensor.
Magnetometer
  
Get the minimum delay of a sensor.
Magnetometer
  
getRangeMax():Number
Get the maximum range of a sensor.
Magnetometer
  
getRangeMin():Number
Get the minimum range of a sensor.
Magnetometer
  
getResolution():Number
Get the resolution of a sensor.
Magnetometer
  
setRequestedUpdateInterval(interval:Number):Boolean
Set a sensor's refresh rate The setRequestedUpdateInterval function sets the rate at which the specified sensor should provide updates.
Magnetometer
  
skipDuplicateEvents(skipEvents:Boolean):Boolean
Specify whether duplicate sensor events should be skipped.
Magnetometer
  
start():Boolean
Starts the Magnetometer sensor.
Magnetometer
  
stop():Boolean
Stops the Magnetometer sensor.
Magnetometer

Events

 Event Summary Defined By
  Dispatched when new data from the Magnetometer is availableMagnetometer

Property Detail

isSupported


isSupported:Boolean  [read-only]

Returns true if the Magnetometer is supported on the platform the application is currently running on.


Implementation

public static function get isSupported():Boolean

Constructor Detail

Magnetometer()


public function Magnetometer()

Constructs a Magnetometer object.

Method Detail

getDelayDefault()


public function getDelayDefault():int

Get the default delay of a sensor. The getDelayDefault() function gets the default delay of the sensor that is represented by the specified sensor information.

Returns

int — The sensor's default delay.

getDelayMax()


public function getDelayMax():int

Get the maximum delay of a sensor. The getDelayMax() function gets the maximum delay of the sensor that is represented by the specified sensor information.

Returns

int — The sensor's maximum delay.

getDelayMin()


public function getDelayMin():int

Get the minimum delay of a sensor. The getDelayMin() function gets the minimum delay of the sensor that is represented by the specified sensor information.

Returns

int — The sensor's minimum delay.

getRangeMax()


public function getRangeMax():Number

Get the maximum range of a sensor. The getRangeMax() function gets the maximum range of the sensor that is represented by the specified sensor information.

Returns

Number — The sensor's maximum range. NaN will be returned if the resolution could not be retrieved.

getRangeMin()


public function getRangeMin():Number

Get the minimum range of a sensor. The getRangeMin() function gets the minimum range of the sensor that is represented by the specified sensor information.

Returns

Number — The sensor's minimum range. NaN will be returned if the resolution could not be retrieved.

getResolution()


public function getResolution():Number

Get the resolution of a sensor. The getResolution function gets the resolution of the sensor that is represented by the specified sensor information. The resolution represents the sensitivity of a sensor.

Returns

Number — The sensor's resolution. NaN will be returned if the resolution could not be retrieved.

setRequestedUpdateInterval()


public function setRequestedUpdateInterval(interval:Number):Boolean

Set a sensor's refresh rate The setRequestedUpdateInterval function sets the rate at which the specified sensor should provide updates. The device attempts to achieve the specified rate, but this is not guaranteed; the sensor might provide updates more frequently or less frequently than the specified rate. The rate that you specify here corresponds roughly to the number of sensor events that are delivered to the event queue for your application.

Parameters

interval:Number — The rate to set (in milliseconds).

Returns

Booleantrue upon success.

skipDuplicateEvents()


public function skipDuplicateEvents(skipEvents:Boolean):Boolean

Specify whether duplicate sensor events should be skipped. The skipDuplicateEvents() function enables or disables the skipping of duplicate events that are received from the Magnetometer sensor. Calling this method effects all Magnetometer instances.

Parameters

skipEvents:Boolean — If true the device should attempt to skip duplicate events from the specified sensor, if false the device should not skip duplicate events.

Returns

Boolean — Returns true if the call was successful.

start()


public function start():Boolean

Starts the Magnetometer sensor.

Returns

Boolean

Throws

Error — An error is thrown if the Magnetometer cannot be started.

See also

stop()

stop()


public function stop():Boolean

Stops the Magnetometer sensor. When you no longer wish to recieve values from the Magnetometer make sure to stop it.

Returns

Boolean

See also

start()

Event Detail

magnetometerUpdate


Event Object Type: qnx.events.MagnetometerEvent
MagnetometerEvent.type property = qnx.events.MagnetometerEvent.UPDATE

Dispatched when new data from the Magnetometer is available

Defines the value of the type property of a MagnetometerEvent event object.