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;
}
// 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
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];
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)
{