__MMI_CUSTOM_AI_AUTHENTICATE_SUPPORT__
author@CHENG <2393524978@qq.com>
Wed, 25 Sep 2024 08:06:26 +0000 (16:06 +0800)
committer@CHENG <2393524978@qq.com>
Wed, 25 Sep 2024 08:06:26 +0000 (16:06 +0800)
2.sdk/sdk/product/craneg_modem/pcac/wsclient/libwebsockets/inc/mmi_aigc_chat_websocket_client.h
2.sdk/sdk/product/craneg_modem/pcac/wsclient/libwebsockets/inc/mmi_aigc_tts_websocket_client.h
2.sdk/sdk/product/craneg_modem/pcac/wsclient/libwebsockets/inc/mmi_aigc_websocket.h
2.sdk/sdk/product/craneg_modem/pcac/wsclient/libwebsockets/inc/sim_esp_websocket_client.h
2.sdk/sdk/product/craneg_modem/pcac/wsclient/libwebsockets/src/mmi_aigc_chat_websocket.c
2.sdk/sdk/product/craneg_modem/pcac/wsclient/libwebsockets/src/mmi_aigc_chat_websocket_client.c
2.sdk/sdk/product/craneg_modem/pcac/wsclient/libwebsockets/src/mmi_aigc_trans_websocket.c
2.sdk/sdk/product/craneg_modem/pcac/wsclient/libwebsockets/src/mmi_aigc_tts_websocket.c
2.sdk/sdk/product/craneg_modem/pcac/wsclient/libwebsockets/src/mmi_aigc_tts_websocket_client.c
2.sdk/sdk/product/craneg_modem/pcac/wsclient/libwebsockets/src/sim_esp_websocket_client.c
2.sdk/sdk/product/craneg_modem/pcac/wsclient/libwebsockets/src/sim_websocket_example.c

