增加状态信息
authorxue <2144439972@qq.com>
Tue, 23 Dec 2025 12:34:50 +0000 (20:34 +0800)
committerxue <2144439972@qq.com>
Tue, 23 Dec 2025 12:34:50 +0000 (20:34 +0800)
code/sdk/application/wearable/ln/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp
code/sdk/zhihui/leiniao/imsl_ln/ln_api.c
code/sdk/zhihui/leiniao/imsl_ln/ln_api.h
code/sdk/zhihui/leiniao/imsl_ln/ln_api_story_random.c

index b3ffe5b..f277073 100644 (file)
@@ -219,6 +219,13 @@ namespace OHOS
         deviceInfo += " rsrq_quality:" + std::string(cat1_api_runtime_get_cat1_rsrq_quality())+ "\n";
         deviceInfo += "cat1 csq_rssi:" + std::to_string(cat1_api_runtime_get_cat1_signal())+ " "+std::to_string(cat1_api_runtime_get_cat1_signal_bars())+"\n";
 #endif
+        // 检查设备业务忙状态
+        const char* busyStatus = uapi_ln_get_device_busy_status();
+        if (busyStatus != NULL) {
+            deviceInfo += "业务状态:业务忙 - " + std::string(busyStatus) + "\n";
+        } else {
+            deviceInfo += "业务状态:空闲\n";
+        }
         return deviceInfo;
     }
 
index c705dc0..6088eb2 100644 (file)
@@ -1491,4 +1491,40 @@ errcode_t uapi_ln_http_server_init(void)
     // uapi_ln_file_recv_init();
 
     return ERRCODE_SUCC;
+}
+
+/* 获取设备业务忙状态(返回业务忙描述字符串,如果设备空闲则返回NULL) */
+const char* uapi_ln_get_device_busy_status(void)
+{
+    // 检查HTTP下载中(包括表情下载、屏保下载、OTA下载)
+    if (uapi_ln_is_file_downloading() == 1) {
+        int download_type = uapi_ln_get_file_download_type();
+        if (download_type == LN_FILE_DOWNLOAD_TYPE_EMOJI) {
+            return "表情下载中";
+        } else if (download_type == LN_FILE_DOWNLOAD_TYPE_SCREEN_IMAGE) {
+            return "屏保下载中";
+        } else {
+            return "文件下载中";
+        }
+    }
+    
+    // 检查OTA下载中
+    if (uapi_ln_is_ota_downloading() == 1) {
+        return "OTA升级包下载中";
+    }
+
+    // 检查讲故事中(睡眠模式激活表示在讲故事)
+    if (uapi_get_sleep_mode_active()) {
+        return "讲故事中";
+    }
+    
+    // 检查对话中(通过音频初始化状态判断,音频初始化通常表示在对话模式)
+    if (ln_ws_is_audio_initialized()) {
+        return "对话中";
+    }
+    
+
+    
+    // 设备空闲
+    return NULL;
 }
\ No newline at end of file
index f3b095e..ccf4e97 100644 (file)
@@ -376,6 +376,10 @@ void ln_parse_bluetooth_unbind(const char *json_str, int json_len);
 void ln_send_bluetooth_status_report(const char *bluetooth_status);
 /* 设置睡眠模式状态标志位 */
 void uapi_set_sleep_mode_active(bool active);
+/* 获取睡眠模式状态标志位 */
+bool uapi_get_sleep_mode_active(void);
+/* 获取设备业务忙状态(返回业务忙描述字符串,如果设备空闲则返回NULL) */
+const char* uapi_ln_get_device_busy_status(void);
 /* 蓝牙连接命令数据结构 */
 typedef struct {
     char user_id[64];
index 530d27b..1b2c5fd 100644 (file)
@@ -312,6 +312,11 @@ void uapi_set_sleep_mode_active(bool active)
     g_sleep_mode_active = active;
 }
 
+bool uapi_get_sleep_mode_active(void)
+{
+    return g_sleep_mode_active;
+}
+
 /* 解析哄睡模式开始:提取data.storyTheme并触发随机故事 */
 void ln_parse_sleep_mode_start(const char *json_str, int json_len)
 {