public class CategoryEnvironmentData extends SensorData<CategoryEnvironment>
SensorData and describes data information of environment sensors.
The data information includes the timestamps, accuracy, data values, and data dimensions of
sensors. This class also provides the method for constructing a CategoryEnvironmentData
instance.
SensorData,
CategoryEnvironmentSystemCapability.Sensors#SENSOR| 限定符和类型 | 类 | 说明 |
|---|---|---|
static class |
CategoryEnvironmentData.GeomagneticField |
Implements the calculation of the geomagnetic field at a specific location on Earth.
|
| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static float |
SEA_PRESSURE |
Indicates the standard atmospheric pressure or the mean sea-level pressure, in hPa.
|
accuracy, DEFAULT_SENSOR_DATA_DIMS, sensor, sensorDataDim, timestamp, values| 构造器 | 说明 |
|---|---|
CategoryEnvironmentData(CategoryEnvironment sensor,
int accuracy,
long timestamp,
int sensorDataDim,
float[] values) |
A constructor used to create a
CategoryEnvironmentData instance. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
static float |
getDeviceAltitude(float currentPressure) |
Obtains the altitude at which the device is located based on the current atmospheric pressure.
|
static float |
getDeviceAltitude(float seaPressure,
float currentPressure) |
Obtains the altitude at which the device is located based on the sea-level atmospheric
pressure and the current atmospheric pressure.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAccuracy, getSensor, getSensorDataDim, getTimestamp, getValuespublic static final float SEA_PRESSURE
public CategoryEnvironmentData(CategoryEnvironment sensor, int accuracy, long timestamp, int sensorDataDim, float[] values)
CategoryEnvironmentData instance.sensor - Indicates a sensor.accuracy - Indicates the sensor accuracy.timestamp - Indicates the sensor timestamp.sensorDataDim - Indicates the data dimension of the sensor.values - Indicates the data values of the sensor.public static float getDeviceAltitude(float seaPressure,
float currentPressure)
seaPressure - Indicates the sea-level atmospheric pressure, in hPa. The value can be
SEA_PRESSURE.currentPressure - Indicates the atmospheric pressure measured by the barometer, in hPa.public static float getDeviceAltitude(float currentPressure)
currentPressure - Indicates the atmospheric pressure measured by the barometer, in hPa.