From: xue <2144439972@qq.com> Date: Tue, 23 Dec 2025 12:34:50 +0000 (+0800) Subject: 增加状态信息 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=73d4e5a47e5a078e7ec7864c6946beb9e1cb425a;p=mirrors%2FFD230.git 增加状态信息 --- diff --git a/code/sdk/application/wearable/ln/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp b/code/sdk/application/wearable/ln/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp index b3ffe5b2f..f27707345 100644 --- a/code/sdk/application/wearable/ln/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp +++ b/code/sdk/application/wearable/ln/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp @@ -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; } diff --git a/code/sdk/zhihui/leiniao/imsl_ln/ln_api.c b/code/sdk/zhihui/leiniao/imsl_ln/ln_api.c index c705dc0c2..6088eb2aa 100644 --- a/code/sdk/zhihui/leiniao/imsl_ln/ln_api.c +++ b/code/sdk/zhihui/leiniao/imsl_ln/ln_api.c @@ -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 diff --git a/code/sdk/zhihui/leiniao/imsl_ln/ln_api.h b/code/sdk/zhihui/leiniao/imsl_ln/ln_api.h index f3b095e34..ccf4e979e 100644 --- a/code/sdk/zhihui/leiniao/imsl_ln/ln_api.h +++ b/code/sdk/zhihui/leiniao/imsl_ln/ln_api.h @@ -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]; diff --git a/code/sdk/zhihui/leiniao/imsl_ln/ln_api_story_random.c b/code/sdk/zhihui/leiniao/imsl_ln/ln_api_story_random.c index 530d27bde..1b2c5fd43 100644 --- a/code/sdk/zhihui/leiniao/imsl_ln/ln_api_story_random.c +++ b/code/sdk/zhihui/leiniao/imsl_ln/ln_api_story_random.c @@ -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) {