diff options
Diffstat (limited to 'include/hal-radio-interface-1.h')
-rw-r--r-- | include/hal-radio-interface-1.h | 75 |
1 files changed, 75 insertions, 0 deletions
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__ */ |