2 * Open Adaptation Layer (OAL)
4 * Copyright (c) 2014-2015 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 #ifndef _OAL_HARDWARE_H_
21 #define _OAL_HARDWARE_H_
23 #include <sys/types.h>
24 #include <oal-manager.h>
30 #define FOREACH_TYPE(FUNC) \
31 FUNC(BT_CHIP_TYPE_PLATFORM, "Tizen Plaftrom BT Chip") \
32 FUNC(BT_CHIP_TYPE_UNKNOWN, "Unknown Chip Type") \
34 #define GENERATE_TYPE_ENUM(ENUM, STRING) ENUM,
35 #define GENERATE_TYPE_STRING(ENUM, STRING) STRING,
38 FOREACH_TYPE(GENERATE_TYPE_ENUM)
42 * @brief Upgrade BT Chip Firmware.
44 * @remarks BT Chip will be reset and oal will start again after upgrade. \n
46 * @details EVENT: N/A. as this is a blocking call
48 * @return OAL_STATUS_SUCCESS on success, otherwise OAL_STATUS_INTERNAL_ERROR.
49 * @retval #OAL_STATUS_SUCCESS Successful
50 * #OAL_STATUS_INTERNAL_ERROR Failure
52 * @pre N/A, as this is related to hardware, oal need not be initialised.
56 oal_status_t hw_chip_firmware_update(void);
59 * @brief Check whether BT chip is connected or not.
61 * @remarks BT Chip state. \n
63 * @details EVENT: N/A.
65 * @return TRUE if chip connected, otherwise FALSE.
66 * @retval #TRUE Successful
68 * @pre N/A, as this is related to hardware, oal need not be initialised.
72 int hw_is_chip_connected(void);
75 * @brief Get Connected BT Chip Type. (Single/Combo)
77 * @remarks BT Chip Type. \n
81 * @return BT_CHIP_TYPE_SINGLE if Single BT Chip connected,
82 * BT_CHIP_TYPE_COMBO if BT Combo Chip connected,
83 * otherwise BT_CHIP_TYPE_UNKNOWN on error.
84 * @retval #BT_CHIP_TYPE_SINGLE Single-BT Chip
86 * @pre N/A, as this is related to hardware, oal need not be initialised.
90 bt_chip_type_t hw_get_chip_type(void);
93 * @brief Get driver state.
95 * @remarks BT Module State \n
99 * @return OAL_STATUS_SUCCESS on success, otherwise OAL_STATUS_INTERNAL_ERROR.
100 * @retval #OAL_STATUS_SUCCESS Successful
101 * #OAL_STATUS_INTERNAL_ERROR Failure
103 * @pre N/A, as this is related to hardware, oal need not be initialised.
107 oal_status_t hw_is_module_ready(void);
110 * @brief Firmware Upgrade Required Status
112 * @remarks whether upgrade firmwares required or not \n
113 * is_required = TRUE, if upgrade required, else FALSE
115 * @details EVENT: N/A
117 * @return OAL_STATUS_SUCCESS
123 oal_status_t hw_is_fwupgrade_required(gboolean *is_required);
127 #endif /* __cplusplus */
128 #endif /*_OAL_HARDWARE_H_*/