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;
}
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;
}
case MM_MESSAGE_RADIO_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]);
+ __unset_callback(_RADIO_EVENT_TYPE_SCAN_STOP, (radio_h)handle);
+ __unset_callback(_RADIO_EVENT_TYPE_SCAN_INFO, (radio_h)handle);
break;
case MM_MESSAGE_RADIO_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]);
+ __unset_callback(_RADIO_EVENT_TYPE_SCAN_INFO, (radio_h)handle);
break;
case MM_MESSAGE_RADIO_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]);
handle->seeking = false;
}
+ __unset_callback(_RADIO_EVENT_TYPE_SEEK_FINISH, (radio_h)handle);
break;
case MM_MESSAGE_STATE_INTERRUPTED:
if (msg->union_type == MM_MSG_UNION_STATE) {
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 ret = mm_radio_set_frequency(handle->mm_handle, freq);
+ int ret = mm_radio_set_frequency(handle->mm_handle, frequency);
if (ret != MM_ERROR_NONE)
return __convert_error_code(ret, (char *)__FUNCTION__);
else
radio_s *handle = (radio_s *)radio;
RADIO_STATE_CHECK(handle, RADIO_STATE_SCANNING);
+ if (handle->user_cb[_RADIO_EVENT_TYPE_SCAN_STOP]) {
+ LOGW("[%s] Failed to stop scan (0x%x)", __FUNCTION__, RADIO_ERROR_INVALID_OPERATION);
+ return RADIO_ERROR_INVALID_OPERATION;
+ }
+
if (callback != NULL)
__set_callback(_RADIO_EVENT_TYPE_SCAN_STOP, radio, callback, user_data);
else
LOGE("[%s] RADIO_ERROR_INVALID_PARAMETER(0x%08x) : Out of range (0.0 ~ 1.0)", __FUNCTION__, RADIO_ERROR_INVALID_PARAMETER);
return RADIO_ERROR_INVALID_PARAMETER;
}
- float vol = volume;
+
radio_s *handle = (radio_s *)radio;
- int ret = mm_radio_set_volume(handle->mm_handle, vol);
+ int ret = mm_radio_set_volume(handle->mm_handle, volume);
if (ret != MM_ERROR_NONE)
return __convert_error_code(ret, (char *)__FUNCTION__);
else