diff options
author | Chanwoo Choi <cw00.choi@samsung.com> | 2024-06-20 15:42:20 +0900 |
---|---|---|
committer | Chanwoo Choi <cw00.choi@samsung.com> | 2024-06-20 15:42:20 +0900 |
commit | 7bbea53ca07cde62683bd824683e666cba741d26 (patch) | |
tree | 4289a5b1dfc800766ee1058139d3a426fb4adb5d | |
parent | 80fe0de8e6ed6d13e480372a77275786fc8d056f (diff) | |
download | radio-accepted/tizen_9.0_unified.tar.gz radio-accepted/tizen_9.0_unified.tar.bz2 radio-accepted/tizen_9.0_unified.zip |
Add support for HAL_MODULE_RADIO v1.0 interfacetizen_9.0_m2_releaseaccepted/tizen/unified/x/asan/20240813.225947accepted/tizen/unified/x/20240718.022928accepted/tizen/unified/toolchain/20240812.131711accepted/tizen/unified/dev/20240718.035957accepted/tizen/unified/20240718.010233accepted/tizen/9.0/unified/20241030.234649tizen_9.0accepted/tizen_unified_x_asanaccepted/tizen_unified_xaccepted/tizen_unified_toolchainaccepted/tizen_unified_devaccepted/tizen_unifiedaccepted/tizen_9.0_unified
HAL_MODULE_RADIO will support the multiple version of HAL interface.
So that v1.0 is first supported version of HAL_MODULE_RADIO.
hal-radio-interface-1.h contains the v1.0 HAL interface.
Change-Id: I3a4d3e75599c79439f3f4c4a624ba8ed18770cf6
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | include/hal-radio-interface-1.h | 75 | ||||
-rw-r--r-- | include/hal-radio-interface.h | 53 |
3 files changed, 77 insertions, 54 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 14f3356..9b59c9b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,8 +40,7 @@ SET_TARGET_PROPERTIES( ${PROJECT_NAME} PROPERTIES VERSION ${VERSION}) CONFIGURE_FILE( ${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY) INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIBDIR}/hal) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/hal-radio.h DESTINATION ${INCLUDEDIR}/hal) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/hal-radio-interface.h DESTINATION ${INCLUDEDIR}/hal) +INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION ${INCLUDEDIR}/hal FILES_MATCHING PATTERN "hal-radio*.h") INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIBDIR}/pkgconfig) ADD_SUBDIRECTORY(tests) diff --git a/include/hal-radio-interface-1.h b/include/hal-radio-interface-1.h new file mode 100644 index 0000000..eee1318 --- /dev/null +++ b/include/hal-radio-interface-1.h @@ -0,0 +1,75 @@ +/* + * HAL (Hardware Abstract Layer) Radio API + * + * Copyright (c) 2021 Samsung Electronics 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. + */ + +#ifndef __HAL_RADIO_INTERFACE_1__ +#define __HAL_RADIO_INTERFACE_1__ + +#include <stdint.h> + +#ifdef __cplusplus +extern "C" { +#endif +/** + * @brief Enumeration for the radio error. + * @since_tizen 6.5 + */ +typedef enum hal_radio_error { + HAL_RADIO_ERROR_NONE, + HAL_RADIO_ERROR_INVALID_PARAMETER, + HAL_RADIO_ERROR_INVALID_OPERATION, + HAL_RADIO_ERROR_PERMISSION_DENIED, + HAL_RADIO_ERROR_NOT_SUPPORTED, + HAL_RADIO_ERROR_OUT_OF_MEMORY, + HAL_RADIO_ERROR_DEVICE_NOT_PREPARED, + HAL_RADIO_ERROR_DEVICE_NOT_OPENED, + HAL_RADIO_ERROR_DEVICE_NOT_FOUND, + HAL_RADIO_ERROR_NO_ANTENNA, + HAL_RADIO_ERROR_INTERNAL, + HAL_RADIO_ERROR_NOT_IMPLEMENTED, + HAL_RADIO_ERROR_UNKNOWN +} hal_radio_error_t; + +/** + * @brief Enumeration for the radio seek direction. + * @since_tizen 6.5 + */ +typedef enum hal_radio_seek_direction_type { + RADIO_SEEK_DIRECTION_UP, /**< Seek upward */ + RADIO_SEEK_DIRECTION_DOWN, /**< Seek downward */ + RADIO_SEEK_NUM +} hal_radio_seek_direction_type_t; + +typedef struct _hal_backend_radio_funcs { + hal_radio_error_t (*init)(void **radio_handle); + hal_radio_error_t (*deinit)(void *radio_handle); + hal_radio_error_t (*prepare)(void *radio_handle); + hal_radio_error_t (*unprepare)(void *radio_handle); + hal_radio_error_t (*open)(void *radio_handle); + hal_radio_error_t (*close)(void *radio_handle); + hal_radio_error_t (*start)(void *radio_handle); + hal_radio_error_t (*stop)(void *radio_handle); + hal_radio_error_t (*seek)(void *radio_handle, hal_radio_seek_direction_type_t direction); + hal_radio_error_t (*get_frequency)(void *radio_handle, uint32_t *frequency); + hal_radio_error_t (*set_frequency)(void *radio_handle, uint32_t frequency); + hal_radio_error_t (*get_signal_strength)(void *radio_handle, int32_t *strength); +} hal_backend_radio_funcs; + +#ifdef __cplusplus +} +#endif +#endif /* __HAL_RADIO_INTERFACE_1__ */ diff --git a/include/hal-radio-interface.h b/include/hal-radio-interface.h index 7ce0412..362bf8e 100644 --- a/include/hal-radio-interface.h +++ b/include/hal-radio-interface.h @@ -19,57 +19,6 @@ #ifndef __HAL_RADIO_INTERFACE__ #define __HAL_RADIO_INTERFACE__ -#include <stdint.h> +#include <hal-radio-interface-1.h> -#ifdef __cplusplus -extern "C" { -#endif -/** - * @brief Enumeration for the radio error. - * @since_tizen 6.5 - */ -typedef enum hal_radio_error { - HAL_RADIO_ERROR_NONE, - HAL_RADIO_ERROR_INVALID_PARAMETER, - HAL_RADIO_ERROR_INVALID_OPERATION, - HAL_RADIO_ERROR_PERMISSION_DENIED, - HAL_RADIO_ERROR_NOT_SUPPORTED, - HAL_RADIO_ERROR_OUT_OF_MEMORY, - HAL_RADIO_ERROR_DEVICE_NOT_PREPARED, - HAL_RADIO_ERROR_DEVICE_NOT_OPENED, - HAL_RADIO_ERROR_DEVICE_NOT_FOUND, - HAL_RADIO_ERROR_NO_ANTENNA, - HAL_RADIO_ERROR_INTERNAL, - HAL_RADIO_ERROR_NOT_IMPLEMENTED, - HAL_RADIO_ERROR_UNKNOWN -} hal_radio_error_t; - -/** - * @brief Enumeration for the radio seek direction. - * @since_tizen 6.5 - */ -typedef enum hal_radio_seek_direction_type { - RADIO_SEEK_DIRECTION_UP, /**< Seek upward */ - RADIO_SEEK_DIRECTION_DOWN, /**< Seek downward */ - RADIO_SEEK_NUM -} hal_radio_seek_direction_type_t; - -typedef struct _hal_backend_radio_funcs { - hal_radio_error_t (*init)(void **radio_handle); - hal_radio_error_t (*deinit)(void *radio_handle); - hal_radio_error_t (*prepare)(void *radio_handle); - hal_radio_error_t (*unprepare)(void *radio_handle); - hal_radio_error_t (*open)(void *radio_handle); - hal_radio_error_t (*close)(void *radio_handle); - hal_radio_error_t (*start)(void *radio_handle); - hal_radio_error_t (*stop)(void *radio_handle); - hal_radio_error_t (*seek)(void *radio_handle, hal_radio_seek_direction_type_t direction); - hal_radio_error_t (*get_frequency)(void *radio_handle, uint32_t *frequency); - hal_radio_error_t (*set_frequency)(void *radio_handle, uint32_t frequency); - hal_radio_error_t (*get_signal_strength)(void *radio_handle, int32_t *strength); -} hal_backend_radio_funcs; - -#ifdef __cplusplus -} -#endif #endif /* __HAL_RADIO_INTERFACE__ */ |