From 9e206ffc93886487cc5af4c65fb79041f187466b Mon Sep 17 00:00:00 2001 From: yanguofeng Date: Thu, 10 Jul 2025 14:11:03 +0800 Subject: [PATCH 1/4] lpfence mntn interface add Signed-off-by: yanguofeng --- location/lpfence/bundle.json | 27 ++++- location/lpfence/mntn/v1_0/BUILD.gn | 28 +++++ location/lpfence/mntn/v1_0/IMntnCallback.idl | 72 ++++++++++++ location/lpfence/mntn/v1_0/IMntnInterface.idl | 105 ++++++++++++++++++ location/lpfence/mntn/v1_0/MntnTypes.idl | 53 +++++++++ 5 files changed, 284 insertions(+), 1 deletion(-) create mode 100644 location/lpfence/mntn/v1_0/BUILD.gn create mode 100644 location/lpfence/mntn/v1_0/IMntnCallback.idl create mode 100644 location/lpfence/mntn/v1_0/IMntnInterface.idl create mode 100644 location/lpfence/mntn/v1_0/MntnTypes.idl diff --git a/location/lpfence/bundle.json b/location/lpfence/bundle.json index 14e52709..f8d3e13c 100644 --- a/location/lpfence/bundle.json +++ b/location/lpfence/bundle.json @@ -31,7 +31,8 @@ "//drivers/interface/location/lpfence/cellfence/v1_0:lpfence_cellfence_idl_target", "//drivers/interface/location/lpfence/geofence/v1_0:lpfence_geofence_idl_target", "//drivers/interface/location/lpfence/wififence/v1_0:lpfence_wififence_idl_target", - "//drivers/interface/location/lpfence/safe_location/v1_0:lpfence_safe_location_idl_target" + "//drivers/interface/location/lpfence/safe_location/v1_0:lpfence_safe_location_idl_target", + "//drivers/interface/location/lpfence/mntn/v1_0:lpfence_mntn_idl_target" ], "test": [ ], @@ -155,6 +156,30 @@ ], "header_base": "//drivers/interface/location/lpfence/safe_location" } + }, + { + "name": "//drivers/interface/location/lpfence/mntn/v1_0:liblpfence_mntn_stub_1.0", + "header": { + "header_files": [ + ], + "header_base": "//drivers/interface/location/lpfence/mntn" + } + }, + { + "name": "//drivers/interface/location/lpfence/mntn/v1_0:liblpfence_mntn_proxy_1.0", + "header": { + "header_files": [ + ], + "header_base": "//drivers/interface/location/lpfence/mntn" + } + }, + { + "name": "//drivers/interface/location/lpfence/mntn/v1_0:lpfence_mntn_idl_headers", + "header": { + "header_files": [ + ], + "header_base": "//drivers/interface/location/lpfence/mntn" + } } ] } diff --git a/location/lpfence/mntn/v1_0/BUILD.gn b/location/lpfence/mntn/v1_0/BUILD.gn new file mode 100644 index 00000000..9cd4ad78 --- /dev/null +++ b/location/lpfence/mntn/v1_0/BUILD.gn @@ -0,0 +1,28 @@ +# 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("//build/config/components/hdi/hdi.gni") + +hdi("lpfence_mntn") { + module_name = "lpfence_mntn" + + sources = [ + "IMntnCallback.idl", + "IMntnInterface.idl", + "MntnTypes.idl", + ] + + language = "cpp" + subsystem_name = "hdf" + part_name = "drivers_interface_lpfence" +} diff --git a/location/lpfence/mntn/v1_0/IMntnCallback.idl b/location/lpfence/mntn/v1_0/IMntnCallback.idl new file mode 100644 index 00000000..82755ca8 --- /dev/null +++ b/location/lpfence/mntn/v1_0/IMntnCallback.idl @@ -0,0 +1,72 @@ +/* + * 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 HdiLpfenceMntn + * @{ + * + * @brief Provides lpfence mntn APIs for the lpfence mntn service. + * + * @since 6.0 + * @version 1.0 + */ + +/** + * @file IMntnCallback.idl + * + * @brief Declares the callbacks for the lpfence mntn module. + * + * @since 6.0 + * @version 1.0 + */ + +/** + * @brief Declares the path of the lpfence mntn module interface package. + * + * @since 6.0 + */ +package ohos.hdi.location.lpfence.mntn.v1_0; + +/** + * @brief Imports data types of the lpfence mntn module. + * + * @since 6.0 + */ +import ohos.hdi.location.lpfence.mntn.v1_0.MntnTypes; + +/** + * @brief Defines the callback for the lpfence mntn module. + * + * Before enabling the lpfence mntn feature, you need to register this callback to report the device has obtained the lpfence mntn information. + * For details, see {@link IMntnInterface}. + * + * @since 6.0 + */ +[callback] interface IMntnCallback { + /** + * @brief Called to report the lpfence mntn request result. + * + * + * + * @param mntnInfo Indicates the result of getting lpfence mntn. + * + * @return Returns 0 if the callback is invoked successfully. + * @return Returns a negative value if the callback fails to be invoked. + * + @since 6.0 + */ + OnLpfenceMntnRequestCb([in] string[] mntnInfo); +} +/** @} */ diff --git a/location/lpfence/mntn/v1_0/IMntnInterface.idl b/location/lpfence/mntn/v1_0/IMntnInterface.idl new file mode 100644 index 00000000..64784545 --- /dev/null +++ b/location/lpfence/mntn/v1_0/IMntnInterface.idl @@ -0,0 +1,105 @@ +/* + * 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 HdiLpfenceMntn + * @{ + * + * @brief Provides lpfence mntn APIs for the lpfence mntn service. + * + * @since 6.0 + * @version 1.0 + */ + +/** + * @file IMntnInterface.idl + * + * @brief Declares the APIs for the lpfence mntn module. + * + * @since 6.0 + * @version 1.0 + */ + +/** + * @brief Declares the path of the lpfence mntn module interface package. + * + * @since 6.0 + */ +package ohos.hdi.location.lpfence.mntn.v1_0; + +/** + * @brief Imports data types of the lpfence mntn module. + * + * @since 6.0 + */ +import ohos.hdi.location.lpfence.mntn.v1_0.MntnTypes; + +/** + * @brief Imports callbacks of the lpfence mntn module. + * + * @since 6.0 + */ +import ohos.hdi.location.lpfence.mntn.v1_0.IMntnCallback; + +/** + * @brief Provides APIs for basic lpfence mntn operations. + * + * You can use the APIs to register or unregister a callback + */ +interface IMntnInterface { + /** + * @brief Registers a callback. + * + * Before enabling the lpfence mntn feature, you need to register a callback to report the device has obtained the lpfence mntn information. + * + * @param callbackObj Indicates the callback to register, which needs to be registered only once. For details, see {@link IMntnCallback}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a negative value if the operation fails. + * + * @since 6.0 + * @version 1.0 + */ + RegisterLpfenceMntnCallback([in] IMntnCallback callbackObj); + + /** + * @brief Unregisters a callback. + * + * When the lpfence mntn feature is no longer required or the registered callback needs to be changed, you need to unregister the callback. + * + * @param callbackObj Indicates the callback to unregister, which needs to be unregistered only once. For details, see {@link IMntnCallback}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a negative value if the operation fails. + * + * @since 6.0 + * @version 1.0 + */ + UnregisterLpfenceMntnCallback([in] IMntnCallback callbackObj); + + /** + * @brief Obtains the latest lpfence mntn information. + * + * @param type Indicates the lpfence type. For details, see {@link enum LpfenceType}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a negative value if the operation fails. + * + * @since 6.0 + * @version 1.0 + */ + GetCurrentLpfenceMntnInfo([in] enum LpfenceType type); +} +/** @} */ diff --git a/location/lpfence/mntn/v1_0/MntnTypes.idl b/location/lpfence/mntn/v1_0/MntnTypes.idl new file mode 100644 index 00000000..a26d4ffd --- /dev/null +++ b/location/lpfence/mntn/v1_0/MntnTypes.idl @@ -0,0 +1,53 @@ +/* + * 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 HdiLpfenceMntn + * @{ + * + * @brief Provides lpfence mntn APIs for the lpfence mntn service. + * + * @since 6.0 + * @version 1.0 + */ + +/** + * @file MntnTypes.idl + * + * @brief Defines the data types used by the lpfence mntn feature. + * + * @since 6.0 + * @version 1.0 + */ + +/** + * @brief Declares the path of the lpfence mntn module interface package. + * + * @since 6.0 + */ +package ohos.hdi.location.lpfence.mntn.v1_0; + +/** + * @brief Enumerates the lpfence type. + * + * @since 6.0 + */ +enum LpfenceType { + LPFENCE_GEOFENCE = 1, + LPFENCE_CELLFENCE = 2, + LPFENCE_WIFIFENCE = 3, + LPFENCE_SAFE_LOCATION = 4, +}; +/** @} */ -- Gitee From b79cf41f69fc47cb82e0612db4d0027896eb5ddb Mon Sep 17 00:00:00 2001 From: yanguofeng1992 Date: Mon, 14 Jul 2025 11:33:36 +0000 Subject: [PATCH 2/4] rename location/lpfence/mntn/v1_0/IMntnInterface.idl to location/lpfence/mntn/v1_0/IMntnIntf.idl. Signed-off-by: yanguofeng1992 --- .../lpfence/mntn/v1_0/{IMntnInterface.idl => IMntnIntf.idl} | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename location/lpfence/mntn/v1_0/{IMntnInterface.idl => IMntnIntf.idl} (99%) diff --git a/location/lpfence/mntn/v1_0/IMntnInterface.idl b/location/lpfence/mntn/v1_0/IMntnIntf.idl similarity index 99% rename from location/lpfence/mntn/v1_0/IMntnInterface.idl rename to location/lpfence/mntn/v1_0/IMntnIntf.idl index 64784545..8916a119 100644 --- a/location/lpfence/mntn/v1_0/IMntnInterface.idl +++ b/location/lpfence/mntn/v1_0/IMntnIntf.idl @@ -58,7 +58,8 @@ import ohos.hdi.location.lpfence.mntn.v1_0.IMntnCallback; * * You can use the APIs to register or unregister a callback */ -interface IMntnInterface { +interface IMntnIntf { + { /** * @brief Registers a callback. * -- Gitee From 31c7e4e1ca2b1716b9e87ec64e7628091f33489b Mon Sep 17 00:00:00 2001 From: yanguofeng1992 Date: Mon, 14 Jul 2025 11:34:06 +0000 Subject: [PATCH 3/4] update location/lpfence/mntn/v1_0/BUILD.gn. Signed-off-by: yanguofeng1992 --- location/lpfence/mntn/v1_0/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/location/lpfence/mntn/v1_0/BUILD.gn b/location/lpfence/mntn/v1_0/BUILD.gn index 9cd4ad78..216a464c 100644 --- a/location/lpfence/mntn/v1_0/BUILD.gn +++ b/location/lpfence/mntn/v1_0/BUILD.gn @@ -18,7 +18,7 @@ hdi("lpfence_mntn") { sources = [ "IMntnCallback.idl", - "IMntnInterface.idl", + "IMntnIntf.idl", "MntnTypes.idl", ] -- Gitee From da6ca1d8ae7be5a6f52cad02462502f22caf14e7 Mon Sep 17 00:00:00 2001 From: yanguofeng1992 Date: Wed, 16 Jul 2025 07:41:59 +0000 Subject: [PATCH 4/4] update location/lpfence/mntn/v1_0/IMntnIntf.idl. Signed-off-by: yanguofeng1992 --- location/lpfence/mntn/v1_0/IMntnIntf.idl | 1 - 1 file changed, 1 deletion(-) diff --git a/location/lpfence/mntn/v1_0/IMntnIntf.idl b/location/lpfence/mntn/v1_0/IMntnIntf.idl index 8916a119..ffb963ef 100644 --- a/location/lpfence/mntn/v1_0/IMntnIntf.idl +++ b/location/lpfence/mntn/v1_0/IMntnIntf.idl @@ -59,7 +59,6 @@ import ohos.hdi.location.lpfence.mntn.v1_0.IMntnCallback; * You can use the APIs to register or unregister a callback */ interface IMntnIntf { - { /** * @brief Registers a callback. * -- Gitee