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 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);
60 ret = RADIO_ERROR_NONE;
61 msg = "RADIO_ERROR_NONE";
64 case MM_ERROR_RADIO_NO_FREE_SPACE:
65 ret = RADIO_ERROR_OUT_OF_MEMORY;
66 msg = "RADIO_ERROR_OUT_OF_MEMORY";
68 case MM_ERROR_RADIO_NOT_INITIALIZED:
69 case MM_ERROR_RADIO_NO_OP:
70 case MM_ERROR_RADIO_INVALID_STATE:
71 ret = RADIO_ERROR_INVALID_STATE;
72 msg = "RADIO_ERROR_INVALID_STATE";
74 case MM_ERROR_COMMON_INVALID_ARGUMENT:
75 case MM_ERROR_INVALID_ARGUMENT:
76 ret = RADIO_ERROR_INVALID_PARAMETER;
77 msg = "RADIO_ERROR_INVALID_PARAMETER";
79 case MM_ERROR_POLICY_BLOCKED:
80 case MM_ERROR_POLICY_INTERRUPTED:
81 case MM_ERROR_POLICY_INTERNAL:
82 case MM_ERROR_POLICY_DUPLICATED:
83 ret = RADIO_ERROR_SOUND_POLICY;
84 msg = "RADIO_ERROR_SOUND_POLICY";
86 case MM_ERROR_RADIO_INTERNAL:
87 case MM_ERROR_RADIO_RESPONSE_TIMEOUT:
88 ret = RADIO_ERROR_INVALID_OPERATION;
89 msg = "RADIO_ERROR_INVALID_OPERATION";
91 case MM_ERROR_RADIO_DEVICE_NOT_FOUND:
92 ret = RADIO_ERROR_NOT_SUPPORTED;
93 msg = "RADIO_ERROR_NOT_SUPPORTED";
95 case MM_ERROR_RADIO_NO_ANTENNA:
96 ret = RADIO_ERROR_NO_ANTENNA;
97 msg = "RADIO_ERROR_NO_ANTENNA";
99 case MM_ERROR_RADIO_DEVICE_NOT_OPENED:
101 ret = RADIO_ERROR_PERMISSION_DENIED;
102 msg = "RADIO_ERROR_PERMISSION_DENIED";
104 LOGE("[%s] %s(0x%08x) : core fw error(0x%x)", func_name, msg, ret, code);
108 static radio_state_e __convert_radio_state(MMRadioStateType state)
110 int converted_state = RADIO_STATE_READY;
111 LOGI("[%s] Enter state: %d", __func__, state);
114 case MM_RADIO_STATE_PLAYING:
115 converted_state = RADIO_STATE_PLAYING;
117 case MM_RADIO_STATE_SCANNING:
118 converted_state = RADIO_STATE_SCANNING;
120 case MM_RADIO_STATE_NULL:
121 case MM_RADIO_STATE_READY:
123 converted_state = RADIO_STATE_READY;
126 LOGI("[%s] Leave converted_state: %d", __func__, converted_state);
127 return converted_state;
131 static radio_interrupted_code_e __convert_interrupted_code(int code)
133 LOGI("[%s] Enter code: %d", __func__, code);
134 radio_interrupted_code_e ret = RADIO_INTERRUPTED_BY_RESOURCE_CONFLICT;
136 case MM_MSG_CODE_INTERRUPTED_BY_CALL_END:
137 case MM_MSG_CODE_INTERRUPTED_BY_ALARM_END:
138 case MM_MSG_CODE_INTERRUPTED_BY_EMERGENCY_END:
139 case MM_MSG_CODE_INTERRUPTED_BY_NOTIFICATION_END:
140 ret = RADIO_INTERRUPTED_COMPLETED;
142 case MM_MSG_CODE_INTERRUPTED_BY_MEDIA:
143 case MM_MSG_CODE_INTERRUPTED_BY_OTHER_PLAYER_APP:
144 ret = RADIO_INTERRUPTED_BY_MEDIA;
146 case MM_MSG_CODE_INTERRUPTED_BY_CALL_START:
147 ret = RADIO_INTERRUPTED_BY_CALL;
149 case MM_MSG_CODE_INTERRUPTED_BY_EARJACK_UNPLUG:
150 ret = RADIO_INTERRUPTED_BY_EARJACK_UNPLUG;
152 case MM_MSG_CODE_INTERRUPTED_BY_ALARM_START:
153 ret = RADIO_INTERRUPTED_BY_ALARM;
155 case MM_MSG_CODE_INTERRUPTED_BY_NOTIFICATION_START:
156 ret = RADIO_INTERRUPTED_BY_NOTIFICATION;
158 case MM_MSG_CODE_INTERRUPTED_BY_EMERGENCY_START:
159 ret = RADIO_INTERRUPTED_BY_EMERGENCY;
161 case MM_MSG_CODE_INTERRUPTED_BY_RESOURCE_CONFLICT:
163 ret = RADIO_INTERRUPTED_BY_RESOURCE_CONFLICT;
166 LOGE("[%s] interrupted code(%d) => ret(%d)", __FUNCTION__, code, ret);
170 static int __set_callback(_radio_event_e type, radio_h radio, void *callback, void *user_data)
172 RADIO_INSTANCE_CHECK(radio);
173 RADIO_NULL_ARG_CHECK(callback);
174 radio_s *handle = (radio_s *) radio;
175 handle->user_cb[type] = callback;
176 handle->user_data[type] = user_data;
177 LOGI("[%s] Event type : %d ", __FUNCTION__, type);
178 return RADIO_ERROR_NONE;
181 static int __unset_callback(_radio_event_e type, radio_h radio)
183 RADIO_INSTANCE_CHECK(radio);
184 radio_s *handle = (radio_s *) radio;
185 handle->user_cb[type] = NULL;
186 handle->user_data[type] = NULL;
187 LOGI("[%s] Event type : %d ", __FUNCTION__, type);
188 return RADIO_ERROR_NONE;
191 static int __msg_callback(int message, void *param, void *user_data)
193 radio_s *handle = (radio_s *)user_data;
194 MMMessageParamType *msg = (MMMessageParamType *)param;
195 LOGI("[%s] Got message type : 0x%x" , __FUNCTION__, message);
197 case MM_MESSAGE_RADIO_SCAN_INFO:
198 if (handle->user_cb[_RADIO_EVENT_TYPE_SCAN_INFO]) {
199 ((radio_scan_updated_cb)handle->user_cb[_RADIO_EVENT_TYPE_SCAN_INFO])(msg->radio_scan.frequency, handle->user_data[_RADIO_EVENT_TYPE_SCAN_INFO]);
202 case MM_MESSAGE_RADIO_SCAN_STOP:
203 if (handle->user_cb[_RADIO_EVENT_TYPE_SCAN_STOP]) {
204 ((radio_scan_stopped_cb)handle->user_cb[_RADIO_EVENT_TYPE_SCAN_STOP])(handle->user_data[_RADIO_EVENT_TYPE_SCAN_STOP]);
207 case MM_MESSAGE_RADIO_SCAN_FINISH:
208 if (handle->user_cb[_RADIO_EVENT_TYPE_SCAN_FINISH]) {
209 ((radio_scan_completed_cb)handle->user_cb[_RADIO_EVENT_TYPE_SCAN_FINISH])(handle->user_data[_RADIO_EVENT_TYPE_SCAN_FINISH]);
212 case MM_MESSAGE_RADIO_SEEK_FINISH:
213 if (handle->user_cb[_RADIO_EVENT_TYPE_SEEK_FINISH]) {
214 ((radio_seek_completed_cb)handle->user_cb[_RADIO_EVENT_TYPE_SEEK_FINISH])(msg->radio_scan.frequency, handle->user_data[_RADIO_EVENT_TYPE_SEEK_FINISH]);
217 case MM_MESSAGE_STATE_INTERRUPTED:
218 if (handle->user_cb[_RADIO_EVENT_TYPE_INTERRUPT]) {
219 ((radio_interrupted_cb)handle->user_cb[_RADIO_EVENT_TYPE_INTERRUPT])(__convert_interrupted_code(msg->code), handle->user_data[_RADIO_EVENT_TYPE_INTERRUPT]);
222 case MM_MESSAGE_READY_TO_RESUME:
223 if (handle->user_cb[_RADIO_EVENT_TYPE_INTERRUPT]) {
224 ((radio_interrupted_cb)handle->user_cb[_RADIO_EVENT_TYPE_INTERRUPT])(RADIO_INTERRUPTED_COMPLETED, handle->user_data[_RADIO_EVENT_TYPE_INTERRUPT]);
227 case MM_MESSAGE_ERROR:
228 __convert_error_code(msg->code, (char *)__FUNCTION__);
230 case MM_MESSAGE_RADIO_SCAN_START:
231 LOGI("[%s] Scan Started");
233 case MM_MESSAGE_STATE_CHANGED:
234 handle->state = __convert_radio_state(msg->state.current);
235 LOGI("[%s] State Changed --- from : %d , to : %d" , __FUNCTION__, __convert_radio_state(msg->state.previous), handle->state);
237 case MM_MESSAGE_RADIO_SEEK_START:
238 LOGI("[%s] Seek Started", __FUNCTION__);
246 static int __radio_check_system_info_feature_supported()
251 nRetVal = system_info_get_platform_bool("http://tizen.org/feature/fmradio", &bValue);
253 if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
254 LOGE("[%s] SYSTEM_INFO_ERROR : ", __FUNCTION__);
258 if (false == bValue) {
259 LOGI("system_info_get_platform_bool returned Unsupported feature capability\n");
261 LOGI("system_info_get_platform_bool returned Supported status feature\n");
268 * Public Implementation
270 int radio_create(radio_h *radio)
272 LOGI("[%s] Enter", __func__);
273 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
274 RADIO_INSTANCE_CHECK(radio);
277 handle = (radio_s *)malloc(sizeof(radio_s));
279 memset(handle, 0 , sizeof(radio_s));
281 LOGE("[%s] RADIO_ERROR_OUT_OF_MEMORY(0x%08x)" , __FUNCTION__, RADIO_ERROR_OUT_OF_MEMORY);
282 return RADIO_ERROR_OUT_OF_MEMORY;
284 int ret = mm_radio_create(&handle->mm_handle);
285 if (ret != MM_ERROR_NONE) {
288 return __convert_error_code(ret, (char *)__FUNCTION__);
290 *radio = (radio_h)handle;
292 ret = mm_radio_set_message_callback(handle->mm_handle, __msg_callback, (void *)handle);
293 if (ret != MM_ERROR_NONE) {
294 LOGW("[%s] Failed to set message callback function (0x%x)" , __FUNCTION__, ret);
296 ret = mm_radio_realize(handle->mm_handle);
297 if (ret != MM_ERROR_NONE) {
298 return __convert_error_code(ret, (char *)__FUNCTION__);
300 handle->state = RADIO_STATE_READY;
301 handle->mute = FALSE;
302 return RADIO_ERROR_NONE;
306 int radio_destroy(radio_h radio)
308 LOGI("[%s] Enter", __func__);
309 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
310 RADIO_INSTANCE_CHECK(radio);
311 radio_s *handle = (radio_s *) radio;
314 ret = mm_radio_unrealize(handle->mm_handle);
315 if (ret != MM_ERROR_NONE) {
316 LOGW("[%s] Failed to unrealize (0x%x)" , __FUNCTION__, ret);
319 ret = mm_radio_destroy(handle->mm_handle);
320 if (ret != MM_ERROR_NONE) {
321 return __convert_error_code(ret, (char *)__FUNCTION__);
325 return RADIO_ERROR_NONE;
329 int radio_get_state(radio_h radio, radio_state_e *state)
331 LOGI("[%s] Enter", __func__);
332 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
333 RADIO_INSTANCE_CHECK(radio);
334 RADIO_NULL_ARG_CHECK(state);
335 radio_s *handle = (radio_s *) radio;
336 MMRadioStateType currentStat = MM_RADIO_STATE_NULL;
337 int ret = mm_radio_get_state(handle->mm_handle, ¤tStat);
338 if (ret != MM_ERROR_NONE) {
339 *state = handle->state;
340 return __convert_error_code(ret, (char *)__FUNCTION__);
342 handle->state = __convert_radio_state(currentStat);
343 *state = handle->state;
344 return RADIO_ERROR_NONE;
348 int radio_start(radio_h radio)
350 LOGI("[%s] Enter", __func__);
351 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
352 RADIO_INSTANCE_CHECK(radio);
353 radio_s *handle = (radio_s *) radio;
354 RADIO_STATE_CHECK(handle, RADIO_STATE_READY);
356 int ret = mm_radio_start(handle->mm_handle);
357 if (ret != MM_ERROR_NONE) {
358 return __convert_error_code(ret, (char *)__FUNCTION__);
360 handle->state = RADIO_STATE_PLAYING;
361 return RADIO_ERROR_NONE;
365 int radio_stop(radio_h radio)
367 LOGI("[%s] Enter", __func__);
368 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
369 RADIO_INSTANCE_CHECK(radio);
370 radio_s *handle = (radio_s *) radio;
371 RADIO_STATE_CHECK(handle, RADIO_STATE_PLAYING);
373 int ret = mm_radio_stop(handle->mm_handle);
374 if (ret != MM_ERROR_NONE) {
375 return __convert_error_code(ret, (char *)__FUNCTION__);
377 handle->state = RADIO_STATE_READY;
378 return RADIO_ERROR_NONE;
382 int radio_seek_up(radio_h radio, radio_seek_completed_cb callback, void *user_data)
384 LOGI("[%s] Enter", __func__);
385 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
386 RADIO_INSTANCE_CHECK(radio);
387 radio_s *handle = (radio_s *) radio;
388 RADIO_STATE_CHECK(handle, RADIO_STATE_PLAYING);
390 if (callback != NULL) {
391 __set_callback(_RADIO_EVENT_TYPE_SEEK_FINISH, radio, callback, user_data);
393 __unset_callback(_RADIO_EVENT_TYPE_SEEK_FINISH, radio);
396 int ret = mm_radio_seek(handle->mm_handle, MM_RADIO_SEEK_UP);
397 if (ret != MM_ERROR_NONE) {
398 return __convert_error_code(ret, (char *)__FUNCTION__);
400 return RADIO_ERROR_NONE;
404 int radio_seek_down(radio_h radio, radio_seek_completed_cb callback, void *user_data)
406 LOGI("[%s] Enter", __func__);
407 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
408 RADIO_INSTANCE_CHECK(radio);
409 radio_s *handle = (radio_s *) radio;
410 RADIO_STATE_CHECK(handle, RADIO_STATE_PLAYING);
412 if (callback != NULL) {
413 __set_callback(_RADIO_EVENT_TYPE_SEEK_FINISH, radio, callback, user_data);
415 __unset_callback(_RADIO_EVENT_TYPE_SEEK_FINISH, radio);
418 int ret = mm_radio_seek(handle->mm_handle, MM_RADIO_SEEK_DOWN);
419 if (ret != MM_ERROR_NONE) {
420 return __convert_error_code(ret, (char *)__FUNCTION__);
422 return RADIO_ERROR_NONE;
426 int radio_set_frequency(radio_h radio, int frequency)
428 LOGI("[%s] Enter", __func__);
429 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
430 RADIO_INSTANCE_CHECK(radio);
431 if (frequency < 87500 || frequency > 108000) {
432 LOGE("[%s] RADIO_ERROR_INVALID_PARAMETER(0x%08x) : Out of range (87500 ~ 108000)" , __FUNCTION__, RADIO_ERROR_INVALID_PARAMETER);
433 return RADIO_ERROR_INVALID_PARAMETER;
435 int freq = frequency;
436 radio_s *handle = (radio_s *) radio;
437 int ret = mm_radio_set_frequency(handle->mm_handle, freq);
438 if (ret != MM_ERROR_NONE) {
439 return __convert_error_code(ret, (char *)__FUNCTION__);
441 return RADIO_ERROR_NONE;
445 int radio_get_frequency(radio_h radio, int *frequency)
447 LOGI("[%s] Enter", __func__);
448 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
449 RADIO_INSTANCE_CHECK(radio);
450 RADIO_NULL_ARG_CHECK(frequency);
451 radio_s *handle = (radio_s *) radio;
454 int ret = mm_radio_get_frequency(handle->mm_handle, &freq);
455 if (ret != MM_ERROR_NONE) {
456 return __convert_error_code(ret, (char *)__FUNCTION__);
459 return RADIO_ERROR_NONE;
463 int radio_get_signal_strength(radio_h radio, int *strength)
465 LOGI("[%s] Enter", __func__);
466 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
467 RADIO_INSTANCE_CHECK(radio);
468 RADIO_NULL_ARG_CHECK(strength);
469 radio_s *handle = (radio_s *) radio;
472 int ret = mm_radio_get_signal_strength(handle->mm_handle, &_strength);
473 if (ret != MM_ERROR_NONE) {
474 return __convert_error_code(ret, (char *)__FUNCTION__);
476 *strength = _strength;
477 return RADIO_ERROR_NONE;
481 int radio_scan_start(radio_h radio, radio_scan_updated_cb callback, void *user_data)
483 LOGI("[%s] Enter", __func__);
484 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
485 RADIO_INSTANCE_CHECK(radio);
486 radio_s *handle = (radio_s *) radio;
487 RADIO_STATE_CHECK(handle, RADIO_STATE_READY);
489 if (callback != NULL) {
490 __set_callback(_RADIO_EVENT_TYPE_SCAN_INFO, radio, callback, user_data);
492 __unset_callback(_RADIO_EVENT_TYPE_SCAN_INFO, radio);
495 int ret = mm_radio_scan_start(handle->mm_handle);
496 if (ret != MM_ERROR_NONE) {
497 return __convert_error_code(ret, (char *)__FUNCTION__);
499 handle->state = RADIO_STATE_SCANNING;
500 return RADIO_ERROR_NONE;
504 int radio_scan_stop(radio_h radio, radio_scan_stopped_cb callback, void *user_data)
506 LOGI("[%s] Enter", __func__);
507 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
508 RADIO_INSTANCE_CHECK(radio);
509 radio_s *handle = (radio_s *) radio;
510 RADIO_STATE_CHECK(handle, RADIO_STATE_SCANNING);
512 if (callback != NULL) {
513 __set_callback(_RADIO_EVENT_TYPE_SCAN_STOP, radio, callback, user_data);
515 __unset_callback(_RADIO_EVENT_TYPE_SCAN_STOP, radio);
518 int ret = mm_radio_scan_stop(handle->mm_handle);
519 if (ret != MM_ERROR_NONE) {
520 return __convert_error_code(ret, (char *)__FUNCTION__);
522 handle->state = RADIO_STATE_READY;
523 return RADIO_ERROR_NONE;
528 int radio_set_mute(radio_h radio, bool muted)
530 LOGI("[%s] Enter", __func__);
531 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
532 RADIO_INSTANCE_CHECK(radio);
533 radio_s *handle = (radio_s *) radio;
535 int ret = mm_radio_set_mute(handle->mm_handle, muted);
536 if (ret != MM_ERROR_NONE) {
537 return __convert_error_code(ret, (char *)__FUNCTION__);
539 handle->mute = muted;
540 return RADIO_ERROR_NONE;
544 int radio_is_muted(radio_h radio, bool *muted)
546 LOGI("[%s] Enter", __func__);
547 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
548 RADIO_INSTANCE_CHECK(radio);
549 RADIO_NULL_ARG_CHECK(muted);
550 radio_s *handle = (radio_s *) radio;
551 *muted = handle->mute;
552 return RADIO_ERROR_NONE;
555 int radio_set_scan_completed_cb(radio_h radio, radio_scan_completed_cb callback, void *user_data)
557 LOGI("[%s] Enter", __func__);
558 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
559 return __set_callback(_RADIO_EVENT_TYPE_SCAN_FINISH, radio, callback, user_data);
562 int radio_unset_scan_completed_cb(radio_h radio)
564 LOGI("[%s] Enter", __func__);
565 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
566 return __unset_callback(_RADIO_EVENT_TYPE_SCAN_FINISH, radio);
569 int radio_set_interrupted_cb(radio_h radio, radio_interrupted_cb callback, void *user_data)
571 LOGI("[%s] Enter", __func__);
572 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
573 return __set_callback(_RADIO_EVENT_TYPE_INTERRUPT, radio, callback, user_data);
576 int radio_unset_interrupted_cb(radio_h radio)
578 LOGI("[%s] Enter", __func__);
579 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
580 return __unset_callback(_RADIO_EVENT_TYPE_INTERRUPT, radio);
584 int radio_get_frequency_range(radio_h radio, int *min_freq, int *max_freq)
586 LOGI("[%s] Enter", __func__);
587 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
588 RADIO_INSTANCE_CHECK(radio);
589 RADIO_NULL_ARG_CHECK(min_freq);
590 RADIO_NULL_ARG_CHECK(max_freq);
591 radio_s *handle = (radio_s *) radio;
593 unsigned int min = 0;
594 unsigned int max = 0;
596 int ret = mm_radio_get_region_frequency_range(handle->mm_handle, &min, &max);
597 if (ret != MM_ERROR_NONE) {
598 return __convert_error_code(ret, (char *)__FUNCTION__);
602 return RADIO_ERROR_NONE;
606 int radio_get_channel_spacing(radio_h radio, int *channel_spacing)
608 LOGI("[%s] Enter", __func__);
609 RADIO_SUPPORT_CHECK(__radio_check_system_info_feature_supported());
610 RADIO_INSTANCE_CHECK(radio);
612 radio_s *handle = (radio_s *) radio;
614 int ret = mm_radio_get_channel_spacing(handle->mm_handle, channel_spacing);
616 if (ret != MM_ERROR_NONE) {
617 return __convert_error_code(ret, (char *)__FUNCTION__);
619 return RADIO_ERROR_NONE;