2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 #include <radio_private.h>
24 #include <system_info.h>
29 #define LOG_TAG "TIZEN_N_RADIO"
34 #define RADIO_CHECK_CONDITION(condition,error,msg) \
35 if(condition) {} else \
36 { LOGE("[%s] %s(0x%08x)",(char*)__FUNCTION__, msg,error); return error;}; \
38 #define RADIO_INSTANCE_CHECK(radio) \
39 RADIO_CHECK_CONDITION(radio != NULL, RADIO_ERROR_INVALID_PARAMETER,"RADIO_ERROR_INVALID_PARAMETER")
41 #define RADIO_STATE_CHECK(radio,expected_state) \
42 RADIO_CHECK_CONDITION(radio->state == expected_state,RADIO_ERROR_INVALID_STATE,"RADIO_ERROR_INVALID_STATE")
44 #define RADIO_NULL_ARG_CHECK(arg) \
45 RADIO_CHECK_CONDITION(arg != NULL,RADIO_ERROR_INVALID_PARAMETER,"RADIO_ERROR_INVALID_PARAMETER")
47 #define RADIO_SUPPORT_CHECK(arg) \
48 RADIO_CHECK_CONDITION(arg != false, RADIO_ERROR_NOT_SUPPORTED,"RADIO_ERROR_NOT_SUPPORTED")
51 * Internal Implementation
53 static int __convert_error_code(int code, char *func_name)
55 int ret = RADIO_ERROR_NONE;
56 char* msg="RADIO_ERROR_NONE";
57 LOGI("[%s] Enter code :%x", __func__, code);
61 ret = RADIO_ERROR_NONE;
62 msg = "RADIO_ERROR_NONE";
65 case MM_ERROR_RADIO_NO_FREE_SPACE:
66 ret = RADIO_ERROR_OUT_OF_MEMORY;
67 msg = "RADIO_ERROR_OUT_OF_MEMORY";
69 case MM_ERROR_RADIO_NOT_INITIALIZED:
70 case MM_ERROR_RADIO_NO_OP:
71 case MM_ERROR_RADIO_INVALID_STATE:
72 ret = RADIO_ERROR_INVALID_STATE;
73 msg = "RADIO_ERROR_INVALID_STATE";
75 case MM_ERROR_COMMON_INVALID_ARGUMENT:
76 case MM_ERROR_INVALID_ARGUMENT:
77 ret = RADIO_ERROR_INVALID_PARAMETER;
78 msg = "RADIO_ERROR_INVALID_PARAMETER";
80 case MM_ERROR_POLICY_BLOCKED:
81 case MM_ERROR_POLICY_INTERRUPTED:
82 case MM_ERROR_POLICY_INTERNAL:
83 case MM_ERROR_POLICY_DUPLICATED:
84 ret = RADIO_ERROR_SOUND_POLICY;
85 msg = "RADIO_ERROR_SOUND_POLICY";
87 case MM_ERROR_RADIO_INTERNAL:
88 case MM_ERROR_RADIO_RESPONSE_TIMEOUT:
89 ret= RADIO_ERROR_INVALID_OPERATION;
90 msg = "RADIO_ERROR_INVALID_OPERATION";
92 case MM_ERROR_RADIO_DEVICE_NOT_FOUND:
93 ret = RADIO_ERROR_NOT_SUPPORTED;
94 msg = "RADIO_ERROR_NOT_SUPPORTED";
96 case MM_ERROR_RADIO_NO_ANTENNA:
97 ret = RADIO_ERROR_NO_ANTENNA;
98 msg = "RADIO_ERROR_NO_ANTENNA";
100 case MM_ERROR_RADIO_DEVICE_NOT_OPENED:
102 ret= RADIO_ERROR_PERMISSION_DENIED;
103 msg = "RADIO_ERROR_PERMISSION_DENIED";
105 LOGE("[%s] %s(0x%08x) : core fw error(0x%x)",func_name,msg, ret, code);
109 static radio_state_e __convert_radio_state(MMRadioStateType state)
111 int converted_state = RADIO_STATE_READY;
112 LOGI("[%s] Enter state: %d", __func__, state);
116 case MM_RADIO_STATE_PLAYING:
117 converted_state = RADIO_STATE_PLAYING;
119 case MM_RADIO_STATE_SCANNING:
120 converted_state = RADIO_STATE_SCANNING;
122 case MM_RADIO_STATE_NULL:
123 case MM_RADIO_STATE_READY:
125 converted_state = RADIO_STATE_READY;
128 LOGI("[%s] Leave converted_state: %d", __func__, converted_state);
129 return converted_state;
133 static radio_interrupted_code_e __convert_interrupted_code(int code)
135 LOGI("[%s] Enter code: %d", __func__, code);
136 radio_interrupted_code_e ret = RADIO_INTERRUPTED_BY_RESOURCE_CONFLICT;
139 case MM_MSG_CODE_INTERRUPTED_BY_CALL_END:
140 case MM_MSG_CODE_INTERRUPTED_BY_ALARM_END:
141 case MM_MSG_CODE_INTERRUPTED_BY_EMERGENCY_END:
142 case MM_MSG_CODE_INTERRUPTED_BY_NOTIFICATION_END:
143 ret = RADIO_INTERRUPTED_COMPLETED;
145 case MM_MSG_CODE_INTERRUPTED_BY_MEDIA:
146 case MM_MSG_CODE_INTERRUPTED_BY_OTHER_PLAYER_APP:
147 ret = RADIO_INTERRUPTED_BY_MEDIA;
149 case MM_MSG_CODE_INTERRUPTED_BY_CALL_START:
150 ret = RADIO_INTERRUPTED_BY_CALL;
152 case MM_MSG_CODE_INTERRUPTED_BY_EARJACK_UNPLUG:
153 ret = RADIO_INTERRUPTED_BY_EARJACK_UNPLUG;
155 case MM_MSG_CODE_INTERRUPTED_BY_ALARM_START:
156 ret = RADIO_INTERRUPTED_BY_ALARM;
158 case MM_MSG_CODE_INTERRUPTED_BY_NOTIFICATION_START:
159 ret = RADIO_INTERRUPTED_BY_NOTIFICATION;
161 case MM_MSG_CODE_INTERRUPTED_BY_EMERGENCY_START:
162 ret = RADIO_INTERRUPTED_BY_EMERGENCY;
164 case MM_MSG_CODE_INTERRUPTED_BY_RESOURCE_CONFLICT:
166 ret = RADIO_INTERRUPTED_BY_RESOURCE_CONFLICT;
169 LOGE("[%s] interrupted code(%d) => ret(%d)",__FUNCTION__,code, ret);
173 static int __set_callback(_radio_event_e type, radio_h radio, void* callback, void *user_data)
175 RADIO_INSTANCE_CHECK(radio);
176 RADIO_NULL_ARG_CHECK(callback);
177 radio_s * handle = (radio_s *) radio;
178 handle->user_cb[type] = callback;
179 handle->user_data[type] = user_data;
180 LOGI("[%s] Event type : %d ",__FUNCTION__, type);
181 return RADIO_ERROR_NONE;
184 static int __unset_callback(_radio_event_e type, radio_h radio)
186 RADIO_INSTANCE_CHECK(radio);
187 radio_s * handle = (radio_s *) radio;
188 handle->user_cb[type] = NULL;
189 handle->user_data[type] = NULL;
190 LOGI("[%s] Event type : %d ",__FUNCTION__, type);
191 return RADIO_ERROR_NONE;
194 static int __msg_callback(int message, void *param, void *user_data)
196 radio_s * handle = (radio_s*)user_data;
197 MMMessageParamType *msg = (MMMessageParamType*)param;
198 LOGI("[%s] Got message type : 0x%x" ,__FUNCTION__, message);
201 case MM_MESSAGE_RADIO_SCAN_INFO:
202 if( handle->user_cb[_RADIO_EVENT_TYPE_SCAN_INFO] )
204 ((radio_scan_updated_cb)handle->user_cb[_RADIO_EVENT_TYPE_SCAN_INFO])(msg->radio_scan.frequency,handle->user_data[_RADIO_EVENT_TYPE_SCAN_INFO]);
207 case MM_MESSAGE_RADIO_SCAN_STOP:
208 if( handle->user_cb[_RADIO_EVENT_TYPE_SCAN_STOP] )
210 ((radio_scan_stopped_cb)handle->user_cb[_RADIO_EVENT_TYPE_SCAN_STOP])(handle->user_data[_RADIO_EVENT_TYPE_SCAN_STOP]);
213 case MM_MESSAGE_RADIO_SCAN_FINISH:
214 if( handle->user_cb[_RADIO_EVENT_TYPE_SCAN_FINISH] )
216 ((radio_scan_completed_cb)handle->user_cb[_RADIO_EVENT_TYPE_SCAN_FINISH])(handle->user_data[_RADIO_EVENT_TYPE_SCAN_FINISH]);
219 case MM_MESSAGE_RADIO_SEEK_FINISH:
220 if( handle->user_cb[_RADIO_EVENT_TYPE_SEEK_FINISH] )
222 ((radio_seek_completed_cb)handle->user_cb[_RADIO_EVENT_TYPE_SEEK_FINISH])(msg->radio_scan.frequency, handle->user_data[_RADIO_EVENT_TYPE_SEEK_FINISH]);
225 case MM_MESSAGE_STATE_INTERRUPTED:
226 if( handle->user_cb[_RADIO_EVENT_TYPE_INTERRUPT] )
228 ((radio_interrupted_cb)handle->user_cb[_RADIO_EVENT_TYPE_INTERRUPT])(__convert_interrupted_code(msg->code),handle->user_data[_RADIO_EVENT_TYPE_INTERRUPT]);
231 case MM_MESSAGE_READY_TO_RESUME:
232 if( handle->user_cb[_RADIO_EVENT_TYPE_INTERRUPT] )
234 ((radio_interrupted_cb)handle->user_cb[_RADIO_EVENT_TYPE_INTERRUPT])(RADIO_INTERRUPTED_COMPLETED,handle->user_data[_RADIO_EVENT_TYPE_INTERRUPT]);
237 case MM_MESSAGE_ERROR:
238 __convert_error_code(msg->code,(char*)__FUNCTION__);
240 case MM_MESSAGE_RADIO_SCAN_START:
241 LOGI("[%s] Scan Started");
243 case MM_MESSAGE_STATE_CHANGED:
244 handle->state = __convert_radio_state(msg->state.current);
245 LOGI("[%s] State Changed --- from : %d , to : %d" ,__FUNCTION__, __convert_radio_state(msg->state.previous), handle->state);
247 case MM_MESSAGE_RADIO_SEEK_START:
248 LOGI("[%s] Seek Started", __FUNCTION__);
256 static int __radio_check_system_info_feature_supported()
261 nRetVal = system_info_get_platform_bool("http://tizen.org/feature/fmradio", &bValue);
263 if ( nRetVal != SYSTEM_INFO_ERROR_NONE )
265 LOGE("[%s] SYSTEM_INFO_ERROR : ", __FUNCTION__);
269 if ( false == bValue )
271 LOGI("system_info_get_platform_bool returned Unsupported feature capability\n");
275 LOGI("system_info_get_platform_bool returned Supported status feature\n");
282 * Public Implementation
284 int radio_create(radio_h *radio)
286 LOGI("[%s] Enter", __func__);
287 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
288 RADIO_INSTANCE_CHECK(radio);
291 handle = (radio_s*)malloc( sizeof(radio_s));
293 memset(handle, 0 , sizeof(radio_s));
296 LOGE("[%s] RADIO_ERROR_OUT_OF_MEMORY(0x%08x)" ,__FUNCTION__,RADIO_ERROR_OUT_OF_MEMORY);
297 return RADIO_ERROR_OUT_OF_MEMORY;
299 int ret = mm_radio_create(&handle->mm_handle);
300 if( ret != MM_ERROR_NONE)
304 return __convert_error_code(ret,(char*)__FUNCTION__);
308 *radio = (radio_h)handle;
310 ret = mm_radio_set_message_callback(handle->mm_handle, __msg_callback, (void*)handle);
311 if(ret != MM_ERROR_NONE)
313 LOGW("[%s] Failed to set message callback function (0x%x)" ,__FUNCTION__, ret);
315 ret = mm_radio_realize(handle->mm_handle);
316 if(ret != MM_ERROR_NONE)
318 return __convert_error_code(ret,(char*)__FUNCTION__);
320 handle->state = RADIO_STATE_READY;
321 handle->mute = FALSE;
322 return RADIO_ERROR_NONE;
326 int radio_destroy(radio_h radio)
328 LOGI("[%s] Enter", __func__);
329 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
330 RADIO_INSTANCE_CHECK(radio);
331 radio_s * handle = (radio_s *) radio;
334 ret = mm_radio_unrealize(handle->mm_handle);
335 if ( ret!= MM_ERROR_NONE)
337 LOGW("[%s] Failed to unrealize (0x%x)" ,__FUNCTION__, ret);
340 ret = mm_radio_destroy(handle->mm_handle);
341 if (ret!= MM_ERROR_NONE)
343 return __convert_error_code(ret,(char*)__FUNCTION__);
349 return RADIO_ERROR_NONE;
353 int radio_get_state(radio_h radio, radio_state_e *state)
355 LOGI("[%s] Enter", __func__);
356 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
357 RADIO_INSTANCE_CHECK(radio);
358 RADIO_NULL_ARG_CHECK(state);
359 radio_s * handle = (radio_s *) radio;
360 MMRadioStateType currentStat = MM_RADIO_STATE_NULL;
361 int ret = mm_radio_get_state(handle->mm_handle, ¤tStat);
362 if(ret != MM_ERROR_NONE)
364 *state = handle->state;
365 return __convert_error_code(ret,(char*)__FUNCTION__);
369 handle->state = __convert_radio_state(currentStat);
370 *state = handle->state;
371 return RADIO_ERROR_NONE;
375 int radio_start(radio_h radio)
377 LOGI("[%s] Enter", __func__);
378 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
379 RADIO_INSTANCE_CHECK(radio);
380 radio_s * handle = (radio_s *) radio;
381 RADIO_STATE_CHECK(handle,RADIO_STATE_READY);
383 int ret = mm_radio_start(handle->mm_handle);
384 if(ret != MM_ERROR_NONE)
386 return __convert_error_code(ret,(char*)__FUNCTION__);
390 handle->state = RADIO_STATE_PLAYING;
391 return RADIO_ERROR_NONE;
395 int radio_stop(radio_h radio)
397 LOGI("[%s] Enter", __func__);
398 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
399 RADIO_INSTANCE_CHECK(radio);
400 radio_s * handle = (radio_s *) radio;
401 RADIO_STATE_CHECK(handle,RADIO_STATE_PLAYING);
403 int ret = mm_radio_stop(handle->mm_handle);
404 if(ret != MM_ERROR_NONE)
406 return __convert_error_code(ret,(char*)__FUNCTION__);
410 handle->state = RADIO_STATE_READY;
411 return RADIO_ERROR_NONE;
415 int radio_seek_up(radio_h radio,radio_seek_completed_cb callback, void *user_data )
417 LOGI("[%s] Enter", __func__);
418 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
419 RADIO_INSTANCE_CHECK(radio);
420 radio_s * handle = (radio_s *) radio;
421 RADIO_STATE_CHECK(handle,RADIO_STATE_PLAYING);
425 __set_callback(_RADIO_EVENT_TYPE_SEEK_FINISH,radio,callback,user_data);
429 __unset_callback(_RADIO_EVENT_TYPE_SEEK_FINISH,radio);
432 int ret = mm_radio_seek(handle->mm_handle, MM_RADIO_SEEK_UP);
433 if(ret != MM_ERROR_NONE)
435 return __convert_error_code(ret,(char*)__FUNCTION__);
439 return RADIO_ERROR_NONE;
443 int radio_seek_down(radio_h radio,radio_seek_completed_cb callback, void *user_data )
445 LOGI("[%s] Enter", __func__);
446 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
447 RADIO_INSTANCE_CHECK(radio);
448 radio_s * handle = (radio_s *) radio;
449 RADIO_STATE_CHECK(handle,RADIO_STATE_PLAYING);
453 __set_callback(_RADIO_EVENT_TYPE_SEEK_FINISH,radio,callback,user_data);
457 __unset_callback(_RADIO_EVENT_TYPE_SEEK_FINISH,radio);
460 int ret = mm_radio_seek(handle->mm_handle, MM_RADIO_SEEK_DOWN);
461 if(ret != MM_ERROR_NONE)
463 return __convert_error_code(ret,(char*)__FUNCTION__);
467 return RADIO_ERROR_NONE;
471 int radio_set_frequency(radio_h radio, int frequency)
473 LOGI("[%s] Enter", __func__);
474 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
475 RADIO_INSTANCE_CHECK(radio);
476 if(frequency < 87500 || frequency > 108000)
478 LOGE("[%s] RADIO_ERROR_INVALID_PARAMETER(0x%08x) : Out of range (87500 ~ 108000)" ,__FUNCTION__,RADIO_ERROR_INVALID_PARAMETER);
479 return RADIO_ERROR_INVALID_PARAMETER;
482 radio_s * handle = (radio_s *) radio;
483 int ret = mm_radio_set_frequency(handle->mm_handle, freq);
484 if(ret != MM_ERROR_NONE)
486 return __convert_error_code(ret,(char*)__FUNCTION__);
490 return RADIO_ERROR_NONE;
494 int radio_get_frequency(radio_h radio, int *frequency)
496 LOGI("[%s] Enter", __func__);
497 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
498 RADIO_INSTANCE_CHECK(radio);
499 RADIO_NULL_ARG_CHECK(frequency);
500 radio_s * handle = (radio_s *) radio;
503 int ret = mm_radio_get_frequency(handle->mm_handle, &freq);
504 if(ret != MM_ERROR_NONE)
506 return __convert_error_code(ret,(char*)__FUNCTION__);
511 return RADIO_ERROR_NONE;
515 int radio_get_signal_strength(radio_h radio, int *strength)
517 LOGI("[%s] Enter", __func__);
518 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
519 RADIO_INSTANCE_CHECK(radio);
520 RADIO_NULL_ARG_CHECK(strength);
521 radio_s * handle = (radio_s *) radio;
524 int ret = mm_radio_get_signal_strength(handle->mm_handle, &_strength);
525 if(ret != MM_ERROR_NONE)
527 return __convert_error_code(ret,(char*)__FUNCTION__);
531 *strength = _strength;
532 return RADIO_ERROR_NONE;
536 int radio_scan_start(radio_h radio, radio_scan_updated_cb callback, void *user_data)
538 LOGI("[%s] Enter", __func__);
539 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
540 RADIO_INSTANCE_CHECK(radio);
541 radio_s * handle = (radio_s *) radio;
542 RADIO_STATE_CHECK(handle,RADIO_STATE_READY);
546 __set_callback(_RADIO_EVENT_TYPE_SCAN_INFO,radio,callback,user_data);
550 __unset_callback(_RADIO_EVENT_TYPE_SCAN_INFO,radio);
553 int ret = mm_radio_scan_start(handle->mm_handle);
554 if(ret != MM_ERROR_NONE)
556 return __convert_error_code(ret,(char*)__FUNCTION__);
560 handle->state = RADIO_STATE_SCANNING;
561 return RADIO_ERROR_NONE;
565 int radio_scan_stop(radio_h radio, radio_scan_stopped_cb callback, void *user_data)
567 LOGI("[%s] Enter", __func__);
568 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
569 RADIO_INSTANCE_CHECK(radio);
570 radio_s * handle = (radio_s *) radio;
571 RADIO_STATE_CHECK(handle,RADIO_STATE_SCANNING);
575 __set_callback(_RADIO_EVENT_TYPE_SCAN_STOP,radio,callback,user_data);
579 __unset_callback(_RADIO_EVENT_TYPE_SCAN_STOP,radio);
582 int ret = mm_radio_scan_stop(handle->mm_handle);
583 if(ret != MM_ERROR_NONE)
585 return __convert_error_code(ret,(char*)__FUNCTION__);
589 handle->state = RADIO_STATE_READY;
590 return RADIO_ERROR_NONE;
595 int radio_set_mute(radio_h radio, bool muted)
597 LOGI("[%s] Enter", __func__);
598 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
599 RADIO_INSTANCE_CHECK(radio);
600 radio_s * handle = (radio_s *) radio;
602 int ret = mm_radio_set_mute(handle->mm_handle, muted);
603 if(ret != MM_ERROR_NONE)
605 return __convert_error_code(ret,(char*)__FUNCTION__);
609 handle->mute = muted;
610 return RADIO_ERROR_NONE;
614 int radio_is_muted(radio_h radio, bool *muted)
616 LOGI("[%s] Enter", __func__);
617 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
618 RADIO_INSTANCE_CHECK(radio);
619 RADIO_NULL_ARG_CHECK(muted);
620 radio_s * handle = (radio_s *) radio;
621 *muted = handle->mute;
622 return RADIO_ERROR_NONE;
625 int radio_set_scan_completed_cb(radio_h radio, radio_scan_completed_cb callback, void *user_data)
627 LOGI("[%s] Enter", __func__);
628 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
629 return __set_callback(_RADIO_EVENT_TYPE_SCAN_FINISH,radio,callback,user_data);
632 int radio_unset_scan_completed_cb(radio_h radio)
634 LOGI("[%s] Enter", __func__);
635 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
636 return __unset_callback(_RADIO_EVENT_TYPE_SCAN_FINISH,radio);
639 int radio_set_interrupted_cb(radio_h radio, radio_interrupted_cb callback, void *user_data)
641 LOGI("[%s] Enter", __func__);
642 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
643 return __set_callback(_RADIO_EVENT_TYPE_INTERRUPT,radio,callback,user_data);
646 int radio_unset_interrupted_cb(radio_h radio)
648 LOGI("[%s] Enter", __func__);
649 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
650 return __unset_callback(_RADIO_EVENT_TYPE_INTERRUPT,radio);
654 int radio_get_frequency_range(radio_h radio, int *min_freq, int *max_freq)
656 LOGI("[%s] Enter", __func__);
657 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
658 RADIO_INSTANCE_CHECK(radio);
659 RADIO_NULL_ARG_CHECK(min_freq);
660 RADIO_NULL_ARG_CHECK(max_freq);
661 radio_s * handle = (radio_s *) radio;
663 unsigned int min = 0;
664 unsigned int max = 0;
666 int ret = mm_radio_get_region_frequency_range(handle->mm_handle, &min, &max);
667 if(ret != MM_ERROR_NONE)
669 return __convert_error_code(ret,(char*)__FUNCTION__);
675 return RADIO_ERROR_NONE;
679 int radio_get_channel_spacing(radio_h radio, int *channel_spacing)
681 LOGI("[%s] Enter", __func__);
682 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
683 RADIO_INSTANCE_CHECK(radio);
685 radio_s * handle = (radio_s *) radio;
687 int ret = mm_radio_get_channel_spacing(handle->mm_handle, channel_spacing);
689 if(ret != MM_ERROR_NONE)
691 return __convert_error_code(ret,(char*)__FUNCTION__);
695 return RADIO_ERROR_NONE;