int32_t GetAllSensors(SensorInfo **sensorInfo, int32_t *count)
|
Obtains information about all sensors in the system.
Return value: Returns 0 if the information is obtained; returns a non-zero value otherwise.
|
sensorInfo (not NULL): information about all sensors in the system
count (not NULL): total number of sensors in the system
|
int32_t SubscribeSensor(int32_t sensorTypeId, SensorUser *user)
|
Subscribes to sensor data. The system will report the obtained sensor data to the subscriber.
Return value: Returns 0 if the subscription is successful; returns a non-zero value otherwise.
|
sensorTypeId: ID of a sensor type
user (not NULL): sensor subscriber that requests sensor data. A subscriber can obtain data from only one sensor.
|
int32_t UnsubscribeSensor(int32_t sensorTypeId, SensorUser *user)
|
Unsubscribes from sensor data. The system will no longer report sensor data to the subscriber.
Return value: Returns 0 if the unsubscription is successful; returns a non-zero value otherwise.
|
sensorTypeId: ID of a sensor type
user (not NULL): sensor subscriber that requests sensor data. A subscriber can obtain data from only one sensor.
|
int32_t SetBatch(int32_t sensorTypeId, SensorUser *user, int64_t samplingInterval, int64_t reportInterval)
|
Sets the data sampling interval and data reporting interval for the specified sensor.
Return value: Returns 0 if the setting is successful; returns a non-zero value otherwise.
|
sensorTypeId: ID of a sensor type
user (not NULL): sensor subscriber that requests sensor data. A subscriber can obtain data from only one sensor.
samplingInterval: sensor data sampling interval, in nanoseconds
reportInterval: sensor data reporting interval, in nanoseconds
|
int32_t ActivateSensor(int32_t sensorTypeId, SensorUser *user)
|
Enables the specified sensor that has been subscribed to.
Return value: Returns 0 if the sensor is successfully enabled; returns a non-zero value otherwise.
|
sensorTypeId: ID of a sensor type
user (not NULL): sensor subscriber that requests sensor data. A subscriber can obtain data from only one sensor.
|
int32_t DeactivateSensor(int32_t sensorTypeId, SensorUser *user)
|
Disables an enabled sensor.
Return value: Returns 0 if the sensor is successfully disabled; returns a non-zero value otherwise.
|
sensorTypeId: ID of a sensor type
user (not NULL): sensor subscriber that requests sensor data. A subscriber can obtain data from only one sensor.
|
int32_t SetMode(int32_t sensorTypeId, SensorUser *user, int32_t mode)
|
Sets the data reporting mode for the specified sensor.
Return value: Returns 0 if the sensor data reporting mode is successfully set; returns a non-zero value otherwise.
|
sensorTypeId: ID of a sensor type
user (not NULL): sensor subscriber that requests sensor data. A subscriber can obtain data from only one sensor.
mode: data reporting mode of the sensor
|