From 27314bf0b77ef49998f84296f38a117f5cd2bb93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=98=E7=BD=97=E5=AE=87?= Date: Fri, 20 Jun 2025 14:01:38 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0idl=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=88=B01.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 甘罗宇 --- partitionslot/bundle.json | 10 +-- partitionslot/v1_1/BUILD.gn | 23 ++++++ partitionslot/v1_1/IPartitionSlot.idl | 114 ++++++++++++++++++++++++++ 3 files changed, 142 insertions(+), 5 deletions(-) create mode 100755 partitionslot/v1_1/BUILD.gn create mode 100755 partitionslot/v1_1/IPartitionSlot.idl diff --git a/partitionslot/bundle.json b/partitionslot/bundle.json index fc65eb3d..3df8e191 100644 --- a/partitionslot/bundle.json +++ b/partitionslot/bundle.json @@ -1,7 +1,7 @@ { "name": "@ohos/drivers_interface_partitionslot", "description": "partitionslot device driver interface", - "version": "3.2", + "version": "5.1", "license": "Apache License 2.0", "publishAs": "code-segment", "segment": { @@ -26,13 +26,13 @@ }, "build": { "sub_component": [ - "//drivers/interface/partitionslot/v1_0:partitionslot_idl_target" + "//drivers/interface/partitionslot/v1_1:partitionslot_idl_target" ], "test": [ ], "inner_kits": [ { - "name": "//drivers/interface/partitionslot/v1_0:libpartitionslot_proxy_1.0", + "name": "//drivers/interface/partitionslot/v1_1:libpartitionslot_proxy_1.1", "header": { "header_files": [ ], @@ -40,7 +40,7 @@ } }, { - "name": "//drivers/interface/partitionslot/v1_0:partitionslot_idl_headers", + "name": "//drivers/interface/partitionslot/v1_1:libpartitionslot_stub_1.1", "header": { "header_files": [ ], @@ -48,7 +48,7 @@ } }, { - "name": "//drivers/interface/partitionslot/v1_0:libpartitionslot_stub_1.0", + "name": "//drivers/interface/partitionslot/v1_1:partitionslot_idl_headers", "header": { "header_files": [ ], diff --git a/partitionslot/v1_1/BUILD.gn b/partitionslot/v1_1/BUILD.gn new file mode 100755 index 00000000..4a718962 --- /dev/null +++ b/partitionslot/v1_1/BUILD.gn @@ -0,0 +1,23 @@ +# Copyright (c) 2025 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/hdf_core/adapter/uhdf2/hdi.gni") + +hdi("partitionslot") { + module_name = "partitionslot_interface_service" + sources = [ "IPartitionSlot.idl" ] + + language = "cpp" + subsystem_name = "hdf" + part_name = "drivers_interface_partitionslot" +} \ No newline at end of file diff --git a/partitionslot/v1_1/IPartitionSlot.idl b/partitionslot/v1_1/IPartitionSlot.idl new file mode 100755 index 00000000..f7ba88e4 --- /dev/null +++ b/partitionslot/v1_1/IPartitionSlot.idl @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2025 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. + */ + +/** + * @addtogroup HdfPartitionSlot + * + * @brief Provides APIs for the partionton slot service. + * + * The PartitionSlot module provides a unified interface for PartitionSlot service. + * After obtaining the driver object or proxy, the realted APIs can be used to + * obtain current booting partition slot, update current booting partition slot, + * or set partition slot as unbootable. + * @since 5.1 + */ + +/** + * @file IPartitionSlot.idl + * + * @brief Declares common APIs of the PartitionSlot service. + * These APIs can be used to obtain current booting partition slot, + * or update current booting partition slot, or set partition slot as unbootable. + * @since 5.1 + */ + +/** + * @brief Defines the basic operations that can be performed on PartitionSlot. + * + * The operations include getting and setting current booting partition slot, + */ + +package ohos.hdi.partitionslot.v1_1; + + +interface IPartitionSlot { + /** + * @brief Obtains current booting partition slot. + * + * @param numOfSlots number of slots supported. 1 means no AB partition; 2 means AB, > 2 means multiple slots + * @return Returns -1 if the board does not support AB Parittion. + * @return Returns 0 if the board is booting from partition slot A. + * @return Returns 1 if the board is booting from partition slot B. + * @return Returns N if the board is booting from partition slot N. + * + * @since 3.1 + */ + GetCurrentSlot([out] int currentSlot, [out] int numOfSlots); + + /** + * @brief Obtains slot suffix string from slot id + * + * @param slot slot index. + * @param suffix slot suffix string. + * @return Returns -1 if the board does not support AB Parittion. + * @return Returns 0 if the operation is successful. + * + * @since 3.1 + */ + GetSlotSuffix([in] int slot, [out] String suffix); + + /** + * @brief Set current active boot partition slot + * + * @param slot slot index. + * @return Returns 0 if the operation is successful. + * @return Returns a negative value if the operation fails. + * + * @since 3.1 + */ + SetActiveSlot([in] int slot); + + /** + * @brief Set boot partition slot unbootable + * + * @param slot slot index. + * @return Returns 0 if the operation is successful. + * @return Returns a negative value if the operation fails. + * + * @since 3.1 + */ + SetSlotUnbootable([in] int slot); + + /** + * @brief Get checkpoint + * + * @return Returns -1 if the OTA is executing. + * @return Returns 0 if the OTA is not executing. + * + * @since 5.1 + * @version 1.0 + */ + GetCheckpoint([out] int checkpoint); + + /** + * @brief Set checkpoint + * + * @param checkpoint checkpoint index. + * + * @since 5.1 + * @version 1.0 + */ + SetCheckpoint([in] int checkpoint); +} \ No newline at end of file -- Gitee From d894fe3ec7336f650de0046b8935e0598b3cc61f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=98=E7=BD=97=E5=AE=87?= Date: Mon, 1 Sep 2025 07:10:35 +0000 Subject: [PATCH 2/2] update partitionslot/v1_1/BUILD.gn. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 甘罗宇 --- partitionslot/v1_1/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/partitionslot/v1_1/BUILD.gn b/partitionslot/v1_1/BUILD.gn index 4a718962..1ead0e67 100755 --- a/partitionslot/v1_1/BUILD.gn +++ b/partitionslot/v1_1/BUILD.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//drivers/hdf_core/adapter/uhdf2/hdi.gni") +import("//build/config/components/hdi/hdi.gni") hdi("partitionslot") { module_name = "partitionslot_interface_service" -- Gitee