Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
etc/init/ | 12-May-2024 | - | 133 | 124 | ||
LICENSE | D | 12-May-2024 | 10.1 KiB | 177 | 150 | |
OAT.xml | D | 12-May-2024 | 7.1 KiB | 79 | 58 | |
README.md | D | 12-May-2024 | 2.9 KiB | 60 | 47 | |
README_zh.md | D | 12-May-2024 | 2.8 KiB | 60 | 47 | |
bundle.json | D | 12-May-2024 | 628 | 28 | 28 |
README.md
1# Sensor<a name="EN-US_TOPIC_0000001148682248"></a> 2 3- [Introduction](#section11660541593) 4- [Directory Structure](#section44981327519) 5- [Usage](#section1581412211528) 6- [Repositories Involved](#section96071132185310) 7 8## Introduction<a name="section11660541593"></a> 9 10Start sensor, vibrator and other small device services. 11 12## Directory Structure<a name="section44981327519"></a> 13 14The sample code for importing the start module is as follows: 15 16``` 17/base/sensors/start 18├── etc 19 └── init # Place the startup file for the hsensor process 20``` 21 22## Usage<a name="section1581412211528"></a> 23The repository places the startup file of the sensors process to start sensor and small device services such as vibrator. Sensor and small device services such as vibrator share the sensors process.<br> 24Service code for sensor and small device services such as vibrator is [sensors\_sensor](https://gitee.com/openharmony/sensors_sensor) and [sensors\_miscdevice](https://gitee.com/openharmony/sensors_miscdevice) part compartments, respectively. when selecting a part, the product may select either or both parts as needed. This requires that the startup file of the sensors process be placed in a separate start-up part compartment, shared by the two parts, so that any part silo with the starter part can start the sensors process and prevent duplicate start-up of the process.<br> 25Service startup profiles for sensor and small device services such as vibrator are in the sa_profile directory of [sensors\_sensor](https://gitee.com/openharmony/sensors_sensor) and [sensors\_miscdevice](https://gitee.com/openharmony/sensors_miscdevice) part, respectively.The resulting system/profile/sensors.xml file is compiled, as follows.Of these, 3601 and 3602 serve the sensor and vibrator.If only the [sensors\_sensor](https://gitee.com/openharmony/sensors_sensor) code is compiled, the sensors.xml file contains only the configuration items for the 3601 service. The sensors.xml file starts the service when the sensors process is started. 26``` 27<?xml version="1.0" encoding="utf-8"?> 28<info> 29 <process>sensors</process> 30 <loadlibs> 31 <libpath>libmiscdevice_service.z.so</libpath> 32 <libpath>libsensor_service.z.so</libpath> 33 </loadlibs> 34 <systemability> 35 <name>3602</name> 36 <libpath>libmiscdevice_service.z.so</libpath> 37 <run-on-create>true</run-on-create> 38 <distributed>false</distributed> 39 <dump-level>1</dump-level> 40 </systemability> 41 <systemability> 42 <name>3601</name> 43 <libpath>libsensor_service.z.so</libpath> 44 <run-on-create>true</run-on-create> 45 <distributed>false</distributed> 46 <dump-level>1</dump-level> 47 </systemability> 48</info> 49``` 50 51## Repositories Involved<a name="section96071132185310"></a> 52 53Pan-sensor subsystem 54 55[sensors\_sensor](https://gitee.com/openharmony/sensors_sensor) 56 57[sensors\_miscdevice](https://gitee.com/openharmony/sensors_miscdevice) 58 59**sensors\_start** 60
README_zh.md
1# Sensor组件<a name="ZH-CN_TOPIC_0000001148682248"></a> 2 3- [简介](#section11660541593) 4- [目录](#section44981327519) 5- [使用](#section1581412211528) 6- [相关仓](#section96071132185310) 7 8## 简介<a name="section11660541593"></a> 9sensors_start仓归属于[泛sensor服务子系统](https://gitee.com/openharmony/docs/blob/master/zh-cn/readme/%E6%B3%9BSensor%E5%AD%90%E7%B3%BB%E7%BB%9F.md),该仓主要提供了泛sensor服务进程(即sensors)的启动文件。<br> 10 11## 目录<a name="section44981327519"></a> 12 13sensors_start仓的目录结构如下: 14 15``` 16/base/sensors/start 17├── etc 18 └── init # 放置sensors进程的启动文件 19``` 20 21## 使用<a name="section1581412211528"></a> 22泛sensor服务子系统提供了sensor服务和miscdevice服务,分别在[sensors\_sensor](https://gitee.com/openharmony/sensors_sensor)和[sensors\_miscdevice](https://gitee.com/openharmony/sensors_miscdevice)部件仓。产品根据需要可能选择其中一个服务或者两个服务都选择。因此将sensors进程的启动文件单独放置在sensors_start仓,由这两个服务共享,这样任何一个服务搭配启动部件就可以启动sensors进程,防止重复启动进程。<br> 23sensor服务和miscdevice服务的启动配置文件分别在[sensors\_sensor](https://gitee.com/openharmony/sensors_sensor)和[sensors\_miscdevice](https://gitee.com/openharmony/sensors_miscdevice)仓中sa_profile目录下,编译后生成sensors.xml文件,内容如下所示: 24``` 25<?xml version="1.0" encoding="utf-8"?> 26<info> 27 <process>sensors</process> 28 <loadlibs> 29 <libpath>libmiscdevice_service.z.so</libpath> 30 <libpath>libsensor_service.z.so</libpath> 31 </loadlibs> 32 <systemability> 33 <name>3602</name> 34 <libpath>libmiscdevice_service.z.so</libpath> 35 <run-on-create>true</run-on-create> 36 <distributed>false</distributed> 37 <dump-level>1</dump-level> 38 </systemability> 39 <systemability> 40 <name>3601</name> 41 <libpath>libsensor_service.z.so</libpath> 42 <run-on-create>true</run-on-create> 43 <distributed>false</distributed> 44 <dump-level>1</dump-level> 45 </systemability> 46</info> 47``` 48其中3601和3602分别为sensor服务和马达服务。若仅编译[sensors\_sensor](https://gitee.com/openharmony/sensors_sensor)仓代码,sensors.xml文件中则仅包含3601服务的配置项。启动sensors进程时会加载sensors.xml文件启动对应的服务。 49 50## 相关仓<a name="section96071132185310"></a> 51 52[泛sensor服务子系统](https://gitee.com/openharmony/docs/blob/master/zh-cn/readme/%E6%B3%9BSensor%E5%AD%90%E7%B3%BB%E7%BB%9F.md) 53 54[sensors\_sensor](https://gitee.com/openharmony/sensors_sensor) 55 56[sensors\_miscdevice](https://gitee.com/openharmony/sensors_miscdevice) 57 58**sensors\_start** 59 60