Add support for HAL_MODULE_RADIO v1.0 interface 13/313213/1 accepted/tizen_unified accepted/tizen_unified_dev accepted/tizen_unified_toolchain accepted/tizen_unified_x accepted/tizen_unified_x_asan tizen accepted/tizen/unified/20240718.010233 accepted/tizen/unified/dev/20240718.035957 accepted/tizen/unified/toolchain/20240812.131711 accepted/tizen/unified/x/20240718.022928 accepted/tizen/unified/x/asan/20240813.225947
authorChanwoo Choi <cw00.choi@samsung.com>
Thu, 20 Jun 2024 06:42:20 +0000 (15:42 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Thu, 20 Jun 2024 06:42:20 +0000 (15:42 +0900)
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>
CMakeLists.txt
include/hal-radio-interface-1.h [new file with mode: 0644]
include/hal-radio-interface.h

index 14f3356..9b59c9b 100644 (file)
@@ -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 (file)
index 0000000..eee1318
--- /dev/null
@@ -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__ */
index 7ce0412..362bf8e 100644 (file)
 #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__ */