1 /* 2 * 3 * Copyright 2001-2011 Texas Instruments, Inc. - http://www.ti.com/ 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 package com.ti.jfm.core; 19 20 import java.util.HashMap; //import com.ti.jbtl.core.*; 21 import com.ti.jfm.core.*; 22 23 /** Class for providing connection with JFmRxNative.cpp module */ 24 25 public class JFmRx { 26 27 private static final String TAG = "JFmRx"; 28 29 private ICallback callback = null; 30 31 private static JFmContext context; 32 33 /** Hash table to store JFmContext handles based upon JFmRx. */ 34 private static HashMap<JFmContext, JFmRx> mRxContextsTable = new HashMap<JFmContext, JFmRx>(); 35 36 static { 37 try { 38 JFmLog.i(TAG, "Loading libfmradio.so"); 39 System.loadLibrary("fmradio"); 40 nativeJFmRx_ClassInitNative(); 41 } 42 catch (UnsatisfiedLinkError ule) { 43 JFmLog.e(TAG, "WARNING: Could not load libfmradio.so"); 44 } 45 catch (Exception e) { 46 JFmLog.e("JFmRx", "Exception during NativeJFmRx_ClassInitNative (" 47 + e.toString() + ")"); 48 } 49 } 50 51 52 53 public interface ICallback { 54 55 void fmRxRawRDS(JFmRx context, JFmRxStatus status, JFmRxRdsGroupTypeMask bitInMaskValue, 56 byte[] groupData); 57 58 void fmRxRadioText(JFmRx context, JFmRxStatus status, boolean resetDisplay, byte[] msg1, 59 int len, int startIndex, JFmRxRepertoire repertoire); 60 61 void fmRxPiCodeChanged(JFmRx context, JFmRxStatus status, JFmRxRdsPiCode pi); 62 63 void fmRxPtyCodeChanged(JFmRx context, JFmRxStatus status, JFmRxRdsPtyCode pty); 64 65 void fmRxPsChanged(JFmRx context, JFmRxStatus status, JFmRxFreq frequency, byte[] name, 66 JFmRxRepertoire repertoire); 67 68 void fmRxMonoStereoModeChanged(JFmRx context, JFmRxStatus status, JFmRxMonoStereoMode mode); 69 70 void fmRxAudioPathChanged(JFmRx context, JFmRxStatus status); 71 72 void fmRxAfSwitchFreqFailed(JFmRx context, JFmRxStatus status, JFmRxRdsPiCode pi, 73 JFmRxFreq tunedFreq, JFmRxAfFreq afFreq); 74 75 void fmRxAfSwitchStart(JFmRx context, JFmRxStatus status, JFmRxRdsPiCode pi, 76 JFmRxFreq tunedFreq, JFmRxAfFreq afFreq); 77 78 void fmRxAfSwitchComplete(JFmRx context, JFmRxStatus status, JFmRxRdsPiCode pi, 79 JFmRxFreq tunedFreq, JFmRxAfFreq afFreq); 80 81 void fmRxAfListChanged(JFmRx context, JFmRxStatus status, JFmRxRdsPiCode pi, int[] afList, 82 JFmRxAfListSize afListSize); 83 84 void fmRxCmdEnable(JFmRx context, JFmRxStatus status, int command, long value); 85 86 void fmRxCmdDisable(JFmRx context, JFmRxStatus status, int command, long value); 87 88 void fmRxCmdSetBand(JFmRx context, JFmRxStatus status, int command, long value); 89 90 void fmRxCmdGetBand(JFmRx context, JFmRxStatus status, int command, long value); 91 92 void fmRxCmdSetMonoStereoMode(JFmRx context, JFmRxStatus status, int command, long value); 93 94 void fmRxCmdGetMonoStereoMode(JFmRx context, JFmRxStatus status, int command, long value); 95 96 void fmRxCmdGetMuteMode(JFmRx context, JFmRxStatus status, int command, long value); 97 98 void fmRxCmdSetMuteMode(JFmRx context, JFmRxStatus status, int command, long value); 99 100 void fmRxCmdSetRfDependentMuteMode(JFmRx context, JFmRxStatus status, int command, 101 long value); 102 103 void fmRxCmdGetRfDependentMuteMode(JFmRx context, JFmRxStatus status, int command, 104 long value); 105 106 void fmRxCmdSetRssiThreshhold(JFmRx context, JFmRxStatus status, int command, long value); 107 108 void fmRxCmdGetRssiThreshhold(JFmRx context, JFmRxStatus status, int command, long value); 109 110 void fmRxCmdSetDeemphasisFilter(JFmRx context, JFmRxStatus status, int command, long value); 111 112 void fmRxCmdGetDeemphasisFilter(JFmRx context, JFmRxStatus status, int command, long value); 113 114 void fmRxCmdSetVolume(JFmRx context, JFmRxStatus status, int command, long value); 115 116 void fmRxCmdGetVolume(JFmRx context, JFmRxStatus status, int command, long value); 117 118 void fmRxCmdTune(JFmRx context, JFmRxStatus status, int command, long value); 119 120 void fmRxCmdGetTunedFrequency(JFmRx context, JFmRxStatus status, int command, long value); 121 122 void fmRxCmdSeek(JFmRx context, JFmRxStatus status, int command, long value); 123 124 void fmRxCmdStopSeek(JFmRx context, JFmRxStatus status, int command, long value); 125 126 void fmRxCmdGetRssi(JFmRx context, JFmRxStatus status, int command, long value); 127 128 void fmRxCmdEnableRds(JFmRx context, JFmRxStatus status, int command, long value); 129 130 void fmRxCmdDisableRds(JFmRx context, JFmRxStatus status, int command, long value); 131 132 void fmRxCmdGetRdsSystem(JFmRx context, JFmRxStatus status, int command, long value); 133 134 void fmRxCmdSetRdsSystem(JFmRx context, JFmRxStatus status, int command, long value); 135 136 void fmRxCmdSetRdsGroupMask(JFmRx context, JFmRxStatus status, int command, long value); 137 138 void fmRxCmdGetRdsGroupMask(JFmRx context, JFmRxStatus status, int command, long value); 139 140 void fmRxCmdSetRdsAfSwitchMode(JFmRx context, JFmRxStatus status, int command, long value); 141 142 void fmRxCmdGetRdsAfSwitchMode(JFmRx context, JFmRxStatus status, int command, long value); 143 144 void fmRxCmdDisableAudio(JFmRx context, JFmRxStatus status, int command, long value); 145 146 void fmRxCmdDestroy(JFmRx context, JFmRxStatus status, int command, long value); 147 148 void fmRxCmdChangeDigitalAudioConfiguration(JFmRx context, JFmRxStatus status, int command, 149 long value); 150 151 void fmRxCmdEnableAudio(JFmRx context, JFmRxStatus status, int command, long AudioCmd); 152 153 void fmRxCmdChangeAudioTarget(JFmRx context, JFmRxStatus status, int command, long AudioCmd); 154 155 void fmRxCmdSetChannelSpacing(JFmRx context, JFmRxStatus status, int command, long value); 156 157 void fmRxCmdGetChannelSpacing(JFmRx context, JFmRxStatus status, int command, long value); 158 159 void fmRxCompleteScanDone(JFmRx context, JFmRxStatus status, int numOfChannels, 160 int[] channelsData); 161 162 void fmRxCmdStopCompleteScan(JFmRx context, JFmRxStatus status, int command, long value); 163 164 void fmRxCmdIsValidChannel(JFmRx context, JFmRxStatus status, int command, long value); 165 166 void fmRxCmdGetFwVersion(JFmRx context, JFmRxStatus status, int command, long value); 167 168 void fmRxCmdGetCompleteScanProgress(JFmRx context, JFmRxStatus status, int command, 169 long value); 170 171 } 172 173 /** 174 * Datatype Classes 175 */ 176 177 public static class JFmRxRdsPiCode { 178 private int value = 0; 179 180 public JFmRxRdsPiCode(int val) { 181 this.value = val; 182 } 183 184 public int getValue() { 185 return value; 186 } 187 } 188 189 public static class JFmRxRdsPtyCode { 190 private int value = 0; 191 192 public JFmRxRdsPtyCode(int value) { 193 this.value = value; 194 } 195 196 public int getValue() { 197 return value; 198 } 199 } 200 201 public static class JFmRxAfFreq { 202 203 private int value = 0; 204 205 public JFmRxAfFreq(int value) { 206 this.value = value; 207 } 208 209 public int getAfFreq() { 210 return value; 211 } 212 } 213 214 public static class JFmRxAfListSize { 215 private int value = 0; 216 217 public JFmRxAfListSize(int value) { 218 this.value = value; 219 } 220 221 public int getValue() { 222 return value; 223 } 224 225 } 226 227 /* 228 * public static enum JFmRxEcalResource implements IJFmEnum<Integer> { 229 * CAL_RESOURCE_I2SH(0x00), CAL_RESOURCE_PCMH(0x01), 230 * CAL_RESOURCE_PCMT_1(0x02), CAL_RESOURCE_PCMT_2(0x03), 231 * CAL_RESOURCE_PCMT_3(0x04), CAL_RESOURCE_PCMT_4(0x05), 232 * CAL_RESOURCE_PCMT_5(0x06), CAL_RESOURCE_PCMT_6(0x07), 233 * CAL_RESOURCE_FM_ANALOG(0x08), CAL_RESOURCE_LAST_EL_RESOURCE(0x08), 234 * CAL_RESOURCE_PCMIF(0x09), CAL_RESOURCE_FMIF(0x0A), 235 * CAL_RESOURCE_CORTEX(0x0B), CAL_RESOURCE_FM_CORE(0x0C), 236 * CAL_RESOURCE_MAX_NUM(0x0D), CAL_RESOURCE_INVALID(0x0E); private final int 237 * ecalResource; private JFmRxEcalResource(int ecalResource) { 238 * this.ecalResource = ecalResource; } public Integer getValue() { return 239 * ecalResource; } } public static enum JFmRxEcalOperation implements 240 * IJFmEnum<Integer> { CAL_OPERATION_FM_TX(0x00), CAL_OPERATION_FM_RX(0x01), 241 * CAL_OPERATION_A3DP(0x02), CAL_OPERATION_BT_VOICE(0x03), 242 * CAL_OPERATION_WBS(0x04), CAL_OPERATION_AWBS(0x05), 243 * CAL_OPERATION_FM_RX_OVER_SCO(0x06), CAL_OPERATION_FM_RX_OVER_A3DP(0x07), 244 * CAL_OPERATION_MAX_NUM(0x08), CAL_OPERATION_INVALID(0x09); private final 245 * int ecalOperation; private JFmRxEcalOperation(int ecalOperation) { 246 * this.ecalOperation = ecalOperation; } public Integer getValue() { return 247 * ecalOperation; } } 248 */ 249 public static enum JFmRxEcalSampleFrequency implements IJFmEnum<Integer> { 250 CAL_SAMPLE_FREQ_8000(0x00), CAL_SAMPLE_FREQ_11025(0x01), CAL_SAMPLE_FREQ_12000(0x02), CAL_SAMPLE_FREQ_16000( 251 0x03), CAL_SAMPLE_FREQ_22050(0x04), CAL_SAMPLE_FREQ_24000(0x05), CAL_SAMPLE_FREQ_32000( 252 0x06), CAL_SAMPLE_FREQ_44100(0x07), CAL_SAMPLE_FREQ_48000(0x08); 253 254 private final int ecalSampleFreq; 255 256 private JFmRxEcalSampleFrequency(int ecalSampleFreq) { 257 this.ecalSampleFreq = ecalSampleFreq; 258 } 259 260 public Integer getValue() { 261 return ecalSampleFreq; 262 } 263 } 264 265 public static enum JFmRxRdsGroupTypeMask implements IJFmEnum<Long> { 266 267 FM_RDS_GROUP_TYPE_MASK_0A(0x00000001), FM_RDS_GROUP_TYPE_MASK_0B(0x00000002), FM_RDS_GROUP_TYPE_MASK_1A( 268 0x00000004), FM_RDS_GROUP_TYPE_MASK_1B(0x00000008), FM_RDS_GROUP_TYPE_MASK_2A( 269 0x00000010), FM_RDS_GROUP_TYPE_MASK_2B(0x00000020), FM_RDS_GROUP_TYPE_MASK_3A( 270 0x00000040), FM_RDS_GROUP_TYPE_MASK_3B(0x00000080), FM_RDS_GROUP_TYPE_MASK_4A( 271 0x00000100), FM_RDS_GROUP_TYPE_MASK_4B(0x00000200), FM_RDS_GROUP_TYPE_MASK_5A( 272 0x00000400), FM_RDS_GROUP_TYPE_MASK_5B(0x00000800), FM_RDS_GROUP_TYPE_MASK_6A( 273 0x00001000), FM_RDS_GROUP_TYPE_MASK_6B(0x00002000), FM_RDS_GROUP_TYPE_MASK_7A( 274 0x00004000), FM_RDS_GROUP_TYPE_MASK_7B(0x00008000), FM_RDS_GROUP_TYPE_MASK_8A( 275 0x00010000), FM_RDS_GROUP_TYPE_MASK_8B(0x00020000), FM_RDS_GROUP_TYPE_MASK_9A( 276 0x00040000), FM_RDS_GROUP_TYPE_MASK_9B(0x00080000), FM_RDS_GROUP_TYPE_MASK_10A( 277 0x00100000), FM_RDS_GROUP_TYPE_MASK_10B(0x00200000), FM_RDS_GROUP_TYPE_MASK_11A( 278 0x00400000), FM_RDS_GROUP_TYPE_MASK_11B(0x00800000), FM_RDS_GROUP_TYPE_MASK_12A( 279 0x01000000), FM_RDS_GROUP_TYPE_MASK_12B(0x02000000), FM_RDS_GROUP_TYPE_MASK_13A( 280 0x04000000), FM_RDS_GROUP_TYPE_MASK_13B(0x08000000), FM_RDS_GROUP_TYPE_MASK_14A( 281 0x10000000), FM_RDS_GROUP_TYPE_MASK_14B(0x20000000), FM_RDS_GROUP_TYPE_MASK_15A( 282 0x40000000), FM_RDS_GROUP_TYPE_MASK_15B(0x80000000), FM_RDS_GROUP_TYPE_MASK_NONE( 283 0x0), FM_RDS_GROUP_TYPE_MASK_ALL(0xFFFFFFFF); 284 285 private final long rdsGroupTypeMask; 286 287 private JFmRxRdsGroupTypeMask(long rdsGroupTypeMask) { 288 this.rdsGroupTypeMask = rdsGroupTypeMask; 289 } 290 291 public Long getValue() { 292 return rdsGroupTypeMask; 293 } 294 } 295 296 public static enum JFmRxRdsSystem implements IJFmEnum<Integer> { 297 FM_RDS_SYSTEM_RDS(0x00), FM_RDS_SYSTEM_RBDS(0x01); 298 299 private final int rdsSystem; 300 301 private JFmRxRdsSystem(int rdsSystem) { 302 this.rdsSystem = rdsSystem; 303 } 304 305 public Integer getValue() { 306 return rdsSystem; 307 } 308 } 309 310 /* 311 * public static enum JFmRxAudioRouteMask implements IJFmEnum<Integer> { 312 * FMC_AUDIO_ROUTE_MASK_I2S(0x00000001), 313 * FMC_AUDIO_ROUTE_MASK_ANALOG(0x00000002), 314 * FMC_AUDIO_ROUTE_MASK_NONE(0x00000000), 315 * FMC_AUDIO_ROUTE_MASK_ALL(0x00000003); private final int audioRouteMask; 316 * private JFmRxAudioRouteMask(int audioRouteMask) { this.audioRouteMask = 317 * audioRouteMask; } public Integer getValue() { return audioRouteMask; } } 318 */ 319 public static class JFmRxRssi { 320 321 private int jFmRssi; 322 323 public JFmRxRssi(int jFmRssi) { 324 this.jFmRssi = jFmRssi; 325 } 326 327 public int getRssi() { 328 return jFmRssi; 329 } 330 331 public void setRssi(int jFmRssi) { 332 this.jFmRssi = jFmRssi; 333 } 334 } 335 336 public static class JFmRxVolume { 337 338 private int jFmVolume; 339 340 public JFmRxVolume(int jFmVolume) { 341 this.jFmVolume = jFmVolume; 342 } 343 344 public int getVolume() { 345 return jFmVolume; 346 } 347 348 public void setVolume(int jFmVolume) { 349 this.jFmVolume = jFmVolume; 350 } 351 } 352 353 public static class JFmRxFreq { 354 355 private int value = 0; 356 357 public JFmRxFreq(int value) { 358 this.value = value; 359 } 360 361 public int getValue() { 362 return value; 363 } 364 365 public void setValue(int value) { 366 this.value = value; 367 } 368 } 369 370 public static enum JFmRxMuteMode implements IJFmEnum<Integer> { 371 FMC_MUTE(0x00), FMC_NOT_MUTE(0x01), FMC_ATTENUATE(0x02); 372 373 private final int muteMode; 374 375 private JFmRxMuteMode(int muteMode) { 376 this.muteMode = muteMode; 377 } 378 379 public Integer getValue() { 380 return muteMode; 381 } 382 } 383 384 public static enum JFmRxChannelSpacing implements IJFmEnum<Integer> { 385 FMC_CHANNEL_SPACING_50_KHZ(0x01), FMC_CHANNEL_SPACING_100_KHZ(0x02), FMC_CHANNEL_SPACING_200_KHZ( 386 0x04); 387 388 private final int channelSpace; 389 390 private JFmRxChannelSpacing(int channelSpace) { 391 this.channelSpace = channelSpace; 392 } 393 394 public Integer getValue() { 395 return channelSpace; 396 } 397 } 398 399 public static enum JFmRxBand implements IJFmEnum<Integer> { 400 FMC_BAND_EUROPE_US(0x00), FMC_BAND_JAPAN(0x01); 401 402 private final int band; 403 404 private JFmRxBand(int band) { 405 this.band = band; 406 } 407 408 public Integer getValue() { 409 return band; 410 } 411 } 412 413 public static enum JFmRxAudioTargetMask implements IJFmEnum<Integer> { 414 FM_RX_TARGET_MASK_INVALID(0), FM_RX_TARGET_MASK_I2SH(1), FM_RX_TARGET_MASK_PCMH(2), FM_RX_TARGET_MASK_FM_OVER_SCO( 415 4), FM_RX_TARGET_MASK_FM_OVER_A3DP(8), FM_RX_TARGET_MASK_FM_ANALOG(16); 416 417 private final int audioTargetMask; 418 419 private JFmRxAudioTargetMask(int audioTargetMask) { 420 this.audioTargetMask = audioTargetMask; 421 } 422 423 public Integer getValue() { 424 return audioTargetMask; 425 } 426 } 427 428 public static enum JFmRxRfDependentMuteMode implements IJFmEnum<Integer> { 429 FM_RX_RF_DEPENDENT_MUTE_ON(0x01), FM_RX_RF_DEPENDENT_MUTE_OFF(0x00); 430 431 private final int rfDependentMuteMode; 432 433 private JFmRxRfDependentMuteMode(int rfDependentMuteMode) { 434 this.rfDependentMuteMode = rfDependentMuteMode; 435 } 436 437 public Integer getValue() { 438 return rfDependentMuteMode; 439 } 440 } 441 442 public static enum JFmRxRdsAfSwitchMode implements IJFmEnum<Integer> { 443 FM_RX_RDS_AF_SWITCH_MODE_ON(0x01), FM_RX_RDS_AF_SWITCH_MODE_OFF(0x00); 444 445 private final int rdsAfSwitchMode; 446 447 private JFmRxRdsAfSwitchMode(int rdsAfSwitchMode) { 448 this.rdsAfSwitchMode = rdsAfSwitchMode; 449 } 450 451 public Integer getValue() { 452 return rdsAfSwitchMode; 453 } 454 } 455 456 /* 457 * public static enum JFmRxAudioPath implements IJFmEnum<Integer> { 458 * FM_RX_AUDIO_PATH_OFF(0x00), FM_RX_AUDIO_PATH_HEADSET(0x01), 459 * FM_RX_AUDIO_PATH_HANDSET(0x02); private final int audioPath; private 460 * JFmRxAudioPath(int audioPath) { this.audioPath = audioPath; } public 461 * Integer getValue() { return audioPath; } } 462 */ 463 public static enum JFmRxMonoStereoMode implements IJFmEnum<Integer> { 464 FM_RX_MONO(0x01), FM_RX_STEREO(0x00); 465 466 private final int monoStereoModer; 467 468 private JFmRxMonoStereoMode(int monoStereoModer) { 469 this.monoStereoModer = monoStereoModer; 470 } 471 472 public Integer getValue() { 473 return monoStereoModer; 474 } 475 } 476 477 public static enum JFmRxEmphasisFilter implements IJFmEnum<Integer> { 478 FM_RX_EMPHASIS_FILTER_NONE(0x00), FM_RX_EMPHASIS_FILTER_50_USEC(0x01), FM_RX_EMPHASIS_FILTER_75_USEC( 479 0x02); 480 481 private final int emphasisFilter; 482 483 private JFmRxEmphasisFilter(int emphasisFilter) { 484 this.emphasisFilter = emphasisFilter; 485 } 486 487 public Integer getValue() { 488 return emphasisFilter; 489 } 490 } 491 492 public static enum JFmRxRepertoire implements IJFmEnum<Integer> { 493 FMC_RDS_REPERTOIRE_G0_CODE_TABLE(0x00), FMC_RDS_REPERTOIRE_G1_CODE_TABLE(0x01), FMC_RDS_REPERTOIRE_G2_CODE_TABLE( 494 0x02); 495 496 private final int repertoire; 497 498 private JFmRxRepertoire(int repertoire) { 499 this.repertoire = repertoire; 500 } 501 502 public Integer getValue() { 503 return repertoire; 504 } 505 } 506 507 public static enum JFmRxSeekDirection implements IJFmEnum<Integer> { 508 FM_RX_SEEK_DIRECTION_DOWN(0x00), FM_RX_SEEK_DIRECTION_UP(0x01); 509 510 private final int direction; 511 512 private JFmRxSeekDirection(int direction) { 513 this.direction = direction; 514 } 515 516 public Integer getValue() { 517 return direction; 518 } 519 } 520 521 /******************************************************************************* 522 * Class Methods 523 *******************************************************************************/ 524 525 public JFmRxStatus create(ICallback callback) { 526 JFmRxStatus jFmRxStatus; 527 // JBtlStatus jBtlStatus; 528 try { 529 530 context = new JFmContext(); 531 532 //JFmLog.d(TAG, "Calling nativeJFmRx_Create"); 533 int fmStatus = nativeJFmRx_Create(context); 534 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, fmStatus); 535 536 JFmLog.d(TAG, "After nativeJFmRx_Create, status = " + jFmRxStatus.toString() 537 + ", Context = " + context.getValue()); 538 539 /** 540 *Record the caller's callback and returned native context for 541 * nativeJFmRx_create 542 */ 543 544 this.callback = callback; 545 mRxContextsTable.put(context, this); 546 547 } catch (Exception e) { 548 JFmLog.e(TAG, "create: exception during nativeJFmRx_create (" + e.toString() + ")"); 549 jFmRxStatus = JFmRxStatus.FAILED; 550 } 551 552 return jFmRxStatus; 553 } 554 555 public JFmRxStatus destroy() { 556 //JFmLog.d(TAG, "destroy: entered"); 557 JFmRxStatus jFmRxStatus; 558 // JBtlStatus jBtlStatus; 559 560 try { 561 int fmStatus = nativeJFmRx_Destroy(context.getValue()); 562 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, fmStatus); 563 JFmLog.d(TAG, "After nativeJFmRx_Destroy, status = " + jFmRxStatus.toString()); 564 565 /* 566 * Remove a pair of JFmContext-JFmRx related to the destroyed 567 * context from the HashMap 568 */ 569 570 mRxContextsTable.remove(context); 571 572 } catch (Exception e) { 573 JFmLog.e(TAG, "destroy: exception during nativeJFmRx_Destroy (" + e.toString() + ")"); 574 jFmRxStatus = JFmRxStatus.FAILED; 575 } 576 577 //JFmLog.d(TAG, "destroy: exiting"); 578 579 return jFmRxStatus; 580 581 } 582 583 public JFmRxStatus enable() { 584 //JFmLog.d(TAG, "enable: entered"); 585 586 JFmRxStatus jFmRxStatus; 587 588 try { 589 int fmStatus = nativeJFmRx_Enable(context.getValue()); 590 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, fmStatus); 591 JFmLog.d(TAG, "After nativeJFmRx_Enable, status = " + jFmRxStatus.toString()); 592 } catch (Exception e) { 593 JFmLog.e(TAG, "enable: exception during nativeJFmRx_enable (" + e.toString() + ")"); 594 jFmRxStatus = JFmRxStatus.FAILED; 595 } 596 //JFmLog.d(TAG, "enable: exiting"); 597 598 return jFmRxStatus; 599 } 600 601 public JFmRxStatus disable() { 602 //JFmLog.d(TAG, "disable: entered"); 603 604 JFmRxStatus jFmRxStatus; 605 606 try { 607 int status = nativeJFmRx_Disable(context.getValue()); 608 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 609 JFmLog.d(TAG, "After nativeJFmRx_Disable, status = " + jFmRxStatus.toString()); 610 } catch (Exception e) { 611 JFmLog.e(TAG, "disable: exception during nativeJFmRx_Disable (" + e.toString() + ")"); 612 jFmRxStatus = JFmRxStatus.FAILED; 613 } 614 //JFmLog.d(TAG, "disable: exiting"); 615 return jFmRxStatus; 616 } 617 618 public JFmRxStatus setBand(JFmRxBand jFmRxBand) { 619 JFmLog.d(TAG, "setBand: entered"); 620 JFmRxStatus jFmRxStatus; 621 622 try { 623 624 int status = nativeJFmRx_SetBand(context.getValue(), jFmRxBand.getValue()); 625 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 626 JFmLog.d(TAG, "After nativeJFmRx_SetBand, status = " + jFmRxStatus.toString()); 627 } catch (Exception e) { 628 JFmLog.e(TAG, "setBand: exception during nativeJFmRx_SetBand (" + e.toString() + ")"); 629 jFmRxStatus = JFmRxStatus.FAILED; 630 } 631 632 JFmLog.d(TAG, "setBand: exiting"); 633 return jFmRxStatus; 634 } 635 636 public JFmRxStatus getBand() { 637 JFmLog.d(TAG, "getBand: entered"); 638 JFmRxStatus jFmRxStatus; 639 640 try { 641 int status = nativeJFmRx_GetBand(context.getValue()); 642 643 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 644 JFmLog.d(TAG, "After nativeJFmRx_GetBand, status = " + jFmRxStatus.toString()); 645 } catch (Exception e) { 646 JFmLog.e(TAG, "getBand: exception during nativeJFmRx_GetBand (" + e.toString() + ")"); 647 jFmRxStatus = JFmRxStatus.FAILED; 648 } 649 650 JFmLog.d(TAG, "getBand: exiting"); 651 return jFmRxStatus; 652 653 } 654 655 public JFmRxStatus setChannelSpacing(JFmRxChannelSpacing jFmRxChannelSpacing) { 656 JFmLog.d(TAG, "setChannelSpacing: entered"); 657 JFmRxStatus jFmRxStatus; 658 659 try { 660 661 int status = nativeJFmRx_SetChannelSpacing(context.getValue(), jFmRxChannelSpacing 662 .getValue()); 663 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 664 JFmLog 665 .d(TAG, "After nativeJFmRx_SetChannelSpacing, status = " 666 + jFmRxStatus.toString()); 667 } catch (Exception e) { 668 JFmLog.e(TAG, "setBand: exception during nativeJFmRx_SetChannelSpacing (" 669 + e.toString() + ")"); 670 jFmRxStatus = JFmRxStatus.FAILED; 671 } 672 673 JFmLog.d(TAG, "setChannelSpacing: exiting"); 674 return jFmRxStatus; 675 } 676 677 public JFmRxStatus getChannelSpacing() { 678 JFmLog.d(TAG, "getChannelSpacing: entered"); 679 JFmRxStatus jFmRxStatus; 680 681 try { 682 int status = nativeJFmRx_GetChannelSpacing(context.getValue()); 683 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 684 JFmLog 685 .d(TAG, "After nativeJFmRx_GetChannelSpacing, status = " 686 + jFmRxStatus.toString()); 687 } catch (Exception e) { 688 JFmLog.e(TAG, "getChannelSpacing: exception during nativeJFmRx_GetChannelSpacing (" 689 + e.toString() + ")"); 690 jFmRxStatus = JFmRxStatus.FAILED; 691 } 692 693 JFmLog.d(TAG, "getChannelSpacing: exiting"); 694 return jFmRxStatus; 695 696 } 697 698 public JFmRxStatus isValidChannel() { 699 //JFmLog.d(TAG, "isValidChannel: entered"); 700 701 JFmRxStatus jFmRxStatus; 702 703 try { 704 int status = nativeJFmRx_IsValidChannel(context.getValue()); 705 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 706 JFmLog.d(TAG, "After nativeJFmRx_IsValidChannel, status = " + jFmRxStatus.toString()); 707 } catch (Exception e) { 708 JFmLog.e(TAG, "isValidChannel: exception during nativeJFmRx_IsValidChannel (" 709 + e.toString() + ")"); 710 jFmRxStatus = JFmRxStatus.FAILED; 711 } 712 //JFmLog.d(TAG, "isValidChannel: exiting"); 713 return jFmRxStatus; 714 715 } 716 717 public JFmRxStatus completeScan() { 718 JFmLog.d(TAG, "completeScan: entered"); 719 720 JFmRxStatus jFmRxStatus; 721 722 try { 723 int status = nativeJFmRx_CompleteScan(context.getValue()); 724 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 725 JFmLog.d(TAG, "After nativeJFmRx_CompleteScan, status = " + jFmRxStatus.toString()); 726 } catch (Exception e) { 727 JFmLog.e(TAG, "completeScan: exception during nativeJFmRx_CompleteScan (" 728 + e.toString() + ")"); 729 jFmRxStatus = JFmRxStatus.FAILED; 730 } 731 JFmLog.d(TAG, "completeScan: exiting"); 732 return jFmRxStatus; 733 734 } 735 736 public JFmRxStatus getFwVersion() { 737 //JFmLog.d(TAG, "getFwVersion: entered"); 738 739 JFmRxStatus jFmRxStatus; 740 741 try { 742 int status = nativeJFmRx_GetFwVersion(context.getValue()); 743 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 744 JFmLog.d(TAG, "After nativeJFmRx_GetFwVersion, status = " + jFmRxStatus.toString()); 745 } catch (Exception e) { 746 JFmLog.e(TAG, "getFwVersion: exception during nativeJFmRx_GetFwVersion (" 747 + e.toString() + ")"); 748 jFmRxStatus = JFmRxStatus.FAILED; 749 } 750 //JFmLog.d(TAG, "getFwVersion: exiting"); 751 return jFmRxStatus; 752 753 } 754 755 public JFmRxStatus getCompleteScanProgress() { 756 JFmLog.d(TAG, "getCompleteScanProgress: entered"); 757 758 JFmRxStatus jFmRxStatus; 759 760 try { 761 int status = nativeJFmRx_GetCompleteScanProgress(context.getValue()); 762 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 763 JFmLog.d(TAG, "After nativeJFmRx_GetCompleteScanProgress, status = " 764 + jFmRxStatus.toString()); 765 } catch (Exception e) { 766 JFmLog.e(TAG, 767 "getCompleteScanProgress: exception during nativeJFmRx_GetCompleteScanProgress (" 768 + e.toString() + ")"); 769 jFmRxStatus = JFmRxStatus.FAILED; 770 } 771 JFmLog.d(TAG, "getCompleteScanProgress: exiting"); 772 return jFmRxStatus; 773 774 } 775 776 public JFmRxStatus stopCompleteScan() { 777 JFmLog.d(TAG, "stopCompleteScan: entered"); 778 779 JFmRxStatus jFmRxStatus; 780 781 try { 782 int status = nativeJFmRx_StopCompleteScan(context.getValue()); 783 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 784 JFmLog.d(TAG, "After nativeJFmRx_StopCompleteScan, status = " + jFmRxStatus.toString()); 785 } catch (Exception e) { 786 JFmLog.e(TAG, "stopCompleteScan: exception during nativeJFmRx_StopCompleteScan (" 787 + e.toString() + ")"); 788 jFmRxStatus = JFmRxStatus.FAILED; 789 } 790 JFmLog.d(TAG, "stopCompleteScan: exiting"); 791 return jFmRxStatus; 792 793 } 794 795 public JFmRxStatus tune(JFmRxFreq jfmRxFreq) { 796 797 //JFmLog.d(TAG, "tune: entered"); 798 799 JFmRxStatus jFmRxStatus; 800 801 try { 802 803 int status = nativeJFmRx_Tune(context.getValue(), jfmRxFreq.getValue()); 804 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 805 JFmLog.d(TAG, "After nativeJFmRx_Tune, status = " + jFmRxStatus.toString()); 806 } catch (Exception e) { 807 JFmLog.e(TAG, "tune: exception during nativeJFmRx_Tune (" + e.toString() + ")"); 808 jFmRxStatus = JFmRxStatus.FAILED; 809 } 810 //JFmLog.d(TAG, "tune: exiting"); 811 return jFmRxStatus; 812 } 813 814 public JFmRxStatus getTunedFrequency() { 815 //JFmLog.d(TAG, "getTunedFrequency: entered"); 816 JFmRxStatus jFmRxStatus; 817 818 try { 819 int status = nativeJFmRx_GetTunedFrequency(context.getValue()); 820 821 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 822 JFmLog 823 .d(TAG, "After nativeJFmRx_GetTunedFrequency, status = " 824 + jFmRxStatus.toString()); 825 } catch (Exception e) { 826 JFmLog.e(TAG, "getTunedFrequency: exception during nativeJFmRx_GetTunedFrequency (" 827 + e.toString() + ")"); 828 jFmRxStatus = JFmRxStatus.FAILED; 829 } 830 831 //JFmLog.d(TAG, "getTunedFrequency: exiting"); 832 return jFmRxStatus; 833 834 } 835 836 public JFmRxStatus setMonoStereoMode(JFmRxMonoStereoMode jFmRxMonoStereoMode) { 837 //JFmLog.d(TAG, "setMonoStereoMode: entered"); 838 JFmRxStatus jFmRxStatus; 839 840 try { 841 int status = nativeJFmRx_SetMonoStereoMode(context.getValue(), jFmRxMonoStereoMode 842 .getValue()); 843 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 844 JFmLog 845 .d(TAG, "After nativeJFmRx_SetMonoStereoMode, status = " 846 + jFmRxStatus.toString()); 847 } catch (Exception e) { 848 JFmLog.e(TAG, "setMonoStereoMode: exception during nativeJFmRx_SetMonoStereoMode (" 849 + e.toString() + ")"); 850 jFmRxStatus = JFmRxStatus.FAILED; 851 } 852 //JFmLog.d(TAG, "setMonoStereoMode: exiting"); 853 return jFmRxStatus; 854 855 } 856 857 public JFmRxStatus getMonoStereoMode() { 858 //JFmLog.d(TAG, "getMonoStereoMode: entered"); 859 860 JFmRxStatus jFmRxStatus; 861 862 try { 863 int status = nativeJFmRx_GetMonoStereoMode(context.getValue()); 864 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 865 JFmLog 866 .d(TAG, "After nativeJFmRx_GetMonoStereoMode, status = " 867 + jFmRxStatus.toString()); 868 } catch (Exception e) { 869 JFmLog.e(TAG, "getMonoStereoMode: exception during nativeJFmRx_GetMonoStereoMode (" 870 + e.toString() + ")"); 871 jFmRxStatus = JFmRxStatus.FAILED; 872 } 873 //JFmLog.d(TAG, "getMonoStereoMode: exiting"); 874 return jFmRxStatus; 875 876 } 877 878 public JFmRxStatus setMuteMode(JFmRxMuteMode jFmRxMuteMode) { 879 //JFmLog.d(TAG, "setMuteMode: entered"); 880 JFmRxStatus jFmRxStatus; 881 882 try { 883 int status = nativeJFmRx_SetMuteMode(context.getValue(), jFmRxMuteMode.getValue()); 884 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 885 JFmLog.d(TAG, "After nativeJFmRx_SetMuteMode, status = " + jFmRxStatus.toString()); 886 887 } catch (Exception e) { 888 JFmLog.e(TAG, "setMuteMode: exception during nativeJFmRx_SetMuteMode (" + e.toString() 889 + ")"); 890 jFmRxStatus = JFmRxStatus.FAILED; 891 } 892 893 //JFmLog.d(TAG, "setMuteMode: exiting"); 894 return jFmRxStatus; 895 896 } 897 898 public JFmRxStatus getMuteMode() { 899 //JFmLog.d(TAG, "getMuteMode: entered"); 900 JFmRxStatus jFmRxStatus; 901 902 try { 903 int status = nativeJFmRx_GetMuteMode(context.getValue()); 904 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 905 JFmLog.d(TAG, "After nativeJFmRx_GetMuteMode, status = " + jFmRxStatus.toString()); 906 } catch (Exception e) { 907 JFmLog.e(TAG, "getMuteMode: exception during nativeJFmRx_GetMuteMode (" + e.toString() 908 + ")"); 909 jFmRxStatus = JFmRxStatus.FAILED; 910 } 911 //JFmLog.d(TAG, "getMuteMode: exiting"); 912 return jFmRxStatus; 913 } 914 915 public JFmRxStatus setRssiThreshold(JFmRxRssi jFmRssi) { 916 //JFmLog.d(TAG, "setRssiThreshold: entered"); 917 918 JFmRxStatus jFmRxStatus; 919 920 try { 921 int status = nativeJFmRx_SetRssiThreshold(context.getValue(), jFmRssi.getRssi()); 922 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 923 JFmLog.d(TAG, "After nativeJFmRx_SetRssiThreshold, status = " + jFmRxStatus.toString()); 924 } catch (Exception e) { 925 JFmLog.e(TAG, "setRssiThreshold: exception during nativeJFmRx_SetRssiThreshold (" 926 + e.toString() + ")"); 927 jFmRxStatus = JFmRxStatus.FAILED; 928 } 929 //JFmLog.d(TAG, "setRssiThreshold: exiting"); 930 return jFmRxStatus; 931 932 } 933 934 public JFmRxStatus getRssiThreshold() { 935 //JFmLog.d(TAG, "getRssiThreshold: entered"); 936 JFmRxStatus jFmRxStatus; 937 938 try { 939 int fmStatus = nativeJFmRx_GetRssiThreshold(context.getValue()); 940 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, fmStatus); 941 JFmLog.d(TAG, "After nativeJFmRx_GetRssiThreshold, status = " + jFmRxStatus.toString()); 942 } catch (Exception e) { 943 JFmLog.e(TAG, "getRssiThreshold: exception during nativeJFmRx_GetRssiThreshold (" 944 + e.toString() + ")"); 945 jFmRxStatus = JFmRxStatus.FAILED; 946 } 947 //JFmLog.d(TAG, "getRssiThreshold: exiting"); 948 return jFmRxStatus; 949 } 950 951 public JFmRxStatus getRssi() { 952 //JFmLog.d(TAG, "getRssi: entered"); 953 JFmRxStatus jFmRxStatus; 954 955 try { 956 int fmStatus = nativeJFmRx_GetRssi(context.getValue()); 957 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, fmStatus); 958 JFmLog.d(TAG, "After nativeJFmRx_GetRssi, status = " + jFmRxStatus.toString()); 959 960 } catch (Exception e) { 961 JFmLog.e(TAG, "getRssi: exception during nativeJFmRx_GetRssi (" + e.toString() + ")"); 962 jFmRxStatus = JFmRxStatus.FAILED; 963 } 964 //JFmLog.d(TAG, "getRssi: exiting"); 965 return jFmRxStatus; 966 } 967 968 public JFmRxStatus setVolume(JFmRxVolume jFmVolume) { 969 //JFmLog.d(TAG, "setVolume: entered"); 970 JFmRxStatus jFmRxStatus; 971 972 try { 973 int fmStatus = nativeJFmRx_SetVolume(context.getValue(), jFmVolume.getVolume()); 974 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, fmStatus); 975 JFmLog.d(TAG, "After nativeJFmRx_SetVolume, status = " + jFmRxStatus.toString()); 976 } catch (Exception e) { 977 JFmLog.e(TAG, "setVolume: exception during nativeJFmRx_SetVolume (" + e.toString() 978 + ")"); 979 jFmRxStatus = JFmRxStatus.FAILED; 980 } 981 982 //JFmLog.d(TAG, "setVolume: exiting"); 983 return jFmRxStatus; 984 985 } 986 987 public JFmRxStatus getVolume() { 988 //JFmLog.d(TAG, "getVolume: entered"); 989 JFmRxStatus jFmRxStatus; 990 991 try { 992 int fmStatus = nativeJFmRx_GetVolume(context.getValue()); 993 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, fmStatus); 994 JFmLog.d(TAG, "After nativeJFmRx_GetVolume, status = " + jFmRxStatus.toString()); 995 } catch (Exception e) { 996 JFmLog.e(TAG, "getVolume: exception during nativeJFmRx_GetVolume (" + e.toString() 997 + ")"); 998 jFmRxStatus = JFmRxStatus.FAILED; 999 } 1000 1001 //JFmLog.d(TAG, "getVolume: exiting"); 1002 return jFmRxStatus; 1003 1004 } 1005 1006 public JFmRxStatus SetDeEmphasisFilter(JFmRxEmphasisFilter jFmRxEmphasisFilter) { 1007 //JFmLog.d(TAG, "SetDeEmphasisFilter: entered"); 1008 JFmRxStatus jFmRxStatus; 1009 1010 try { 1011 int fmStatus = nativeJFmRx_SetDeEmphasisFilter(context.getValue(), jFmRxEmphasisFilter 1012 .getValue()); 1013 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, fmStatus); 1014 JFmLog.d(TAG, "After nativeJFmRx_SetDeEmphasisFilter, status = " 1015 + jFmRxStatus.toString()); 1016 } catch (Exception e) { 1017 JFmLog.e(TAG, "SetDeEmphasisFilter: exception during nativeJFmRx_SetDeEmphasisFilter (" 1018 + e.toString() + ")"); 1019 jFmRxStatus = JFmRxStatus.FAILED; 1020 } 1021 //JFmLog.d(TAG, "SetDeEmphasisFilter: exiting"); 1022 1023 return jFmRxStatus; 1024 1025 } 1026 1027 public JFmRxStatus GetDeEmphasisFilter() { 1028 //JFmLog.d(TAG, "GetDeEmphasisFilter: entered"); 1029 JFmRxStatus jFmRxStatus; 1030 1031 try { 1032 int fmStatus = nativeJFmRx_GetDeEmphasisFilter(context.getValue()); 1033 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, fmStatus); 1034 JFmLog.d(TAG, "After nativeJFmRx_GetDeEmphasisFilter, status = " 1035 + jFmRxStatus.toString()); 1036 } catch (Exception e) { 1037 JFmLog.e(TAG, "GetDeEmphasisFilter: exception during nativeJFmRx_GetDeEmphasisFilter (" 1038 + e.toString() + ")"); 1039 jFmRxStatus = JFmRxStatus.FAILED; 1040 } 1041 //JFmLog.d(TAG, "GetDeEmphasisFilter: exiting"); 1042 1043 return jFmRxStatus; 1044 } 1045 1046 public JFmRxStatus seek(JFmRxSeekDirection jFmRxSeekDirection) { 1047 //JFmLog.d(TAG, "seek: entered"); 1048 JFmRxStatus jFmRxStatus; 1049 1050 try { 1051 int fmStatus = nativeJFmRx_Seek(context.getValue(), jFmRxSeekDirection.getValue()); 1052 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, fmStatus); 1053 JFmLog.d(TAG, "After nativeJFmRx_Seek, status = " + jFmRxStatus.toString()); 1054 } catch (Exception e) { 1055 JFmLog.e(TAG, "seek: exception during nativeJFmRx_Seek (" + e.toString() + ")"); 1056 jFmRxStatus = JFmRxStatus.FAILED; 1057 } 1058 //JFmLog.d(TAG, "seek: exiting"); 1059 return jFmRxStatus; 1060 } 1061 1062 public JFmRxStatus stopSeek() { 1063 //JFmLog.d(TAG, "stopSeek: entered"); 1064 JFmRxStatus jFmRxStatus; 1065 1066 try { 1067 int fmStatus = nativeJFmRx_StopSeek(context.getValue()); 1068 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, fmStatus); 1069 JFmLog.d(TAG, "After nativeJFmRx_StopSeek, status = " + jFmRxStatus.toString()); 1070 } catch (Exception e) { 1071 JFmLog.e(TAG, "stopSeek: exception during nativeJFmRx_StopSeek (" + e.toString() + ")"); 1072 jFmRxStatus = JFmRxStatus.FAILED; 1073 } 1074 //JFmLog.d(TAG, "stopSeek: exiting"); 1075 1076 return jFmRxStatus; 1077 1078 } 1079 1080 public JFmRxStatus enableRDS() { 1081 //JFmLog.d(TAG, "enableRDS: entered"); 1082 JFmRxStatus jFmRxStatus; 1083 1084 try { 1085 int fmStatus = nativeJFmRx_EnableRDS(context.getValue()); 1086 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, fmStatus); 1087 JFmLog.d(TAG, "After nativeJFmRx_EnableRDS, status = " + jFmRxStatus.toString()); 1088 } catch (Exception e) { 1089 JFmLog.e(TAG, "enableRDS: exception during nativeJFmRx_EnableRDS (" + e.toString() 1090 + ")"); 1091 jFmRxStatus = JFmRxStatus.FAILED; 1092 } 1093 //JFmLog.d(TAG, "enableRDS: exiting"); 1094 1095 return jFmRxStatus; 1096 } 1097 1098 public JFmRxStatus DisableRDS() { 1099 //JFmLog.d(TAG, "DisableRDS: entered"); 1100 JFmRxStatus jFmRxStatus; 1101 1102 try { 1103 int fmStatus = nativeJFmRx_DisableRDS(context.getValue()); 1104 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, fmStatus); 1105 JFmLog.d(TAG, "After nativeJFmRx_DisableRDS, status = " + jFmRxStatus.toString()); 1106 } catch (Exception e) { 1107 JFmLog.e(TAG, "DisableRDS: exception during nativeJFmRx_DisableRDS (" + e.toString() 1108 + ")"); 1109 jFmRxStatus = JFmRxStatus.FAILED; 1110 } 1111 //JFmLog.d(TAG, "DisableRDS: exiting"); 1112 1113 return jFmRxStatus; 1114 } 1115 1116 public JFmRxStatus enableAudioRouting() { 1117 //JFmLog.d(TAG, "enableAudioRouting: entered"); 1118 JFmRxStatus jFmRxStatus; 1119 1120 try { 1121 int fmStatus = nativeJFmRx_EnableAudioRouting(context.getValue()); 1122 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, fmStatus); 1123 JFmLog.d(TAG, "After nativeJFmRx_EnableAudioRouting, status = " 1124 + jFmRxStatus.toString()); 1125 } catch (Exception e) { 1126 JFmLog.e(TAG, "enableAudioRouting: exception during nativeJFmRx_EnableAudioRouting (" 1127 + e.toString() + ")"); 1128 jFmRxStatus = JFmRxStatus.FAILED; 1129 } 1130 1131 //JFmLog.d(TAG, "enableAudioRouting: exiting"); 1132 return jFmRxStatus; 1133 } 1134 1135 public JFmRxStatus disableAudioRouting() { 1136 //JFmLog.d(TAG, "disableAudioRouting: entered"); 1137 JFmRxStatus jFmRxStatus; 1138 1139 try { 1140 int fmStatus = nativeJFmRx_DisableAudioRouting(context.getValue()); 1141 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, fmStatus); 1142 JFmLog.d(TAG, "After nativeJFmRx_DisableAudioRouting, status = " 1143 + jFmRxStatus.toString()); 1144 } catch (Exception e) { 1145 JFmLog.e(TAG, "disableAudioRouting: exception during nativeJFmRx_DisableAudioRouting (" 1146 + e.toString() + ")"); 1147 jFmRxStatus = JFmRxStatus.FAILED; 1148 } 1149 1150 //JFmLog.d(TAG, "disableAudioRouting: exiting"); 1151 return jFmRxStatus; 1152 1153 } 1154 1155 public JFmRxStatus setRdsAfSwitchMode(JFmRxRdsAfSwitchMode jRdsAfSwitchMode) { 1156 //JFmLog.d(TAG, "setRdsAfSwitchMode: entered"); 1157 JFmRxStatus jFmRxStatus; 1158 1159 try { 1160 int fmStatus = nativeJFmRx_SetRdsAfSwitchMode(context.getValue(), jRdsAfSwitchMode 1161 .getValue()); 1162 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, fmStatus); 1163 JFmLog.d(TAG, "After nativeJFmRx_SetRdsAfSwitchMode, status = " 1164 + jFmRxStatus.toString()); 1165 } catch (Exception e) { 1166 JFmLog.e(TAG, "setRdsAfSwitchMode: exception during nativeJFmRx_SetRdsAfSwitchMode (" 1167 + e.toString() + ")"); 1168 jFmRxStatus = JFmRxStatus.FAILED; 1169 } 1170 1171 //JFmLog.d(TAG, "setRdsAfSwitchMode: exiting"); 1172 return jFmRxStatus; 1173 1174 } 1175 1176 public JFmRxStatus getRdsAfSwitchMode() { 1177 //JFmLog.d(TAG, "getRdsAfSwitchMode: entered"); 1178 JFmRxStatus jFmRxStatus; 1179 1180 try { 1181 int fmStatus = nativeJFmRx_GetRdsAfSwitchMode(context.getValue()); 1182 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, fmStatus); 1183 JFmLog.d(TAG, "After nativeJFmRx_GetRdsAfSwitchMode, status = " 1184 + jFmRxStatus.toString()); 1185 } catch (Exception e) { 1186 JFmLog.e(TAG, "getRdsAfSwitchMode: exception during nativeJFmRx_GetRdsAfSwitchMode (" 1187 + e.toString() + ")"); 1188 jFmRxStatus = JFmRxStatus.FAILED; 1189 } 1190 //JFmLog.d(TAG, "getRdsAfSwitchMode: exiting"); 1191 1192 return jFmRxStatus; 1193 } 1194 1195 public JFmRxStatus changeAudioTarget(JFmRxAudioTargetMask jFmRxAudioTargetMask, 1196 JFmRxEcalSampleFrequency digitalConfig) { 1197 //JFmLog.d(TAG, "changeAudioTarget: entered"); 1198 JFmRxStatus jFmRxStatus; 1199 1200 try { 1201 int fmStatus = nativeJFmRx_ChangeAudioTarget(context.getValue(), jFmRxAudioTargetMask 1202 .getValue(), digitalConfig.getValue()); 1203 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, fmStatus); 1204 JFmLog 1205 .d(TAG, "After nativeJFmRx_ChangeAudioTarget, status = " 1206 + jFmRxStatus.toString()); 1207 } catch (Exception e) { 1208 JFmLog.e(TAG, "changeAudioTarget: exception during nativeJFmRx_ChangeAudioTarget (" 1209 + e.toString() + ")"); 1210 jFmRxStatus = JFmRxStatus.FAILED; 1211 } 1212 //JFmLog.d(TAG, "changeAudioTarget: exiting"); 1213 1214 return jFmRxStatus; 1215 1216 } 1217 1218 public JFmRxStatus changeDigitalTargetConfiguration(JFmRxEcalSampleFrequency digitalConfig) { 1219 //JFmLog.d(TAG, "changeDigitalTargetConfiguration: entered"); 1220 JFmRxStatus jFmRxStatus; 1221 1222 try { 1223 int fmStatus = nativeJFmRx_ChangeDigitalTargetConfiguration(context.getValue(), 1224 digitalConfig.getValue()); 1225 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, fmStatus); 1226 JFmLog.d(TAG, "After nativeJFmRx_ChangeDigitalTargetConfiguration, status = " 1227 + jFmRxStatus.toString()); 1228 } catch (Exception e) { 1229 JFmLog.e(TAG, 1230 "changeDigitalTargetConfiguration: exception during nativeJFmRx_ChangeDigitalTargetConfiguration (" 1231 + e.toString() + ")"); 1232 jFmRxStatus = JFmRxStatus.FAILED; 1233 } 1234 //JFmLog.d(TAG, "changeDigitalTargetConfiguration: exiting"); 1235 1236 return jFmRxStatus; 1237 1238 } 1239 1240 public JFmRxStatus setRfDependentMuteMode(JFmRxRfDependentMuteMode mode) { 1241 //JFmLog.d(TAG, "setRfDependentMuteMode: entered"); 1242 JFmRxStatus jFmRxStatus; 1243 1244 try { 1245 int fmStatus = nativeJFmRx_SetRfDependentMuteMode(context.getValue(), mode.getValue()); 1246 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, fmStatus); 1247 JFmLog.d(TAG, "After nativeJFmRx_SetRfDependentMuteMode, status = " 1248 + jFmRxStatus.toString()); 1249 } catch (Exception e) { 1250 JFmLog.e(TAG, 1251 "setRfDependentMuteMode: exception during nativeJFmRx_SetRfDependentMuteMode (" 1252 + e.toString() + ")"); 1253 jFmRxStatus = JFmRxStatus.FAILED; 1254 } 1255 //JFmLog.d(TAG, "setRfDependentMuteMode: exiting"); 1256 1257 return jFmRxStatus; 1258 1259 } 1260 1261 public JFmRxStatus getRfDependentMute() { 1262 //JFmLog.d(TAG, "getRfDependentMute: entered"); 1263 JFmRxStatus jFmRxStatus; 1264 1265 try { 1266 int fmStatus = nativeJFmRx_GetRfDependentMute(context.getValue()); 1267 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, fmStatus); 1268 JFmLog.d(TAG, "After nativeJFmRx_GetRfDependentMute, status = " 1269 + jFmRxStatus.toString()); 1270 } catch (Exception e) { 1271 JFmLog.e(TAG, "getRfDependentMute: exception during nativeJFmRx_GetRfDependentMute (" 1272 + e.toString() + ")"); 1273 jFmRxStatus = JFmRxStatus.FAILED; 1274 } 1275 //JFmLog.d(TAG, "getRfDependentMute: exiting"); 1276 1277 return jFmRxStatus; 1278 1279 } 1280 1281 public JFmRxStatus setRdsSystem(JFmRxRdsSystem rdsSystem) { 1282 //JFmLog.d(TAG, "setRdsSystem: entered"); 1283 JFmRxStatus jFmRxStatus; 1284 1285 try { 1286 int fmStatus = nativeJFmRx_SetRdsSystem(context.getValue(), rdsSystem.getValue()); 1287 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, fmStatus); 1288 JFmLog.d(TAG, "After nativeJFmRx_SetRdsSystem, status = " + jFmRxStatus.toString()); 1289 } catch (Exception e) { 1290 JFmLog.e(TAG, "setRdsSystem: exception during nativeJFmRx_SetRdsSystem (" 1291 + e.toString() + ")"); 1292 jFmRxStatus = JFmRxStatus.FAILED; 1293 } 1294 //JFmLog.d(TAG, "setRdsSystem: exiting"); 1295 1296 return jFmRxStatus; 1297 1298 } 1299 1300 public JFmRxStatus getRdsSystem() { 1301 //JFmLog.d(TAG, "getRdsSystem: entered"); 1302 JFmRxStatus jFmRxStatus; 1303 1304 try { 1305 int fmStatus = nativeJFmRx_GetRdsSystem(context.getValue()); 1306 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, fmStatus); 1307 JFmLog.d(TAG, "After nativeJFmRx_GetRdsSystem, status = " + jFmRxStatus.toString()); 1308 } catch (Exception e) { 1309 JFmLog.e(TAG, "getRdsSystem: exception during nativeJFmRx_GetRdsSystem (" 1310 + e.toString() + ")"); 1311 jFmRxStatus = JFmRxStatus.FAILED; 1312 } 1313 //JFmLog.d(TAG, "getRdsSystem: exiting"); 1314 1315 return jFmRxStatus; 1316 1317 } 1318 1319 public JFmRxStatus setRdsGroupMask(JFmRxRdsGroupTypeMask groupMask) { 1320 //JFmLog.d(TAG, "setRdsGroupMask: entered"); 1321 JFmRxStatus jFmRxStatus; 1322 1323 try { 1324 int fmStatus = nativeJFmRx_SetRdsGroupMask(context.getValue(), groupMask.getValue()); 1325 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, fmStatus); 1326 JFmLog.d(TAG, "After nativeJFmRx_SetRdsGroupMask, status = " + jFmRxStatus.toString()); 1327 } catch (Exception e) { 1328 JFmLog.e(TAG, "setRdsGroupMask: exception during nativeJFmRx_SetRdsGroupMask (" 1329 + e.toString() + ")"); 1330 jFmRxStatus = JFmRxStatus.FAILED; 1331 } 1332 //JFmLog.d(TAG, "setRdsGroupMask: exiting"); 1333 1334 return jFmRxStatus; 1335 1336 } 1337 1338 public JFmRxStatus getRdsGroupMask() { 1339 //JFmLog.d(TAG, "getRdsGroupMask: entered"); 1340 JFmRxStatus jFmRxStatus; 1341 1342 try { 1343 int fmStatus = nativeJFmRx_GetRdsGroupMask(context.getValue()); 1344 jFmRxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, fmStatus); 1345 JFmLog.d(TAG, "After nativeJFmRx_GetRdsGroupMask, status = " + jFmRxStatus.toString()); 1346 } catch (Exception e) { 1347 JFmLog.e(TAG, "getRdsGroupMask: exception during nativeJFmRx_GetRdsGroupMask (" 1348 + e.toString() + ")"); 1349 jFmRxStatus = JFmRxStatus.FAILED; 1350 } 1351 //JFmLog.d(TAG, "getRdsGroupMask: exiting"); 1352 1353 return jFmRxStatus; 1354 1355 } 1356 1357 /*-------------------------------------------------------------------------- 1358 * NATIVE PART 1359 *------------------------------------------------------------------------*/ 1360 1361 /* RBTL Calls */ 1362 private static native void nativeJFmRx_ClassInitNative(); 1363 1364 private static native int nativeJFmRx_Create(JFmContext contextValue); 1365 1366 private static native int nativeJFmRx_Destroy(long contextValue); 1367 1368 private static native int nativeJFmRx_Enable(long contextValue); 1369 1370 private static native int nativeJFmRx_Disable(long contextValue); 1371 1372 private static native int nativeJFmRx_SetBand(long contextValue, int jFmBand); 1373 1374 private static native int nativeJFmRx_GetBand(long contextValue); 1375 1376 private static native int nativeJFmRx_Tune(long contextValue, int jFmFreq); 1377 1378 private static native int nativeJFmRx_GetTunedFrequency(long contextValue); 1379 1380 private static native int nativeJFmRx_SetMonoStereoMode(long contextValue, int jFmMonoStereoMode); 1381 1382 private static native int nativeJFmRx_GetMonoStereoMode(long contextValue); 1383 1384 private static native int nativeJFmRx_SetMuteMode(long contextValue, int jFmMuteMode); 1385 1386 private static native int nativeJFmRx_GetMuteMode(long contextValue); 1387 1388 private static native int nativeJFmRx_SetRssiThreshold(long contextValue, int jFmRssi); 1389 1390 private static native int nativeJFmRx_GetRssiThreshold(long contextValue); 1391 1392 private static native int nativeJFmRx_GetRssi(long contextValue); 1393 1394 private static native int nativeJFmRx_SetVolume(long contextValue, int jFmVolume); 1395 1396 private static native int nativeJFmRx_GetVolume(long contextValue); 1397 1398 private static native int nativeJFmRx_SetDeEmphasisFilter(long contextValue, 1399 int jFmEmphasisFilter); 1400 1401 private static native int nativeJFmRx_GetDeEmphasisFilter(long contextValue); 1402 1403 private static native int nativeJFmRx_Seek(long contextValue, int jFmDirection); 1404 1405 private static native int nativeJFmRx_StopSeek(long contextValue); 1406 1407 private static native int nativeJFmRx_EnableRDS(long contextValue); 1408 1409 private static native int nativeJFmRx_DisableRDS(long contextValue); 1410 1411 private static native int nativeJFmRx_EnableAudioRouting(long contextValue); 1412 1413 private static native int nativeJFmRx_DisableAudioRouting(long contextValue); 1414 1415 private static native int nativeJFmRx_SetRdsAfSwitchMode(long contextValue, int jRdsAfSwitchMode); 1416 1417 private static native int nativeJFmRx_GetRdsAfSwitchMode(long contextValue); 1418 1419 private static native int nativeJFmRx_ChangeAudioTarget(long contextValue, int audioTargetMask, 1420 int digitalConfig); 1421 1422 private static native int nativeJFmRx_ChangeDigitalTargetConfiguration(long contextValue, 1423 int digitalConfig); 1424 1425 private static native int nativeJFmRx_SetRfDependentMuteMode(long contextValue, int mode); 1426 1427 private static native int nativeJFmRx_GetRfDependentMute(long contextValue); 1428 1429 private static native int nativeJFmRx_SetRdsSystem(long contextValue, int rdsSystem); 1430 1431 private static native int nativeJFmRx_GetRdsSystem(long contextValue); 1432 1433 private static native int nativeJFmRx_SetRdsGroupMask(long contextValue, long groupMask); 1434 1435 private static native int nativeJFmRx_GetRdsGroupMask(long contextValue); 1436 1437 private static native int nativeJFmRx_SetChannelSpacing(long contextValue, int fmChannelSpacing); 1438 1439 private static native int nativeJFmRx_GetChannelSpacing(long contextValue); 1440 1441 private static native int nativeJFmRx_IsValidChannel(long contextValue); 1442 1443 private static native int nativeJFmRx_CompleteScan(long contextValue); 1444 1445 private static native int nativeJFmRx_GetFwVersion(long contextValue); 1446 1447 private static native int nativeJFmRx_GetCompleteScanProgress(long contextValue); 1448 1449 private static native int nativeJFmRx_StopCompleteScan(long contextValue); 1450 1451 /*--------------------------------------------------------------------------- 1452 * -------------------------------- NATIVE PART-------------------------------- 1453 * --------------------------------------------------------------------------- 1454 */ 1455 1456 /*--------------------------------------------------------------------------- 1457 * ---------------------------------------------- Callbacks from the------------- 1458 * JFmRxNative.cpp module ----------------------------------------------------- 1459 */ 1460 1461 @SuppressWarnings("unused") 1462 public static void nativeCb_fmRxRawRDS(long contextValue, int status, int bitInMaskValue, 1463 byte[] groupData) { 1464 1465 //JFmLog.d(TAG, "nativeCb_fmRxRawRDS: entered"); 1466 1467 JFmRx mJFmRx = getJFmRx(contextValue); 1468 1469 if (mJFmRx != null) { 1470 1471 ICallback callback = mJFmRx.callback; 1472 1473 // JFmLog.d(TAG, "nativeCb_fmRxRawRDS: converting callback args"); 1474 1475 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 1476 1477 JFmRxRdsGroupTypeMask bitInMask = JFmUtils.getEnumConst(JFmRxRdsGroupTypeMask.class, 1478 (long) bitInMaskValue); 1479 1480 //JFmLog.d(TAG, "nativeCb_fmRxRawRDS: calling callback"); 1481 1482 callback.fmRxRawRDS(mJFmRx, rxStatus, bitInMask, groupData); 1483 1484 } 1485 } 1486 1487 @SuppressWarnings("unused") 1488 public static void nativeCb_fmRxRadioText(long contextValue, int status, boolean resetDisplay, 1489 byte[] msg1, int len, int startIndex, int repertoire) { 1490 1491 //JFmLog.d(TAG, "nativeCb_fmRxRadioText: entered"); 1492 1493 JFmRx mJFmRx = getJFmRx(contextValue); 1494 1495 if (mJFmRx != null) { 1496 1497 ICallback callback = mJFmRx.callback; 1498 1499 //JFmLog.d(TAG, "nativeCb_fmRxRadioText: converting callback args"); 1500 1501 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 1502 1503 JFmRxRepertoire jRepertoire = JFmUtils.getEnumConst(JFmRxRepertoire.class, repertoire); 1504 1505 //JFmLog.d(TAG, "nativeCb_fmRxRadioText: calling callback"); 1506 1507 callback.fmRxRadioText(mJFmRx, rxStatus, resetDisplay, msg1, len, startIndex, 1508 jRepertoire); 1509 1510 } 1511 1512 } 1513 1514 @SuppressWarnings("unused") 1515 public static void nativeCb_fmRxPiCodeChanged(long contextValue, int status, int piValue) { 1516 1517 //JFmLog.d(TAG, "nativeCb_fmRxPiCodeChanged: entered"); 1518 1519 JFmRx mJFmRx = getJFmRx(contextValue); 1520 1521 if (mJFmRx != null) { 1522 1523 ICallback callback = mJFmRx.callback; 1524 1525 //JFmLog.d(TAG, "nativeCb_fmRxPiCodeChanged: converting callback args"); 1526 1527 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 1528 1529 JFmRxRdsPiCode pi = new JFmRxRdsPiCode(piValue); 1530 1531 //JFmLog.d(TAG, "nativeCb_fmRxPiCodeChanged: calling callback"); 1532 1533 callback.fmRxPiCodeChanged(mJFmRx, rxStatus, pi); 1534 1535 } 1536 1537 } 1538 1539 @SuppressWarnings("unused") 1540 public static void nativeCb_fmRxPtyCodeChanged(long contextValue, int status, int ptyValue) { 1541 1542 //JFmLog.d(TAG, "nativeCb_fmRxPtyCodeChanged: entered"); 1543 1544 JFmRx mJFmRx = getJFmRx(contextValue); 1545 1546 if (mJFmRx != null) { 1547 1548 ICallback callback = mJFmRx.callback; 1549 1550 // JFmLog.d(TAG, "nativeCb_fmRxPtyCodeChanged: converting callback args"); 1551 1552 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 1553 1554 JFmRxRdsPtyCode pty = new JFmRxRdsPtyCode(ptyValue); 1555 1556 //JFmLog.d(TAG, "nativeCb_fmRxPtyCodeChanged: calling callback"); 1557 1558 callback.fmRxPtyCodeChanged(mJFmRx, rxStatus, pty); 1559 1560 } 1561 1562 } 1563 1564 @SuppressWarnings("unused") 1565 public static void nativeCb_fmRxPsChanged(long contextValue, int status, int frequency, 1566 byte[] name, int repertoire) { 1567 1568 //JFmLog.d(TAG, "nativeCb_fmRxPsChanged: entered"); 1569 1570 JFmRx mJFmRx = getJFmRx(contextValue); 1571 1572 if (mJFmRx != null) { 1573 1574 ICallback callback = mJFmRx.callback; 1575 1576 // JFmLog.d(TAG, "nativeCb_fmRxPsChanged: converting callback args"); 1577 1578 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 1579 1580 JFmRxRepertoire jRepertoire = JFmUtils.getEnumConst(JFmRxRepertoire.class, repertoire); 1581 1582 JFmRxFreq jFreq = new JFmRxFreq(frequency); 1583 1584 //JFmLog.d(TAG, "nativeCb_fmRxPsChanged: calling callback"); 1585 1586 callback.fmRxPsChanged(mJFmRx, rxStatus, jFreq, name, jRepertoire); 1587 1588 } 1589 1590 } 1591 1592 @SuppressWarnings("unused") 1593 public static void nativeCb_fmRxMonoStereoModeChanged(long contextValue, int status, 1594 int modeValue) { 1595 1596 //JFmLog.d(TAG, "nativeCb_fmRxMonoStereoModeChanged: entered"); 1597 1598 JFmRx mJFmRx = getJFmRx(contextValue); 1599 1600 if (mJFmRx != null) { 1601 1602 ICallback callback = mJFmRx.callback; 1603 1604 //JFmLog.d(TAG, "nativeCb_fmRxMonoStereoModeChanged: converting callback args"); 1605 1606 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 1607 1608 JFmRxMonoStereoMode monoStereoMode = JFmUtils.getEnumConst(JFmRxMonoStereoMode.class, 1609 modeValue); 1610 1611 //JFmLog.d(TAG, "nativeCb_fmRxMonoStereoModeChanged: calling callback"); 1612 1613 callback.fmRxMonoStereoModeChanged(mJFmRx, rxStatus, monoStereoMode); 1614 1615 } 1616 } 1617 1618 @SuppressWarnings("unused") 1619 public static void nativeCb_fmRxAudioPathChanged(long contextValue, int status) { 1620 1621 //JFmLog.d(TAG, "nativeCb_fmRxAudioPathChanged: entered"); 1622 1623 JFmRx mJFmRx = getJFmRx(contextValue); 1624 1625 if (mJFmRx != null) { 1626 1627 ICallback callback = mJFmRx.callback; 1628 1629 // JFmLog.d(TAG, "nativeCb_fmRxAudioPathChanged: converting callback args"); 1630 1631 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 1632 1633 //JFmLog.d(TAG, "nativeCb_fmRxAudioPathChanged: calling callback"); 1634 1635 callback.fmRxAudioPathChanged(mJFmRx, rxStatus); 1636 1637 } 1638 } 1639 1640 @SuppressWarnings("unused") 1641 public static void nativeCb_fmRxAfSwitchFreqFailed(long contextValue, int status, int piValue, 1642 int tunedFreq, int afFreqValue) { 1643 1644 //JFmLog.d(TAG, "nativeCb_fmRxAfSwitchFreqFailed: entered"); 1645 1646 JFmRx mJFmRx = getJFmRx(contextValue); 1647 1648 if (mJFmRx != null) { 1649 1650 ICallback callback = mJFmRx.callback; 1651 1652 // JFmLog.d(TAG, "nativeCb_fmRxAfSwitchFreqFailed: converting callback args"); 1653 1654 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 1655 1656 JFmRxRdsPiCode pi = new JFmRxRdsPiCode(piValue); 1657 1658 JFmRxFreq tuneFreq = new JFmRxFreq(tunedFreq); 1659 1660 JFmRxAfFreq afFreq = new JFmRxAfFreq(afFreqValue); 1661 1662 //JFmLog.d(TAG, "nativeCb_fmRxAfSwitchFreqFailed: calling callback"); 1663 1664 callback.fmRxAfSwitchFreqFailed(mJFmRx, rxStatus, pi, tuneFreq, afFreq); 1665 1666 } 1667 1668 } 1669 1670 @SuppressWarnings("unused") 1671 public static void nativeCb_fmRxAfSwitchStart(long contextValue, int status, int piValue, 1672 int tunedFreq, int afFreq) { 1673 1674 //JFmLog.d(TAG, "nativeCb_fmRxAfSwitchStart: entered"); 1675 1676 JFmRx mJFmRx = getJFmRx(contextValue); 1677 1678 if (mJFmRx != null) { 1679 1680 ICallback callback = mJFmRx.callback; 1681 1682 // JFmLog.d(TAG, "nativeCb_fmRxAfSwitchStart: converting callback args"); 1683 1684 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 1685 JFmRxRdsPiCode pi = new JFmRxRdsPiCode(piValue); 1686 1687 JFmRxFreq tuneFreq = new JFmRxFreq(tunedFreq); 1688 1689 JFmRxAfFreq aFreq = new JFmRxAfFreq(afFreq); 1690 1691 //JFmLog.d(TAG, "nativeCb_fmRxAfSwitchStart: calling callback"); 1692 1693 callback.fmRxAfSwitchStart(mJFmRx, rxStatus, pi, tuneFreq, aFreq); 1694 1695 } 1696 } 1697 1698 @SuppressWarnings("unused") 1699 public static void nativeCb_fmRxAfListChanged(long contextValue, int status, int piValue, 1700 int[] afList, int afListSize) { 1701 1702 //JFmLog.d(TAG, "nativeCb_fmRxAfListChanged: entered"); 1703 1704 JFmRx mJFmRx = getJFmRx(contextValue); 1705 if (mJFmRx != null) { 1706 1707 ICallback callback = mJFmRx.callback; 1708 1709 // JFmLog.d(TAG, "nativeCb_fmRxAfListChanged: converting callback args"); 1710 1711 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 1712 1713 JFmRxRdsPiCode pi = new JFmRxRdsPiCode(piValue); 1714 1715 JFmRxAfListSize jafListSize = new JFmRxAfListSize(afListSize); 1716 1717 //JFmLog.d(TAG, "nativeCb_fmRxAfListChanged: calling callback"); 1718 1719 callback.fmRxAfListChanged(mJFmRx, rxStatus, pi, afList, jafListSize); 1720 1721 } 1722 1723 } 1724 1725 @SuppressWarnings("unused") 1726 public static void nativeCb_fmRxAfSwitchComplete(long contextValue, int status, int piValue, 1727 int tunedFreq, int afFreq) { 1728 1729 //JFmLog.d(TAG, "nativeCb_fmRxAfSwitchComplete: entered"); 1730 1731 JFmRx mJFmRx = getJFmRx(contextValue); 1732 1733 if (mJFmRx != null) { 1734 1735 ICallback callback = mJFmRx.callback; 1736 1737 //JFmLog.d(TAG, "nativeCb_fmRxAfSwitchComplete: converting callback args"); 1738 1739 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 1740 1741 JFmRxRdsPiCode pi = new JFmRxRdsPiCode(piValue); 1742 1743 JFmRxFreq tuneFreq = new JFmRxFreq(tunedFreq); 1744 1745 JFmRxAfFreq aFreq = new JFmRxAfFreq(afFreq); 1746 1747 //JFmLog.d(TAG, "nativeCb_fmRxAfSwitchComplete: calling callback"); 1748 1749 callback.fmRxAfSwitchComplete(mJFmRx, rxStatus, pi, tuneFreq, aFreq); 1750 1751 } 1752 1753 } 1754 1755 @SuppressWarnings("unused") 1756 public static void nativeCb_fmRxCmdEnable(long contextValue, int status, int cmd, long value) { 1757 1758 //JFmLog.d(TAG, "nativeCb_fmRxCmdEnable: entered"); 1759 1760 JFmRx mJFmRx = getJFmRx(contextValue); 1761 1762 if (mJFmRx != null) { 1763 1764 ICallback callback = mJFmRx.callback; 1765 1766 //JFmLog.d(TAG, "nativeCb_fmRxCmdEnable: converting callback args"); 1767 1768 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 1769 1770 //JFmLog.d(TAG, "nativeCb_fmRxCmdEnable: calling callback"); 1771 1772 callback.fmRxCmdEnable(mJFmRx, rxStatus, cmd, value); 1773 1774 } 1775 1776 } 1777 1778 @SuppressWarnings("unused") 1779 public static void nativeCb_fmRxCmdDisable(long contextValue, int status, int cmd, long value) { 1780 1781 //JFmLog.d(TAG, "nativeCb_fmRxCmdDisable: entered"); 1782 1783 JFmRx mJFmRx = getJFmRx(contextValue); 1784 1785 if (mJFmRx != null) { 1786 1787 ICallback callback = mJFmRx.callback; 1788 1789 //JFmLog.d(TAG, "nativeCb_fmRxCmdDisable: converting callback args"); 1790 1791 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 1792 1793 //JFmLog.d(TAG, "nativeCb_fmRxCmdDisable: calling callback"); 1794 1795 callback.fmRxCmdDisable(mJFmRx, rxStatus, cmd, value); 1796 1797 } 1798 1799 } 1800 1801 @SuppressWarnings("unused") 1802 public static void nativeCb_fmRxCmdEnableAudio(long contextValue, int status, int cmd, 1803 long audioCmd) { 1804 1805 //JFmLog.d(TAG, "nativeCb_fmRxCmdEnableAudio: entered"); 1806 1807 JFmRx mJFmRx = getJFmRx(contextValue); 1808 1809 if (mJFmRx != null) { 1810 1811 ICallback callback = mJFmRx.callback; 1812 1813 //JFmLog.d(TAG, "nativeCb_fmRxCmdEnableAudio: converting callback args"); 1814 1815 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 1816 1817 //JFmLog.d(TAG, "nativeCb_fmRxCmdEnableAudio: calling callback"); 1818 1819 callback.fmRxCmdEnableAudio(mJFmRx, rxStatus, cmd, audioCmd); 1820 1821 } 1822 1823 } 1824 1825 @SuppressWarnings("unused") 1826 public static void nativeCb_fmRxCmdChangeAudioTarget(long contextValue, int status, int cmd, 1827 long audioCmd) { 1828 1829 //JFmLog.d(TAG, "nativeCb_fmRxCmdChangeAudioTarget: entered"); 1830 1831 JFmRx mJFmRx = getJFmRx(contextValue); 1832 1833 if (mJFmRx != null) { 1834 1835 ICallback callback = mJFmRx.callback; 1836 1837 //JFmLog.d(TAG, "nativeCb_fmRxCmdChangeAudioTarget: converting callback args"); 1838 1839 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 1840 1841 //JFmLog.d(TAG, "nativeCb_fmRxCmdChangeAudioTarget: calling callback"); 1842 1843 callback.fmRxCmdChangeAudioTarget(mJFmRx, rxStatus, cmd, audioCmd); 1844 1845 } 1846 1847 } 1848 1849 @SuppressWarnings("unused") 1850 public static void nativeCb_fmRxCmdSetBand(long contextValue, int status, int cmd, long value) { 1851 1852 JFmLog.d(TAG, "nativeCb_fmRxCmdSetBand: entered"); 1853 1854 JFmRx mJFmRx = getJFmRx(contextValue); 1855 1856 if (mJFmRx != null) { 1857 1858 ICallback callback = mJFmRx.callback; 1859 1860 // JFmLog.d(TAG, "nativeCb_fmRxCmdSetBand: converting callback args"); 1861 1862 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 1863 1864 //JFmLog.d(TAG, "nativeCb_fmRxCmdSetBand: calling callback"); 1865 1866 callback.fmRxCmdSetBand(mJFmRx, rxStatus, cmd, value); 1867 1868 } 1869 1870 } 1871 1872 @SuppressWarnings("unused") 1873 public static void nativeCb_fmRxCmdGetBand(long contextValue, int status, int cmd, long value) { 1874 1875 //JFmLog.d(TAG, "nativeCb_fmRxCmdGetBand: entered"); 1876 1877 JFmRx mJFmRx = getJFmRx(contextValue); 1878 1879 if (mJFmRx != null) { 1880 1881 ICallback callback = mJFmRx.callback; 1882 1883 // JFmLog.d(TAG, "nativeCb_fmRxCmdGetBand: converting callback args"); 1884 1885 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 1886 1887 //JFmLog.d(TAG, "nativeCb_fmRxCmdGetBand: calling callback"); 1888 1889 callback.fmRxCmdGetBand(mJFmRx, rxStatus, cmd, value); 1890 1891 } 1892 1893 } 1894 1895 @SuppressWarnings("unused") 1896 public static void nativeCb_fmRxCmdSetMonoStereoMode(long contextValue, int status, int cmd, 1897 long value) { 1898 1899 //JFmLog.d(TAG, "nativeCb_fmRxCmdSetMonoStereoMode: entered"); 1900 1901 JFmRx mJFmRx = getJFmRx(contextValue); 1902 1903 if (mJFmRx != null) { 1904 1905 ICallback callback = mJFmRx.callback; 1906 1907 //JFmLog.d(TAG, "nativeCb_fmRxCmdSetMonoStereoMode: converting callback args"); 1908 1909 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 1910 1911 //JFmLog.d(TAG, "nativeCb_fmRxCmdSetMonoStereoMode: calling callback"); 1912 1913 callback.fmRxCmdSetMonoStereoMode(mJFmRx, rxStatus, cmd, value); 1914 1915 } 1916 1917 } 1918 1919 @SuppressWarnings("unused") 1920 public static void nativeCb_fmRxCmdGetMonoStereoMode(long contextValue, int status, int cmd, 1921 long value) { 1922 1923 //JFmLog.d(TAG, "nativeCb_fmRxCmdGetMonoStereoMode: entered"); 1924 1925 JFmRx mJFmRx = getJFmRx(contextValue); 1926 1927 if (mJFmRx != null) { 1928 1929 ICallback callback = mJFmRx.callback; 1930 1931 //JFmLog.d(TAG, "nativeCb_fmRxCmdGetMonoStereoMode: converting callback args"); 1932 1933 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 1934 1935 //JFmLog.d(TAG, "nativeCb_fmRxCmdGetMonoStereoMode: calling callback"); 1936 1937 callback.fmRxCmdGetMonoStereoMode(mJFmRx, rxStatus, cmd, value); 1938 1939 } 1940 1941 } 1942 1943 @SuppressWarnings("unused") 1944 public static void nativeCb_fmRxCmdGetMuteMode(long contextValue, int status, int cmd, 1945 long value) { 1946 1947 //JFmLog.d(TAG, "nativeCb_fmRxCmdGetMuteMode: entered"); 1948 1949 JFmRx mJFmRx = getJFmRx(contextValue); 1950 1951 if (mJFmRx != null) { 1952 1953 ICallback callback = mJFmRx.callback; 1954 1955 // JFmLog.d(TAG, "nativeCb_fmRxCmdGetMuteMode: converting callback args"); 1956 1957 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 1958 1959 //JFmLog.d(TAG, "nativeCb_fmRxCmdGetMuteMode: calling callback"); 1960 1961 callback.fmRxCmdGetMuteMode(mJFmRx, rxStatus, cmd, value); 1962 1963 } 1964 1965 } 1966 1967 @SuppressWarnings("unused") 1968 public static void nativeCb_fmRxCmdSetMuteMode(long contextValue, int status, int cmd, 1969 long value) { 1970 1971 // JFmLog.d(TAG, "nativeCb_fmRxCmdSetMuteMode: entered"); 1972 1973 JFmRx mJFmRx = getJFmRx(contextValue); 1974 1975 if (mJFmRx != null) { 1976 1977 ICallback callback = mJFmRx.callback; 1978 1979 // JFmLog.d(TAG, "nativeCb_fmRxCmdSetMuteMode: converting callback args"); 1980 1981 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 1982 1983 // JFmLog.d(TAG, "nativeCb_fmRxCmdSetMuteMode: calling callback"); 1984 1985 callback.fmRxCmdSetMuteMode(mJFmRx, rxStatus, cmd, value); 1986 1987 } 1988 1989 } 1990 1991 @SuppressWarnings("unused") 1992 public static void nativeCb_fmRxCmdSetRfDependentMuteMode(long contextValue, int status, 1993 int cmd, long value) { 1994 1995 // JFmLog.d(TAG, "nativeCb_fmRxCmdSetRfDependentMuteMode: entered"); 1996 1997 JFmRx mJFmRx = getJFmRx(contextValue); 1998 1999 if (mJFmRx != null) { 2000 2001 ICallback callback = mJFmRx.callback; 2002 2003 // JFmLog.d(TAG, "nativeCb_fmRxCmdSetRfDependentMuteMode: converting callback args"); 2004 2005 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2006 2007 // JFmLog.d(TAG, "nativeCb_fmRxCmdSetRfDependentMuteMode: calling callback"); 2008 2009 callback.fmRxCmdSetRfDependentMuteMode(mJFmRx, rxStatus, cmd, value); 2010 2011 } 2012 2013 } 2014 2015 @SuppressWarnings("unused") 2016 public static void nativeCb_fmRxCmdGetRfDependentMuteMode(long contextValue, int status, 2017 int cmd, long value) { 2018 2019 // JFmLog.d(TAG, "nativeCb_fmRxCmdGetRfDependentMuteMode: entered"); 2020 2021 JFmRx mJFmRx = getJFmRx(contextValue); 2022 2023 if (mJFmRx != null) { 2024 2025 ICallback callback = mJFmRx.callback; 2026 2027 // JFmLog.d(TAG, "nativeCb_fmRxCmdGetRfDependentMuteMode: converting callback args"); 2028 2029 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2030 2031 // JFmLog.d(TAG, "nativeCb_fmRxCmdGetRfDependentMuteMode: calling callback"); 2032 2033 callback.fmRxCmdGetRfDependentMuteMode(mJFmRx, rxStatus, cmd, value); 2034 2035 } 2036 2037 } 2038 2039 @SuppressWarnings("unused") 2040 public static void nativeCb_fmRxCmdSetRssiThreshhold(long contextValue, int status, int cmd, 2041 long value) { 2042 2043 // JFmLog.d(TAG, "nativeCb_fmRxCmdSetRssiThreshhold: entered"); 2044 2045 JFmRx mJFmRx = getJFmRx(contextValue); 2046 if (mJFmRx != null) { 2047 2048 ICallback callback = mJFmRx.callback; 2049 2050 // JFmLog.d(TAG, "nativeCb_fmRxCmdSetRssiThreshhold: converting callback args"); 2051 2052 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2053 2054 // JFmLog.d(TAG, "nativeCb_fmRxCmdSetRssiThreshhold: calling callback"); 2055 2056 callback.fmRxCmdSetRssiThreshhold(mJFmRx, rxStatus, cmd, value); 2057 2058 } 2059 2060 } 2061 2062 @SuppressWarnings("unused") 2063 public static void nativeCb_fmRxCmdGetRssiThreshhold(long contextValue, int status, int cmd, 2064 long value) { 2065 2066 //JFmLog.d(TAG, "nativeCb_fmRxCmdGetRssiThreshhold: entered"); 2067 2068 JFmRx mJFmRx = getJFmRx(contextValue); 2069 2070 if (mJFmRx != null) { 2071 2072 ICallback callback = mJFmRx.callback; 2073 2074 // JFmLog.d(TAG, "nativeCb_fmRxCmdGetRssiThreshhold: converting callback args"); 2075 2076 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2077 2078 //JFmLog.d(TAG, "nativeCb_fmRxCmdGetRssiThreshhold: calling callback"); 2079 2080 callback.fmRxCmdGetRssiThreshhold(mJFmRx, rxStatus, cmd, value); 2081 2082 } 2083 2084 } 2085 2086 @SuppressWarnings("unused") 2087 public static void nativeCb_fmRxCmdSetDeemphasisFilter(long contextValue, int status, int cmd, 2088 long value) { 2089 2090 //JFmLog.d(TAG, "nativeCb_fmRxCmdSetDeemphasisFilter: entered"); 2091 2092 JFmRx mJFmRx = getJFmRx(contextValue); 2093 2094 if (mJFmRx != null) { 2095 2096 ICallback callback = mJFmRx.callback; 2097 2098 // JFmLog.d(TAG, "nativeCb_fmRxCmdSetDeemphasisFilter: converting callback args"); 2099 2100 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2101 2102 //JFmLog.d(TAG, "nativeCb_fmRxCmdSetDeemphasisFilter: calling callback"); 2103 2104 callback.fmRxCmdSetDeemphasisFilter(mJFmRx, rxStatus, cmd, value); 2105 2106 } 2107 2108 } 2109 2110 @SuppressWarnings("unused") 2111 public static void nativeCb_fmRxCmdGetDeemphasisFilter(long contextValue, int status, int cmd, 2112 long value) { 2113 2114 //JFmLog.d(TAG, "nativeCb_fmRxCmdGetDeemphasisFilter: entered"); 2115 2116 JFmRx mJFmRx = getJFmRx(contextValue); 2117 2118 if (mJFmRx != null) { 2119 2120 ICallback callback = mJFmRx.callback; 2121 2122 // JFmLog.d(TAG, "nativeCb_fmRxCmdGetDeemphasisFilter: converting callback args"); 2123 2124 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2125 2126 //JFmLog.d(TAG, "nativeCb_fmRxCmdGetDeemphasisFilter: calling callback"); 2127 2128 callback.fmRxCmdGetDeemphasisFilter(mJFmRx, rxStatus, cmd, value); 2129 2130 } 2131 2132 } 2133 2134 @SuppressWarnings("unused") 2135 public static void nativeCb_fmRxCmdSetChannelSpacing(long contextValue, int status, int cmd, 2136 long value) { 2137 2138 //JFmLog.d(TAG, "nativeCb_fmRxCmdSetChannelSpacing: entered"); 2139 2140 JFmRx mJFmRx = getJFmRx(contextValue); 2141 2142 if (mJFmRx != null) { 2143 2144 ICallback callback = mJFmRx.callback; 2145 2146 // JFmLog.d(TAG, "nativeCb_fmRxCmdSetChannelSpacing: converting callback args"); 2147 2148 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2149 2150 //JFmLog.d(TAG, "nativeCb_fmRxCmdSetChannelSpacing: calling callback"); 2151 2152 callback.fmRxCmdSetChannelSpacing(mJFmRx, rxStatus, cmd, value); 2153 2154 } 2155 2156 } 2157 2158 @SuppressWarnings("unused") 2159 public static void nativeCb_fmRxCmdGetChannelSpacing(long contextValue, int status, int cmd, 2160 long value) { 2161 2162 // JFmLog.d(TAG, "nativeCb_fmRxCmdGetChannelSpacing: entered"); 2163 2164 JFmRx mJFmRx = getJFmRx(contextValue); 2165 2166 if (mJFmRx != null) { 2167 2168 ICallback callback = mJFmRx.callback; 2169 2170 // JFmLog.d(TAG, "nativeCb_fmRxCmdGetChannelSpacing: converting callback args"); 2171 2172 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2173 2174 // JFmLog.d(TAG, "nativeCb_fmRxCmdGetChannelSpacing: calling callback"); 2175 2176 callback.fmRxCmdGetChannelSpacing(mJFmRx, rxStatus, cmd, value); 2177 2178 } 2179 2180 } 2181 2182 @SuppressWarnings("unused") 2183 public static void nativeCb_fmRxCmdSetVolume(long contextValue, int status, int cmd, long value) { 2184 2185 // JFmLog.d(TAG, "nativeCb_fmRxCmdSetVolume: entered"); 2186 2187 JFmRx mJFmRx = getJFmRx(contextValue); 2188 2189 if (mJFmRx != null) { 2190 2191 ICallback callback = mJFmRx.callback; 2192 2193 // JFmLog.d(TAG, "nativeCb_fmRxCmdSetVolume: converting callback args"); 2194 2195 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2196 2197 // JFmLog.d(TAG, "nativeCb_fmRxCmdSetVolume: calling callback"); 2198 2199 callback.fmRxCmdSetVolume(mJFmRx, rxStatus, cmd, value); 2200 2201 } 2202 2203 } 2204 2205 @SuppressWarnings("unused") 2206 public static void nativeCb_fmRxCmdGetVolume(long contextValue, int status, int cmd, long value) { 2207 2208 // JFmLog.d(TAG, "nativeCb_fmRxCmdGetVolume: entered"); 2209 2210 JFmRx mJFmRx = getJFmRx(contextValue); 2211 2212 if (mJFmRx != null) { 2213 2214 ICallback callback = mJFmRx.callback; 2215 2216 // JFmLog.d(TAG, "nativeCb_fmRxCmdGetVolume: converting callback args"); 2217 2218 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2219 2220 // JFmLog.d(TAG, "nativeCb_fmRxCmdGetVolume: calling callback"); 2221 2222 callback.fmRxCmdGetVolume(mJFmRx, rxStatus, cmd, value); 2223 2224 } 2225 2226 } 2227 2228 @SuppressWarnings("unused") 2229 public static void nativeCb_fmRxCmdTune(long contextValue, int status, int cmd, long value) { 2230 2231 //JFmLog.d(TAG, "nativeCb_fmRxCmdTune: entered"); 2232 2233 JFmRx mJFmRx = getJFmRx(contextValue); 2234 2235 if (mJFmRx != null) { 2236 2237 ICallback callback = mJFmRx.callback; 2238 2239 // JFmLog.d(TAG, "nativeCb_fmRxCmdTune: converting callback args"); 2240 2241 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2242 2243 //JFmLog.d(TAG, "nativeCb_fmRxCmdTune: calling callback"); 2244 2245 callback.fmRxCmdTune(mJFmRx, rxStatus, cmd, value); 2246 2247 } 2248 2249 } 2250 2251 @SuppressWarnings("unused") 2252 public static void nativeCb_fmRxCmdGetTunedFrequency(long contextValue, int status, int cmd, 2253 long value) { 2254 2255 //JFmLog.d(TAG, "nativeCb_fmRxCmdGetTunedFrequency: entered"); 2256 2257 JFmRx mJFmRx = getJFmRx(contextValue); 2258 2259 if (mJFmRx != null) { 2260 2261 ICallback callback = mJFmRx.callback; 2262 2263 // JFmLog.d(TAG, "nativeCb_fmRxCmdGetTunedFrequency: converting callback args"); 2264 2265 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2266 2267 //JFmLog.d(TAG, "nativeCb_fmRxCmdGetTunedFrequency: calling callback"); 2268 2269 callback.fmRxCmdGetTunedFrequency(mJFmRx, rxStatus, cmd, value); 2270 2271 } 2272 2273 } 2274 2275 @SuppressWarnings("unused") 2276 public static void nativeCb_fmRxCmdSeek(long contextValue, int status, int cmd, long value) { 2277 2278 //JFmLog.d(TAG, "nativeCb_fmRxCmdSeek: entered"); 2279 2280 JFmRx mJFmRx = getJFmRx(contextValue); 2281 2282 if (mJFmRx != null) { 2283 2284 ICallback callback = mJFmRx.callback; 2285 2286 // JFmLog.d(TAG, "nativeCb_fmRxCmdSeek: converting callback args"); 2287 2288 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2289 2290 //JFmLog.d(TAG, "nativeCb_fmRxCmdSeek: calling callback"); 2291 2292 callback.fmRxCmdSeek(mJFmRx, rxStatus, cmd, value); 2293 2294 } 2295 2296 } 2297 2298 @SuppressWarnings("unused") 2299 public static void nativeCb_fmRxCmdStopSeek(long contextValue, int status, int cmd, long value) { 2300 2301 //JFmLog.d(TAG, "nativeCb_fmRxCmdStopSeek: entered"); 2302 2303 JFmRx mJFmRx = getJFmRx(contextValue); 2304 2305 if (mJFmRx != null) { 2306 2307 ICallback callback = mJFmRx.callback; 2308 2309 // JFmLog.d(TAG, "nativeCb_fmRxCmdStopSeek: converting callback args"); 2310 2311 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2312 2313 //JFmLog.d(TAG, "nativeCb_fmRxCmdStopSeek: calling callback"); 2314 2315 callback.fmRxCmdStopSeek(mJFmRx, rxStatus, cmd, value); 2316 2317 } 2318 2319 } 2320 2321 @SuppressWarnings("unused") 2322 public static void nativeCb_fmRxCmdGetRssi(long contextValue, int status, int cmd, long value) { 2323 2324 //JFmLog.d(TAG, "nativeCb_fmRxCmdGetRssi: entered"); 2325 2326 JFmRx mJFmRx = getJFmRx(contextValue); 2327 2328 if (mJFmRx != null) { 2329 2330 ICallback callback = mJFmRx.callback; 2331 2332 // JFmLog.d(TAG, "nativeCb_fmRxCmdGetRssi: converting callback args"); 2333 2334 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2335 2336 //JFmLog.d(TAG, "nativeCb_fmRxCmdGetRssi: calling callback"); 2337 2338 callback.fmRxCmdGetRssi(mJFmRx, rxStatus, cmd, value); 2339 2340 } 2341 2342 } 2343 2344 @SuppressWarnings("unused") 2345 public static void nativeCb_fmRxCmdEnableRds(long contextValue, int status, int cmd, long value) { 2346 2347 // JFmLog.d(TAG, "nativeCb_fmRxCmdEnableRds: entered"); 2348 2349 JFmRx mJFmRx = getJFmRx(contextValue); 2350 2351 if (mJFmRx != null) { 2352 2353 ICallback callback = mJFmRx.callback; 2354 2355 // JFmLog.d(TAG, "nativeCb_fmRxCmdEnableRds: converting callback args"); 2356 2357 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2358 2359 // JFmLog.d(TAG, "nativeCb_fmRxCmdEnableRds: calling callback"); 2360 2361 callback.fmRxCmdEnableRds(mJFmRx, rxStatus, cmd, value); 2362 2363 } 2364 2365 } 2366 2367 @SuppressWarnings("unused") 2368 public static void nativeCb_fmRxCmdDisableRds(long contextValue, int status, int cmd, long value) { 2369 2370 // JFmLog.d(TAG, "nativeCb_fmRxCmdDisableRds: entered"); 2371 2372 JFmRx mJFmRx = getJFmRx(contextValue); 2373 2374 if (mJFmRx != null) { 2375 2376 ICallback callback = mJFmRx.callback; 2377 2378 // JFmLog.d(TAG, "nativeCb_fmRxCmdDisableRds: converting callback args"); 2379 2380 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2381 2382 // JFmLog.d(TAG, "nativeCb_fmRxCmdDisableRds: calling callback"); 2383 2384 callback.fmRxCmdDisableRds(mJFmRx, rxStatus, cmd, value); 2385 2386 } 2387 2388 } 2389 2390 @SuppressWarnings("unused") 2391 public static void nativeCb_fmRxCmdGetRdsSystem(long contextValue, int status, int cmd, 2392 long value) { 2393 2394 //JFmLog.d(TAG, "nativeCb_fmRxCmdGetRdsSystem: entered"); 2395 2396 JFmRx mJFmRx = getJFmRx(contextValue); 2397 2398 if (mJFmRx != null) { 2399 2400 ICallback callback = mJFmRx.callback; 2401 2402 // JFmLog.d(TAG, "nativeCb_fmRxCmdGetRdsSystem: converting callback args"); 2403 2404 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2405 2406 //JFmLog.d(TAG, "nativeCb_fmRxCmdGetRdsSystem: calling callback"); 2407 2408 callback.fmRxCmdGetRdsSystem(mJFmRx, rxStatus, cmd, value); 2409 2410 } 2411 2412 } 2413 2414 @SuppressWarnings("unused") 2415 public static void nativeCb_fmRxCmdSetRdsSystem(long contextValue, int status, int cmd, 2416 long value) { 2417 2418 // JFmLog.d(TAG, "nativeCb_fmRxCmdSetRdsSystem: entered"); 2419 2420 JFmRx mJFmRx = getJFmRx(contextValue); 2421 2422 if (mJFmRx != null) { 2423 2424 ICallback callback = mJFmRx.callback; 2425 2426 // JFmLog.d(TAG, "nativeCb_fmRxCmdSetRdsSystem: converting callback args"); 2427 2428 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2429 2430 // JFmLog.d(TAG, "nativeCb_fmRxCmdSetRdsSystem: calling callback"); 2431 2432 callback.fmRxCmdSetRdsSystem(mJFmRx, rxStatus, cmd, value); 2433 2434 } 2435 2436 } 2437 2438 @SuppressWarnings("unused") 2439 public static void nativeCb_fmRxCmdSetRdsGroupMask(long contextValue, int status, int cmd, 2440 long value) { 2441 2442 // JFmLog.d(TAG, "nativeCb_fmRxCmdSetRdsGroupMask: entered"); 2443 2444 JFmRx mJFmRx = getJFmRx(contextValue); 2445 2446 if (mJFmRx != null) { 2447 2448 ICallback callback = mJFmRx.callback; 2449 2450 // JFmLog.d(TAG, "nativeCb_fmRxCmdSetRdsGroupMask: converting callback args"); 2451 2452 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2453 2454 // JFmLog.d(TAG, "nativeCb_fmRxCmdSetRdsGroupMask: calling callback"); 2455 2456 callback.fmRxCmdSetRdsGroupMask(mJFmRx, rxStatus, cmd, value); 2457 2458 } 2459 2460 } 2461 2462 @SuppressWarnings("unused") 2463 public static void nativeCb_fmRxCmdGetRdsGroupMask(long contextValue, int status, int cmd, 2464 long value) { 2465 2466 // JFmLog.d(TAG, "nativeCb_fmRxCmdGetRdsGroupMask: entered"); 2467 2468 JFmRx mJFmRx = getJFmRx(contextValue); 2469 2470 if (mJFmRx != null) { 2471 2472 ICallback callback = mJFmRx.callback; 2473 2474 // JFmLog.d(TAG, "nativeCb_fmRxCmdGetRdsGroupMask: converting callback args"); 2475 2476 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2477 2478 // JFmLog.d(TAG, "nativeCb_fmRxCmdGetRdsGroupMask: calling callback"); 2479 2480 callback.fmRxCmdGetRdsGroupMask(mJFmRx, rxStatus, cmd, value); 2481 2482 } 2483 2484 } 2485 2486 @SuppressWarnings("unused") 2487 public static void nativeCb_fmRxCmdSetRdsAfSwitchMode(long contextValue, int status, int cmd, 2488 long value) { 2489 2490 // JFmLog.d(TAG, "nativeCb_fmRxCmdSetRdsAfSwitchMode: entered"); 2491 2492 JFmRx mJFmRx = getJFmRx(contextValue); 2493 2494 if (mJFmRx != null) { 2495 2496 ICallback callback = mJFmRx.callback; 2497 2498 // JFmLog.d(TAG, "nativeCb_fmRxCmdSetRdsAfSwitchMode: converting callback args"); 2499 2500 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2501 2502 // JFmLog.d(TAG, "nativeCb_fmRxCmdSetRdsAfSwitchMode: calling callback"); 2503 2504 callback.fmRxCmdSetRdsAfSwitchMode(mJFmRx, rxStatus, cmd, value); 2505 2506 } 2507 2508 } 2509 2510 @SuppressWarnings("unused") 2511 public static void nativeCb_fmRxCmdGetRdsAfSwitchMode(long contextValue, int status, int cmd, 2512 long value) { 2513 2514 // JFmLog.d(TAG, "nativeCb_fmRxCmdGetRdsAfSwitchMode: entered"); 2515 2516 JFmRx mJFmRx = getJFmRx(contextValue); 2517 2518 if (mJFmRx != null) { 2519 2520 ICallback callback = mJFmRx.callback; 2521 2522 // JFmLog.d(TAG, "nativeCb_fmRxCmdGetRdsAfSwitchMode: converting callback args"); 2523 2524 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2525 2526 // JFmLog.d(TAG, "nativeCb_fmRxCmdGetRdsAfSwitchMode: calling callback"); 2527 2528 callback.fmRxCmdGetRdsAfSwitchMode(mJFmRx, rxStatus, cmd, value); 2529 2530 } 2531 2532 } 2533 2534 @SuppressWarnings("unused") 2535 public static void nativeCb_fmRxCmdDisableAudio(long contextValue, int status, int cmd, 2536 long value) { 2537 2538 // JFmLog.d(TAG, "nativeCb_fmRxCmdDisableAudio: entered"); 2539 2540 JFmRx mJFmRx = getJFmRx(contextValue); 2541 2542 if (mJFmRx != null) { 2543 2544 ICallback callback = mJFmRx.callback; 2545 2546 // JFmLog.d(TAG, "nativeCb_fmRxCmdDisableAudio: converting callback args"); 2547 2548 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2549 2550 // JFmLog.d(TAG, "nativeCb_fmRxCmdDisableAudio: calling callback"); 2551 2552 callback.fmRxCmdDisableAudio(mJFmRx, rxStatus, cmd, value); 2553 2554 } 2555 2556 } 2557 2558 @SuppressWarnings("unused") 2559 public static void nativeCb_fmRxCmdDestroy(long contextValue, int status, int cmd, long value) { 2560 2561 // JFmLog.d(TAG, "nativeCb_fmRxCmdDestroy: entered"); 2562 2563 JFmRx mJFmRx = getJFmRx(contextValue); 2564 2565 if (mJFmRx != null) { 2566 2567 ICallback callback = mJFmRx.callback; 2568 2569 // JFmLog.d(TAG, "nativeCb_fmRxCmdDestroy: converting callback args"); 2570 2571 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2572 2573 // JFmLog.d(TAG, "nativeCb_fmRxCmdDestroy: calling callback"); 2574 2575 callback.fmRxCmdDestroy(mJFmRx, rxStatus, cmd, value); 2576 2577 } 2578 2579 } 2580 2581 @SuppressWarnings("unused") 2582 public static void nativeCb_fmRxCmdChangeDigitalAudioConfiguration(long contextValue, 2583 int status, int cmd, long value) { 2584 2585 // JFmLog.d(TAG, "nativeCb_fmRxCmdChangeDigitalAudioConfiguration: entered"); 2586 2587 JFmRx mJFmRx = getJFmRx(contextValue); 2588 2589 if (mJFmRx != null) { 2590 2591 ICallback callback = mJFmRx.callback; 2592 2593 // JFmLog.d(TAG, 2594 // "nativeCb_fmRxCmdChangeDigitalAudioConfiguration: converting callback args"); 2595 2596 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2597 2598 // JFmLog.d(TAG, "nativeCb_fmRxCmdChangeDigitalAudioConfiguration: calling callback"); 2599 2600 callback.fmRxCmdChangeDigitalAudioConfiguration(mJFmRx, rxStatus, cmd, value); 2601 2602 } 2603 } 2604 2605 @SuppressWarnings("unused") 2606 public static void nativeCb_fmRxCompleteScanDone(long contextValue, int status, 2607 int numOfChannels, int[] channelsData) { 2608 2609 //JFmLog.d(TAG, "nativeCb_fmRxCompleteScanDone: entered"); 2610 2611 JFmRx mJFmRx = getJFmRx(contextValue); 2612 2613 if (mJFmRx != null) { 2614 2615 ICallback callback = mJFmRx.callback; 2616 2617 // JFmLog.d(TAG, "nativeCb_fmRxCompleteScanDone: converting callback args"); 2618 2619 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2620 2621 //JFmLog.d(TAG, "nativeCb_fmRxCompleteScanDone: calling callback"); 2622 2623 callback.fmRxCompleteScanDone(mJFmRx, rxStatus, numOfChannels, channelsData); 2624 2625 } 2626 2627 } 2628 2629 @SuppressWarnings("unused") 2630 public static void nativeCb_fmRxCmdStopCompleteScan(long contextValue, int status, int cmd, 2631 long value) { 2632 2633 // JFmLog.d(TAG, "nativeCb_fmRxCmdStopCompleteScan: entered"); 2634 2635 JFmRx mJFmRx = getJFmRx(contextValue); 2636 2637 if (mJFmRx != null) { 2638 2639 ICallback callback = mJFmRx.callback; 2640 2641 // JFmLog.d(TAG, "nativeCb_fmRxCmdStopCompleteScan: converting callback args"); 2642 2643 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2644 2645 // JFmLog.d(TAG, "nativeCb_fmRxCmdStopCompleteScan: calling callback"); 2646 2647 callback.fmRxCmdStopCompleteScan(mJFmRx, rxStatus, cmd, value); 2648 2649 } 2650 2651 } 2652 2653 @SuppressWarnings("unused") 2654 public static void nativeCb_fmRxCmdIsValidChannel(long contextValue, int status, int cmd, 2655 long value) { 2656 2657 // JFmLog.d(TAG, "nativeCb_fmRxCmdIsValidChannel: entered"); 2658 2659 JFmRx mJFmRx = getJFmRx(contextValue); 2660 2661 if (mJFmRx != null) { 2662 2663 ICallback callback = mJFmRx.callback; 2664 2665 // JFmLog.d(TAG, "nativeCb_fmRxCmdIsValidChannel: converting callback args"); 2666 2667 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2668 2669 // JFmLog.d(TAG, "nativeCb_fmRxIsValidChannel: calling callback"); 2670 2671 callback.fmRxCmdIsValidChannel(mJFmRx, rxStatus, cmd, value); 2672 2673 } 2674 2675 } 2676 2677 @SuppressWarnings("unused") 2678 public static void nativeCb_fmRxCmdGetFwVersion(long contextValue, int status, int cmd, 2679 long value) { 2680 2681 // JFmLog.d(TAG, "nativeCb_fmRxCmdGetFwVersion: entered"); 2682 2683 JFmRx mJFmRx = getJFmRx(contextValue); 2684 2685 if (mJFmRx != null) { 2686 2687 ICallback callback = mJFmRx.callback; 2688 2689 // JFmLog.d(TAG, "nativeCb_fmRxCmdGetFwVersion: converting callback args"); 2690 2691 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2692 2693 // JFmLog.d(TAG, "nativeCb_fmRxCmdGetFwVersion: calling callback"); 2694 2695 callback.fmRxCmdGetFwVersion(mJFmRx, rxStatus, cmd, value); 2696 2697 } 2698 2699 } 2700 2701 @SuppressWarnings("unused") 2702 public static void nativeCb_fmRxCmdGetCompleteScanProgress(long contextValue, int status, 2703 int cmd, long value) { 2704 2705 // JFmLog.d(TAG, "nativeCb_fmRxCmdGetCompleteScanProgress: entered"); 2706 2707 JFmRx mJFmRx = getJFmRx(contextValue); 2708 2709 if (mJFmRx != null) { 2710 2711 ICallback callback = mJFmRx.callback; 2712 2713 // JFmLog.d(TAG, "nativeCb_fmRxCmdGetCompleteScanProgress: converting callback args"); 2714 2715 JFmRxStatus rxStatus = JFmUtils.getEnumConst(JFmRxStatus.class, status); 2716 2717 // JFmLog.d(TAG, "nativeCb_fmRxCmdGetCompleteScanProgress: calling callback"); 2718 2719 callback.fmRxCmdGetCompleteScanProgress(mJFmRx, rxStatus, cmd, value); 2720 2721 } 2722 2723 } 2724 2725 /****************************************************************************************** 2726 * Private utility functions 2727 *******************************************************************************************/ 2728 2729 private static JFmRx getJFmRx(long contextValue) { 2730 JFmRx jFmRx; 2731 2732 JFmContext profileContext = new JFmContext(contextValue); 2733 2734 if (mRxContextsTable.containsKey(profileContext)) { 2735 jFmRx = mRxContextsTable.get(profileContext); 2736 } else { 2737 JFmLog.e(TAG, "JFmRx: Failed mapping context " + contextValue + " to a callback"); 2738 jFmRx = null; 2739 } 2740 2741 return jFmRx; 2742 } 2743 2744 } /* End class */ 2745