summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilbok Lee <gilbok.lee@samsung.com>2016-07-05 15:15:09 +0900
committerGilbok Lee <gilbok.lee@samsung.com>2016-07-19 16:22:22 +0900
commitdf10f465c54150fd65a725f9088b757f0ad6e7b5 (patch)
treebe1c179804a40fd4d265184be0ea9f6d60b09c70
parent2142931e6351574ea8acb982365286f4d30d641b (diff)
downloadmm-hal-interface-accepted/tizen_mobile.tar.gz
mm-hal-interface-accepted/tizen_mobile.tar.bz2
mm-hal-interface-accepted/tizen_mobile.zip
[Radio] Initial release for radio HALtizen_4.0.m2_releasetizen_4.0.m1_releasetizen_4.0.IoT.p2_releasetizen_4.0.IoT.p1_releasesubmit/tizen_unified/20170308.100408submit/tizen_4.0/20170828.110004submit/tizen_4.0/20170828.100004submit/tizen_4.0/20170811.094300submit/tizen_3.0_wearable/20161015.000004submit/tizen_3.0_tv/20161015.000004submit/tizen_3.0_mobile/20161015.000004submit/tizen_3.0_ivi/20161010.000005submit/tizen_3.0_common/20161104.104000submit/tizen_3.0.m2/20170104.093750submit/tizen/20160805.054353accepted/tizen/wearable/20160808.081100accepted/tizen/unified/20170309.033313accepted/tizen/tv/20160808.080959accepted/tizen/mobile/20160808.080807accepted/tizen/ivi/20160808.081149accepted/tizen/common/20160805.130149accepted/tizen/4.0/unified/20170829.020054accepted/tizen/4.0/unified/20170816.013407accepted/tizen/3.0/wearable/20161015.083718accepted/tizen/3.0/tv/20161016.005501accepted/tizen/3.0/mobile/20161015.033657accepted/tizen/3.0/ivi/20161011.055428accepted/tizen/3.0/common/20161114.105827accepted/tizen/3.0.m2/wearable/20170104.125905accepted/tizen/3.0.m2/tv/20170104.125642accepted/tizen/3.0.m2/mobile/20170104.125433tizen_4.0_tvtizen_4.0tizen_3.0_tvtizen_3.0.m2accepted/tizen_wearableaccepted/tizen_tvaccepted/tizen_mobileaccepted/tizen_iviaccepted/tizen_commonaccepted/tizen_4.0_unifiedaccepted/tizen_3.0_wearableaccepted/tizen_3.0_tvaccepted/tizen_3.0_mobileaccepted/tizen_3.0_iviaccepted/tizen_3.0_commonaccepted/tizen_3.0.m2_wearableaccepted/tizen_3.0.m2_tvaccepted/tizen_3.0.m2_mobile
Change-Id: I06f3bfcbeee7f67fb1b673eab9992db65a44288e Signed-off-by: Gilbok Lee <gilbok.lee@samsung.com>
-rw-r--r--radio/tizen-radio.h244
1 files changed, 244 insertions, 0 deletions
diff --git a/radio/tizen-radio.h b/radio/tizen-radio.h
index bdb04e6..c2bbadb 100644
--- a/radio/tizen-radio.h
+++ b/radio/tizen-radio.h
@@ -17,3 +17,247 @@
*
*/
+#ifndef __TIZEN_RADIO_HAL_H__
+#define __TIZEN_RADIO_HAL_H__
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * @file tizen-radio.h
+ * @brief This file contains the Tizen radio HAL API, related structures and enumerations.
+ * @since_tizen 3.0
+ */
+
+/**
+ * @addtogroup TIZEN_RADIO_HAL_MODULE
+ * @{
+ */
+
+/**
+ * @brief Enumeration for the radio error.
+ * @since_tizen 3.0
+ */
+typedef enum radio_error {
+ RADIO_ERROR_NONE,
+ RADIO_ERROR_INVALID_PARAMETER,
+ RADIO_ERROR_INVALID_STATE,
+ RADIO_ERROR_INVALID_OPERATION,
+ RADIO_ERROR_PERMISSION_DENIED,
+ RADIO_ERROR_NOT_SUPPORTED,
+ RADIO_ERROR_OUT_OF_MEMORY,
+ RADIO_ERROR_DEVICE_NOT_PREPARED,
+ RADIO_ERROR_DEVICE_NOT_OPENED,
+ RADIO_ERROR_DEVICE_NOT_FOUND,
+ RADIO_ERROR_DEVICE_NOT_SUPPORTED,
+ RADIO_ERROR_INTERNAL,
+ RADIO_ERROR_UNKNOWN
+} radio_error_t;
+
+/**
+ * @brief Enumeration for the radio seek direction.
+ * @since_tizen 3.0
+ */
+typedef enum radio_seek_direction_type {
+ RADIO_SEEK_DIRECTION_UP, /**< Seek upward */
+ RADIO_SEEK_DIRECTION_DOWN /**< Seek downward */
+} radio_seek_direction_type_t;
+
+typedef struct radio_interface {
+ /* create & destroy */
+ radio_error_t (*init)(void **radio_hanle);
+ radio_error_t (*deinit)(void *radio_handle);
+ radio_error_t (*prepare)(void *radio_handle);
+ radio_error_t (*unprepare)(void *radio_handle);
+ radio_error_t (*open)(void *radio_handle);
+ radio_error_t (*close)(void *radio_handle);
+ radio_error_t (*start)(void *radio_handle);
+ radio_error_t (*stop)(void *radio_handle);
+ radio_error_t (*seek)(void *radio_handle, radio_seek_direction_type_t direction);
+ radio_error_t (*get_frequency)(void *radio_handle, uint32_t *frequency);
+ radio_error_t (*set_frequency)(void *radio_handle, uint32_t frequency);
+ radio_error_t (*mute)(void *radio_handle);
+ radio_error_t (*unmute)(void *radio_handle);
+ radio_error_t (*get_signal_strength)(void *radio_handle, uint32_t *strength);
+} radio_interface_t;
+
+/**
+ * @brief Initializes new handle of radio HAL.
+ * @since_tizen 3.0
+ * @param[out] radio_handle A newly returned handle to the radio HAL
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RADIO_ERROR_NONE Successful
+ * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #RADIO_ERROR_OUT_OF_MEMORY Out of memory
+ * @see radio_deinit()
+ */
+radio_error_t radio_init(void **radio_handle);
+
+/**
+ * @brief Deinitializes handle of camera HAL.
+ * @since_tizen 3.0
+ * @param[in] radio_handle The handle to the radio HAL
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RADIO_ERROR_NONE Successful
+ * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @see radio_init()
+ */
+radio_error_t radio_deinit(void *radio_handle);
+
+/**
+ * @brief Prepare the device of radio.
+ * @since_tizen 3.0
+ * @param[in] radio_handle The handle to the radio HAL
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RADIO_ERROR_NONE Successful
+ * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #RADIO_ERROR_DEVICE_NOT_OPENED The radio device is not opened
+ * @see radio_unprepare()
+ */
+radio_error_t radio_prepare(void *radio_handle);
+
+/**
+ * @brief Unprepare the device of radio.
+ * @since_tizen 3.0
+ * @param[in] radio_handle The handle to the radio HAL
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RADIO_ERROR_NONE Successful
+ * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @see radio_prepare()
+ */
+radio_error_t radio_unprepare(void *radio_handle);
+
+/**
+ * @brief Opens the device of radio.
+ * @since_tizen 3.0
+ * @param[in] radio_handle The handle to the radio HAL
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RADIO_ERROR_NONE Successful
+ * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #RADIO_ERROR_DEVICE_NOT_FOUND Failed to find radio device
+ * @retval #RADIO_ERROR_DEVICE_NOT_OPENED The radio device is not opened
+ * @retval #RADIO_ERROR_PERMISSION_DENIED The access to the resources can not be granted.
+ * @retval #RADIO_ERROR_DEVICE_NOT_PREPARED Not prepared the radio device
+ * @see radio_close()
+ */
+radio_error_t radio_open(void *radio_handle);
+
+/**
+ * @brief Closes the device of radio.
+ * @since_tizen 3.0
+ * @param[in] radio_handle The handle to the radio HAL
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RADIO_ERROR_NONE Successful
+ * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @see radio_open()
+ */
+radio_error_t radio_close(void *radio_handle);
+
+/**
+ * @brief Starts the device of radio.
+ * @since_tizen 3.0
+ * @param[in] radio_handle The handle to the radio HAL
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RADIO_ERROR_NONE Successful
+ * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @see radio_stop()
+ */
+radio_error_t radio_start(void *radio_handle);
+
+/**
+ * @brief Stops the device of radio.
+ * @since_tizen 3.0
+ * @param[in] radio_handle The handle to the radio HAL
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RADIO_ERROR_NONE Successful
+ * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @see radio_start()
+ */
+radio_error_t radio_stop(void *radio_handle);
+
+/**
+ * @brief Seeks (up or down) the effective frequency of the radio.
+ * @since_tizen 3.0
+ * @param[in] radio_handle The handle to the radio HAL
+ * @param[in] direction The seek direction type (up or down)
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RADIO_ERROR_NONE Successful
+ * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #RADIO_ERROR_DEVICE_NOT_OPENED The radio device is not opened
+ * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
+ */
+radio_error_t radio_seek(void *radio_handle, radio_seek_direction_type_t direction);
+
+/**
+ * @brief Gets the radio frequency.
+ * @since_tizen 3.0
+ * @param[in] radio_handle The handle to the radio HAL
+ * @param[out] frequency The current frequency (khz)
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RADIO_ERROR_NONE Successful
+ * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #RADIO_ERROR_DEVICE_NOT_OPENED The radio device is not opened
+ * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
+ */
+radio_error_t radio_get_frequency(void *radio_handle, uint32_t *frequency);
+
+/**
+ * @brief Sets the radio frequency.
+ * @since_tizen 3.0
+ * @param[in] radio_handle The handle to the radio HAL
+ * @param[in] frequency The frequency to set (khz)
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RADIO_ERROR_NONE Successful
+ * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #RADIO_ERROR_DEVICE_NOT_OPENED The radio device is not opened
+ * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
+ */
+radio_error_t radio_set_frequency(void *radio_handle, uint32_t frequency);
+
+/**
+ * @brief Sets the radio's mute
+ * @since_tizen 3.0
+ * @param[in] radio_handle The handle to the radio HAL
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RADIO_ERROR_NONE Successful
+ * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
+ */
+radio_error_t radio_mute(void *radio_handle);
+
+/**
+ * @brief Unsets the radio's mute
+ * @since_tizen 3.0
+ * @param[in] radio_handle The handle to the radio HAL
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RADIO_ERROR_NONE Successful
+ * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
+ */
+radio_error_t radio_unmute(void *radio_handle);
+
+/**
+ * @brief Gets the current signal strength of the radio
+ * @since_tizen 3.0
+ * @param[in] radio_handle The handle to the radio HAL
+ * @param[out] strength The current signal strength (dBm)
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RADIO_ERROR_NONE Successful
+ * @retval #RADIO_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #RADIO_ERROR_INVALID_OPERATION Invalid operation
+ */
+radio_error_t radio_get_signal_strength(void *radio_handle, uint32_t *strength);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __TIZEN_RADIO_HAL_H__ */
+