aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Hsu <ryan.hsu@telink-semi.com>2023-04-06 23:36:22 -0700
committerRyan Hsu <ryan.hsu@telink-semi.com>2023-04-06 23:39:01 -0700
commitaef07ae9e16b7d91cc25790882a73e27ca3e86ba (patch)
tree3cad88dd68d6bdbd4912c0bd407e8a42c5435eb7
parentce5fe4540f30d0f16d4edbc6f1e8372b8e070297 (diff)
downloadrefDesignRcu-aef07ae9e16b7d91cc25790882a73e27ca3e86ba.tar.gz
Android TV Reference Remote
Check in SDK based on Telink 8278 chipset, solution provided by Telink Semiconductor (Shanghai) Co., Ltd. This source code drop contains the open source software. The libraries, compiler toolchain and other binaries dependencies are hosted by Telink. ATTENTION: Please read the “readme” file in the root directory after downloading this SDK for instructions on getting/setting up the tools, libraries, and binaries necessary for building the SDK, and all the reference design files. Software version: 2.14 v2.14 Library version | lib name | origin | | :-------------------: | :-----------------------: | | libfirmware_encrypt.a | ble SDK V3.4.2 | | liblt_8278.a | ble SDK V3.4.2.0 | | libapp_ota.a | google BLE RCU SDK v2.08 | v2.14 Changes - Enable Active Remote Timeout function - Speed up google voice triggered by OK button - Fixed the issue of not reconnecting after OTA - Fixed test mode issue BYPASS_INCLUSIVE_LANGUAGE_REASON=tech_terms. No-Typo-Check: name in lib. Change-Id: I0395167f93ea191e4ab9d69c52d5b1ddc935d223
-rw-r--r--application/audio/gl_audio.c12
-rw-r--r--application/audio/gl_audio.h3
-rw-r--r--vendor/827x_ble_remote/app.c9
-rw-r--r--vendor/827x_ble_remote/app_att.c17
-rw-r--r--vendor/827x_ble_remote/app_find_me/app_fms.c31
-rw-r--r--vendor/827x_ble_remote/app_ui.c17
-rw-r--r--vendor/827x_ble_remote/app_ui.h4
-rw-r--r--vendor/827x_ble_remote/main.c8
-rw-r--r--version.h2
9 files changed, 84 insertions, 19 deletions
diff --git a/application/audio/gl_audio.c b/application/audio/gl_audio.c
index 096d750..575e3a5 100644
--- a/application/audio/gl_audio.c
+++ b/application/audio/gl_audio.c
@@ -219,6 +219,10 @@ void google_voice_on_request(){
if(prevent_repeat_trigger_on_request_tick && (!clock_time_exceed(prevent_repeat_trigger_on_request_tick,PREVENT_TIME*1000))) return;
prevent_repeat_trigger_on_request_tick = clock_time()|1;
google_voice_ctl |= FLAG_GOOGLE_SEARCH;
+
+ /* 221116 by ken. Record delay PM Start Time. The delay condition is to press the ASSIST and CENTER buttons */
+ extern u32 g_delay_en_pm;
+ g_delay_en_pm = clock_time()|1;
}
/**
@@ -464,6 +468,9 @@ void google_voice_v0p4(rf_packet_att_data_t *pw){
*/
u8 verify_stream_id(u8 id){
+ /* 221129 by ken. Prevent infinite EXTEND. So only accept EXTEND requests during active. */
+ if(0 == flag_active_mic_open) return 4;
+
switch(id){
case 0x00: // Check if start reason is on-request.
{
@@ -505,6 +512,11 @@ void google_voice_v1p0(rf_packet_att_data_t *pw){
if(!flag_active_mic_open){
printf("mic is not activated\n");
+
+ /* 221116 by ken. enable 4.6.2 Active Remote Timeout */
+ google_voice_ctl |= FLAG_GOOGLE_OPEN_ERROR;
+ mic_open_error_code = ERROR_RCU_NOT_ACTIVE;
+ return;
}
u8 mic_mode = pw->dat[1];
diff --git a/application/audio/gl_audio.h b/application/audio/gl_audio.h
index 3a05388..370bb42 100644
--- a/application/audio/gl_audio.h
+++ b/application/audio/gl_audio.h
@@ -57,7 +57,8 @@
****************** google voice v0.4 *********************
**************************************************************/
-#define APP_AUDIO_GOOGLE_TIMEOUT1 60000000 //60s //1000000 // 1s
+/* 221129 by ken. Reduce the window time(60s to 30s) to receive MIC OPEN */
+#define APP_AUDIO_GOOGLE_TIMEOUT1 30000000 // 60s //1000000 // 1s
#define APP_AUDIO_GOOGLE_TIMEOUT2 15000000 // 15s
#define PLAYBACK_MODE_THRESHOLD1 4 //16k audio change to 8k audio
diff --git a/vendor/827x_ble_remote/app.c b/vendor/827x_ble_remote/app.c
index 0754def..626c328 100644
--- a/vendor/827x_ble_remote/app.c
+++ b/vendor/827x_ble_remote/app.c
@@ -880,6 +880,9 @@ void app_phy_update_complete_event(u8 e,u8 *p, int n)
extern u32 drive_pins[];
void blt_pm_proc(void)
{
+ /* 221116 by ken */
+ app_ui_check_delay_en_pm();
+
#if(BLE_REMOTE_PM_ENABLE)
u8 time=0;
@@ -1006,6 +1009,12 @@ void blt_pm_proc(void)
#endif
}
+ /* The button has been released and g_delay_en_pm is not 0 */
+ if((0 == key_not_released) && g_delay_en_pm){
+ /* 221116 by ken. A short latency is required during the validity period of the delay PM.
+ * In order to quickly receive the mic open command of GOOGLE voice */
+ bls_pm_setManualLatency(5);
+ }
#if 1 //deepsleep
if(sendTerminate_before_enterDeep == 1){ //sending Terminate and wait for ack before enter deepsleep
diff --git a/vendor/827x_ble_remote/app_att.c b/vendor/827x_ble_remote/app_att.c
index 341e7c9..3a33622 100644
--- a/vendor/827x_ble_remote/app_att.c
+++ b/vendor/827x_ble_remote/app_att.c
@@ -774,7 +774,7 @@ int app_ota_handle(void * p){
};
#if (MP_TEST_MODE)
- static const attribute_t my_test_dome_Attributes[] = {
+ static const attribute_t my_test_demo_Attributes[] = {
{ATT_END_H - 1, 0,0,0,0,0}, // total num of attribute
@@ -928,6 +928,19 @@ int app_ota_handle(void * p){
{0,ATT_PERMISSIONS_RDWR,2,0,(u8*)(&clientCharacterCfgUUID), 0, &app_ir_callback},
#endif
+#if FIND_ME_ENABLE
+ {6,ATT_PERMISSIONS_READ,2,16,(u8*)(&my_primaryServiceUUID), (u8*)(&FMS_Server_UUID), 0},
+
+ {0,ATT_PERMISSIONS_READ,2,sizeof(my_fms_CharCtlVal),(u8*)(&my_characterUUID), (u8*)(my_fms_CharCtlVal), 0},
+ {0,ATT_PERMISSIONS_RDWR,16,2,(u8*)(&FMS_Char_UUID_CTL),(u8 *) g_p_app_fms_ctrl_val, &app_fms_att_ctl_cb},
+
+ {0,ATT_PERMISSIONS_READ,2,sizeof(my_fms_CharDataVal),(u8*)(&my_characterUUID),(u8*)(my_fms_CharDataVal), 0},
+ {0,ATT_PERMISSIONS_RDWR,16,2,(u8*)(&FMS_Char_UUID_DATA),(u8 *)g_p_app_fms_data_val, &app_fms_att_data_cb},
+ {0,ATT_PERMISSIONS_RDWR,2,sizeof(my_fms_data_ccc),(u8*)(&clientCharacterCfgUUID),(u8*)(&my_fms_data_ccc), &att_ccc_control},
+
+#endif
+
+
/////////////////////////////////// 9. TEST MODE ///////////////////////////////////////////////////
// 004E - 0051 (78-81)
{4, ATT_PERMISSIONS_READ, 2, 16, (u8*)(&my_primaryServiceUUID), (u8*)(&my_TestModeServiceUUID), 0},
@@ -942,7 +955,7 @@ int app_ota_handle(void * p){
void my_att_init (void)
{
#if (MP_TEST_MODE)
- if (test_get_mode() == MODE_TEST) bls_att_setAttributeTable((u8 *)my_test_dome_Attributes);
+ if (test_get_mode() == MODE_TEST) bls_att_setAttributeTable((u8 *)my_test_demo_Attributes);
else
#endif
bls_att_setAttributeTable ((u8 *)my_Attributes);
diff --git a/vendor/827x_ble_remote/app_find_me/app_fms.c b/vendor/827x_ble_remote/app_find_me/app_fms.c
index 1853e63..cb31f90 100644
--- a/vendor/827x_ble_remote/app_find_me/app_fms.c
+++ b/vendor/827x_ble_remote/app_find_me/app_fms.c
@@ -198,32 +198,35 @@ void app_fms_adv_settings(u16 interval_min, u16 interval_max){
smp_param_save_t bondInfo;
bls_smp_param_loadByIndex( bond_number - 1, &bondInfo); //get the latest bonding device (index: bond_number-1 )
+ ll_resolvingList_reset();
ll_resolvingList_add(bondInfo.peer_id_adrType,bondInfo.peer_id_addr,bondInfo.peer_irk,bondInfo.local_irk);
ll_whiteList_reset();
- u8 status = 0;
+ u8 status=0,rpa_flag=0;
+ if (memcmp(bondInfo.peer_id_addr, bondInfo.peer_addr, 6) == 0)
+ {
+ rpa_flag = 0;
+ }
+ else
+ {
+ extern u8 en_slave_rpa;
+ if(en_slave_rpa == 0)
+ rpa_flag = 0;
+ else
+ rpa_flag = 1;
+ }
// TODO check setting host address
- if (memcmp(bondInfo.peer_id_addr, bondInfo.peer_addr, 6) == 0){
+ if (0 == rpa_flag){
+ ll_whiteList_add(bondInfo.peer_addr_type,bondInfo.peer_addr);
status = bls_ll_setAdvParam(interval_min, interval_max,
ADV_TYPE_CONNECTABLE_DIRECTED_LOW_DUTY, OWN_ADDRESS_PUBLIC,
bondInfo.peer_addr_type, bondInfo.peer_addr,
BLT_ENABLE_ADV_ALL,
ADV_FP_NONE);
}else{
- ll_resolvingList_reset();
- status = ll_resolvingList_add(bondInfo.peer_id_adrType, bondInfo.peer_id_addr, bondInfo.peer_irk, bondInfo.local_irk);
- status = ll_resolvingList_setAddrResolutionEnable(1);
-
- extern u8 en_slave_rpa;
- if(0 == en_slave_rpa) {
- app_own_address_type = OWN_ADDRESS_RESOLVE_PRIVATE_PUBLIC;
- }else{
- app_own_address_type = OWN_ADDRESS_PUBLIC;
- }
-
status = bls_ll_setAdvParam(interval_min, interval_max,
- ADV_TYPE_CONNECTABLE_DIRECTED_LOW_DUTY, app_own_address_type,
+ ADV_TYPE_CONNECTABLE_DIRECTED_LOW_DUTY, OWN_ADDRESS_RESOLVE_PRIVATE_PUBLIC,
bondInfo.peer_id_adrType, bondInfo.peer_id_addr,
BLT_ENABLE_ADV_ALL,
ADV_FP_NONE);
diff --git a/vendor/827x_ble_remote/app_ui.c b/vendor/827x_ble_remote/app_ui.c
index 5f2b862..e8f3bfa 100644
--- a/vendor/827x_ble_remote/app_ui.c
+++ b/vendor/827x_ble_remote/app_ui.c
@@ -73,6 +73,10 @@ _attribute_data_retention_ u8 ota_flag = 0; //0:pause 1:continue
_attribute_data_retention_ u8 testmode_key_seq[5]={0};
_attribute_data_retention_ u8 testmode_key_seq_count=0;
+/* 221116 by ken. This variable is used to wait for google voice mic open cmd */
+_attribute_data_retention_ u32 g_delay_en_pm = 0;
+
+
extern u8 wakeup_key_keycount;
extern u8 comb_key_keyid[9];
extern u32 latest_user_event_tick;
@@ -1433,6 +1437,11 @@ void key_change_proc(void)
if(consumer_key[0] == GOOGLE_MKEY_CENTER)
{
google_voice_dpad_select();
+
+ /* 221116 by ken. Record delay PM Start Time. The delay condition is to press the ASSIST and CENTER buttons */
+ g_delay_en_pm = clock_time()|1;
+
+ printf("[NOTICE] Record delay PM tick ");
}
#endif
}
@@ -1973,4 +1982,10 @@ void app_ui_check_wakeup_src(u8 deepRetWakeUp){
}
-
+void app_ui_check_delay_en_pm(void){
+ /* 221116 by ken. clear delay PM flag. The delay condition is to press the ASSIST and CENTER buttons */
+ if(g_delay_en_pm && clock_time_exceed(g_delay_en_pm, 2000000)){
+ g_delay_en_pm = 0;
+ printf("[NOTICE] Clear delay PM flag ");
+ }
+}
diff --git a/vendor/827x_ble_remote/app_ui.h b/vendor/827x_ble_remote/app_ui.h
index 153e645..824ea45 100644
--- a/vendor/827x_ble_remote/app_ui.h
+++ b/vendor/827x_ble_remote/app_ui.h
@@ -81,6 +81,9 @@ extern int lowBatt_alarmFlag;
extern u8 app_mtu_size;
+/* 221116 by ken. This variable is used to wait for google voice mic open cmd */
+extern u32 g_delay_en_pm;
+
extern void app_pairing_led(void);
extern void app_pairing_error(void);
extern u8 app_repairing(void);
@@ -92,6 +95,7 @@ extern void app_ota_timeout(void);
extern int app_cachekey_send_timer(void);
extern int app_is_key_released(void);
+void app_ui_check_delay_en_pm(void);
void app_keyboard_release_action_by_flag(void);
diff --git a/vendor/827x_ble_remote/main.c b/vendor/827x_ble_remote/main.c
index 5332188..60249ec 100644
--- a/vendor/827x_ble_remote/main.c
+++ b/vendor/827x_ble_remote/main.c
@@ -110,6 +110,14 @@ _attribute_ram_code_ int main (void) //must run in ramcode
extern void app_trigger_phytest_mode(void);
app_trigger_phytest_mode();
+
+ /* 221116 by ken. Fix the problem of not being able to enter PHY TEST MODE */
+ irq_enable();
+
+ while(1){
+ bls_pm_setSuspendMask (SUSPEND_DISABLE);
+ blt_sdk_main_loop();
+ }
}
#endif
diff --git a/version.h b/version.h
index e1f9316..f36bad1 100644
--- a/version.h
+++ b/version.h
@@ -27,6 +27,6 @@
#ifndef VERSION_H_
#define VERSION_H_
-#define FW_VERSION 0x34210212//FW:v3.4.2 SW:v2.12
+#define FW_VERSION 0x34210214//FW:v3.4.2 SW:v2.14
#endif /* VERSION_H_ */