pan-sensor.md 1.7 KB
Newer Older
1
# Pan-Sensor
L
liudongmiao 已提交
2

3
## Introduction
L
liudongmiao 已提交
4 5 6 7 8 9 10 11 12 13 14 15

The pan-sensor service subsystem provides a lightweight sensor service framework, through which you can perform the following operations:

-   Query the sensor list.
-   Enable or disable a sensor.
-   Subscribe to or unsubscribe from sensor data.
-   Set the data reporting mode of a sensor.

The following figure shows the architecture of the pan-sensor service framework.

![](figures/en-us_image_0000001106694563.png)

16
## Directory Structure
L
liudongmiao 已提交
17 18 19 20

```
/base/sensors
├── sensor_lite          # Sensor directory
L
liudongmiao 已提交
21 22 23
│   ├── frameworks       # Framework code
│   ├── interfaces       # Native APIs
│   └── services         # Code of services
L
liudongmiao 已提交
24 25 26
└── miscdevice_lite      # Misc device directory
```

27
## Usage
L
liudongmiao 已提交
28 29 30 31 32 33 34

The following modules work cooperatively to implement pan-sensor capabilities: Sensor API, Sensor Framework, and Sensor Service.

-   Sensor API: provides APIs for performing basic operations on sensors, including querying the sensor list, enabling or disabling sensors, and subscribing to or unsubscribing from sensor data.
-   Sensor Framework: manages sensor data subscription, creates and destroys data channels, subscribes to or unsubscribes from sensor data, and implements communication with the Sensor Service module.
-   Sensor Service: interacts with the HDF module to receive, parse, and distribute data, manages sensor services and sensor data reporting, and controls sensor permissions.

35
## Repositories Involved
L
liudongmiao 已提交
36 37 38

**Pan-sensor subsystem**

L
liudongmiao 已提交
39
[sensors_sensor_lite](https://gitee.com/openharmony/sensors_sensor_lite/blob/master/README.md)
L
liudongmiao 已提交
40

L
liudongmiao 已提交
41
[sensors_miscdevice_lite](https://gitee.com/openharmony/sensors_miscdevice_lite/blob/master/README.md)
L
liudongmiao 已提交
42