Add document and update doxygen 95/316095/5 tizen_9.0
authorWootak Jung <wootak.jung@samsung.com>
Tue, 10 Dec 2024 03:22:49 +0000 (12:22 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Thu, 19 Dec 2024 01:19:43 +0000 (10:19 +0900)
Change-Id: I2ebcc0977549355c40b1f1e949f923e11c70d06f
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
doc/hal_bluetooth_doc.h [new file with mode: 0644]
include/hal-bluetooth-interface-1.h
include/hal-bluetooth.h
test/bluetooth_hal_tc.cpp

diff --git a/doc/hal_bluetooth_doc.h b/doc/hal_bluetooth_doc.h
new file mode 100644 (file)
index 0000000..1eec7d3
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * 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__ */
+
index 30120e0fe946ce6b77cf2e28b64e5688f3c90f6a..d1db15e768ce8374be999bbc41edf039c1611c4d 100644 (file)
 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
index 427b9e9e05005cf166e1111ebe6fb134dc548cdf..15a22bfb4160a230ff5154e6d6df438226ccf9d4 100644 (file)
 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
index c85551116fff86cab8042ed03b3e7300e455d366..fa46db128c82452679b38704f94ce3d2071b1360 100644 (file)
@@ -38,33 +38,33 @@ using ::testing::TestPartResult;
 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) {