编译验证 shibao
authorcheng.chen <cheng.chen@raisound.com>
Thu, 18 Jun 2026 03:54:48 +0000 (11:54 +0800)
committercheng.chen <cheng.chen@raisound.com>
Thu, 18 Jun 2026 03:54:57 +0000 (11:54 +0800)
2.code/aicos/app/AI_AMP_2_5/dev_authentication.c

index 96a5dc9..6f341ea 100644 (file)
@@ -26,6 +26,9 @@
 
 #define bk_malloc aic_malloc
 #define bk_free aic_free
+
+  #define DMPTEST
+
 int get_dev_pass_MAX_len(void)//获取设备密码最大长度,注意要防止内存越界
 {
     return sizeof(vc_cfg.dev_pass);
@@ -326,9 +329,272 @@ char * get_token(void)
 
 //激活->登录的密钥
 
-const char *dev_pid = "cqxJZi5CNgzjS3mX21Zw";//PID
-const char *dev_key = "uKLrChwrxA1LklgBc3VwawYjUkbT3BgX";//密钥
+//   const char *dev_pid = "cqxJZi5CNgzjS3mX21Zw";//PID
+//   const char *dev_key = "uKLrChwrxA1LklgBc3VwawYjUkbT3BgX";//密钥
+//电信
+//  const char *dev_pid = "DieBeXahZHLrjSnORbgN";//PID
+//  const char *dev_key = "FuXG4ptpGbzvKbdB4vpUypisbENgy2nB";//密钥
+
+//音箱
+//XbClE3xMZZGZTSnPjFjV
+//eWlTnlhmjk5ixBa4KpVTKUhNqLHXnEWy
+
+   const char *dev_pid = "XbClE3xMZZGZTSnPjFjV";//PID
+   const char *dev_key = "eWlTnlhmjk5ixBa4KpVTKUhNqLHXnEWy";//密钥
+
+
+#define HTTP_DEMO_CLIENT_NAME "HTTP Demo Client"
+#define HTTP_DEMO_URL "http://47.101.171.33/doc/download/10.txt"
+#define HTTPS_DEMO_URL "https://ting.raisound.com/GKwRIUEM7KLlABfEQAQ1sw59.mp3"
+
+//https://ting.raisound.com/GKwRIUEM7KLlABfEQAQ1sw59.mp3
+
+#define HTTP_DEMO_WAIT_TIME (10 * 1000)
+#define HTTP_DEMO_SLEEP_TIME (60 *1000)
+
+static u32 http_demo_handle = 0;
+static u32 https_demo_handle = 0;
+static aos_thread_id http_demo_thread;
+static aos_thread_id https_demo_thread;
+
+
+int32_t play_audio_done_duplex(const char *buf, uint32_t buf_len, uint32_t sample_rate, uint32_t is_file);
+
+extern int start_play_music_demo;
+void resetClose_time();
+
+void aic_http_demotest(char *url_play)
+{
+    u32 status = 0;
+    long lbytes = 0;
+    u8 *buff;
+    u32 bytes = 2048;
+    u32 total_length = 0;
+    u32 length_to_be_copied = 0;
+    u32 chunked_mode = 0;
+
+     bk_printf("aic_http_demotest1213...");
+
+     start_play_music_demo=1;
+
+    http_demo_handle = aic_http_client_create(HTTP_DEMO_CLIENT_NAME);
+    if (http_demo_handle == 0) {
+        return;
+    }
+    aicx_error(0x1132e2, "", "http demo start");
+
+     bk_printf("aic_http_demotest121312...");
+
+    /*wait pdp active,only for demo test.*/
+    //aos_sleep(HTTP_DEMO_SLEEP_TIME);
+
+    status = aic_http_client_get_start(http_demo_handle, HTTP_DEMO_URL, NULL,
+                                       NULL, 80, HTTP_DEMO_WAIT_TIME);
+    if (status != NX_SUCCESS) {
+        aic_http_client_delete(http_demo_handle);
+        return;
+    }
+
+    buff = aos_zalloc(bytes+2000);
+
+     bk_printf("aic_http_demotest1213121...");
+
+    do {
+
+      //  bk_printf("aic_http_demotest1213122...");
+
+         if(start_play_music_demo!=1)
+          break;
+        lbytes = aic_https_client_response_data_get(http_demo_handle, buff, bytes,
+                                                    HTTP_DEMO_WAIT_TIME);
+       bk_printf("aic_http_demotest1213123 lbytes %d...",lbytes);
+      //  aicx_error(0x18afe9, "d", "http get lbytes len is %d", lbytes);
+
+        if (lbytes <= 0) {
+            break;
+        } else {
+
+             bk_printf("https  get data %d ",lbytes);
+
+             play_audio_done_duplex(buff, bytes, 16000, 0);
+
+             //audio_data(buff,lbytes,37);
+             resetClose_time();
+
+             aos_sleep(20);
+
+            chunked_mode = aic_http_client_chunked_mode_check(http_demo_handle);
+            length_to_be_copied = aic_https_client_total_receive_bytes_get(http_demo_handle);
+            if (!chunked_mode && length_to_be_copied) {
+                total_length += lbytes;
+            }
+
+              bk_printf("aic_http_demotest1213123...");
+        }
+
+    } while (total_length < length_to_be_copied || chunked_mode);
+
+   // aicx_error(0x1e6e26, "s", "http get data is %s", buff);
+
+     bk_printf("aic_http_demotest1213123 finish...");
+    bk_free(buff);
+    aic_http_client_delete(http_demo_handle);
+
+    return;
+}
+
+
+void aic_https_demotest(char *url_play)
+{
+    u32 status = 0;
+    LONG lbytes = 0;
+    u8 *buff;
+    u32 bytes = 1024*2;
+    u32 total_length = 0;
+    u32 length_to_be_copied = 0;
+    u32 chunked_mode = 0;
+    AIC_HTTPS_CLIENT_INSTANCE *client_ptr;
+
+     start_play_music_demo=1;
+     bk_printf("aic_https_demotest1213...");
+
+    https_demo_handle = aic_https_client_create(HTTP_DEMO_CLIENT_NAME);
+    if (https_demo_handle == 0) {
+        return;
+    }
+
+     bk_printf("aic_https_demotest12131...");
+
+    /*for https test,set auth_type to 0, do not need certifica1*/
+    client_ptr = (AIC_HTTPS_CLIENT_INSTANCE *)https_demo_handle;
+    client_ptr->https_client->auth_type = 0;
+
+    /*wait pdp active,only for demo test.*/
+    // aos_sleep(HTTP_DEMO_SLEEP_TIME);
+
+    VC_state=VC_State_TTSStart;
+    status = aic_https_client_get_start(https_demo_handle, url_play, NULL,
+                                       NULL, 443, HTTP_DEMO_WAIT_TIME);
+    if (status != NX_SUCCESS) {
+        aic_https_client_delete(https_demo_handle);
+        return;
+    }
+
+    buff = aos_zalloc(bytes);
+
+    bk_printf("aic_https_demotest12132...");
+
+    do {
+
+        if(start_play_music_demo!=1)
+          break;
+        lbytes = aic_https_client_response_data_get(https_demo_handle, buff , bytes,
+                                                    HTTP_DEMO_WAIT_TIME);
+        if (lbytes <= 0) {
+            break;
+        } else {
+
+             bk_printf("https  get data %d ",lbytes);
+
+            // play_audio_done_duplex(buff, bytes, 16000, 0);
+
+             //audio_data(buff,lbytes,37);
+             resetClose_time();
+
+             aos_sleep(20);
+            chunked_mode = aic_http_client_chunked_mode_check(https_demo_handle);
+            length_to_be_copied = aic_https_client_total_receive_bytes_get(https_demo_handle);
+            if (!chunked_mode && length_to_be_copied) {
+                total_length += lbytes;
+            }
+        }
+
+    } while (total_length < length_to_be_copied || chunked_mode);
 
+    //  aicx_error(0x0f0971, "s", "https get data is %s", buff);
+    start_play_music_demo=0;  
+    bk_printf("download123 finish %d...",total_length);
+   // VC_state=VC_State_TTSEnd;
+    bk_free(buff);
+    aic_https_client_delete(https_demo_handle);
+
+    return;
+}
+
+
+void aic_https_demotest_status()
+{
+    u32 status = 0;
+    LONG lbytes = 0;
+    u8 *buff;
+    u32 bytes = 1024*2;
+    u32 total_length = 0;
+    u32 length_to_be_copied = 0;
+    u32 chunked_mode = 0;
+    AIC_HTTPS_CLIENT_INSTANCE *client_ptr;
+
+     bk_printf("aic_https_demotest1213...");
+
+    https_demo_handle = aic_https_client_create(HTTP_DEMO_CLIENT_NAME);
+    if (https_demo_handle == 0) {
+        return;
+    }
+
+     bk_printf("aic_https_demotest_status...");
+
+    /*for https test,set auth_type to 0, do not need certifica1*/
+    client_ptr = (AIC_HTTPS_CLIENT_INSTANCE *)https_demo_handle;
+    client_ptr->https_client->auth_type = 0;
+
+    /*wait pdp active,only for demo test.*/
+    // aos_sleep(HTTP_DEMO_SLEEP_TIME);
+
+    status = aic_https_client_get_start(https_demo_handle, "https://app-api.raisound.com/dev/device/info/simple/867686073051904", NULL,
+                                       NULL, 443, HTTP_DEMO_WAIT_TIME);
+    if (status != NX_SUCCESS) {
+        aic_https_client_delete(https_demo_handle);
+        return;
+    }
+
+    buff = aos_zalloc(bytes);
+
+    bk_printf("aic_https_demotest12132...");
+
+    do {
+        lbytes = aic_https_client_response_data_get(https_demo_handle, buff , bytes,
+                                                    HTTP_DEMO_WAIT_TIME);
+        if (lbytes <= 0) {
+            break;
+        } else {
+
+             bk_printf("https  get data %d ",lbytes);
+
+           //   bk_printf("read_bytes :%d\n",read_bytes);
+
+            // play_audio_done_duplex(buff, bytes, 16000, 0);
+
+            bk_printf("IOT_update_bargein :%s",buff);
+             //audio_data(buff,lbytes,37);
+           //  resetClose_time();
+
+            //  aos_sleep(20);
+            chunked_mode = aic_http_client_chunked_mode_check(https_demo_handle);
+            length_to_be_copied = aic_https_client_total_receive_bytes_get(https_demo_handle);
+            if (!chunked_mode && length_to_be_copied) {
+                total_length += lbytes;
+            }
+        }
+
+    } while (total_length < length_to_be_copied || chunked_mode);
+
+    //  aicx_error(0x0f0971, "s", "https get data is %s", buff);
+
+    bk_printf("download123 finish %d...",total_length);
+
+    aic_https_client_delete(https_demo_handle);
+
+    return;
+}
 
 void aut_active(void)//设备激活
 {
@@ -377,14 +643,19 @@ void aut_active(void)//设备激活
 
     //118.145.159.222:30400
 
-    //http://dmp.raisound.com/bz-api/dev/auth/active
+    // http://dmp.raisound.com/bz-api/dev/auth/active
 
-    //https://dmp-dev.raisound.com/dmp-api/dev/auth/active
+    // https://dmp-dev.raisound.com/dmp-api/dev/auth/active
+#ifdef DMPTEST
 
+    char *sign_url = "http://dmp-dev.raisound.com/dmp-api/dev/auth/active";
+    bk_printf("http://dmp-dev.raisound.com/dmp-api/dev/auth/active\n");
+#else
     char *sign_url = "http://dmp.raisound.com/bz-api/dev/auth/active";
-
     bk_printf("http://dmp.raisound.com/bz-api/dev/auth/active\n");
 
+#endif
+
     u32 response = 0;
     //创建客户端实例
     aut_active_http_handle = aic_http_client_create("HTTP_DEMO_CLIENT_NAME");
@@ -653,7 +924,256 @@ aut_active_return:
         aic_http_client_delete(aut_active_http_handle);
 }
 
- char ota_url[200] ={0};
+
+
+void get_alarm_info13(void)//设备激活
+{
+    int ret;
+    bk_printf("get_alarm_info13");
+
+
+    AIC_HTTPS_CLIENT_INSTANCE *http_client;
+    char deviceId[30] = {0};
+    //char dev_pass_base64[100] ={0};
+   // char enc_iv[65] = {0};
+
+    char dev_iccid[100] ={0};
+
+    // http创建客户端句柄
+    u32 aut_active_http_handle = 0;
+    char *aut_buf =NULL;
+    char *json_string =NULL;
+    char form_data_string[200]={0};
+
+
+    char  sign_url[200]={0};
+
+    cJSON *root = NULL;
+    aut_buf = bk_malloc(5*1024);
+    if(aut_buf)
+        memset(aut_buf , 0,5*1024);
+    else
+        goto aut_active_return;
+
+    bk_get_imei(deviceId);
+
+    bk_get_iccid(dev_iccid);
+
+    
+   // const char *signMethod ="MD5";
+
+   // alog_info("http demo start");
+    //登陆数据
+
+   // bk_printf("dev_id:%s timestamp:%s ",deviceId,timestamp_str);
+   // char *sign_url = "http://dmp.raisound.com/bz-api/dev/iccid";
+
+    sprintf(sign_url,"http://wsiot-nocdn.raisound.com/ws-bus/alarm/system/list/%s?devToken=%s",deviceId,get_token());
+
+    bk_printf(sign_url);
+
+
+    //  http://dmp.raisound.com/bz-api/dev/iccid
+    u32 response = 0;
+    //创建客户端实例
+    aut_active_http_handle = aic_http_client_create("HTTP_DEMO_CLIENT_NAME");
+    if (aut_active_http_handle == 0) {
+        bk_printf("Failed to create HTTP client instance\n");
+        goto aut_active_return;
+    }
+    int url_value = aic_process_https_url(aut_active_http_handle,sign_url,AIC_HTTP_HEAD);               
+    bk_printf("url_value:%d",url_value);      
+    http_client = (AIC_HTTPS_CLIENT_INSTANCE *)aut_active_http_handle;
+    http_client->login_info.server_port = 80;
+    aic_http_client_connect(aut_active_http_handle, 5000);
+        
+    // 创建JSON对象
+    root = cJSON_CreateObject();
+    if (root == NULL) {
+    bk_printf( "Failed to create JSON object\n");
+        goto aut_active_return; ;
+    }
+
+    // 添加字段
+   cJSON_AddStringToObject(root, "devToken", get_token());
+   // cJSON_AddStringToObject(root, "iccid", dev_iccid);
+    //cJSON_AddStringToObject(root, "sign", md5_buf);
+    //cJSON_AddStringToObject(root, "timeStamp", timestamp_str);
+    // cJSON_AddStringToObject(root, "signMethod", signMethod);
+
+    // 生成JSON字符串
+    json_string = cJSON_Print(root);
+    if (json_string == NULL) {
+    bk_printf("Failed to print JSON\n");
+        //cJSON_Delete(root);
+        goto aut_active_return; 
+    }
+
+    // 输出JSON
+   // bk_printf("JSON output: %s\n", json_string);
+
+    //sprintf(form_data_string,"deviceId=%s&iccid=%s",deviceId,dev_iccid);
+
+    //bk_printf("form_data_string: %s\n", form_data_string);
+
+
+    aic_https_client_request_initialize(aut_active_http_handle,AIC_HTTPS_METHOD_GET, 0,
+    0, NULL,NULL, 10000);
+    
+ //   aic_https_client_request_header_add(aut_active_http_handle,"Content-Type",strlen("Content-Type"),"application/json",strlen("application/json"),10000);//添加头
+ //   bk_printf("aic_https_client_request_header_add1");
+
+  //  aic_https_client_request_header_add(aut_active_http_handle,"bz-dt",strlen("bz-dt"),aut_token,strlen(aut_token),10000);//添加头
+  //  bk_printf("aic_https_client_request_header_add3");
+
+    
+    response = nx_web_http_client_request_send(http_client->https_client,10 * 1000);
+
+
+    http_client->https_client->nx_web_http_client_state = NX_WEB_HTTP_CLIENT_STATE_POST;
+
+//    ret = aic_https_client_put_data(aut_active_http_handle, json_string, strlen(json_string),
+//    1000);
+//     if (ret == 0) {
+//         bk_printf("数据发送成功\n");
+
+//    } else {
+//         // 处理错误
+//         bk_printf("数据发送失败,错误码: %d\n", ret);
+//         goto aut_active_return; 
+//     }
+    long read_bytes=0;
+
+    long read_bytes_tmp = aic_https_client_response_data_get(aut_active_http_handle,aut_buf,5*1024,10000);
+
+     while(read_bytes_tmp>0){
+
+         bk_printf("read_bytes :%d\n",read_bytes_tmp);
+
+         read_bytes+=read_bytes_tmp;
+
+         read_bytes_tmp = aic_https_client_response_data_get(aut_active_http_handle,aut_buf+read_bytes,5*1024,10000);
+
+     }
+
+
+    if(read_bytes<=0)
+        goto aut_active_return; 
+
+    bk_printf("get_alarm_info13 :%s",aut_buf);
+
+     cJSON* root123 = cJSON_Parse(aut_buf);
+   //  parse_object(root123,aut_buf);
+
+   //  cJSON_Array *test=cJSON_GetObjectItem(root123,"data");
+
+     cJSON*  tmp123=cJSON_GetObjectItem(root123,"msg");
+
+     bk_printf("get_alarm_info13 count :%s",cJSON_GetStringValue(tmp123));
+
+     cJSON* cjarray1=cJSON_GetObjectItemCaseSensitive(root123,"data");
+
+     int count_alarm=cJSON_GetArraySize(cjarray1);
+
+    bk_printf("get_alarm_info13 count :%d",cJSON_GetArraySize(cjarray1));
+
+     vc_cfg.alarm_count=0;
+
+     for(int i=0;i<count_alarm;i++){
+
+          cJSON* temp01=cJSON_GetArrayItem(cjarray1,i);
+
+          char*  name_tp=cJSON_GetStringValue(cJSON_GetObjectItem(temp01,"name"));
+
+          char*  time_tp=cJSON_GetStringValue(cJSON_GetObjectItem(temp01,"time"));
+
+          bk_printf("name_tp %s time_tp :%s",name_tp,time_tp);
+
+          if(name_tp==NULL){
+
+            bk_printf("name_tp  is null");
+          }
+
+          if(vc_cfg.alarm_count<100){
+
+            memset(vc_cfg.alarm_name[vc_cfg.alarm_count],0,50);
+
+             if(time_tp!=NULL)
+              memcpy(vc_cfg.alarm_name[vc_cfg.alarm_count],time_tp,strlen(time_tp));
+
+            
+            memset(vc_cfg.alarm_content[vc_cfg.alarm_count],0,150);
+
+            if(name_tp!=NULL)
+              memcpy(vc_cfg.alarm_content[vc_cfg.alarm_count],name_tp,strlen(name_tp));
+
+           
+                              // save_VC_cfg();
+         }
+
+
+               vc_cfg.alarm_count++;
+
+     }
+
+    // char *str_tmp = NULL;
+
+    // char *str_data=null;
+    
+    // str_tmp = strstr(aut_buf,"\"time\":\"");
+
+    //  while(str_tmp)//解析password
+    // {
+    //     str_tmp += strlen("\"time\":\"");
+
+    //     str_data=str_tmp;
+    //     int count = str_count(str_tmp,'\"');
+    //     bk_printf("count:%d",count);
+    //     if(count < sizeof(ota_url))
+    //     {
+    //         memcpy(ota_url,str_tmp,count);
+    //         ota_url[count] = 0;
+    //         bk_printf("bargein:%s",ota_url);
+
+    //         int temp_bag=atoi(ota_url);
+    //         if(temp_bag>=0&&temp_bag<10){
+
+    //           //  if(temp_bag==1)
+    //           //    vc_cfg.VC_mode=0;
+    //            // else
+    //               vc_cfg.VC_mode=temp_bag;
+    //         }
+    //       //  vc_cfg.VC_mode=
+
+    //     //  vc_cfg.VC_TTS_volume
+
+
+            
+    //     }
+    //     else
+    //     {
+    //         bk_printf("bargein");
+    //     }
+
+    //     str_tmp = strstr(str_data,"\"time\":\"");
+    // }
+
+   
+    
+aut_active_return:   
+    // 释放内存
+    if(aut_buf)
+        bk_free(aut_buf);
+    if(json_string)
+        cJSON_free(json_string);
+    if(root)
+        cJSON_Delete(root);
+    if(aut_active_http_handle)
+        aic_http_client_delete(aut_active_http_handle);
+}
+
+
+char ota_url[200] ={0};
 
 static int apifota_start_h3(void) 
 { 
@@ -751,10 +1271,20 @@ void IOT_update_bargein(void)//OTA更新
         goto aut_active_return;
 
     bk_get_imei(deviceId);
+    //// DMPTEST
+
 
     //http://app-api.raisound.com/dev/device/info/simple/867686073050930
- 
-    sprintf(sign_url,"http://app-api.raisound.com/dev/device/info/simple/%s",deviceId);
+ #if 1
+     sprintf(sign_url,"http://dmp-dev.raisound.com/dmp-api/dev/device/info/simple/%s",deviceId);
+  
+ #else
+      //https://app-api.raisound.com
+
+     sprintf(sign_url,"https://app-api.raisound.com/dev/device/info/simple/%s",deviceId);
+     
+ #endif
+   
 
     bk_printf(sign_url);
 
@@ -825,7 +1355,10 @@ void IOT_update_bargein(void)//OTA更新
             int temp_bag=atoi(ota_url);
             if(temp_bag>=0&&temp_bag<10){
 
-                vc_cfg.VC_mode=temp_bag;
+              //  if(temp_bag==1)
+              //    vc_cfg.VC_mode=0;
+               // else
+                  vc_cfg.VC_mode=temp_bag;
             }
           //  vc_cfg.VC_mode=
 
@@ -853,6 +1386,233 @@ aut_active_return:
 }
 
 
+
+
+void get_alarm_info12()
+{
+    u32 status = 0;
+    LONG lbytes = 0;
+    u8 *buff;
+    u32 bytes = 1024*2;
+    u32 total_length = 0;
+    u32 length_to_be_copied = 0;
+    u32 chunked_mode = 0;
+    AIC_HTTPS_CLIENT_INSTANCE *client_ptr;
+
+     bk_printf("get_alarm_info12...");
+
+    https_demo_handle = aic_https_client_create(HTTP_DEMO_CLIENT_NAME);
+    if (https_demo_handle == 0) {
+        return;
+    }
+
+     bk_printf("get_alarm_info12...");
+
+      char  sign_url[300]={0};
+
+      char deviceId[30] = {0};
+
+      bk_get_imei(deviceId);
+
+      sprintf(sign_url,"https://wsiot-nocdn.raisound.com/ws-bus/alarm/system/list/%s?devToken=%s",deviceId,get_token());
+  
+
+      bk_printf(sign_url);
+
+    /*for https test,set auth_type to 0, do not need certifica1*/
+    client_ptr = (AIC_HTTPS_CLIENT_INSTANCE *)https_demo_handle;
+    client_ptr->https_client->auth_type = 0;
+
+    /*wait pdp active,only for demo test.*/
+    // aos_sleep(HTTP_DEMO_SLEEP_TIME);
+
+    status = aic_https_client_get_start(https_demo_handle, sign_url, NULL,
+                                       NULL, 443, HTTP_DEMO_WAIT_TIME);
+    if (status != NX_SUCCESS) {
+        aic_https_client_delete(https_demo_handle);
+        return;
+    }
+
+    buff = aos_zalloc(bytes);
+
+    bk_printf("get_alarm_info12...");
+
+    do {
+        lbytes = aic_https_client_response_data_get(https_demo_handle, buff , bytes,
+                                                    HTTP_DEMO_WAIT_TIME);
+        if (lbytes <= 0) {
+            break;
+        } else {
+
+             bk_printf("https  get data %d ",lbytes);
+
+           //  play_audio_done_duplex(buff, bytes, 16000, 0);
+
+             //audio_data(buff,lbytes,37);
+          //   resetClose_time();
+
+              aos_sleep(20);
+            chunked_mode = aic_http_client_chunked_mode_check(https_demo_handle);
+            length_to_be_copied = aic_https_client_total_receive_bytes_get(https_demo_handle);
+            if (!chunked_mode && length_to_be_copied) {
+                total_length += lbytes;
+            }
+        }
+
+    } while (total_length < length_to_be_copied || chunked_mode);
+
+    //  aicx_error(0x0f0971, "s", "https get data is %s", buff);
+
+    bk_printf("download123 finish %d...",total_length);
+
+    aic_https_client_delete(https_demo_handle);
+
+    return;
+}
+
+
+void get_alarm_info(void)//OTA更新
+{
+    int ret;
+    bk_printf("get_alarm_info");
+
+
+    AIC_HTTPS_CLIENT_INSTANCE *http_client;
+    char deviceId[30] = {0};
+    //char dev_pass_base64[100] ={0};
+
+    // http创建客户端句柄
+    u32 aut_active_http_handle = 0;
+    char *aut_buf =NULL;
+
+    //char *json_string =NULL;
+    //char form_data_string[200]={0};
+
+    char  sign_url[200]={0};
+
+    cJSON *root = NULL;
+    aut_buf = bk_malloc(5*1024);
+    if(aut_buf)
+        memset(aut_buf , 0,5*1024);
+    else
+        goto aut_active_return;
+
+    bk_get_imei(deviceId);
+    //// DMPTEST
+
+
+    //http://app-api.raisound.com/dev/device/info/simple/867686073050930
+ #if 1
+     sprintf(sign_url,"https://wsiot-nocdn.raisound.com/ws-bus/alarm/system/list/%s?devToken=%s",deviceId,get_token());
+  
+ #else
+      //https://app-api.raisound.com
+
+      sprintf(sign_url,"https://app-api.raisound.com/dev/device/info/simple/%s",deviceId);
+     
+ #endif
+   
+
+    bk_printf(sign_url);
+
+    u32 response = 0;
+    //创建客户端实例
+    aut_active_http_handle = aic_http_client_create("HTTP_DEMO_CLIENT_NAME");
+    if (aut_active_http_handle == 0) {
+        bk_printf("Failed to create HTTP client instance\n");
+        goto aut_active_return;
+    }
+    int url_value = aic_process_https_url(aut_active_http_handle,sign_url,AIC_HTTP_HEAD);               
+    bk_printf("url_value:%d",url_value);      
+    http_client = (AIC_HTTPS_CLIENT_INSTANCE *)aut_active_http_handle;
+    http_client->login_info.server_port = 80;
+    aic_http_client_connect(aut_active_http_handle, 5000);
+        
+    // 创建JSON对象
+    root = cJSON_CreateObject();
+    if (root == NULL) {
+    bk_printf( "Failed to create JSON object\n");
+        goto aut_active_return; ;
+    }
+ 
+    // 输出JSON
+    // bk_printf("JSON output: %s\n", json_string);
+
+    aic_https_client_request_initialize(aut_active_http_handle,AIC_HTTPS_METHOD_GET, 0,
+    0, NULL,NULL, 10000);
+    
+  
+    response = nx_web_http_client_request_send(http_client->https_client,10 * 1000);
+
+  ret=0;
+    if (ret == 0) {
+        bk_printf("数据发送成功\n");
+
+   } else {
+        // 处理错误
+        bk_printf("数据发送失败,错误码: %d\n", ret);
+        goto aut_active_return; 
+    }
+    
+    long read_bytes = aic_https_client_response_data_get(aut_active_http_handle,aut_buf,5*1024,10000);
+
+    bk_printf("read_bytes :%d\n",read_bytes);
+
+    if(read_bytes<=0)
+        goto aut_active_return; 
+
+    bk_printf("get_alarm_info :%s",aut_buf);
+
+
+    char *str_tmp = NULL;
+    
+    str_tmp = strstr(aut_buf,"\"bargein\":\"");
+    //bk_printf("str_tmp:%p",str_tmp);
+    // if(str_tmp)//解析password
+    // {
+    //     str_tmp += strlen("\"bargein\":\"");
+    //     int count = str_count(str_tmp,'\"');
+    //     bk_printf("count:%d",count);
+    //     if(count < sizeof(ota_url))
+    //     {
+    //         memcpy(ota_url,str_tmp,count);
+    //         ota_url[count] = 0;
+    //         bk_printf("bargein:%s",ota_url);
+
+    //         int temp_bag=atoi(ota_url);
+    //         if(temp_bag>=0&&temp_bag<10){
+
+    //           //  if(temp_bag==1)
+    //           //    vc_cfg.VC_mode=0;
+    //            // else
+    //               vc_cfg.VC_mode=temp_bag;
+    //         }
+    //       //  vc_cfg.VC_mode=
+
+    //     //  vc_cfg.VC_TTS_volume
+
+
+            
+    //     }
+    //     else
+    //     {
+    //         bk_printf("bargein");
+    //     }
+    // }
+
+aut_active_return:   
+    // 释放内存
+    if(aut_buf)
+        bk_free(aut_buf);
+   // if(json_string)
+   //     cJSON_free(json_string);
+    if(root)
+        cJSON_Delete(root);
+    if(aut_active_http_handle)
+        aic_http_client_delete(aut_active_http_handle);
+}
+
+
 void ota_check_version(void)//OTA更新
 {
     int ret;
@@ -1008,8 +1768,7 @@ void ota_check_version(void)//OTA更新
         
     }
 
-    
- 
+
 aut_active_return:   
     // 释放内存
     if(aut_buf)
@@ -1228,15 +1987,15 @@ void ota_update_version(void)//OTA上报
         goto aut_active_return; 
     }
     
