ServiceName PS_Final;
ServiceName PS_Buffered;
+bool is_ps_event_received = false;
+bool is_rt_event_received = false;
+
unsigned char rt_flag;
unsigned char ps_flag;
radio_state = FM_RADIO_ON;
}
+ServiceName FmRadioController_slsi::GetPs() {
+ is_ps_event_received = false;
+ return PS_Final;
+}
+
+RadioText FmRadioController_slsi::GetLrText() {
+ is_rt_event_received = false;
+ return RT_Final;
+}
+
+int FmRadioController_slsi::ReadRDS() {
+ int ret = 0;
+
+ if (is_ps_event_received)
+ ret |= RDS_EVT_PS_UPDATE;
+ if (is_rt_event_received)
+ ret |= RDS_EVT_RT_UPDATE;
+
+ return ret;
+}
+
/*******************************************************************************
*
* Functions about RDS, AF, and DNS
if ((RT_Final.bValidated == 1) || (RT_Final.bValidated % 10) == 0) {
strcpy(final_rds_data[test_data_index_rds].RadioText, RT_Final.Text);
rds_flag = 1;
+ is_rt_event_received = true;
}
}
}
if ((PS_Final.bValidated == 2) || (PS_Final.bValidated % 10) == 0) {
strcpy(final_rds_data[test_data_index_rds].StationName, PS_Final.Text);
rds_flag = 1;
+ is_ps_event_received = true;
}
}
}
FM_RADIO_RDS_BLER,
};
+typedef enum {
+ RDS_EVT_UPDATE = 0x0001,
+ RDS_EVT_PI_UPDATE = 0x0002,
+ RDS_EVT_PTY_UPDATE = 0x0004,
+ RDS_EVT_PS_UPDATE = 0x0008,
+ RDS_EVT_RT_UPDATE = 0x0040,
+ RDS_EVT_AF_JUMP = 0x0080,
+ RDS_EVT_AF_LIST = 0x0100,
+ RDS_EVT_AF_LIST_UPDATE = 0x0200,
+ RDS_EVT_RDS_AVL = 0x2000,
+ RDS_EVT_RDS_NOT_AVL = 0x4000,
+} RdsEvts;
+
#if !defined(FM_RADIO_TEST_MODE)
extern void RDSDataReceived(Final_RDS_data rdsData);
extern void RTPlusDataReceived(RTPlus_data rtplusData);
int GetSNR_th();
int GetCnt_th();
void setScanning(bool value);
+
+ ServiceName GetPs();
+ RadioText GetLrText();
+ int ReadRDS();
};
#endif /* __FM_RADIO_CONTROLLER_SLSI_H__ */
jshort readRds(JNIEnv *env __unused, jobject thiz __unused)
{
- ALOGD("%s not supported \n", __func__);
+ ALOGI("%s \n", __func__);
- return JNI_FALSE;
+ return pFMRadio->ReadRDS();
}
jbyteArray getPs(JNIEnv *env, jobject thiz __unused)
{
ALOGI("%s \n", __func__);
- // TODO
+
jbyteArray PSName;
- uint8_t *rt = NULL;
- int rt_len = 0;
- PSName = env->NewByteArray(rt_len);
- env->SetByteArrayRegion(PSName, 0, rt_len, (const jbyte*)rt);
+ ServiceName ps = pFMRadio->GetPs();
+ PSName = env->NewByteArray(ps.iLenght);
+ env->SetByteArrayRegion(PSName, 0, ps.iLenght, (const jbyte*)ps.Text);
+
return PSName;
}
jbyteArray getLrText(JNIEnv *env, jobject thiz __unused)
{
ALOGI("%s \n", __func__);
- // TODO
- jbyteArray PSName;
- uint8_t *rt = NULL;
- int rt_len = 0;
- PSName = env->NewByteArray(rt_len);
- env->SetByteArrayRegion(PSName, 0, rt_len, (const jbyte*)rt);
- return PSName;
+
+ jbyteArray SName;
+ RadioText rt = pFMRadio->GetLrText();
+ SName = env->NewByteArray(rt.iLenght);
+ env->SetByteArrayRegion(SName, 0, rt.iLenght, (const jbyte*)rt.Text);
+
+ return SName;
}
jshort activeAf(JNIEnv *env __unused, jobject thiz __unused)
jint isRdsSupport(JNIEnv *env __unused, jobject thiz __unused)
{
- ALOGD("%s not supported \n", __func__);
+ ALOGI("%s \n", __func__);
- return JNI_FALSE;
+ return JNI_TRUE;
}
jint switchAntenna(JNIEnv *env __unused, jobject thiz __unused, jint antenna __unused)