* @brief Enumeration of radio state.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
-typedef enum
-{
+typedef enum {
RADIO_STATE_READY, /**< Ready to play or scan */
RADIO_STATE_PLAYING, /**< Playing the audio from the tuner */
RADIO_STATE_SCANNING, /**< Scanning/Searching for the next station signal that starts from a given starting frequency */
* @brief Enumeration of error codes for the radio.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
-typedef enum
-{
- RADIO_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
- RADIO_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
- RADIO_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
+typedef enum {
+ RADIO_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
+ RADIO_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
+ RADIO_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
RADIO_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Invalid operation */
- RADIO_ERROR_INVALID_STATE = TIZEN_ERROR_RADIO | 0x01 , /**< Invalid state */
- RADIO_ERROR_SOUND_POLICY = TIZEN_ERROR_RADIO | 0x02 , /**< Sound policy error */
- RADIO_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
- RADIO_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */
+ RADIO_ERROR_INVALID_STATE = TIZEN_ERROR_RADIO | 0x01 , /**< Invalid state */
+ RADIO_ERROR_SOUND_POLICY = TIZEN_ERROR_RADIO | 0x02 , /**< Sound policy error */
+ RADIO_ERROR_NO_ANTENNA = TIZEN_ERROR_RADIO | 0x03 , /**< No Antenna error (Since 2.4) */
+ RADIO_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
+ RADIO_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */
} radio_error_e;
/**
* @brief Enumeration of radio interrupted type.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
-typedef enum
-{
- RADIO_INTERRUPTED_COMPLETED = 0, /**< Interrupt completed */
- RADIO_INTERRUPTED_BY_MEDIA, /**< Interrupted by a non-resumable media application */
- RADIO_INTERRUPTED_BY_CALL, /**< Interrupted by an incoming call */
- RADIO_INTERRUPTED_BY_EARJACK_UNPLUG, /**< Interrupted by unplugging headphones */
- RADIO_INTERRUPTED_BY_RESOURCE_CONFLICT, /**< Interrupted by a resource conflict */
- RADIO_INTERRUPTED_BY_ALARM, /**< Interrupted by an alarm */
- RADIO_INTERRUPTED_BY_EMERGENCY, /**< Interrupted by an emergency */
- RADIO_INTERRUPTED_BY_RESUMABLE_MEDIA, /**< Interrupted by a resumable media application */
- RADIO_INTERRUPTED_BY_NOTIFICATION, /**< Interrupted by a notification */
+typedef enum {
+ RADIO_INTERRUPTED_COMPLETED = 0, /**< Interrupt completed */
+ RADIO_INTERRUPTED_BY_MEDIA, /**< Interrupted by a non-resumable media application */
+ RADIO_INTERRUPTED_BY_CALL, /**< Interrupted by an incoming call */
+ RADIO_INTERRUPTED_BY_EARJACK_UNPLUG, /**< Interrupted by unplugging headphones */
+ RADIO_INTERRUPTED_BY_RESOURCE_CONFLICT, /**< Interrupted by a resource conflict */
+ RADIO_INTERRUPTED_BY_ALARM, /**< Interrupted by an alarm */
+ RADIO_INTERRUPTED_BY_EMERGENCY, /**< Interrupted by an emergency */
+ RADIO_INTERRUPTED_BY_RESUMABLE_MEDIA, /**< Interrupted by a resumable media application */
+ RADIO_INTERRUPTED_BY_NOTIFICATION, /**< Interrupted by a notification */
} radio_interrupted_code_e;
/**
* @retval #RADIO_ERROR_INVALID_STATE Invalid radio state
* @retval #RADIO_ERROR_SOUND_POLICY Sound policy error
* @retval #RADIO_ERROR_NOT_SUPPORTED Not supported
+ * @retval #RADIO_ERROR_NO_ANTENNA No Antenna error
* @pre The radio state must be set to #RADIO_STATE_READY by calling radio_create().
* @post The radio state will be #RADIO_STATE_PLAYING.
* @see radio_stop()
* @post It invokes radio_seek_completed_cb() when the seek completes.
* @see radio_seek_down()
*/
-int radio_seek_up(radio_h radio,radio_seek_completed_cb callback, void *user_data );
+int radio_seek_up(radio_h radio, radio_seek_completed_cb callback, void *user_data);
/**
* @brief Seeks down the effective frequency of the radio, asynchronously.
* @post It invokes radio_seek_completed_cb() when the seek completes.
* @see radio_seek_up()
*/
-int radio_seek_down(radio_h radio,radio_seek_completed_cb callback, void *user_data );
+int radio_seek_down(radio_h radio, radio_seek_completed_cb callback, void *user_data);
/**
* @brief Sets the radio frequency.
int radio_unset_interrupted_cb(radio_h radio);
/**
+ * @brief Gets the min, max frequency of the region.
+ * @since_tizen 2.4
+ * @param[in] radio The handle to radio
+ * @param[out] min_freq The min frequency [87500 ~ 108000] (kHz)
+ * @param[out] max_freq The max frequency [87500 ~ 108000] (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_INVALID_OPERATION Invalid operation
+ * @retval #RADIO_ERROR_NOT_SUPPORTED Not supported
+ */
+int radio_get_frequency_range(radio_h radio, int *min_freq, int *max_freq);
+
+/**
+ * @brief Gets channel spacing.
+ * @since_tizen 2.4
+ * @param[in] radio The handle to radio
+ * @param[out] channel_spacing The channel spacing value
+ * @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
+ * @retval #RADIO_ERROR_NOT_SUPPORTED Not supported
+ */
+int radio_get_channel_spacing(radio_h radio, int *channel_spacing);
+
+
+/**
* @}
*/
/*
* Internal Macros
*/
-#define RADIO_CHECK_CONDITION(condition,error,msg) \
- if(condition) {} else \
- { LOGE("[%s] %s(0x%08x)",(char*)__FUNCTION__, msg,error); return error;}; \
+#define RADIO_CHECK_CONDITION(condition, error, msg) \
+ if (condition) { } else \
+ { LOGE("[%s] %s(0x%08x)", (char *)__FUNCTION__, msg, error); return error; }; \
#define RADIO_INSTANCE_CHECK(radio) \
- RADIO_CHECK_CONDITION(radio != NULL, RADIO_ERROR_INVALID_PARAMETER,"RADIO_ERROR_INVALID_PARAMETER")
+ RADIO_CHECK_CONDITION(radio != NULL, RADIO_ERROR_INVALID_PARAMETER, "RADIO_ERROR_INVALID_PARAMETER")
-#define RADIO_STATE_CHECK(radio,expected_state) \
- RADIO_CHECK_CONDITION(radio->state == expected_state,RADIO_ERROR_INVALID_STATE,"RADIO_ERROR_INVALID_STATE")
+#define RADIO_STATE_CHECK(radio, expected_state) \
+ RADIO_CHECK_CONDITION(radio->state == expected_state, RADIO_ERROR_INVALID_STATE, "RADIO_ERROR_INVALID_STATE")
#define RADIO_NULL_ARG_CHECK(arg) \
- RADIO_CHECK_CONDITION(arg != NULL,RADIO_ERROR_INVALID_PARAMETER,"RADIO_ERROR_INVALID_PARAMETER")
+ RADIO_CHECK_CONDITION(arg != NULL, RADIO_ERROR_INVALID_PARAMETER, "RADIO_ERROR_INVALID_PARAMETER")
#define RADIO_SUPPORT_CHECK(arg) \
- RADIO_CHECK_CONDITION(arg != false, RADIO_ERROR_NOT_SUPPORTED,"RADIO_ERROR_NOT_SUPPORTED")
+ RADIO_CHECK_CONDITION(arg != false, RADIO_ERROR_NOT_SUPPORTED, "RADIO_ERROR_NOT_SUPPORTED")
/*
* Internal Implementation
*/
-static int __convert_error_code(int code, char *func_name)
+int __convert_error_code(int code, char *func_name)
{
int ret = RADIO_ERROR_NONE;
- char* msg="RADIO_ERROR_NONE";
+ char *msg = "RADIO_ERROR_NONE";
LOGI("[%s] Enter code :%x", __func__, code);
- switch(code)
- {
+ switch (code) {
case MM_ERROR_NONE:
ret = RADIO_ERROR_NONE;
msg = "RADIO_ERROR_NONE";
msg = "RADIO_ERROR_INVALID_STATE";
break;
case MM_ERROR_COMMON_INVALID_ARGUMENT:
+ case MM_ERROR_INVALID_ARGUMENT:
ret = RADIO_ERROR_INVALID_PARAMETER;
msg = "RADIO_ERROR_INVALID_PARAMETER";
break;
break;
case MM_ERROR_RADIO_INTERNAL:
case MM_ERROR_RADIO_RESPONSE_TIMEOUT:
- ret= RADIO_ERROR_INVALID_OPERATION;
+ ret = RADIO_ERROR_INVALID_OPERATION;
msg = "RADIO_ERROR_INVALID_OPERATION";
break;
case MM_ERROR_RADIO_DEVICE_NOT_FOUND:
ret = RADIO_ERROR_NOT_SUPPORTED;
msg = "RADIO_ERROR_NOT_SUPPORTED";
break;
+ case MM_ERROR_RADIO_NO_ANTENNA:
+ ret = RADIO_ERROR_NO_ANTENNA;
+ msg = "RADIO_ERROR_NO_ANTENNA";
+ break;
case MM_ERROR_RADIO_DEVICE_NOT_OPENED:
- default :
- ret= RADIO_ERROR_PERMISSION_DENIED;
+ default:
+ ret = RADIO_ERROR_PERMISSION_DENIED;
msg = "RADIO_ERROR_PERMISSION_DENIED";
}
- LOGE("[%s] %s(0x%08x) : core fw error(0x%x)",func_name,msg, ret, code);
+ LOGE("[%s] %s(0x%08x) : core fw error(0x%x)", func_name, msg, ret, code);
return ret;
}
{
int converted_state = RADIO_STATE_READY;
LOGI("[%s] Enter state: %d", __func__, state);
- switch(state)
- {
+ switch (state) {
case MM_RADIO_STATE_PLAYING:
converted_state = RADIO_STATE_PLAYING;
case MM_RADIO_STATE_NULL:
case MM_RADIO_STATE_READY:
default:
- converted_state = RADIO_STATE_READY;
- break;
+ converted_state = RADIO_STATE_READY;
+ break;
}
LOGI("[%s] Leave converted_state: %d", __func__, converted_state);
return converted_state;
{
LOGI("[%s] Enter code: %d", __func__, code);
radio_interrupted_code_e ret = RADIO_INTERRUPTED_BY_RESOURCE_CONFLICT;
- switch(code)
- {
+ switch (code) {
case MM_MSG_CODE_INTERRUPTED_BY_CALL_END:
case MM_MSG_CODE_INTERRUPTED_BY_ALARM_END:
case MM_MSG_CODE_INTERRUPTED_BY_EMERGENCY_END:
case MM_MSG_CODE_INTERRUPTED_BY_EMERGENCY_START:
ret = RADIO_INTERRUPTED_BY_EMERGENCY;
break;
- case MM_MSG_CODE_INTERRUPTED_BY_RESUMABLE_MEDIA:
- ret = RADIO_INTERRUPTED_BY_RESUMABLE_MEDIA;
- break;
case MM_MSG_CODE_INTERRUPTED_BY_RESOURCE_CONFLICT:
- default :
+ default:
ret = RADIO_INTERRUPTED_BY_RESOURCE_CONFLICT;
break;
}
- LOGE("[%s] interrupted code(%d) => ret(%d)",__FUNCTION__,code, ret);
+ LOGE("[%s] interrupted code(%d) => ret(%d)", __FUNCTION__, code, ret);
return ret;
}
-static int __set_callback(_radio_event_e type, radio_h radio, void* callback, void *user_data)
+static int __set_callback(_radio_event_e type, radio_h radio, void *callback, void *user_data)
{
RADIO_INSTANCE_CHECK(radio);
RADIO_NULL_ARG_CHECK(callback);
- radio_s * handle = (radio_s *) radio;
+ radio_s *handle = (radio_s *) radio;
handle->user_cb[type] = callback;
handle->user_data[type] = user_data;
- LOGI("[%s] Event type : %d ",__FUNCTION__, type);
+ LOGI("[%s] Event type : %d ", __FUNCTION__, type);
return RADIO_ERROR_NONE;
}
static int __unset_callback(_radio_event_e type, radio_h radio)
{
RADIO_INSTANCE_CHECK(radio);
- radio_s * handle = (radio_s *) radio;
+ radio_s *handle = (radio_s *) radio;
handle->user_cb[type] = NULL;
handle->user_data[type] = NULL;
- LOGI("[%s] Event type : %d ",__FUNCTION__, type);
+ LOGI("[%s] Event type : %d ", __FUNCTION__, type);
return RADIO_ERROR_NONE;
}
static int __msg_callback(int message, void *param, void *user_data)
{
- radio_s * handle = (radio_s*)user_data;
- MMMessageParamType *msg = (MMMessageParamType*)param;
- LOGI("[%s] Got message type : 0x%x" ,__FUNCTION__, message);
- switch(message)
- {
+ radio_s *handle = (radio_s *)user_data;
+ MMMessageParamType *msg = (MMMessageParamType *)param;
+ LOGI("[%s] Got message type : 0x%x" , __FUNCTION__, message);
+ switch (message) {
case MM_MESSAGE_RADIO_SCAN_INFO:
- if( handle->user_cb[_RADIO_EVENT_TYPE_SCAN_INFO] )
- {
- ((radio_scan_updated_cb)handle->user_cb[_RADIO_EVENT_TYPE_SCAN_INFO])(msg->radio_scan.frequency,handle->user_data[_RADIO_EVENT_TYPE_SCAN_INFO]);
+ if (handle->user_cb[_RADIO_EVENT_TYPE_SCAN_INFO]) {
+ ((radio_scan_updated_cb)handle->user_cb[_RADIO_EVENT_TYPE_SCAN_INFO])(msg->radio_scan.frequency, handle->user_data[_RADIO_EVENT_TYPE_SCAN_INFO]);
}
break;
case MM_MESSAGE_RADIO_SCAN_STOP:
- if( handle->user_cb[_RADIO_EVENT_TYPE_SCAN_STOP] )
- {
+ if (handle->user_cb[_RADIO_EVENT_TYPE_SCAN_STOP]) {
((radio_scan_stopped_cb)handle->user_cb[_RADIO_EVENT_TYPE_SCAN_STOP])(handle->user_data[_RADIO_EVENT_TYPE_SCAN_STOP]);
}
break;
case MM_MESSAGE_RADIO_SCAN_FINISH:
- if( handle->user_cb[_RADIO_EVENT_TYPE_SCAN_FINISH] )
- {
+ if (handle->user_cb[_RADIO_EVENT_TYPE_SCAN_FINISH]) {
((radio_scan_completed_cb)handle->user_cb[_RADIO_EVENT_TYPE_SCAN_FINISH])(handle->user_data[_RADIO_EVENT_TYPE_SCAN_FINISH]);
}
break;
case MM_MESSAGE_RADIO_SEEK_FINISH:
- if( handle->user_cb[_RADIO_EVENT_TYPE_SEEK_FINISH] )
- {
+ if (handle->user_cb[_RADIO_EVENT_TYPE_SEEK_FINISH]) {
((radio_seek_completed_cb)handle->user_cb[_RADIO_EVENT_TYPE_SEEK_FINISH])(msg->radio_scan.frequency, handle->user_data[_RADIO_EVENT_TYPE_SEEK_FINISH]);
}
break;
case MM_MESSAGE_STATE_INTERRUPTED:
- if( handle->user_cb[_RADIO_EVENT_TYPE_INTERRUPT] )
- {
- ((radio_interrupted_cb)handle->user_cb[_RADIO_EVENT_TYPE_INTERRUPT])(__convert_interrupted_code(msg->code),handle->user_data[_RADIO_EVENT_TYPE_INTERRUPT]);
+ if (handle->user_cb[_RADIO_EVENT_TYPE_INTERRUPT]) {
+ ((radio_interrupted_cb)handle->user_cb[_RADIO_EVENT_TYPE_INTERRUPT])(__convert_interrupted_code(msg->code), handle->user_data[_RADIO_EVENT_TYPE_INTERRUPT]);
}
break;
case MM_MESSAGE_READY_TO_RESUME:
- if( handle->user_cb[_RADIO_EVENT_TYPE_INTERRUPT] )
- {
- ((radio_interrupted_cb)handle->user_cb[_RADIO_EVENT_TYPE_INTERRUPT])(RADIO_INTERRUPTED_COMPLETED,handle->user_data[_RADIO_EVENT_TYPE_INTERRUPT]);
+ if (handle->user_cb[_RADIO_EVENT_TYPE_INTERRUPT]) {
+ ((radio_interrupted_cb)handle->user_cb[_RADIO_EVENT_TYPE_INTERRUPT])(RADIO_INTERRUPTED_COMPLETED, handle->user_data[_RADIO_EVENT_TYPE_INTERRUPT]);
}
break;
case MM_MESSAGE_ERROR:
- __convert_error_code(msg->code,(char*)__FUNCTION__);
+ __convert_error_code(msg->code, (char *)__FUNCTION__);
break;
case MM_MESSAGE_RADIO_SCAN_START:
LOGI("[%s] Scan Started");
break;
case MM_MESSAGE_STATE_CHANGED:
handle->state = __convert_radio_state(msg->state.current);
- LOGI("[%s] State Changed --- from : %d , to : %d" ,__FUNCTION__, __convert_radio_state(msg->state.previous), handle->state);
+ LOGI("[%s] State Changed --- from : %d , to : %d" , __FUNCTION__, __convert_radio_state(msg->state.previous), handle->state);
break;
case MM_MESSAGE_RADIO_SEEK_START:
LOGI("[%s] Seek Started", __FUNCTION__);
nRetVal = system_info_get_platform_bool("http://tizen.org/feature/fmradio", &bValue);
- if ( nRetVal != SYSTEM_INFO_ERROR_NONE )
- {
+ if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
LOGE("[%s] SYSTEM_INFO_ERROR : ", __FUNCTION__);
return false;
}
- if ( false == bValue )
- {
+ if (false == bValue) {
LOGI("system_info_get_platform_bool returned Unsupported feature capability\n");
- }
- else
- {
+ } else {
LOGI("system_info_get_platform_bool returned Supported status feature\n");
}
LOGI("[%s] Enter", __func__);
RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
RADIO_INSTANCE_CHECK(radio);
- radio_s * handle;
+ radio_s *handle;
- handle = (radio_s*)malloc( sizeof(radio_s));
+ handle = (radio_s *)malloc(sizeof(radio_s));
if (handle != NULL)
memset(handle, 0 , sizeof(radio_s));
- else
- {
- LOGE("[%s] RADIO_ERROR_OUT_OF_MEMORY(0x%08x)" ,__FUNCTION__,RADIO_ERROR_OUT_OF_MEMORY);
+ else {
+ LOGE("[%s] RADIO_ERROR_OUT_OF_MEMORY(0x%08x)" , __FUNCTION__, RADIO_ERROR_OUT_OF_MEMORY);
return RADIO_ERROR_OUT_OF_MEMORY;
}
int ret = mm_radio_create(&handle->mm_handle);
- if( ret != MM_ERROR_NONE)
- {
+ if (ret != MM_ERROR_NONE) {
free(handle);
- handle=NULL;
- return __convert_error_code(ret,(char*)__FUNCTION__);
- }
- else
- {
+ handle = NULL;
+ return __convert_error_code(ret, (char *)__FUNCTION__);
+ } else {
*radio = (radio_h)handle;
- ret = mm_radio_set_message_callback(handle->mm_handle, __msg_callback, (void*)handle);
- if(ret != MM_ERROR_NONE)
- {
- LOGW("[%s] Failed to set message callback function (0x%x)" ,__FUNCTION__, ret);
+ ret = mm_radio_set_message_callback(handle->mm_handle, __msg_callback, (void *)handle);
+ if (ret != MM_ERROR_NONE) {
+ LOGW("[%s] Failed to set message callback function (0x%x)" , __FUNCTION__, ret);
}
ret = mm_radio_realize(handle->mm_handle);
- if(ret != MM_ERROR_NONE)
- {
- return __convert_error_code(ret,(char*)__FUNCTION__);
+ if (ret != MM_ERROR_NONE) {
+ return __convert_error_code(ret, (char *)__FUNCTION__);
}
handle->state = RADIO_STATE_READY;
handle->mute = FALSE;
LOGI("[%s] Enter", __func__);
RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
RADIO_INSTANCE_CHECK(radio);
- radio_s * handle = (radio_s *) radio;
+ radio_s *handle = (radio_s *) radio;
int ret;
ret = mm_radio_unrealize(handle->mm_handle);
- if ( ret!= MM_ERROR_NONE)
- {
- LOGW("[%s] Failed to unrealize (0x%x)" ,__FUNCTION__, ret);
+ if (ret != MM_ERROR_NONE) {
+ LOGW("[%s] Failed to unrealize (0x%x)" , __FUNCTION__, ret);
}
ret = mm_radio_destroy(handle->mm_handle);
- if (ret!= MM_ERROR_NONE)
- {
- return __convert_error_code(ret,(char*)__FUNCTION__);
- }
- else
- {
+ if (ret != MM_ERROR_NONE) {
+ return __convert_error_code(ret, (char *)__FUNCTION__);
+ } else {
free(handle);
- handle= NULL;
+ handle = NULL;
return RADIO_ERROR_NONE;
}
}
RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
RADIO_INSTANCE_CHECK(radio);
RADIO_NULL_ARG_CHECK(state);
- radio_s * handle = (radio_s *) radio;
+ radio_s *handle = (radio_s *) radio;
MMRadioStateType currentStat = MM_RADIO_STATE_NULL;
int ret = mm_radio_get_state(handle->mm_handle, ¤tStat);
- if(ret != MM_ERROR_NONE)
- {
+ if (ret != MM_ERROR_NONE) {
*state = handle->state;
- return __convert_error_code(ret,(char*)__FUNCTION__);
- }
- else
- {
+ return __convert_error_code(ret, (char *)__FUNCTION__);
+ } else {
handle->state = __convert_radio_state(currentStat);
*state = handle->state;
return RADIO_ERROR_NONE;
LOGI("[%s] Enter", __func__);
RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
RADIO_INSTANCE_CHECK(radio);
- radio_s * handle = (radio_s *) radio;
- RADIO_STATE_CHECK(handle,RADIO_STATE_READY);
+ radio_s *handle = (radio_s *) radio;
+ RADIO_STATE_CHECK(handle, RADIO_STATE_READY);
int ret = mm_radio_start(handle->mm_handle);
- if(ret != MM_ERROR_NONE)
- {
- return __convert_error_code(ret,(char*)__FUNCTION__);
- }
- else
- {
+ if (ret != MM_ERROR_NONE) {
+ return __convert_error_code(ret, (char *)__FUNCTION__);
+ } else {
handle->state = RADIO_STATE_PLAYING;
return RADIO_ERROR_NONE;
}
LOGI("[%s] Enter", __func__);
RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
RADIO_INSTANCE_CHECK(radio);
- radio_s * handle = (radio_s *) radio;
- RADIO_STATE_CHECK(handle,RADIO_STATE_PLAYING);
+ radio_s *handle = (radio_s *) radio;
+ RADIO_STATE_CHECK(handle, RADIO_STATE_PLAYING);
int ret = mm_radio_stop(handle->mm_handle);
- if(ret != MM_ERROR_NONE)
- {
- return __convert_error_code(ret,(char*)__FUNCTION__);
- }
- else
- {
+ if (ret != MM_ERROR_NONE) {
+ return __convert_error_code(ret, (char *)__FUNCTION__);
+ } else {
handle->state = RADIO_STATE_READY;
return RADIO_ERROR_NONE;
}
}
-int radio_seek_up(radio_h radio,radio_seek_completed_cb callback, void *user_data )
+int radio_seek_up(radio_h radio, radio_seek_completed_cb callback, void *user_data)
{
LOGI("[%s] Enter", __func__);
RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
RADIO_INSTANCE_CHECK(radio);
- radio_s * handle = (radio_s *) radio;
- RADIO_STATE_CHECK(handle,RADIO_STATE_PLAYING);
+ radio_s *handle = (radio_s *) radio;
+ RADIO_STATE_CHECK(handle, RADIO_STATE_PLAYING);
- if(callback!=NULL)
- {
- __set_callback(_RADIO_EVENT_TYPE_SEEK_FINISH,radio,callback,user_data);
- }
- else
- {
- __unset_callback(_RADIO_EVENT_TYPE_SEEK_FINISH,radio);
+ if (callback != NULL) {
+ __set_callback(_RADIO_EVENT_TYPE_SEEK_FINISH, radio, callback, user_data);
+ } else {
+ __unset_callback(_RADIO_EVENT_TYPE_SEEK_FINISH, radio);
}
int ret = mm_radio_seek(handle->mm_handle, MM_RADIO_SEEK_UP);
- if(ret != MM_ERROR_NONE)
- {
- return __convert_error_code(ret,(char*)__FUNCTION__);
- }
- else
- {
+ if (ret != MM_ERROR_NONE) {
+ return __convert_error_code(ret, (char *)__FUNCTION__);
+ } else {
return RADIO_ERROR_NONE;
}
}
-int radio_seek_down(radio_h radio,radio_seek_completed_cb callback, void *user_data )
+int radio_seek_down(radio_h radio, radio_seek_completed_cb callback, void *user_data)
{
LOGI("[%s] Enter", __func__);
RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
RADIO_INSTANCE_CHECK(radio);
- radio_s * handle = (radio_s *) radio;
- RADIO_STATE_CHECK(handle,RADIO_STATE_PLAYING);
+ radio_s *handle = (radio_s *) radio;
+ RADIO_STATE_CHECK(handle, RADIO_STATE_PLAYING);
- if(callback!=NULL)
- {
- __set_callback(_RADIO_EVENT_TYPE_SEEK_FINISH,radio,callback,user_data);
- }
- else
- {
- __unset_callback(_RADIO_EVENT_TYPE_SEEK_FINISH,radio);
+ if (callback != NULL) {
+ __set_callback(_RADIO_EVENT_TYPE_SEEK_FINISH, radio, callback, user_data);
+ } else {
+ __unset_callback(_RADIO_EVENT_TYPE_SEEK_FINISH, radio);
}
int ret = mm_radio_seek(handle->mm_handle, MM_RADIO_SEEK_DOWN);
- if(ret != MM_ERROR_NONE)
- {
- return __convert_error_code(ret,(char*)__FUNCTION__);
- }
- else
- {
+ if (ret != MM_ERROR_NONE) {
+ return __convert_error_code(ret, (char *)__FUNCTION__);
+ } else {
return RADIO_ERROR_NONE;
}
}
LOGI("[%s] Enter", __func__);
RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
RADIO_INSTANCE_CHECK(radio);
- if(frequency < 87500 || frequency > 108000)
- {
- LOGE("[%s] RADIO_ERROR_INVALID_PARAMETER(0x%08x) : Out of range (87500 ~ 108000)" ,__FUNCTION__,RADIO_ERROR_INVALID_PARAMETER);
+ if (frequency < 87500 || frequency > 108000) {
+ LOGE("[%s] RADIO_ERROR_INVALID_PARAMETER(0x%08x) : Out of range (87500 ~ 108000)" , __FUNCTION__, RADIO_ERROR_INVALID_PARAMETER);
return RADIO_ERROR_INVALID_PARAMETER;
}
- int freq= frequency;
- radio_s * handle = (radio_s *) radio;
+ int freq = frequency;
+ radio_s *handle = (radio_s *) radio;
int ret = mm_radio_set_frequency(handle->mm_handle, freq);
- if(ret != MM_ERROR_NONE)
- {
- return __convert_error_code(ret,(char*)__FUNCTION__);
- }
- else
- {
+ if (ret != MM_ERROR_NONE) {
+ return __convert_error_code(ret, (char *)__FUNCTION__);
+ } else {
return RADIO_ERROR_NONE;
}
}
RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
RADIO_INSTANCE_CHECK(radio);
RADIO_NULL_ARG_CHECK(frequency);
- radio_s * handle = (radio_s *) radio;
+ radio_s *handle = (radio_s *) radio;
int freq;
int ret = mm_radio_get_frequency(handle->mm_handle, &freq);
- if(ret != MM_ERROR_NONE)
- {
- return __convert_error_code(ret,(char*)__FUNCTION__);
- }
- else
- {
+ if (ret != MM_ERROR_NONE) {
+ return __convert_error_code(ret, (char *)__FUNCTION__);
+ } else {
*frequency = freq;
return RADIO_ERROR_NONE;
}
RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
RADIO_INSTANCE_CHECK(radio);
RADIO_NULL_ARG_CHECK(strength);
- radio_s * handle = (radio_s *) radio;
+ radio_s *handle = (radio_s *) radio;
int _strength;
int ret = mm_radio_get_signal_strength(handle->mm_handle, &_strength);
- if(ret != MM_ERROR_NONE)
- {
- return __convert_error_code(ret,(char*)__FUNCTION__);
- }
- else
- {
+ if (ret != MM_ERROR_NONE) {
+ return __convert_error_code(ret, (char *)__FUNCTION__);
+ } else {
*strength = _strength;
return RADIO_ERROR_NONE;
}
LOGI("[%s] Enter", __func__);
RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
RADIO_INSTANCE_CHECK(radio);
- radio_s * handle = (radio_s *) radio;
- RADIO_STATE_CHECK(handle,RADIO_STATE_READY);
+ radio_s *handle = (radio_s *) radio;
+ RADIO_STATE_CHECK(handle, RADIO_STATE_READY);
- if(callback!=NULL)
- {
- __set_callback(_RADIO_EVENT_TYPE_SCAN_INFO,radio,callback,user_data);
- }
- else
- {
- __unset_callback(_RADIO_EVENT_TYPE_SCAN_INFO,radio);
+ if (callback != NULL) {
+ __set_callback(_RADIO_EVENT_TYPE_SCAN_INFO, radio, callback, user_data);
+ } else {
+ __unset_callback(_RADIO_EVENT_TYPE_SCAN_INFO, radio);
}
int ret = mm_radio_scan_start(handle->mm_handle);
- if(ret != MM_ERROR_NONE)
- {
- return __convert_error_code(ret,(char*)__FUNCTION__);
- }
- else
- {
+ if (ret != MM_ERROR_NONE) {
+ return __convert_error_code(ret, (char *)__FUNCTION__);
+ } else {
handle->state = RADIO_STATE_SCANNING;
return RADIO_ERROR_NONE;
}
LOGI("[%s] Enter", __func__);
RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
RADIO_INSTANCE_CHECK(radio);
- radio_s * handle = (radio_s *) radio;
- RADIO_STATE_CHECK(handle,RADIO_STATE_SCANNING);
+ radio_s *handle = (radio_s *) radio;
+ RADIO_STATE_CHECK(handle, RADIO_STATE_SCANNING);
- if(callback!=NULL)
- {
- __set_callback(_RADIO_EVENT_TYPE_SCAN_STOP,radio,callback,user_data);
- }
- else
- {
- __unset_callback(_RADIO_EVENT_TYPE_SCAN_STOP,radio);
+ if (callback != NULL) {
+ __set_callback(_RADIO_EVENT_TYPE_SCAN_STOP, radio, callback, user_data);
+ } else {
+ __unset_callback(_RADIO_EVENT_TYPE_SCAN_STOP, radio);
}
int ret = mm_radio_scan_stop(handle->mm_handle);
- if(ret != MM_ERROR_NONE)
- {
- return __convert_error_code(ret,(char*)__FUNCTION__);
- }
- else
- {
+ if (ret != MM_ERROR_NONE) {
+ return __convert_error_code(ret, (char *)__FUNCTION__);
+ } else {
handle->state = RADIO_STATE_READY;
return RADIO_ERROR_NONE;
}
LOGI("[%s] Enter", __func__);
RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
RADIO_INSTANCE_CHECK(radio);
- radio_s * handle = (radio_s *) radio;
+ radio_s *handle = (radio_s *) radio;
int ret = mm_radio_set_mute(handle->mm_handle, muted);
- if(ret != MM_ERROR_NONE)
- {
- return __convert_error_code(ret,(char*)__FUNCTION__);
- }
- else
- {
+ if (ret != MM_ERROR_NONE) {
+ return __convert_error_code(ret, (char *)__FUNCTION__);
+ } else {
handle->mute = muted;
return RADIO_ERROR_NONE;
}
RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
RADIO_INSTANCE_CHECK(radio);
RADIO_NULL_ARG_CHECK(muted);
- radio_s * handle = (radio_s *) radio;
+ radio_s *handle = (radio_s *) radio;
*muted = handle->mute;
return RADIO_ERROR_NONE;
}
{
LOGI("[%s] Enter", __func__);
RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
- return __set_callback(_RADIO_EVENT_TYPE_SCAN_FINISH,radio,callback,user_data);
+ return __set_callback(_RADIO_EVENT_TYPE_SCAN_FINISH, radio, callback, user_data);
}
int radio_unset_scan_completed_cb(radio_h radio)
{
LOGI("[%s] Enter", __func__);
RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
- return __unset_callback(_RADIO_EVENT_TYPE_SCAN_FINISH,radio);
+ return __unset_callback(_RADIO_EVENT_TYPE_SCAN_FINISH, radio);
}
int radio_set_interrupted_cb(radio_h radio, radio_interrupted_cb callback, void *user_data)
{
LOGI("[%s] Enter", __func__);
RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
- return __set_callback(_RADIO_EVENT_TYPE_INTERRUPT,radio,callback,user_data);
+ return __set_callback(_RADIO_EVENT_TYPE_INTERRUPT, radio, callback, user_data);
}
int radio_unset_interrupted_cb(radio_h radio)
{
LOGI("[%s] Enter", __func__);
RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
- return __unset_callback(_RADIO_EVENT_TYPE_INTERRUPT,radio);
+ return __unset_callback(_RADIO_EVENT_TYPE_INTERRUPT, radio);
}
+
+
+int radio_get_frequency_range(radio_h radio, int *min_freq, int *max_freq)
+{
+ LOGI("[%s] Enter", __func__);
+ RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
+ RADIO_INSTANCE_CHECK(radio);
+ RADIO_NULL_ARG_CHECK(min_freq);
+ RADIO_NULL_ARG_CHECK(max_freq);
+ radio_s *handle = (radio_s *) radio;
+
+ unsigned int min = 0;
+ unsigned int max = 0;
+
+ int ret = mm_radio_get_region_frequency_range(handle->mm_handle, &min, &max);
+ if (ret != MM_ERROR_NONE) {
+ return __convert_error_code(ret, (char *)__FUNCTION__);
+ } else {
+ *min_freq = min;
+ *max_freq = max;
+ return RADIO_ERROR_NONE;
+ }
+}
+
+int radio_get_channel_spacing(radio_h radio, int *channel_spacing)
+{
+ LOGI("[%s] Enter", __func__);
+ RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
+ RADIO_INSTANCE_CHECK(radio);
+
+ radio_s *handle = (radio_s *) radio;
+
+ int ret = mm_radio_get_channel_spacing(handle->mm_handle, channel_spacing);
+
+ if (ret != MM_ERROR_NONE) {
+ return __convert_error_code(ret, (char *)__FUNCTION__);
+ } else {
+ return RADIO_ERROR_NONE;
+ }
+}
+
+
+
#include <unistd.h>
#define DEFAULT_TEST_FREQ 107700
-#define MENU_ITEM_MAX 19
+#define MENU_ITEM_MAX 20
#define _MAX_INPUT_STRING_ 100
int radio_rt_api_test(void);
static int __menu(void);
-static void __call_api( int choosen );
+static void __call_api(int choosen);
void __radio_seek_completed_cb(int frequency, void *user_data);
void __radio_scan_updated_cb(int freq, void *user_data);
void __radio_scan_stop_cb(void *user_data);
/* list of tests*/
-test_item_t g_tests[100] =
-{
+test_item_t g_tests[100] = {
/* menu string : short string to be displayed to menu
description : detailed description
test function : a pointer to a actual test function
"init test",
"check radio init function",
__test_radio_init,
- 0
+ 0
},
{
"listening gorealra",
"let's listen to the gorealra!",
__test_radio_listen_gorealra,
- 0
+ 0
},
{
"repeat_init_release",
"repeat init and release and check if it working and memory usage increment",
__test_repeat_init_release,
- 0
+ 0
},
{
"repeat_start_stop",
"repeat start and stop and check if it working and memory usage increment",
__test_repeat_start_stop,
- 0
+ 0
},
{
"repeat_seek",
"repeat seek and check if it working and memory usage increment",
__test_repeat_seek,
- 0
+ 0
},
{
"repeat_whole",
"repeat whole radio sequence and check if it working and memory usage increment",
__test_repeat_whole,
- 0
+ 0
},
{
"manual api calling test",
"mapping each api to each test manu. just like other testsuite. try to reproduce the bugs with it.",
__test_manual_api_calling,
- 0
+ 0
},
/* add tests here*/
do {
key = getchar();
- if ( key >= '0' && key <= '9')
- {
- __run_test( key - '0' );
+ if (key >= '0' && key <= '9') {
+ __run_test(key - '0');
}
- }while ( key == '\n' );
- if(key == 'Q' || key == 'q')
+ } while (key == '\n');
+ if (key == 'Q' || key == 'q')
break;
- }while(1);
+ } while (1);
printf("radio test client finished\n");
printf("\n\nFMRadio testing menu\n");
printf("------------------------------------------\n");
- for ( i = 0; g_tests[i].func; i++ )
- {
- printf( "[%d] %s\n", i, g_tests[i].menu_string );
+ for (i = 0; g_tests[i].func; i++) {
+ printf("[%d] %s\n", i, g_tests[i].menu_string);
}
printf("[q] quit\n");
/* check index */
printf("#tests : %d key : %d\n", g_num_of_tests, key);
- if ( key >= g_num_of_tests || key < 0 )
- {
+ if (key >= g_num_of_tests || key < 0) {
printf("unassigned key has pressed : %d\n", key);
return;
}
/* display description*/
- printf( "excuting test : %s\n", g_tests[key].menu_string );
- printf( "description : %s\n", g_tests[key].description );
+ printf("excuting test : %s\n", g_tests[key].menu_string);
+ printf("description : %s\n", g_tests[key].description);
/* calling test function*/
ret = g_tests[key].func();
g_tests[key].result = ret;
- if ( ret )
- {
- printf( "TEST FAILED. ret code : %d\n", g_tests[key].result);
- }
- else
- {
- printf( "TEST SUCCEDED. ret code : %d\n", g_tests[key].result);
+ if (ret) {
+ printf("TEST FAILED. ret code : %d\n", g_tests[key].result);
+ } else {
+ printf("TEST SUCCEDED. ret code : %d\n", g_tests[key].result);
}
}
int ret = RADIO_ERROR_NONE;
radio_h radio;
- RADIO_TEST__( radio_create(&radio); )
- RADIO_TEST__( radio_destroy(radio); )
+ RADIO_TEST__(radio_create(&radio);)
+ RADIO_TEST__(radio_destroy(radio);)
return ret;
}
int ret = RADIO_ERROR_NONE;
radio_h radio;
- RADIO_TEST__( radio_create(&radio); )
- RADIO_TEST__( radio_set_frequency( radio, DEFAULT_TEST_FREQ ); )
- RADIO_TEST__( radio_start(radio); )
+ RADIO_TEST__(radio_create(&radio);)
+ RADIO_TEST__(radio_set_frequency(radio, DEFAULT_TEST_FREQ);)
+ RADIO_TEST__(radio_start(radio);)
usleep(5000 * 1000);
- RADIO_TEST__( radio_stop(radio); )
- RADIO_TEST__( radio_destroy(radio); )
+ RADIO_TEST__(radio_stop(radio);)
+ RADIO_TEST__(radio_destroy(radio);)
return ret;
}
int cnt = 0;
radio_h radio;
- while ( cnt < 1000 )
- {
- RADIO_TEST__( radio_create(&radio); )
- RADIO_TEST__( radio_destroy(radio); )
+ while (cnt < 1000) {
+ RADIO_TEST__(radio_create(&radio);)
+ RADIO_TEST__(radio_destroy(radio);)
cnt++;
int cnt = 0;
radio_h radio;
- RADIO_TEST__( radio_create(&radio); )
- RADIO_TEST__( radio_set_frequency( radio, DEFAULT_TEST_FREQ ); )
+ RADIO_TEST__(radio_create(&radio);)
+ RADIO_TEST__(radio_set_frequency(radio, DEFAULT_TEST_FREQ);)
- while(cnt < 10)
- {
- RADIO_TEST__( radio_start(radio); )
+ while (cnt < 10) {
+ RADIO_TEST__(radio_start(radio);)
usleep(2000 * 1000);
- RADIO_TEST__( radio_stop(radio); )
+ RADIO_TEST__(radio_stop(radio);)
cnt++;
int radio_rt_api_test(void)
{
- while(1)
- {
+ while (1) {
int choosen = 0;
choosen = __menu();
- if ( choosen == -1)
+ if (choosen == -1)
continue;
- if ( choosen == 0 )
+ if (choosen == 0)
break;
- __call_api( choosen );
+ __call_api(choosen);
}
printf("radio test client finished\n");
printf("[16] radio_unset_scan_completed_cb\n");
printf("[17] radio_set_interrupted_cb\n");
printf("[18] radio_unset_interrupted_cb\n");
+ printf("[19] radio_get_frequency_range\n");
+ printf("[20] radio_get_channel_spacing\n");
printf("[0] quit\n");
printf("---------------------------------------------------------\n");
printf("choose one : ");
- if ( scanf("%d", &menu_item) == 0)
- {
+ if (scanf("%d", &menu_item) == 0) {
char temp[_MAX_INPUT_STRING_];
- if (scanf("%s", temp) ==0)
- {
+ if (scanf("%s", temp) == 0) {
printf("Error while flushing the input buffer - but lets continue\n");
}
return -1;
}
- if ( menu_item > MENU_ITEM_MAX )
+ if (menu_item > MENU_ITEM_MAX)
menu_item = -1;
return menu_item;
}
-void __call_api( int choosen )
+void __call_api(int choosen)
{
int ret = RADIO_ERROR_NONE;
- switch( choosen )
- {
- case 1:
- {
- RADIO_TEST__( radio_create( &g_my_radio ); )
- }
- break;
+ switch (choosen) {
+ case 1: {
+ RADIO_TEST__(radio_create(&g_my_radio);)
+ }
+ break;
- case 2:
- {
- RADIO_TEST__( radio_destroy( g_my_radio ); )
- g_my_radio = 0;
- }
- break;
+ case 2: {
+ RADIO_TEST__(radio_destroy(g_my_radio);)
+ g_my_radio = 0;
+ }
+ break;
- case 3:
- {
- radio_state_e state;
- RADIO_TEST__( radio_get_state(g_my_radio, &state); )
+ case 3: {
+ radio_state_e state;
+ RADIO_TEST__(radio_get_state(g_my_radio, &state);)
- printf("state : %d\n", state);
- }
- break;
+ printf("state : %d\n", state);
+ }
+ break;
- case 4:
- {
- RADIO_TEST__( radio_start(g_my_radio); )
- }
- break;
+ case 4: {
+ RADIO_TEST__(radio_start(g_my_radio);)
+ }
+ break;
- case 5:
- {
- RADIO_TEST__( radio_stop(g_my_radio); )
- }
- break;
+ case 5: {
+ RADIO_TEST__(radio_stop(g_my_radio);)
+ }
+ break;
- case 6:
- {
- RADIO_TEST__( radio_seek_up(g_my_radio, __radio_seek_completed_cb, NULL); )
+ case 6: {
+ RADIO_TEST__(radio_seek_up(g_my_radio, __radio_seek_completed_cb, NULL);)
- }
- break;
+ }
+ break;
- case 7:
- {
- RADIO_TEST__( radio_seek_down(g_my_radio, __radio_seek_completed_cb, NULL); )
- }
- break;
+ case 7: {
+ RADIO_TEST__(radio_seek_down(g_my_radio, __radio_seek_completed_cb, NULL);)
+ }
+ break;
- case 8:
- {
- int freq = 0;
- printf("input freq : ");
- if (scanf("%d", &freq) == 0)
- return;
+ case 8: {
+ int freq = 0;
+ printf("input freq : ");
+ if (scanf("%d", &freq) == 0)
+ return;
- RADIO_TEST__( radio_set_frequency(g_my_radio, freq); )
- }
- break;
+ RADIO_TEST__(radio_set_frequency(g_my_radio, freq);)
+ }
+ break;
- case 9:
- {
- int freq = 0;
- RADIO_TEST__( radio_get_frequency(g_my_radio, &freq ); )
+ case 9: {
+ int freq = 0;
+ RADIO_TEST__(radio_get_frequency(g_my_radio, &freq);)
- printf("freq : %d\n", freq);
- }
- break;
+ printf("freq : %d\n", freq);
+ }
+ break;
- case 10:
- {
- int signal_strength = 0;
- RADIO_TEST__( radio_get_signal_strength(g_my_radio, &signal_strength); )
- printf("signal strength is : %d \n", signal_strength);
- }
- break;
+ case 10: {
+ int signal_strength = 0;
+ RADIO_TEST__(radio_get_signal_strength(g_my_radio, &signal_strength);)
+ printf("signal strength is : %d \n", signal_strength);
+ }
+ break;
- case 11:
- {
- RADIO_TEST__( radio_scan_start(g_my_radio, &__radio_scan_updated_cb, NULL); )
- }
- break;
+ case 11: {
+ RADIO_TEST__(radio_scan_start(g_my_radio, &__radio_scan_updated_cb, NULL);)
+ }
+ break;
- case 12:
- {
- RADIO_TEST__( radio_scan_stop(g_my_radio, &__radio_scan_stop_cb, NULL); )
- }
- break;
-
- case 13:
- {
- int muted = 0;
- printf("select one(0:UNMUTE/1:MUTE) : ");
- if ( scanf("%d", &muted) == 0)
- return;
- RADIO_TEST__( radio_set_mute(g_my_radio, muted); )
- }
- break;
+ case 12: {
+ RADIO_TEST__(radio_scan_stop(g_my_radio, &__radio_scan_stop_cb, NULL);)
+ }
+ break;
- case 14:
- {
- bool muted = 0;
- RADIO_TEST__( radio_is_muted(g_my_radio, &muted); )
- printf("muted : %d \n", muted);
- }
- break;
+ case 13: {
+ int muted = 0;
+ printf("select one(0:UNMUTE/1:MUTE) : ");
+ if (scanf("%d", &muted) == 0)
+ return;
+ RADIO_TEST__(radio_set_mute(g_my_radio, muted);)
+ }
+ break;
+ case 14: {
+ bool muted = 0;
+ RADIO_TEST__(radio_is_muted(g_my_radio, &muted);)
+ printf("muted : %d \n", muted);
+ }
+ break;
- case 15:
- {
- RADIO_TEST__( radio_set_scan_completed_cb(g_my_radio, &__radio_set_scan_completed_cb, NULL); )
- }
- break;
- case 16:
- {
- RADIO_TEST__( radio_unset_scan_completed_cb(g_my_radio); )
- }
- break;
+ case 15: {
+ RADIO_TEST__(radio_set_scan_completed_cb(g_my_radio, &__radio_set_scan_completed_cb, NULL);)
+ }
+ break;
- case 17:
- {
- RADIO_TEST__( radio_set_interrupted_cb(g_my_radio, &__radio_set_interrupted_cb, NULL ); )
- }
- break;
+ case 16: {
+ RADIO_TEST__(radio_unset_scan_completed_cb(g_my_radio);)
+ }
+ break;
- case 18:
- {
- RADIO_TEST__( radio_unset_interrupted_cb(g_my_radio); )
- }
- break;
+ case 17: {
+ RADIO_TEST__(radio_set_interrupted_cb(g_my_radio, &__radio_set_interrupted_cb, NULL);)
+ }
+ break;
+
+ case 18: {
+ RADIO_TEST__(radio_unset_interrupted_cb(g_my_radio);)
+ }
+ break;
+
+ case 19: {
+ int min = 0;
+ int max = 0;
+ RADIO_TEST__(radio_get_frequency_range(g_my_radio, &min, &max);)
+ printf("min : %d max: %d \n", min, max);
+ }
+ break;
+
+ case 20: {
+ int channel_spacing = 0;
+ RADIO_TEST__(radio_get_channel_spacing(g_my_radio, &channel_spacing);)
+ printf("channel_spacing : %d \n", channel_spacing);
+ }
+ break;
default:
break;