-    long read_bytes = aic_https_client_response_data_get(aut_active_http_handle,aut_buf,5*1024,10000);
+    //long read_bytes = aic_https_client_response_data_get(aut_active_http_handle,aut_buf,5*1024,10000);
 
-    bk_printf("read_bytes :%d\n",read_bytes);
+   // bk_printf("read_bytes :%d\n",read_bytes);
 
 
-    if(read_bytes<=0)
-        goto aut_active_return; 
+    //if(read_bytes<=0)
+     //   goto aut_active_return; 
 
-    bk_printf("http put data update_iccid :%s",aut_buf);
+    bk_printf("ota_update_version_end");
 
      
 aut_active_return:   
@@ -1313,8 +2072,13 @@ void aut_login(void)//登录
 
     // http://dmp.raisound.com/bz-api/dev/auth/sign_in
 
-    //https://dmp-dev.raisound.com/dmp-api/dev/auth/active
-    char *sign_url = "http://dmp.raisound.com/bz-api/dev/auth/sign_in"; // 登录地址
+    // https://dmp-dev.raisound.com/dmp-api/dev/auth/active
+#ifdef DMPTEST
+    char *sign_url = "http://dmp-dev.raisound.com/dmp-api/dev/auth/sign_in"; // 登录地址
+#else
+
+    char *sign_url = "http://dmp.raisound.com/bz-api/dev/auth/sign_in"; // 登录地址  
+#endif
 
     //char *headers_T = "\"Content-Type\":\"application/json\"";
     bk_printf(sign_url);
@@ -1515,4 +2279,6 @@ void dev_authentication_init(void)
         AOS_AUTO_START);
 }
 
+
+
 // AIC_BASIC_APP_P2_INIT_EXPORT(apifota_callback_init); 
\ No newline at end of file