S - Indicates a category of sensors.CategoryBodyData, CategoryEnvironmentData, CategoryLightData, CategoryMotionData, CategoryOrientationData, CategoryOtherDatapublic class SensorData<S extends SensorBase> extends Object
The data information includes the timestamps, accuracy, data values, and data dimensions of
sensors. This class also provides the method for constructing a SensorData instance.
SystemCapability.Sensors#SENSOR| 限定符和类型 | 字段 | 说明 |
|---|---|---|
int |
accuracy |
Indicates the accuracy of a sensor.
|
protected static int |
DEFAULT_SENSOR_DATA_DIMS |
Indicates the default data dimension of a sensor.
|
S |
sensor |
Indicates a category of sensors.
|
int |
sensorDataDim |
Indicates the data dimension of a sensor.
|
long |
timestamp |
Indicates the timestamp of a sensor.
|
float[] |
values |
Indicates the data values of a sensor.
|
| 构造器 | 说明 |
|---|---|
SensorData(S sensor,
int accuracy,
long timestamp,
int sensorDataDim,
float[] values) |
A constructor used to create a
SensorData instance. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
int |
getAccuracy() |
Obtains the accuracy of a sensor.
|
S |
getSensor() |
Obtains a category of sensors.
|
int |
getSensorDataDim() |
Obtains the data dimension of a sensor.
|
long |
getTimestamp() |
Obtains the timestamp of a sensor.
|
float[] |
getValues() |
Obtains the data values of a sensor.
|
protected static final int DEFAULT_SENSOR_DATA_DIMS
public int accuracy
public S extends SensorBase sensor
public int sensorDataDim
public long timestamp
public float[] values
public SensorData(S sensor, int accuracy, long timestamp, int sensorDataDim, float[] values)
SensorData 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 S getSensor()
public int getAccuracy()
public long getTimestamp()
public int getSensorDataDim()
public float[] getValues()