Tizen HAL API  1.0
Radio

The Radio provides functions for radio devices.

Required Header

#include <hal-radio.h> The radio devices have various specifications, so it's hard to control them using single code. The radio HAL provides common abstraction interfaces to control radio devices which are different.

The radio HAL allows creation of components required in listening to the radio including:

State Diagram

hal_radio_state_diagram.png

State Transitions

FUNCTION PRE-STATE POST-STATE SYNC TYPE
hal_radio_init() N/A INITIALIZED SYNC
hal_radio_deinit() INITIALIZED N/A SYNC
hal_radio_prepare() INITIALIZED PREPARED SYNC
hal_radio_unprepare() PREPARED INITIALIZED SYNC
hal_radio_open() PREPARED OPENED SYNC
hal_radio_close() OPENED PREPARED SYNC
hal_radio_start() OPENED PLAYING SYNC
hal_radio_stop() PLAYING OPENED SYNC
hal_radio_seek() PLAYING PLAYING SYNC
hal_radio_seek() PLAYING PLAYING SYNC
hal_radio_set_frequency() PLAYING PLAYING SYNC
hal_radio_get_frequency() PLAYING PLAYING SYNC
hal_radio_get_signal_strength() PLAYING PLAYING SYNC

For more information on the radio features and the macros, see HAL radio programming guides and tutorials.

Typedefs

typedef enum hal_radio_error hal_radio_error_e
 Enumeration for the radio error.
typedef enum
hal_radio_seek_direction_type 
hal_radio_seek_direction_type_e
 Enumeration for the radio seek direction.
typedef struct
_hal_backend_radio_funcs 
hal_backend_radio_funcs
 The structure type of the radio HAL functions.

Data Structure Documentation

struct _hal_backend_radio_funcs

The structure type of the radio HAL functions.

Since:
HAL_MODULE_RADIO 1.0

Data Fields

hal_radio_error_e(* init )(void **radio_handle)
hal_radio_error_e(* deinit )(void *radio_handle)
hal_radio_error_e(* prepare )(void *radio_handle)
hal_radio_error_e(* unprepare )(void *radio_handle)
hal_radio_error_e(* open )(void *radio_handle)
hal_radio_error_e(* close )(void *radio_handle)
hal_radio_error_e(* start )(void *radio_handle)
hal_radio_error_e(* stop )(void *radio_handle)
hal_radio_error_e(* seek )(void *radio_handle, hal_radio_seek_direction_type_e direction)
hal_radio_error_e(* get_frequency )(void *radio_handle, uint32_t *frequency)
hal_radio_error_e(* set_frequency )(void *radio_handle, uint32_t frequency)

Field Documentation

Starts the device of radio

Prepare the device of radio

hal_radio_error_e(* _hal_backend_radio_funcs::get_frequency)(void *radio_handle, uint32_t *frequency)

Sets the radio frequency (khz)

< Initialize HAL backend handle Initialize HAL backend handle

Closes the device of radio

Unprepare the device of radio

Gets the radio frequency (khz)

hal_radio_error_e(* _hal_backend_radio_funcs::set_frequency)(void *radio_handle, uint32_t frequency)

Gets the current signal strength of the radio (dBm)

Stops the device of radio

Seeks (up or down) the effective frequency of the radio

Opens the device of radio


Typedef Documentation

The structure type of the radio HAL functions.

Since:
HAL_MODULE_RADIO 1.0

Enumeration for the radio error.

Since:
HAL_MODULE_RADIO 1.0

Enumeration for the radio seek direction.

Since:
HAL_MODULE_RADIO 1.0

Enumeration Type Documentation

Enumeration for the radio error.

Since:
HAL_MODULE_RADIO 1.0
Enumerator:
HAL_RADIO_ERROR_NONE 

Error none

HAL_RADIO_ERROR_INVALID_PARAMETER 

Invalid parameter

HAL_RADIO_ERROR_INVALID_OPERATION 

Invalid operation

HAL_RADIO_ERROR_PERMISSION_DENIED 

Permission denied

HAL_RADIO_ERROR_NOT_SUPPORTED 

Not supported

HAL_RADIO_ERROR_OUT_OF_MEMORY 

Out of memory

HAL_RADIO_ERROR_DEVICE_NOT_PREPARED 

Device is not prepared

HAL_RADIO_ERROR_DEVICE_NOT_OPENED 

Device is not opened

HAL_RADIO_ERROR_DEVICE_NOT_FOUND 

Device not found

HAL_RADIO_ERROR_NO_ANTENNA 

No antenna error

HAL_RADIO_ERROR_INTERNAL 

Internal error

HAL_RADIO_ERROR_NOT_IMPLEMENTED 

Not implemented

HAL_RADIO_ERROR_UNKNOWN 

Unknown

Enumeration for the radio seek direction.

Since:
HAL_MODULE_RADIO 1.0
Enumerator:
HAL_RADIO_SEEK_DIRECTION_UP 

Seek upward

HAL_RADIO_SEEK_DIRECTION_DOWN 

Seek downward