}
else if(type_ai==AI_TYPE_DOU)
{
- sprintf(put_buf,"ws://%s/chat/ws?device_id=%s&product_id=%s&platform=huoshan",Service_url,device_id,product_id);
+ sprintf(put_buf,"ws://%s/chat/ws?platform=huoshan",Service_url);
}
else if(type_ai==AI_TYPE_WEN)
{
- sprintf(put_buf,"ws://%s/chat/ws?device_id=%s&product_id=%s&platform=baidu",Service_url,device_id,product_id);
+ sprintf(put_buf,"ws://%s/chat/ws?platform=baidu",Service_url);
}
else if(type_ai==AI_TYPE_KIMI)
{
- sprintf(put_buf,"ws://%s/chat/ws?device_id=%s&product_id=%s&platform=moonshot",Service_url,device_id,product_id);
+ sprintf(put_buf,"ws://%s/chat/ws?platform=moonshot",Service_url);
}
else if(type_ai==AI_TYPE_DE)
{
- sprintf(put_buf,"ws://%s/chat/ws?device_id=%s&product_id=%s&platform=huoshan&model=ep-20250205103849-582m7",Service_url,device_id,product_id);
+ sprintf(put_buf,"ws://%s/chat/ws?platform=huoshan&model=ep-20250205103849-582m7",Service_url);
}
else
{
- sprintf(put_buf,"ws://%s/chat/ws?device_id=%s&product_id=%s&platform=aliyun",Service_url,device_id,product_id);
+ sprintf(put_buf,"ws://%s/chat/ws?platform=aliyun",Service_url);
}
return false;
}
uint8_t TRANSMIT_DATA=START_CAT1_OTA;
CustomEventPublish(TOPIC_EVENT_BLE_TRANSMIT,&TRANSMIT_DATA,1);
+
uapi_cat1_keep_wakeup(1);
}
void Cat1_OTA(uint8_t ota_state)
uint8_t errno_count=0;
static uint8_t IS_need_ota=1;
extern uint8_t g_py_ver;
+
+
void cat1_server_file_task(void *pvParameters)
{
char rx_buffer[512];
else if (g_py_ver>=19 && (uapi_dev_runtime_get_cat1_networkstat()) )
{
char * cat1_modemver = uapi_dev_runtime_get_cat1_modemver();
- if(g_py_ver==19)
- {
- if(strcmp(cat1_modemver, "EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_TEST0630")!=0)
- {
- star_http_ota_updata(g_py_ver);
- }
- }
- else
- {
- star_http_ota_updata(g_py_ver);
- }
+
+ star_http_ota_updata(cat1_modemver ,g_py_ver);
+
}
}
}
+static uint8_t old_model_ver=0;
+
+extern uint8_t g_py_ver;
+
+extern uint8_t g_py_ver_new;
+
+static osTimerId_t modem_ota_timer=NULL;
+
+static uint16 mode_ota_count=0;
+
+
+static void modem_ota_timer_CallBack(int data_tmp)
+{
+ if(old_model_ver!=g_py_ver)
+ {
+ uint8_t TRANSMIT_DATA=TRANS_FREE;
+ CustomEventPublish(TOPIC_EVENT_BLE_TRANSMIT,&TRANSMIT_DATA,1);
+
+ if(modem_ota_timer){
+ osTimerStop(modem_ota_timer);
+ osTimerDelete(modem_ota_timer);
+ modem_ota_timer = NULL;
+ }
+
+ }
+ else
+ {
+ mode_ota_count++;
+ if(mode_ota_count>120 || g_py_ver_new==0)
+ {
+ uint8_t TRANSMIT_DATA=OTA_UPDATA_FAIL;
+ CustomEventPublish(TOPIC_EVENT_BLE_TRANSMIT,&TRANSMIT_DATA,1);
+
+ if(modem_ota_timer){
+ osTimerStop(modem_ota_timer);
+ osTimerDelete(modem_ota_timer);
+ modem_ota_timer = NULL;
+ }
+ }
+ }
+}
+
+
+void start_mode_ota_timer()
+{
+ uint32_t tick;
+ osStatus_t retTimer;
+ if(modem_ota_timer == NULL){
+ modem_ota_timer = osTimerNew((osTimerFunc_t)modem_ota_timer_CallBack, osTimerPeriodic, NULL, NULL);
+ tick = 5000;// osMs2Tick(1000);
+ retTimer = osTimerStart(modem_ota_timer, tick);
+ if (retTimer != osOK && modem_ota_timer != NULL) {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"StartCallTimer osTimerStart failed, ret = %lx!!", retTimer);
+ osTimerDelete(modem_ota_timer);
+ modem_ota_timer = NULL;
+ }
+ }
+
+}
+
+
+
+
//
// http://snicker.com.cn:8089/FD230/PY_SRV_V19/dfota_2.bin
-void star_http_ota_updata(uint8_t ver)
+void star_http_ota_updata(char*mod_ver, uint8_t ver)
{
int ret=0;
char buf_1[256]={0};
- char PY_BUF_1[32]={0};
- sprintf(PY_BUF_1,"PY%d_1",ver);
+ char PY_BUF_1[128]={0};
+ sprintf(PY_BUF_1,"%s_PY%d_1",mod_ver,ver);
ret = http_get_ota_url(buf_1,PY_BUF_1);
- char PY_BUF_2[32]={0};
- sprintf(PY_BUF_2,"PY%d_2",ver);
+ char PY_BUF_2[128]={0};
+ sprintf(PY_BUF_2,"%s_PY%d_2",mod_ver,ver);
ret = http_get_ota_url(buf_1,PY_BUF_2);
for (int i = 0; i <3; i++)
// sprintf(send_buf,"%s and %s","http://snicker.com.cn:8089/FD230/PY_SRV_V19/dfota_1.bin","http://snicker.com.cn:8089/FD230/PY_SRV_V19/dfota_2.bin");
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%s ",send_buf);
+ uint8_t TRANSMIT_DATA=START_CAT1_OTA;
+
+ CustomEventPublish(TOPIC_EVENT_BLE_TRANSMIT,&TRANSMIT_DATA,1);
+
+
+ old_model_ver=ver;
+
+
send_fota_url(send_buf);
+ g_py_ver_new=1;
+ start_mode_ota_timer();
+
+
+
+
+
free(send_buf);
}
// http_get_ota_url()
\ No newline at end of file