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_RESUMABLE_MEDIA:
165 ret = RADIO_INTERRUPTED_BY_RESUMABLE_MEDIA;
167 case MM_MSG_CODE_INTERRUPTED_BY_RESOURCE_CONFLICT:
169 ret = RADIO_INTERRUPTED_BY_RESOURCE_CONFLICT;
172 LOGE("[%s] interrupted code(%d) => ret(%d)",__FUNCTION__,code, ret);
176 static int __set_callback(_radio_event_e type, radio_h radio, void* callback, void *user_data)
178 RADIO_INSTANCE_CHECK(radio);
179 RADIO_NULL_ARG_CHECK(callback);
180 radio_s * handle = (radio_s *) radio;
181 handle->user_cb[type] = callback;
182 handle->user_data[type] = user_data;
183 LOGI("[%s] Event type : %d ",__FUNCTION__, type);
184 return RADIO_ERROR_NONE;
187 static int __unset_callback(_radio_event_e type, radio_h radio)
189 RADIO_INSTANCE_CHECK(radio);
190 radio_s * handle = (radio_s *) radio;
191 handle->user_cb[type] = NULL;
192 handle->user_data[type] = NULL;
193 LOGI("[%s] Event type : %d ",__FUNCTION__, type);
194 return RADIO_ERROR_NONE;
197 static int __msg_callback(int message, void *param, void *user_data)
199 radio_s * handle = (radio_s*)user_data;
200 MMMessageParamType *msg = (MMMessageParamType*)param;
201 LOGI("[%s] Got message type : 0x%x" ,__FUNCTION__, message);
204 case MM_MESSAGE_RADIO_SCAN_INFO:
205 if( handle->user_cb[_RADIO_EVENT_TYPE_SCAN_INFO] )
207 ((radio_scan_updated_cb)handle->user_cb[_RADIO_EVENT_TYPE_SCAN_INFO])(msg->radio_scan.frequency,handle->user_data[_RADIO_EVENT_TYPE_SCAN_INFO]);
210 case MM_MESSAGE_RADIO_SCAN_STOP:
211 if( handle->user_cb[_RADIO_EVENT_TYPE_SCAN_STOP] )
213 ((radio_scan_stopped_cb)handle->user_cb[_RADIO_EVENT_TYPE_SCAN_STOP])(handle->user_data[_RADIO_EVENT_TYPE_SCAN_STOP]);
216 case MM_MESSAGE_RADIO_SCAN_FINISH:
217 if( handle->user_cb[_RADIO_EVENT_TYPE_SCAN_FINISH] )
219 ((radio_scan_completed_cb)handle->user_cb[_RADIO_EVENT_TYPE_SCAN_FINISH])(handle->user_data[_RADIO_EVENT_TYPE_SCAN_FINISH]);
222 case MM_MESSAGE_RADIO_SEEK_FINISH:
223 if( handle->user_cb[_RADIO_EVENT_TYPE_SEEK_FINISH] )
225 ((radio_seek_completed_cb)handle->user_cb[_RADIO_EVENT_TYPE_SEEK_FINISH])(msg->radio_scan.frequency, handle->user_data[_RADIO_EVENT_TYPE_SEEK_FINISH]);
228 case MM_MESSAGE_STATE_INTERRUPTED:
229 if( handle->user_cb[_RADIO_EVENT_TYPE_INTERRUPT] )
231 ((radio_interrupted_cb)handle->user_cb[_RADIO_EVENT_TYPE_INTERRUPT])(__convert_interrupted_code(msg->code),handle->user_data[_RADIO_EVENT_TYPE_INTERRUPT]);
234 case MM_MESSAGE_READY_TO_RESUME:
235 if( handle->user_cb[_RADIO_EVENT_TYPE_INTERRUPT] )
237 ((radio_interrupted_cb)handle->user_cb[_RADIO_EVENT_TYPE_INTERRUPT])(RADIO_INTERRUPTED_COMPLETED,handle->user_data[_RADIO_EVENT_TYPE_INTERRUPT]);
240 case MM_MESSAGE_ERROR:
241 __convert_error_code(msg->code,(char*)__FUNCTION__);
243 case MM_MESSAGE_RADIO_SCAN_START:
244 LOGI("[%s] Scan Started");
246 case MM_MESSAGE_STATE_CHANGED:
247 handle->state = __convert_radio_state(msg->state.current);
248 LOGI("[%s] State Changed --- from : %d , to : %d" ,__FUNCTION__, __convert_radio_state(msg->state.previous), handle->state);
250 case MM_MESSAGE_RADIO_SEEK_START:
251 LOGI("[%s] Seek Started", __FUNCTION__);
259 static int __radio_check_system_info_feature_supported()
264 nRetVal = system_info_get_platform_bool("http://tizen.org/feature/fmradio", &bValue);
266 if ( nRetVal != SYSTEM_INFO_ERROR_NONE )
268 LOGE("[%s] SYSTEM_INFO_ERROR : ", __FUNCTION__);
272 if ( false == bValue )
274 LOGI("system_info_get_platform_bool returned Unsupported feature capability\n");
278 LOGI("system_info_get_platform_bool returned Supported status feature\n");
285 * Public Implementation
287 int radio_create(radio_h *radio)
289 LOGI("[%s] Enter", __func__);
290 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
291 RADIO_INSTANCE_CHECK(radio);
294 handle = (radio_s*)malloc( sizeof(radio_s));
296 memset(handle, 0 , sizeof(radio_s));
299 LOGE("[%s] RADIO_ERROR_OUT_OF_MEMORY(0x%08x)" ,__FUNCTION__,RADIO_ERROR_OUT_OF_MEMORY);
300 return RADIO_ERROR_OUT_OF_MEMORY;
302 int ret = mm_radio_create(&handle->mm_handle);
303 if( ret != MM_ERROR_NONE)
307 return __convert_error_code(ret,(char*)__FUNCTION__);
311 *radio = (radio_h)handle;
313 ret = mm_radio_set_message_callback(handle->mm_handle, __msg_callback, (void*)handle);
314 if(ret != MM_ERROR_NONE)
316 LOGW("[%s] Failed to set message callback function (0x%x)" ,__FUNCTION__, ret);
318 ret = mm_radio_realize(handle->mm_handle);
319 if(ret != MM_ERROR_NONE)
321 return __convert_error_code(ret,(char*)__FUNCTION__);
323 handle->state = RADIO_STATE_READY;
324 handle->mute = FALSE;
325 return RADIO_ERROR_NONE;
329 int radio_destroy(radio_h radio)
331 LOGI("[%s] Enter", __func__);
332 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
333 RADIO_INSTANCE_CHECK(radio);
334 radio_s * handle = (radio_s *) radio;
337 ret = mm_radio_unrealize(handle->mm_handle);
338 if ( ret!= MM_ERROR_NONE)
340 LOGW("[%s] Failed to unrealize (0x%x)" ,__FUNCTION__, ret);
343 ret = mm_radio_destroy(handle->mm_handle);
344 if (ret!= MM_ERROR_NONE)
346 return __convert_error_code(ret,(char*)__FUNCTION__);
352 return RADIO_ERROR_NONE;
356 int radio_get_state(radio_h radio, radio_state_e *state)
358 LOGI("[%s] Enter", __func__);
359 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
360 RADIO_INSTANCE_CHECK(radio);
361 RADIO_NULL_ARG_CHECK(state);
362 radio_s * handle = (radio_s *) radio;
363 MMRadioStateType currentStat = MM_RADIO_STATE_NULL;
364 int ret = mm_radio_get_state(handle->mm_handle, ¤tStat);
365 if(ret != MM_ERROR_NONE)
367 *state = handle->state;
368 return __convert_error_code(ret,(char*)__FUNCTION__);
372 handle->state = __convert_radio_state(currentStat);
373 *state = handle->state;
374 return RADIO_ERROR_NONE;
378 int radio_start(radio_h radio)
380 LOGI("[%s] Enter", __func__);
381 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
382 RADIO_INSTANCE_CHECK(radio);
383 radio_s * handle = (radio_s *) radio;
384 RADIO_STATE_CHECK(handle,RADIO_STATE_READY);
386 int ret = mm_radio_start(handle->mm_handle);
387 if(ret != MM_ERROR_NONE)
389 return __convert_error_code(ret,(char*)__FUNCTION__);
393 handle->state = RADIO_STATE_PLAYING;
394 return RADIO_ERROR_NONE;
398 int radio_stop(radio_h radio)
400 LOGI("[%s] Enter", __func__);
401 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
402 RADIO_INSTANCE_CHECK(radio);
403 radio_s * handle = (radio_s *) radio;
404 RADIO_STATE_CHECK(handle,RADIO_STATE_PLAYING);
406 int ret = mm_radio_stop(handle->mm_handle);
407 if(ret != MM_ERROR_NONE)
409 return __convert_error_code(ret,(char*)__FUNCTION__);
413 handle->state = RADIO_STATE_READY;
414 return RADIO_ERROR_NONE;
418 int radio_seek_up(radio_h radio,radio_seek_completed_cb callback, void *user_data )
420 LOGI("[%s] Enter", __func__);
421 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
422 RADIO_INSTANCE_CHECK(radio);
423 radio_s * handle = (radio_s *) radio;
424 RADIO_STATE_CHECK(handle,RADIO_STATE_PLAYING);
428 __set_callback(_RADIO_EVENT_TYPE_SEEK_FINISH,radio,callback,user_data);
432 __unset_callback(_RADIO_EVENT_TYPE_SEEK_FINISH,radio);
435 int ret = mm_radio_seek(handle->mm_handle, MM_RADIO_SEEK_UP);
436 if(ret != MM_ERROR_NONE)
438 return __convert_error_code(ret,(char*)__FUNCTION__);
442 return RADIO_ERROR_NONE;
446 int radio_seek_down(radio_h radio,radio_seek_completed_cb callback, void *user_data )
448 LOGI("[%s] Enter", __func__);
449 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
450 RADIO_INSTANCE_CHECK(radio);
451 radio_s * handle = (radio_s *) radio;
452 RADIO_STATE_CHECK(handle,RADIO_STATE_PLAYING);
456 __set_callback(_RADIO_EVENT_TYPE_SEEK_FINISH,radio,callback,user_data);
460 __unset_callback(_RADIO_EVENT_TYPE_SEEK_FINISH,radio);
463 int ret = mm_radio_seek(handle->mm_handle, MM_RADIO_SEEK_DOWN);
464 if(ret != MM_ERROR_NONE)
466 return __convert_error_code(ret,(char*)__FUNCTION__);
470 return RADIO_ERROR_NONE;
474 int radio_set_frequency(radio_h radio, int frequency)
476 LOGI("[%s] Enter", __func__);
477 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
478 RADIO_INSTANCE_CHECK(radio);
479 if(frequency < 87500 || frequency > 108000)
481 LOGE("[%s] RADIO_ERROR_INVALID_PARAMETER(0x%08x) : Out of range (87500 ~ 108000)" ,__FUNCTION__,RADIO_ERROR_INVALID_PARAMETER);
482 return RADIO_ERROR_INVALID_PARAMETER;
485 radio_s * handle = (radio_s *) radio;
486 int ret = mm_radio_set_frequency(handle->mm_handle, freq);
487 if(ret != MM_ERROR_NONE)
489 return __convert_error_code(ret,(char*)__FUNCTION__);
493 return RADIO_ERROR_NONE;
497 int radio_get_frequency(radio_h radio, int *frequency)
499 LOGI("[%s] Enter", __func__);
500 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
501 RADIO_INSTANCE_CHECK(radio);
502 RADIO_NULL_ARG_CHECK(frequency);
503 radio_s * handle = (radio_s *) radio;
506 int ret = mm_radio_get_frequency(handle->mm_handle, &freq);
507 if(ret != MM_ERROR_NONE)
509 return __convert_error_code(ret,(char*)__FUNCTION__);
514 return RADIO_ERROR_NONE;
518 int radio_get_signal_strength(radio_h radio, int *strength)
520 LOGI("[%s] Enter", __func__);
521 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
522 RADIO_INSTANCE_CHECK(radio);
523 RADIO_NULL_ARG_CHECK(strength);
524 radio_s * handle = (radio_s *) radio;
527 int ret = mm_radio_get_signal_strength(handle->mm_handle, &_strength);
528 if(ret != MM_ERROR_NONE)
530 return __convert_error_code(ret,(char*)__FUNCTION__);
534 *strength = _strength;
535 return RADIO_ERROR_NONE;
539 int radio_scan_start(radio_h radio, radio_scan_updated_cb callback, void *user_data)
541 LOGI("[%s] Enter", __func__);
542 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
543 RADIO_INSTANCE_CHECK(radio);
544 radio_s * handle = (radio_s *) radio;
545 RADIO_STATE_CHECK(handle,RADIO_STATE_READY);
549 __set_callback(_RADIO_EVENT_TYPE_SCAN_INFO,radio,callback,user_data);
553 __unset_callback(_RADIO_EVENT_TYPE_SCAN_INFO,radio);
556 int ret = mm_radio_scan_start(handle->mm_handle);
557 if(ret != MM_ERROR_NONE)
559 return __convert_error_code(ret,(char*)__FUNCTION__);
563 handle->state = RADIO_STATE_SCANNING;
564 return RADIO_ERROR_NONE;
568 int radio_scan_stop(radio_h radio, radio_scan_stopped_cb callback, void *user_data)
570 LOGI("[%s] Enter", __func__);
571 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
572 RADIO_INSTANCE_CHECK(radio);
573 radio_s * handle = (radio_s *) radio;
574 RADIO_STATE_CHECK(handle,RADIO_STATE_SCANNING);
578 __set_callback(_RADIO_EVENT_TYPE_SCAN_STOP,radio,callback,user_data);
582 __unset_callback(_RADIO_EVENT_TYPE_SCAN_STOP,radio);
585 int ret = mm_radio_scan_stop(handle->mm_handle);
586 if(ret != MM_ERROR_NONE)
588 return __convert_error_code(ret,(char*)__FUNCTION__);
592 handle->state = RADIO_STATE_READY;
593 return RADIO_ERROR_NONE;
598 int radio_set_mute(radio_h radio, bool muted)
600 LOGI("[%s] Enter", __func__);
601 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
602 RADIO_INSTANCE_CHECK(radio);
603 radio_s * handle = (radio_s *) radio;
605 int ret = mm_radio_set_mute(handle->mm_handle, muted);
606 if(ret != MM_ERROR_NONE)
608 return __convert_error_code(ret,(char*)__FUNCTION__);
612 handle->mute = muted;
613 return RADIO_ERROR_NONE;
617 int radio_is_muted(radio_h radio, bool *muted)
619 LOGI("[%s] Enter", __func__);
620 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
621 RADIO_INSTANCE_CHECK(radio);
622 RADIO_NULL_ARG_CHECK(muted);
623 radio_s * handle = (radio_s *) radio;
624 *muted = handle->mute;
625 return RADIO_ERROR_NONE;
628 int radio_set_scan_completed_cb(radio_h radio, radio_scan_completed_cb callback, void *user_data)
630 LOGI("[%s] Enter", __func__);
631 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
632 return __set_callback(_RADIO_EVENT_TYPE_SCAN_FINISH,radio,callback,user_data);
635 int radio_unset_scan_completed_cb(radio_h radio)
637 LOGI("[%s] Enter", __func__);
638 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
639 return __unset_callback(_RADIO_EVENT_TYPE_SCAN_FINISH,radio);
642 int radio_set_interrupted_cb(radio_h radio, radio_interrupted_cb callback, void *user_data)
644 LOGI("[%s] Enter", __func__);
645 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
646 return __set_callback(_RADIO_EVENT_TYPE_INTERRUPT,radio,callback,user_data);
649 int radio_unset_interrupted_cb(radio_h radio)
651 LOGI("[%s] Enter", __func__);
652 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
653 return __unset_callback(_RADIO_EVENT_TYPE_INTERRUPT,radio);
657 int radio_get_frequency_range(radio_h radio, int *min_freq, int *max_freq)
659 LOGI("[%s] Enter", __func__);
660 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
661 RADIO_INSTANCE_CHECK(radio);
662 RADIO_NULL_ARG_CHECK(min_freq);
663 RADIO_NULL_ARG_CHECK(max_freq);
664 radio_s * handle = (radio_s *) radio;
666 unsigned int min = 0;
667 unsigned int max = 0;
669 int ret = mm_radio_get_region_frequency_range(handle->mm_handle, &min, &max);
670 if(ret != MM_ERROR_NONE)
672 return __convert_error_code(ret,(char*)__FUNCTION__);
678 return RADIO_ERROR_NONE;
682 int radio_get_channel_spacing(radio_h radio, int *channel_spacing)
684 LOGI("[%s] Enter", __func__);
685 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
686 RADIO_INSTANCE_CHECK(radio);
688 radio_s * handle = (radio_s *) radio;
690 int ret = mm_radio_get_channel_spacing(handle->mm_handle, channel_spacing);
692 if(ret != MM_ERROR_NONE)
694 return __convert_error_code(ret,(char*)__FUNCTION__);
698 return RADIO_ERROR_NONE;