public class CategoryBody extends SensorBase
SensorBase and describes body sensors on hardware devices.
This class describes the sensor types in the body category, such as the heart rate sensors.
It also provides the method for constructing a CategoryBody instance.
SensorBaseSystemCapability.Sensors#SENSOR| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
SENSOR_TYPE_HEART_RATE |
An integer representing the heart rate sensor type.
|
static int |
SENSOR_TYPE_WEAR_DETECTION |
An integer representing the wear detection sensor type.
|
static String |
STRING_SENSOR_TYPE_HEART_RATE |
A string of characters describing the heart rate sensor type.
|
| 构造器 | 说明 |
|---|---|
CategoryBody(int sensorId,
String name,
String vendor,
int version,
float upperRange,
float resolution,
int flags,
int cacheMaxCount,
long minInterval,
long maxInterval) |
A constructor used to create a
CategoryBody instance. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCacheMaxCount, getFlags, getMaxInterval, getMinInterval, getName, getResolution, getSensorId, getUpperRange, getVendor, getVersionpublic static final int SENSOR_TYPE_HEART_RATE
Heart rate sensors are used to monitor users' health status. A heart rate sensor
records a user's heart rate data and returns the number of heartbeats per minute. Before
subscribing to this sensor, the application needs to request the
ohos.permission.READ_HEALTH_DATA permission.
public static final int SENSOR_TYPE_WEAR_DETECTION
public CategoryBody(int sensorId,
String name,
String vendor,
int version,
float upperRange,
float resolution,
int flags,
int cacheMaxCount,
long minInterval,
long maxInterval)
CategoryBody instance.sensorId - Indicates the ID of the sensor.name - Indicates the name of the sensor.vendor - Indicates the manufacturer of the sensor.version - Indicates the version of the sensor.upperRange - Indicates the maximum measurement range of the sensor.resolution - Indicates the resolution of the sensor.flags - Indicates the flags of the sensor.cacheMaxCount - Indicates the maximum number of hardware FIFO elements supported by
the sensor.minInterval - Indicates the minimum sampling interval of the sensor, in nanoseconds.maxInterval - Indicates the maximum sampling interval of the sensor, in nanoseconds.