// void watch_replay_cat1_ANSWER(void);
void cat1_get_DEV_ID(void);
+uint8_t g_py_ver_new = 0;
+
+
static char ble_buffer[20] = {0};
static uint8_t g_flag_disable_cat1_cmd = 0;
memcpy_s(buffer,len,ble_buffer,strlen(ble_buffer));
}
+
+void send_fota_url(char *buf)//发送VOLTE->CAT1
+{
+ udp_send_msg_toCat1(UDP_MSG_SEND_OTA,buf);
+}
+
void send_ble_mac_toCat1(void)//发送BLE mac地址 to CAT1
{
errcode_t ret = 0;
restart_time_sync();
cat1_getsignal();
+
+ if(g_py_ver_new)
+ {
+ g_py_ver_new=0;
+ }
cat1_print_info("IMEI received, sending AT+ICCID command\n");
cat1_at_cmd("AT+ICCID");
}
+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) {
+ cat1_print_err("StartCallTimer osTimerStart failed, ret = %lx!!", retTimer);
+ osTimerDelete(modem_ota_timer);
+ modem_ota_timer = NULL;
+ }
+ }
+
+}
+void star_http_ota_updata(char*buf_1,char* buf_2,uint8_t ver)
+{
+ int ret=0;
+ char * send_buf=(char *) malloc(strlen(buf_1)+strlen(buf_2)+40);
+ memset(send_buf,0,strlen(buf_1)+strlen(buf_2)+40);
+
+ sprintf(send_buf,"%s and %s",buf_1,buf_2);
+ // 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");
+
+ 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);
+}
+
#ifdef __cplusplus