include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
- FmRadioController_slsi.cpp
+ FmRadioController_slsi.cpp \
libfm_jni.cpp
LOCAL_SHARED_LIBRARIES := \
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/poll.h>
-#include <utils/Log.h>
+#include <log/log.h>
//#include <linux/videodev2.h>
#include "FmRadioController_slsi.h"
long channel_limit_low;
long channel_limit_high;
+unsigned char test_read_data[TEST_DATA_SIZE][12];
+radio_data_t test_radio_data[TEST_DATA_SIZE];
+struct PIECC_data test_piecc[TEST_DATA_SIZE];
+struct RTPlus_data test_rtplus[TEST_DATA_SIZE];
+struct Final_RDS_data final_rds_data[10];
+
+RadioText RT_Final;
+RadioText RT_Buffered;
+ServiceName PS_Final;
+ServiceName PS_Buffered;
+
+unsigned char rt_flag;
+unsigned char ps_flag;
+
+unsigned int test_data_index;
+unsigned int test_data_index_rtplus;
+unsigned int test_data_index_rds;
+
/*******************************************************************************
*
* Static functions to access device driver of kernel
struct v4l2_control ctrl;
int ret;
- ALOGD("FmRadioController:fm_radio_set_control: id(%d) val(%d)\n", id, val);
+ ALOGD("FmRadioController:fm_radio_set_control: id(%d) val(%ld)\n", id, val);
ctrl.id = id;
if (val)
{
int ret;
- ALOGI("FmRadioController::TuneChannel: %d\n", channel);
+ ALOGI("FmRadioController::TuneChannel: %ld\n", channel);
ret = fm_radio_check_state(&radio_state);
if (ret < 0)
*/
void FmRadioController_slsi::SetVolume(long volume)
{
- int ret;
-
- ALOGI("FmRadioController::SetVolume: %d\n", volume);
+ ALOGI("FmRadioController::SetVolume: %ld\n", volume);
current_volume = volume;
}
long FmRadioController_slsi::GetVolume()
{
- ALOGI("FmRadioController::GetVolume: %d\n", current_volume);
+ ALOGI("FmRadioController::GetVolume: %ld\n", current_volume);
return current_volume;
}
long val_deconstant;
int ret;
- ALOGI("FmRadioController::SetDeConstant: %d\n", DeConstant);
+ ALOGI("FmRadioController::SetDeConstant: %ld\n", DeConstant);
ret = fm_radio_check_state(&radio_state);
if (ret < 0)
val_deconstant = FM_RADIO_DE_TIME_CONSTANT_0;
break;
default:
- ALOGE("FmRadioController::SetDeConstant: [%d] is not supported\n", DeConstant);
+ ALOGE("FmRadioController::SetDeConstant: [%ld] is not supported\n", DeConstant);
goto fail;
}
if (ret < 0)
goto fail;
- ALOGI("FmRadioController::setDeConstant: set[%d] success\n", val_deconstant);
+ ALOGI("FmRadioController::setDeConstant: set[%ld] success\n", val_deconstant);
fail:
if (radio_state != FM_RADIO_STOP)
if (value > 127)
value |= 0xFFFFFF00;
- ALOGI("FmRadioController::GetCurrentRSSI: %d\n", value);
+ ALOGI("FmRadioController::GetCurrentRSSI: %ld\n", value);
done:
if (radio_state != FM_RADIO_STOP)
goto done;
}
- ALOGI("FmRadioController::GetCurrentSNR: %d\n", value);
+ ALOGI("FmRadioController::GetCurrentSNR: %ld\n", value);
done:
if (radio_state != FM_RADIO_STOP)
unsigned char crssi;
int ret;
- ALOGI("FmRadioController::SetCurrentRSSI: %d\n", rssi);
+ ALOGI("FmRadioController::SetCurrentRSSI: %ld\n", rssi);
ret = fm_radio_check_state(&radio_state);
if (ret < 0)
if (ret < 0)
goto fail;
- ALOGI("FmRadioController::SetCurrentRSSI: set[%d] success\n", rssi);
+ ALOGI("FmRadioController::SetCurrentRSSI: set[%ld] success\n", rssi);
fail:
if (radio_state != FM_RADIO_STOP)
goto done;
}
- ALOGI("FmRadioController::GetSeekMode: %d\n", seek_mode);
+ ALOGI("FmRadioController::GetSeekMode: %ld\n", seek_mode);
done:
if (radio_state != FM_RADIO_STOP)
{
int ret;
- ALOGI("FmRadioController::SetSeekMode %d\n", seek_mode);
+ ALOGI("FmRadioController::SetSeekMode %ld\n", seek_mode);
ret = fm_radio_check_state(&radio_state);
if (ret < 0)
if (ret < 0)
goto fail;
- ALOGI("FmRadioController::SetSeekMode: set[%d] success\n", seek_mode);
+ ALOGI("FmRadioController::SetSeekMode: set[%ld] success\n", seek_mode);
fail:
if (radio_state != FM_RADIO_STOP)
struct PIECC_data piecc_data;
struct Final_RDS_data final_rds_data;
struct RTPlus_data rtplus_data;
+#if !defined(FM_RADIO_TEST_MODE)
unsigned short checkFlag = 0;
+#endif
int i;
memset(&r_data, 0, sizeof(radio_data_t));
******************************************************************************/
void FmRadioController_slsi::SetSeekRSSI(long freq)
{
- ALOGI("FmRadioController::SetSeekRSSI: freq:%d\n", freq);
+ ALOGI("FmRadioController::SetSeekRSSI: freq:%ld\n", freq);
}
void FmRadioController_slsi::SetSeekSNR(long freq)
{
- ALOGI("FmRadioController::SetSeekSNR: freq:%d\n", freq);
+ ALOGI("FmRadioController::SetSeekSNR: freq:%ld\n", freq);
}
void FmRadioController_slsi::setScanning(bool value)
static FmRadioController_slsi * pFMRadio = NULL;
-jboolean openDev(JNIEnv *env, jobject thiz)
+jboolean openDev(JNIEnv *env __unused, jobject thiz __unused)
{
pFMRadio = new FmRadioController_slsi();
return JNI_FALSE;
}
-jboolean closeDev(JNIEnv *env, jobject thiz)
+jboolean closeDev(JNIEnv *env __unused, jobject thiz __unused)
{
delete pFMRadio;
pFMRadio = NULL;
return JNI_TRUE;
}
-jboolean powerUp(JNIEnv *env, jobject thiz, jfloat freq)
+jboolean powerUp(JNIEnv *env __unused, jobject thiz __unused, jfloat freq)
{
pFMRadio->TuneChannel((int)(freq * 1000.00000000));
ALOGI("%s [freq=%d] \n", __func__, (int)freq);
return JNI_TRUE;
}
-jboolean powerDown(JNIEnv *env, jobject thiz, jint type)
+jboolean powerDown(JNIEnv *env __unused, jobject thiz __unused, jint type __unused)
{
ALOGI("%s \n", __func__);
return JNI_TRUE;
}
-jboolean tune(JNIEnv *env, jobject thiz, jfloat freq)
+jboolean tune(JNIEnv *env __unused, jobject thiz __unused, jfloat freq)
{
pFMRadio->TuneChannel((int)(freq * 1000.00000000));
ALOGI("%s [freq=%d] \n", __func__, (int)freq);
return JNI_TRUE;
}
-jfloat seek(JNIEnv *env, jobject thiz, jfloat freq, jboolean isUp) //jboolean isUp;
+jfloat seek(JNIEnv *env __unused, jobject thiz __unused, jfloat freq __unused, jboolean isUp)
{
int ret;
- if (isup == JNI_TRUE) {
+ if (isUp == JNI_TRUE) {
ret = pFMRadio->SeekUp();
} else {
ret = pFMRadio->SeekDown();
return roundf((ret/1000.00F) * 100) / 100;
}
-jshortArray autoScan(JNIEnv *env, jobject thiz)
+jshortArray autoScan(JNIEnv *env __unused, jobject thiz __unused)
{
ALOGD("%s not supported \n", __func__);
return JNI_FALSE;
}
-jshort readRds(JNIEnv *env, jobject thiz)
+jshort readRds(JNIEnv *env __unused, jobject thiz __unused)
{
ALOGD("%s not supported \n", __func__);
return JNI_FALSE;
}
-jbyteArray getPs(JNIEnv *env, jobject thiz)
+jbyteArray getPs(JNIEnv *env, jobject thiz __unused)
{
ALOGI("%s \n", __func__);
// TODO
return PSName;
}
-jbyteArray getLrText(JNIEnv *env, jobject thiz)
+jbyteArray getLrText(JNIEnv *env, jobject thiz __unused)
{
ALOGI("%s \n", __func__);
// TODO
return PSName;
}
-jshort activeAf(JNIEnv *env, jobject thiz)
+jshort activeAf(JNIEnv *env __unused, jobject thiz __unused)
{
ALOGI("%s \n", __func__);
return roundf((ret/1000.00F) * 100) / 100;
}
-jshortArray getAFList(JNIEnv *env, jobject thiz)
+jshortArray getAFList(JNIEnv *env __unused, jobject thiz __unused)
{
ALOGD("%s not supported \n", __func__);
return JNI_FALSE;
}
-jint setRds(JNIEnv *env, jobject thiz, jboolean rdson)
+jint setRds(JNIEnv *env __unused, jobject thiz __unused, jboolean rdson)
{
if (rdson == JNI_TRUE) {
pFMRadio->EnableRDS();
return JNI_TRUE;
}
-jboolean stopScan(JNIEnv *env, jobject thiz)
+jboolean stopScan(JNIEnv *env __unused, jobject thiz __unused)
{
ALOGD("%s not supported \n", __func__);
return JNI_TRUE;
}
-jint setMute(JNIEnv *env, jobject thiz, jboolean mute)
+jint setMute(JNIEnv *env __unused, jobject thiz __unused, jboolean mute)
{
if (mute == JNI_TRUE) {
pFMRadio->MuteOn();
return JNI_TRUE;
}
-jint isRdsSupport(JNIEnv *env, jobject thiz)
+jint isRdsSupport(JNIEnv *env __unused, jobject thiz __unused)
{
ALOGD("%s not supported \n", __func__);
return JNI_FALSE;
}
-jint switchAntenna(JNIEnv *env, jobject thiz, jint antenna)
+jint switchAntenna(JNIEnv *env __unused, jobject thiz __unused, jint antenna __unused)
{
ALOGD("%s not supported \n", __func__);
void* venv;
} UnionJNIEnvToVoid;
-jint JNI_OnLoad(JavaVM* vm, void* reserved)
+jint JNI_OnLoad(JavaVM* vm, void* reserved __unused)
{
UnionJNIEnvToVoid uenv;
uenv.venv = NULL;