--- /dev/null
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+
+#ifndef __TIZEN_HAL_BLUETOOTH_DOC_H__
+#define __TIZEN_HAL_BLUETOOTH_DOC_H__
+
+
+/**
+ * @file hal_bluetooth_doc.h
+ * @brief This file contains high level documentation of the HAL Bluetooth.
+ */
+
+/**
+ * @defgroup HALAPI_HAL_BLUETOOTH_MODULE Bluetooth
+ * @brief The @ref HALAPI_HAL_BLUETOOTH_MODULE provides functions to enable and disable the HCI interface.
+ *
+ * @section HALAPI_HAL_BLUETOOTH_MODULE_HEADER Required Header
+ * \#include <hal-bluetooth.h>
+ *
+ * @section HALAPI_HAL_BLUETOOTH_MODULE_OVERVIEW Overview
+ * The Bluetooth provides to get/put backend and enable/disable HCI interface.
+ * - hal_bluetooth_get_backend
+ * - hal_bluetooth_put_backend
+ * - hal_bluetooth_start
+ * - hal_bluetooth_stop
+ *
+ * For more information on the Bluetooth features and the macros, see HAL Bluetooth programming guides and tutorials.
+ */
+
+#endif /* __TIZEN_HAL_BLUETOOTH_DOC_H__ */
+
extern "C" {
#endif
-#define HAL_BACKEND_ERROR_NONE 0
-#define HAL_BACKEND_ERROR_INTERNAL -1
-#define HAL_BACKEND_ERROR_TIMEOUT -2
+/**
+ * @addtogroup HALAPI_HAL_BLUETOOTH_MODULE
+ * @{
+ */
+
+/**
+ * @brief Structure for bluetooth functions.
+ * @since HAL_MODULE_BLUETOOTH 1.0
+ */
+
+/**
+ * @brief Error none
+ * @since HAL_MODULE_BLUETOOTH 1.0
+ */
+#define HAL_BLUETOOTH_BACKEND_ERROR_NONE 0
+
+/**
+ * @brief Internal error
+ * @since HAL_MODULE_BLUETOOTH 1.0
+ */
+#define HAL_BLUETOOTH_BACKEND_ERROR_INTERNAL -1
+
+/**
+ * @brief Timeout error
+ * @since HAL_MODULE_BLUETOOTH 1.0
+ */
+#define HAL_BLUETOOTH_BACKEND_ERROR_TIMEOUT -2
+/**
+ * @brief The structure type of the bluetooth HAL functions.
+ * @since HAL_MODULE_BLUETOOTH 1.0
+ */
typedef struct _hal_backend_bluetooth_funcs {
- int (*start)(void);
- int (*stop)(void);
+ int (*start)(void); /**< Start Bluetooth HAL backend */
+ int (*stop)(void); /**< Stop Bluetooth HAL backend */
} hal_backend_bluetooth_funcs;
+/**
+ * @}
+ */
+
#ifdef __cplusplus
}
#endif
extern "C" {
#endif
+/**
+ * @addtogroup HALAPI_HAL_BLUETOOTH_MODULE
+ * @{
+ */
+
+/**
+ * @brief Gets the bluetooth backend
+ * @since HAL_MODULE_BLUETOOTH 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @see hal_bluetooth_put_backend()
+ */
int hal_bluetooth_get_backend(void);
+
+/**
+ * @brief Puts the bluetooth backend
+ * @since HAL_MODULE_BLUETOOTH 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @see hal_bluetooth_get_backend()
+ */
int hal_bluetooth_put_backend(void);
+/**
+ * @brief Start the bluetooth backend
+ * @since HAL_MODULE_BLUETOOTH 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @see hal_bluetooth_stop()
+ */
int hal_bluetooth_start(void);
+/**
+ * @brief Stop the bluetooth backend
+ * @since HAL_MODULE_BLUETOOTH 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @see hal_bluetooth_start()
+ */
int hal_bluetooth_stop(void);
+/**
+ * @}
+ */
+
#ifdef __cplusplus
}
#endif
using ::testing::UnitTest;
TEST(BluetoothHALtest, bluetooth_get_put_backend_p) {
- int ret = HAL_BACKEND_ERROR_NONE;
+ int ret = HAL_BLUETOOTH_BACKEND_ERROR_NONE;
ret = hal_bluetooth_get_backend();
- ASSERT_TRUE(ret == HAL_BACKEND_ERROR_NONE);
+ ASSERT_TRUE(ret == HAL_BLUETOOTH_BACKEND_ERROR_NONE);
ret = hal_bluetooth_put_backend();
- ASSERT_TRUE(ret == HAL_BACKEND_ERROR_NONE);
+ ASSERT_TRUE(ret == HAL_BLUETOOTH_BACKEND_ERROR_NONE);
}
TEST(BluetoothHALtest, bluetooth_start_p) {
- int ret = HAL_BACKEND_ERROR_NONE;
+ int ret = HAL_BLUETOOTH_BACKEND_ERROR_NONE;
ret = hal_bluetooth_get_backend();
- ASSERT_TRUE(ret == HAL_BACKEND_ERROR_NONE);
+ ASSERT_TRUE(ret == HAL_BLUETOOTH_BACKEND_ERROR_NONE);
ret = hal_bluetooth_start();
- ASSERT_TRUE(ret == HAL_BACKEND_ERROR_NONE);
+ ASSERT_TRUE(ret == HAL_BLUETOOTH_BACKEND_ERROR_NONE);
}
TEST(BluetoothHALtest, bluetooth_stop_p) {
- int ret = HAL_BACKEND_ERROR_NONE;
+ int ret = HAL_BLUETOOTH_BACKEND_ERROR_NONE;
ret = hal_bluetooth_get_backend();
- ASSERT_TRUE(ret == HAL_BACKEND_ERROR_NONE);
+ ASSERT_TRUE(ret == HAL_BLUETOOTH_BACKEND_ERROR_NONE);
ret = hal_bluetooth_stop();
- ASSERT_TRUE(ret == HAL_BACKEND_ERROR_NONE);
+ ASSERT_TRUE(ret == HAL_BLUETOOTH_BACKEND_ERROR_NONE);
}
int main(int argc, char **argv) {