diff --git a/ConnectivityKit/bluetooth/BUILD.gn b/ConnectivityKit/bluetooth/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..869366f31d196301aa0499d694ef943d419fda77 --- /dev/null +++ b/ConnectivityKit/bluetooth/BUILD.gn @@ -0,0 +1,29 @@ +# Copyright (C) 2024 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/ohos.gni") +import("//build/ohos/ndk/ndk.gni") + +ohos_ndk_headers("bluetooth_ndk_header") { + dest_dir = "$ndk_headers_out_dir/ConnectivityKit/bluetooth" + sources = [ "./oh_bluetooth.h" ] +} + +ohos_ndk_library("libbluetooth_ndk") { + ndk_description_file = "./libbluetooth.ndk.json" + output_name = "bluetooth_ndk" + output_extension = "so" + min_compact_version = "13" + system_capability = "SystemCapability.Communication.Bluetooth.Core" + system_capability_headers = [ "./oh_bluetooth.h" ] +} diff --git a/ConnectivityKit/bluetooth/libbluetooth.ndk.json b/ConnectivityKit/bluetooth/libbluetooth.ndk.json new file mode 100644 index 0000000000000000000000000000000000000000..d8b21f30ce75182012fd52c07d3e0f4f7a418d8d --- /dev/null +++ b/ConnectivityKit/bluetooth/libbluetooth.ndk.json @@ -0,0 +1,5 @@ +[ + { + "name": "OH_Bluetooth_GetBluetoothSwitchState" + } +] \ No newline at end of file diff --git a/ConnectivityKit/bluetooth/oh_bluetooth.h b/ConnectivityKit/bluetooth/oh_bluetooth.h new file mode 100644 index 0000000000000000000000000000000000000000..cbe820916a8d670da02e6e9ecf27c35ad0deaeaa --- /dev/null +++ b/ConnectivityKit/bluetooth/oh_bluetooth.h @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2024 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 Bluetooth + * @{ + * + * @brief Provide functions for querying the status of bluetooth switch. + * @since 13 + */ +/** + * @file oh_bluetooth.h + * @kit ConnectivityKit + * @brief Define interfaces for querying bluetooth switch status. + * @library libbluetooth.so + * @syscap SystemCapability.Communication.Bluetooth.Core + * @since 13 + */ + +#ifndef OH_BLUETOOTH_H +#define OH_BLUETOOTH_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Enumeration state of bluetooth switch. + * + * @since 13 + */ +typedef enum Bluetooth_SwitchState { + /** Indicates the local bluetooth is off. */ + BLUETOOTH_STATE_OFF = 0, + /** Indicates the local bluetooth is turning on. */ + BLUETOOTH_STATE_TURNING_ON = 1, + /** Indicates the local bluetooth is on, and ready for use. */ + BLUETOOTH_STATE_ON = 2, + /** Indicates the local bluetooth is turning off. */ + BLUETOOTH_STATE_TURNING_OFF = 3, + /** Indicates the local bluetooth is turning LE mode on. */ + BLUETOOTH_STATE_BLE_TURNING_ON = 4, + /** Indicates the local bluetooth is in LE only mode. */ + BLUETOOTH_STATE_BLE_ON = 5, + /** Indicates the local bluetooth is turning off LE only mode. */ + BLUETOOTH_STATE_BLE_TURNING_OFF = 6 +} Bluetooth_SwitchState; + +/** + * @brief Enumeration the bluetooth result codes. + * + * @since 13 + */ +typedef enum Bluetooth_ResultCode { + /** + * @error The operation is successful. + */ + BLUETOOTH_SUCCESS = 0, + /** + * @error Parameter error. Possible reasons: 1. The input parameter is a null pointer; + * 2. Parameter values exceed the defined range. + */ + BLUETOOTH_INVALID_PARAM = 401, +} Bluetooth_ResultCode; + +/** + * @brief Get the bluetooth switch state. + * + * @param state - It is a pointer used to receive bluetooth switch status values. + * The caller needs to pass in a non empty boolean pointer, otherwise an error will be returned. + * For a detailed definition, please refer to {@link Bluetooth_SwitchState}. + * @return Bluetooth functions result code. + * For a detailed definition, please refer to {@link Bluetooth_ResultCode}. + * {@link BLUETOOTH_SUCCESS} Successfully obtained the bluetooth switch status. + * {@link BLUETOOTH_INVALID_PARAM} The input parameter enabled is a null pointer. + * @since 13 + */ +Bluetooth_ResultCode OH_Bluetooth_GetBluetoothSwitchState(Bluetooth_SwitchState *state); +#ifdef __cplusplus +} +#endif +/** @} */ +#endif // OH_BLUETOOTH_H \ No newline at end of file diff --git a/graphic/graphic_2d/native_window/graphic_error_code.h b/graphic/graphic_2d/native_window/graphic_error_code.h index 1b5e9deb0166e9817bf5cf1f8a600f73ef53c5dd..9bd9f2aceecfedf45c98950a9f21c033ab80c989 100644 --- a/graphic/graphic_2d/native_window/graphic_error_code.h +++ b/graphic/graphic_2d/native_window/graphic_error_code.h @@ -80,7 +80,10 @@ typedef enum OHNativeErrorCode { NATIVE_ERROR_UNSUPPORTED = 50102000, /** @error unknown error, please check log */ NATIVE_ERROR_UNKNOWN = 50002000, - /** @error hdi interface error */ + /** + * @error hdi interface error + * @since 13 + */ NATIVE_ERROR_HDI_ERROR = 50007000, /** @error ipc send failed */ NATIVE_ERROR_BINDER_ERROR = 50401000,