index 2bf4d13..f3e0cfa 100644 (file)
 #ifdef __cplusplus
 extern "C" {
 #endif
+
+#include "../../../../config/watch/lv_watch_conf_CUSTOM.h"
+
+#ifdef __MMI_CUSTOM_AIGC_SUPPORT__
+
 typedef unsigned long UINT32;
 
 #define sim_portTICK_RATE_MS   1000
@@ -277,6 +282,7 @@ bool chat_websocket_client_is_connected(sim_esp_websocket_client_handle_t client
 esp_err_t chat_websocket_register_events(sim_esp_websocket_client_handle_t client,
                                                                                        sim_esp_event_handler_t event_handler);
 
+#endif
 
 #ifdef __cplusplus
 }
index 900773b..9ca3b9e 100644 (file)
 #ifdef __cplusplus
 extern "C" {
 #endif
+
+#include "../../../../config/watch/lv_watch_conf_CUSTOM.h"
+
+#ifdef __MMI_CUSTOM_AIGC_SUPPORT__
+
 typedef unsigned long UINT32;
 
 #define sim_portTICK_RATE_MS   1000
@@ -277,6 +282,7 @@ bool tts_websocket_client_is_connected(sim_esp_websocket_client_handle_t client)
 esp_err_t tts_websocket_register_events(sim_esp_websocket_client_handle_t client,
                                                                                        sim_esp_event_handler_t event_handler);
 
+#endif
 
 #ifdef __cplusplus
 }
index 79dcc9b..d19bd6d 100644 (file)
@@ -8,7 +8,9 @@
 extern "C" {
 #endif
 
-#if 1 // def __MMI_CUSTOM_AIGC_SUPPORT__
+#include "../../../../config/watch/lv_watch_conf_CUSTOM.h"
+
+#ifdef __MMI_CUSTOM_AIGC_SUPPORT__
 
 
 #define __MMI_AIGC_WB_DEBUG__
index d9f8698..479e077 100644 (file)
 #ifdef __cplusplus
 extern "C" {
 #endif
+
+#include "../../../../config/watch/lv_watch_conf_CUSTOM.h"
+
+#ifdef __MMI_CUSTOM_AIGC_SUPPORT__
+
 typedef unsigned long UINT32;
 
 #define sim_portTICK_RATE_MS   1000
@@ -277,6 +282,7 @@ bool sim_esp_websocket_client_is_connected(sim_esp_websocket_client_handle_t cli
 esp_err_t sim_esp_websocket_register_events(sim_esp_websocket_client_handle_t client,
                                                                                        sim_esp_event_handler_t event_handler);
 
+#endif
 
 #ifdef __cplusplus
 }
index 7a34ff9..9d7c588 100644 (file)
@@ -1,19 +1,23 @@
 
 
 
-#if 1 // def __MMI_CUSTOM_AIGC_SUPPORT__
-
 #include "uart.h"
 #include "mmi_aigc_chat_websocket_client.h"
 #include "mmi_aigc_websocket.h"
 
+
+#ifdef __MMI_CUSTOM_AIGC_SUPPORT__
+
 //#define MMI_AIGC_CHAT_WEBSOCKET_URI "ws://121.40.67.151:9099/chat/ws"
-#define MMI_AIGC_CHAT_WEBSOCKET_URI "ws://118.145.158.207:80/chat/ws"
+//#define MMI_AIGC_CHAT_WEBSOCKET_URI "ws://118.145.158.207:80/chat/ws"
+#define MMI_AIGC_CHAT_WEBSOCKET_URI "ws://amp.raisound.com/chat/ws"
 
 static sim_esp_websocket_client_handle_t s_aigc_chat_ws_client_p = NULL;
 
 extern void mmi_aigc_chat_websocket_recv_data_handler(char * data_ptr, int data_len, int payload_len, int payload_offset);
-
+#ifdef __MMI_CUSTOM_AI_AUTHENTICATE_SUPPORT__
+extern char * mmi_ai_device_token_get(void);
+#endif
 
 
 int mmi_aigc_chat_websocket_send_text_data(char * data_ptr, int data_len)
@@ -120,7 +124,14 @@ void mmi_aigc_chat_websocket_app_start(void)
        int ret = 0;
     sim_esp_websocket_client_config_t websocket_cfg = {0};
 
+#ifdef __MMI_CUSTOM_AI_AUTHENTICATE_SUPPORT__
+       char url_str[256] = {0};
+       sprintf(url_str, "%s?dt=%s", MMI_AIGC_CHAT_WEBSOCKET_URI, mmi_ai_device_token_get());
+       
+    websocket_cfg.uri = url_str;
+#else
     websocket_cfg.uri = MMI_AIGC_CHAT_WEBSOCKET_URI;
+#endif
 
        AIGC_WB_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: url=%s\n", __FUNCTION__, __LINE__, websocket_cfg.uri);
 
index f12ebaf..fe3c9c5 100644 (file)
@@ -27,6 +27,8 @@
 #include "sockets.h"
 #include "osa.h"
 
+#ifdef __MMI_CUSTOM_AIGC_SUPPORT__
+
 static int       task_run = 0;
 static OSTaskRef chat_websocket_client_ref = NULL;
 static void *    chat_websocket_client_stack_ptr = NULL;
@@ -824,3 +826,6 @@ esp_err_t chat_websocket_register_events(sim_esp_websocket_client_handle_t clien
        client->handler = event_handler;
     return 0;
 }
+
+#endif
+
index d4af685..1e12cd3 100644 (file)
@@ -1,19 +1,23 @@
 
 
 
-#if 1 // def __MMI_CUSTOM_AIGC_SUPPORT__
-
 #include "uart.h"
 #include "sim_esp_websocket_client.h"
 #include "mmi_aigc_websocket.h"
 
+
+#ifdef __MMI_CUSTOM_AIGC_SUPPORT__
+
 //#define MMI_AIGC_TRANS_WEBSOCKET_URI "ws://121.40.67.151:9099/asr/ws"
-#define MMI_AIGC_TRANS_WEBSOCKET_URI "ws://118.145.158.207:80/asr/ws"
+//#define MMI_AIGC_TRANS_WEBSOCKET_URI "ws://118.145.158.207:80/asr/ws"
+#define MMI_AIGC_TRANS_WEBSOCKET_URI "ws://amp.raisound.com/asr/ws"
 
 static sim_esp_websocket_client_handle_t s_aigc_trans_ws_client_p = NULL;
 
 extern void mmi_aigc_trans_websocket_recv_data_handler(char * data_ptr, int data_len, int payload_len, int payload_offset);
-
+#ifdef __MMI_CUSTOM_AI_AUTHENTICATE_SUPPORT__
+extern char * mmi_ai_device_token_get(void);
+#endif
 
 
 int mmi_aigc_trans_websocket_send_text_data(char * data_ptr, int data_len)
@@ -120,7 +124,14 @@ void mmi_aigc_trans_websocket_app_start(void)
        int ret = 0;
     sim_esp_websocket_client_config_t websocket_cfg = {0};
 
+#ifdef __MMI_CUSTOM_AI_AUTHENTICATE_SUPPORT__
+       char url_str[256] = {0};
+       sprintf(url_str, "%s?dt=%s", MMI_AIGC_TRANS_WEBSOCKET_URI, mmi_ai_device_token_get());
+       
+    websocket_cfg.uri = url_str;
+#else
     websocket_cfg.uri = MMI_AIGC_TRANS_WEBSOCKET_URI;
+#endif
 
        AIGC_WB_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: url=%s\n", __FUNCTION__, __LINE__, websocket_cfg.uri);
 
index 907b04c..f01e2b0 100644 (file)
@@ -1,19 +1,23 @@
 
 
 
-#if 1 // def __MMI_CUSTOM_AIGC_SUPPORT__
-
 #include "uart.h"
 #include "mmi_aigc_tts_websocket_client.h"
 #include "mmi_aigc_websocket.h"
 
+
+#ifdef __MMI_CUSTOM_AIGC_SUPPORT__
+
 //#define MMI_AIGC_TTS_WEBSOCKET_URI "ws://121.40.67.151:9099/tts/stream"
-#define MMI_AIGC_TTS_WEBSOCKET_URI "ws://118.145.158.207:80/tts/stream"
+//#define MMI_AIGC_TTS_WEBSOCKET_URI "ws://118.145.158.207:80/tts/stream"
+#define MMI_AIGC_TTS_WEBSOCKET_URI "ws://amp.raisound.com/tts/stream"
 
 static sim_esp_websocket_client_handle_t s_aigc_tts_ws_client_p = NULL;
 
 extern void mmi_aigc_tts_websocket_recv_data_handler(char * data_ptr, int data_len, int payload_len, int payload_offset);
-
+#ifdef __MMI_CUSTOM_AI_AUTHENTICATE_SUPPORT__
+extern char * mmi_ai_device_token_get(void);
+#endif
 
 
 int mmi_aigc_tts_websocket_send_text_data(char * data_ptr, int data_len)
@@ -120,7 +124,14 @@ void mmi_aigc_tts_websocket_app_start(void)
        int ret = 0;
     sim_esp_websocket_client_config_t websocket_cfg = {0};
 
+#ifdef __MMI_CUSTOM_AI_AUTHENTICATE_SUPPORT__
+       char url_str[256] = {0};
+       sprintf(url_str, "%s?dt=%s", MMI_AIGC_TTS_WEBSOCKET_URI, mmi_ai_device_token_get());
+       
+       websocket_cfg.uri = url_str;
+#else
     websocket_cfg.uri = MMI_AIGC_TTS_WEBSOCKET_URI;
+#endif
 
        AIGC_WB_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: url=%s\n", __FUNCTION__, __LINE__, websocket_cfg.uri);
 
index 1e0f726..5490d0a 100644 (file)
@@ -27,6 +27,8 @@
 #include "sockets.h"
 #include "osa.h"
 
+#ifdef __MMI_CUSTOM_AIGC_SUPPORT__
+
 static int       task_run = 0;
 static OSTaskRef tts_websocket_client_ref = NULL;
 static void *    tts_websocket_client_stack_ptr = NULL;
@@ -824,3 +826,6 @@ esp_err_t tts_websocket_register_events(sim_esp_websocket_client_handle_t client
        client->handler = event_handler;
     return 0;
 }
+
+#endif
+
index c27a774..b9554e6 100644 (file)
@@ -27,6 +27,8 @@
 #include "sockets.h"
 #include "osa.h"
 
+#ifdef __MMI_CUSTOM_AIGC_SUPPORT__
+
 static int       task_run = 0;
 static OSTaskRef websocket_client_ref = NULL;
 static void *    websocket_client_stack_ptr = NULL;
@@ -824,3 +826,6 @@ esp_err_t sim_esp_websocket_register_events(sim_esp_websocket_client_handle_t cl
        client->handler = event_handler;
     return 0;
 }
+
+#endif
+
index 286ea1b..69eb5b3 100644 (file)
@@ -12,6 +12,8 @@
 #include "esp_log.h"
 #include "sim_esp_websocket_client.h"
 
+#ifdef __MMI_CUSTOM_AIGC_SUPPORT__
+
 #define NO_DATA_TIMEOUT_SEC 10
 
 char config_websocket_uri[1024] = "ws://echo.websocket.org";
@@ -144,3 +146,7 @@ int sim_app_main(void)
     sim_websocket_app_start();
        return 0;
 }
+
+
+#endif
+