From cab357d470b303afc8f0e1e2d7008b0940bd7e5f Mon Sep 17 00:00:00 2001 From: wangyipeng Date: Tue, 15 Feb 2022 21:57:47 +0800 Subject: [PATCH] Fix:HDI prefix modify Signed-off-by: wangyipeng --- battery/v1_0/BUILD.gn | 36 +++++++++++++++++ battery/v1_0/IBatteryCallback.idl | 22 +++++++++++ battery/v1_0/IBatteryInterface.idl | 33 ++++++++++++++++ battery/v1_0/Types.idl | 59 ++++++++++++++++++++++++++++ light/v1_0/BUILD.gn | 2 +- light/v1_0/ILightInterface.idl | 4 +- light/v1_0/LightTypes.idl | 2 +- power/v1_0/BUILD.gn | 36 +++++++++++++++++ power/v1_0/IPowerHdiCallback.idl | 21 ++++++++++ power/v1_0/IPowerInterface.idl | 28 +++++++++++++ power/v1_0/PowerTypes.idl | 37 +++++++++++++++++ sensor/v1_0/BUILD.gn | 2 +- sensor/v1_0/ISensorCallback.idl | 4 +- sensor/v1_0/ISensorInterface.idl | 6 +-- sensor/v1_0/SensorTypes.idl | 2 +- thermal/v1_0/BUILD.gn | 36 +++++++++++++++++ thermal/v1_0/IThermalCallback.idl | 22 +++++++++++ thermal/v1_0/IThermalInterface.idl | 28 +++++++++++++ thermal/v1_0/ThermalTypes.idl | 25 ++++++++++++ vibrator/v1_0/BUILD.gn | 2 +- vibrator/v1_0/IVibratorInterface.idl | 4 +- vibrator/v1_0/VibratorTypes.idl | 2 +- 22 files changed, 398 insertions(+), 15 deletions(-) create mode 100755 battery/v1_0/BUILD.gn create mode 100755 battery/v1_0/IBatteryCallback.idl create mode 100755 battery/v1_0/IBatteryInterface.idl create mode 100755 battery/v1_0/Types.idl create mode 100755 power/v1_0/BUILD.gn create mode 100755 power/v1_0/IPowerHdiCallback.idl create mode 100755 power/v1_0/IPowerInterface.idl create mode 100755 power/v1_0/PowerTypes.idl create mode 100755 thermal/v1_0/BUILD.gn create mode 100755 thermal/v1_0/IThermalCallback.idl create mode 100755 thermal/v1_0/IThermalInterface.idl create mode 100755 thermal/v1_0/ThermalTypes.idl diff --git a/battery/v1_0/BUILD.gn b/battery/v1_0/BUILD.gn new file mode 100755 index 00000000..d9d97019 --- /dev/null +++ b/battery/v1_0/BUILD.gn @@ -0,0 +1,36 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//drivers/adapter/uhdf2/hdi.gni") +if (defined(ohos_lite)) { + group("libbattery_proxy_1.0") { + deps = [] + public_configs = [] + } +} else { + hdi("battery") { + package = "OHOS.HDI.battery.v1_0" + + module_name = "battery_interface_service" + + sources = [ + "IBatteryCallback.idl", + "IBatteryInterface.idl", + "Types.idl", + ] + + language = "cpp" + subsystem_name = "hdf" + part_name = "battery_device_driver" + } +} diff --git a/battery/v1_0/IBatteryCallback.idl b/battery/v1_0/IBatteryCallback.idl new file mode 100755 index 00000000..02b736e3 --- /dev/null +++ b/battery/v1_0/IBatteryCallback.idl @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package OHOS.HDI.battery.v1_0; + +import OHOS.HDI.battery.v1_0.Types; + +[callback] interface IBatteryCallback { + Update([in] struct CallbackInfo event); +} diff --git a/battery/v1_0/IBatteryInterface.idl b/battery/v1_0/IBatteryInterface.idl new file mode 100755 index 00000000..46bd03d4 --- /dev/null +++ b/battery/v1_0/IBatteryInterface.idl @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package OHOS.HDI.battery.v1_0; + +import OHOS.HDI.battery.v1_0.Types; +import OHOS.HDI.battery.v1_0.IBatteryCallback; + +interface IBatteryInterface { + Register([in] IBatteryCallback event); + UnRegister(); + ChangePath([in] String path); + GetCapacity([out] int capacity); + GetVoltage([out] int voltage); + GetTemperature([out] int temperature); + GetHealthState([out] enum BatteryHealthState healthState); + GetPluggedType([out] enum BatteryPluggedType pluggedType); + GetChargeState([out] enum BatteryChargeState chargeState); + GetPresent([out] boolean present); + GetTechnology([out] String technology); +} diff --git a/battery/v1_0/Types.idl b/battery/v1_0/Types.idl new file mode 100755 index 00000000..fcf756e7 --- /dev/null +++ b/battery/v1_0/Types.idl @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package OHOS.HDI.battery.v1_0; + +enum BatteryHealthState +{ + BATTERY_HEALTH_UNKNOWN = 0, + BATTERY_HEALTH_GOOD, + BATTERY_HEALTH_OVERHEAT, + BATTERY_HEALTH_OVERVOLTAGE, + BATTERY_HEALTH_COLD, + BATTERY_HEALTH_DEAD, + BATTERY_HEALTH_RESERVED, +}; + +enum BatteryChargeState +{ + CHARGE_STATE_NONE = 0, + CHARGE_STATE_ENABLE, + CHARGE_STATE_DISABLE, + CHARGE_STATE_FULL, + CHARGE_STATE_RESERVED, +}; + +enum BatteryPluggedType +{ + PLUGGED_TYPE_NONE = 0, + PLUGGED_TYPE_AC, + PLUGGED_TYPE_USB, + PLUGGED_TYPE_WIRELESS, + PLUGGED_TYPE_BUTT +}; + +struct CallbackInfo { + int capacity; + int voltage; + int temperature; + int healthState; + int pluggedType; + int pluggedMaxCurrent; + int pluggedMaxVoltage; + int chargeState; + int chargeCounter; + byte present; + String technology; +}; diff --git a/light/v1_0/BUILD.gn b/light/v1_0/BUILD.gn index be9b3176..33fffc65 100755 --- a/light/v1_0/BUILD.gn +++ b/light/v1_0/BUILD.gn @@ -20,7 +20,7 @@ if (defined(ohos_lite)) { } } else { hdi("light") { - package = "light.v1_0" + package = "OHOS.HDI.light.v1_0" module_name = "light_service" diff --git a/light/v1_0/ILightInterface.idl b/light/v1_0/ILightInterface.idl index 6d347f9e..75c61ada 100755 --- a/light/v1_0/ILightInterface.idl +++ b/light/v1_0/ILightInterface.idl @@ -13,8 +13,8 @@ * limitations under the License. */ -package light.v1_0; -import light.v1_0.LightTypes; +package OHOS.HDI.light.v1_0; +import OHOS.HDI.light.v1_0.LightTypes; interface ILightInterface { GetLightInfo([out] struct HdfLightInfo[] info); diff --git a/light/v1_0/LightTypes.idl b/light/v1_0/LightTypes.idl index 8e151c9e..d6beab98 100755 --- a/light/v1_0/LightTypes.idl +++ b/light/v1_0/LightTypes.idl @@ -13,7 +13,7 @@ * limitations under the License. */ -package light.v1_0; +package OHOS.HDI.light.v1_0; enum HdfLighType { HDF_LIGHT_TYPE_BATTERY = 1, diff --git a/power/v1_0/BUILD.gn b/power/v1_0/BUILD.gn new file mode 100755 index 00000000..04b22287 --- /dev/null +++ b/power/v1_0/BUILD.gn @@ -0,0 +1,36 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//drivers/adapter/uhdf2/hdi.gni") +if (defined(ohos_lite)) { + group("libpower_proxy_1.0") { + deps = [] + public_configs = [] + } +} else { + hdi("power") { + package = "OHOS.HDI.power.v1_0" + + module_name = "power_interface_service" + + sources = [ + "IPowerHdiCallback.idl", + "IPowerInterface.idl", + "PowerTypes.idl", + ] + + language = "cpp" + subsystem_name = "hdf" + part_name = "power_device_driver" + } +} diff --git a/power/v1_0/IPowerHdiCallback.idl b/power/v1_0/IPowerHdiCallback.idl new file mode 100755 index 00000000..9a8fe2cc --- /dev/null +++ b/power/v1_0/IPowerHdiCallback.idl @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package OHOS.HDI.power.v1_0; + +[callback] interface IPowerHdiCallback { + OnSuspend(); + OnWakeup(); +} diff --git a/power/v1_0/IPowerInterface.idl b/power/v1_0/IPowerInterface.idl new file mode 100755 index 00000000..9a747677 --- /dev/null +++ b/power/v1_0/IPowerInterface.idl @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package OHOS.HDI.power.v1_0; +import OHOS.HDI.power.v1_0.IPowerHdiCallback; +import OHOS.HDI.power.v1_0.PowerTypes; + +interface IPowerInterface { + RegisterCallback([in] IPowerHdiCallback ipowerHdiCallback); + StartSuspend(); + StopSuspend(); + ForceSuspend(); + SuspendBlock([in] String name); + SuspendUnblock([in] String name); + PowerDump([out] String info); +} diff --git a/power/v1_0/PowerTypes.idl b/power/v1_0/PowerTypes.idl new file mode 100755 index 00000000..086f5538 --- /dev/null +++ b/power/v1_0/PowerTypes.idl @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package OHOS.HDI.power.v1_0; + +enum PowerHdfCmd { + CMD_REGISTER_CALLBCK = 0, + CMD_START_SUSPEND, + CMD_STOP_SUSPEND, + CMD_FORCE_SUSPEND, + CMD_SUSPEND_BLOCK, + CMD_SUSPEND_UNBLOCK, + CMD_DUMP, +}; + +enum PowerHdfCallbackCmd { + CMD_ON_SUSPEND = 0, + CMD_ON_WAKEUP, +}; + +enum PowerHdfState { + AWAKE = 0, + INACTIVE, + SLEEP, +}; diff --git a/sensor/v1_0/BUILD.gn b/sensor/v1_0/BUILD.gn index 51c19ae8..0c196002 100644 --- a/sensor/v1_0/BUILD.gn +++ b/sensor/v1_0/BUILD.gn @@ -19,7 +19,7 @@ if (defined(ohos_lite)) { } } else { hdi("sensor") { - package = "sensor.v1_0" + package = "OHOS.HDI.sensor.v1_0" module_name = "sensor_service" diff --git a/sensor/v1_0/ISensorCallback.idl b/sensor/v1_0/ISensorCallback.idl index 93813655..ae2a75eb 100644 --- a/sensor/v1_0/ISensorCallback.idl +++ b/sensor/v1_0/ISensorCallback.idl @@ -27,9 +27,9 @@ * @version 1.0 */ -package sensor.v1_0; +package OHOS.HDI.sensor.v1_0; -import sensor.v1_0.SensorTypes; +import OHOS.HDI.sensor.v1_0.SensorTypes; /** * @brief Defines the callback for reporting sensor data. This callback needs to be registered when diff --git a/sensor/v1_0/ISensorInterface.idl b/sensor/v1_0/ISensorInterface.idl index 387e0f2e..66ab862d 100644 --- a/sensor/v1_0/ISensorInterface.idl +++ b/sensor/v1_0/ISensorInterface.idl @@ -38,10 +38,10 @@ * @version 1.0 */ -package sensor.v1_0; +package OHOS.HDI.sensor.v1_0; -import sensor.v1_0.SensorTypes; -import sensor.v1_0.ISensorCallback; +import OHOS.HDI.sensor.v1_0.SensorTypes; +import OHOS.HDI.sensor.v1_0.ISensorCallback; /** * @brief Defines the functions for performing basic operations on sensors. diff --git a/sensor/v1_0/SensorTypes.idl b/sensor/v1_0/SensorTypes.idl index 5b3862db..ab37a92c 100644 --- a/sensor/v1_0/SensorTypes.idl +++ b/sensor/v1_0/SensorTypes.idl @@ -37,7 +37,7 @@ * @version 1.0 */ -package sensor.v1_0; +package OHOS.HDI.sensor.v1_0; /** * @brief Defines basic sensor information. diff --git a/thermal/v1_0/BUILD.gn b/thermal/v1_0/BUILD.gn new file mode 100755 index 00000000..8ecfd7c9 --- /dev/null +++ b/thermal/v1_0/BUILD.gn @@ -0,0 +1,36 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//drivers/adapter/uhdf2/hdi.gni") +if (defined(ohos_lite)) { + group("libthermal_proxy_1.0") { + deps = [] + public_configs = [] + } +} else { + hdi("thermal") { + package = "OHOS.HDI.thermal.v1_0" + + module_name = "thermal_interface_service" + + sources = [ + "IThermalCallback.idl", + "IThermalInterface.idl", + "ThermalTypes.idl", + ] + + language = "cpp" + subsystem_name = "hdf" + part_name = "thermal_device_driver" + } +} diff --git a/thermal/v1_0/IThermalCallback.idl b/thermal/v1_0/IThermalCallback.idl new file mode 100755 index 00000000..3b9f6b8a --- /dev/null +++ b/thermal/v1_0/IThermalCallback.idl @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package OHOS.HDI.thermal.v1_0; + +import OHOS.HDI.thermal.v1_0.ThermalTypes; + +[callback] interface IThermalCallback { + OnThermalDataEvent([in] struct HdfThermalCallbackInfo event); +} \ No newline at end of file diff --git a/thermal/v1_0/IThermalInterface.idl b/thermal/v1_0/IThermalInterface.idl new file mode 100755 index 00000000..1709d908 --- /dev/null +++ b/thermal/v1_0/IThermalInterface.idl @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package OHOS.HDI.thermal.v1_0; + +import OHOS.HDI.thermal.v1_0.ThermalTypes; +import OHOS.HDI.thermal.v1_0.IThermalCallback; + +interface IThermalInterface { + SetCpuFreq([in] int freq); + SetGpuFreq([in] int freq); + SetBatteryCurrent([in] int current); + GetThermalZoneInfo([out] struct HdfThermalCallbackInfo event); + Register([in] IThermalCallback callbackObj); + Unregister(); +} \ No newline at end of file diff --git a/thermal/v1_0/ThermalTypes.idl b/thermal/v1_0/ThermalTypes.idl new file mode 100755 index 00000000..8fc3d3a4 --- /dev/null +++ b/thermal/v1_0/ThermalTypes.idl @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package OHOS.HDI.thermal.v1_0; + +struct ThermalZoneInfo { + String type; + int temp; +}; + +struct HdfThermalCallbackInfo { + List info; +}; \ No newline at end of file diff --git a/vibrator/v1_0/BUILD.gn b/vibrator/v1_0/BUILD.gn index dcdce13a..d53a7fac 100755 --- a/vibrator/v1_0/BUILD.gn +++ b/vibrator/v1_0/BUILD.gn @@ -19,7 +19,7 @@ if (defined(ohos_lite)) { } } else { hdi("vibrator") { - package = "vibrator.v1_0" + package = "OHOS.HDI.vibrator.v1_0" module_name = "vibrator_service" diff --git a/vibrator/v1_0/IVibratorInterface.idl b/vibrator/v1_0/IVibratorInterface.idl index ad41ce1b..690ebd90 100755 --- a/vibrator/v1_0/IVibratorInterface.idl +++ b/vibrator/v1_0/IVibratorInterface.idl @@ -35,9 +35,9 @@ * @version 1.0 */ -package vibrator.v1_0; +package OHOS.HDI.vibrator.v1_0; -import vibrator.v1_0.VibratorTypes; +import OHOS.HDI.vibrator.v1_0.VibratorTypes; interface IVibratorInterface { /** diff --git a/vibrator/v1_0/VibratorTypes.idl b/vibrator/v1_0/VibratorTypes.idl index 2ca65a9b..a93a4687 100755 --- a/vibrator/v1_0/VibratorTypes.idl +++ b/vibrator/v1_0/VibratorTypes.idl @@ -13,7 +13,7 @@ * limitations under the License. */ -package vibrator.v1_0; +package OHOS.HDI.vibrator.v1_0; /** * @brief Enumerates the vibration modes of this vibrator. -- Gitee