MoSync 3.0.1
Sensor Functions

Functions

int maSensorStart (int sensor, int interval)
 Enables a sensor and starts sending events if the sensor is available. If the sensor is already enabled this call will have no effect.
int maSensorStop (int sensor)
 Disables a sensor so that it doesn't send any further events.

Function Documentation

int maSensorStart ( int  sensor,
int  interval 
)

Enables a sensor and starts sending events if the sensor is available. If the sensor is already enabled this call will have no effect.

Parameters:
sensorThe sensor which should be enabled. One of the SENSOR_TYPE constants.
intervalTime interval in which a sensor update shall be triggered. Can be one of the SENSOR_RATE constants or a time interval in milliseconds.
Returns:
SENSOR_ERROR_NONE on success. SENSOR_ERROR_NOT_AVAILABLE if this sensor wasn't available. SENSOR_ERROR_INTERVAL_NOT_SET if the interval wasn't set, could be due to platform limitations. SENSOR_ERROR_ALREADY_ENABLED if the sensor already was enabled.
See also:
EVENT_TYPE_SENSOR

References maIOCtl().

int maSensorStop ( int  sensor)

Disables a sensor so that it doesn't send any further events.

Parameters:
sensorThe sensor which should be disabled. One of the SENSOR_TYPE constants.
Returns:
SENSOR_ERROR_NONE on success. SENSOR_ERROR_NOT_ENABLED if this sensor wasn't enabled. SENSOR_ERROR_CANNOT_DISABLE if there was a problem disabling the sensor.
See also:
EVENT_TYPE_SENSOR

References maIOCtl().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines