From: Caisking Date: Wed, 15 Oct 2025 02:37:38 +0000 (+0800) Subject: 合并 X-Git-Tag: V1.0.9_20251128_194606_LN~212^2~23 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=bdf954ae7bc7ec2f01d85b71cc4c52cae0c9790b;p=mirrors%2FFD230.git 合并 --- diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp index 2086842bd..1c6e57ba9 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp @@ -102,42 +102,10 @@ static void LN_OPERATE_AlarmCallBackProcC(struct tm curTime) if (curTime.tm_hour == 0 && curTime.tm_min == 0 && curTime.tm_sec == 0) { do_ln_http_server_send_data(LN_HTTP_SERVICE_CMD_EMOJI_REPORT_ALL, NULL, 0); } - - if(curTime.tm_hour == 15 && curTime.tm_min == 30 && curTime.tm_sec == 0) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "开始锻炼了"); - - //切换到锻炼的表情和状态 - if(OHOS::ThunderBirdModel::GetInstance()) - { - OHOS::ThunderBirdModel::GetInstance()->ThunderBirdModel::SetCurrentStatusText("锻炼中"); - OHOS::ThunderBirdModel::GetInstance()->ThunderBirdModel::SetCurrentExpression("Exercise"); - OHOS::ThunderBirdModel::GetInstance()->SetCurrentExpressionAndStatus(); - } - } - if(curTime.tm_hour == 17 && curTime.tm_min == 0 && curTime.tm_sec == 0) + //整点上报时间线状态 + if(curTime.tm_hour % 24 == 0 && curTime.tm_min == 0 && curTime.tm_sec == 0) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "开始玩耍了"); - - //切换到锻炼的表情和状态 - if(OHOS::ThunderBirdModel::GetInstance()) - { - OHOS::ThunderBirdModel::GetInstance()->ThunderBirdModel::SetCurrentStatusText("玩耍中"); - OHOS::ThunderBirdModel::GetInstance()->ThunderBirdModel::SetCurrentExpression("Play"); - OHOS::ThunderBirdModel::GetInstance()->SetCurrentExpressionAndStatus(); - } - } - if(curTime.tm_hour == 10 && curTime.tm_min == 35 && curTime.tm_sec == 0) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "开始哭了"); - - //切换到锻炼的表情和状态 - if(OHOS::ThunderBirdModel::GetInstance()) - { - OHOS::ThunderBirdModel::GetInstance()->ThunderBirdModel::SetCurrentStatusText("难过了..."); - OHOS::ThunderBirdModel::GetInstance()->ThunderBirdModel::SetCurrentExpression("crying"); - OHOS::ThunderBirdModel::GetInstance()->SetCurrentExpressionAndStatus(); - } + do_ln_http_server_send_data(LN_HTTP_SERVICE_CMD_TIMELINE_GET_STATUS, NULL, 0); } } diff --git a/code/sdk/zhihui/config/include/ConfigModel.h b/code/sdk/zhihui/config/include/ConfigModel.h index 6f88f31e1..13bcfbc41 100644 --- a/code/sdk/zhihui/config/include/ConfigModel.h +++ b/code/sdk/zhihui/config/include/ConfigModel.h @@ -321,7 +321,7 @@ namespace OHOS {ConfigDataType::DATATYPE_STRING, "cat1_imei", "pls poweron 4G first" },//CONFIGMODEL_ITEM_CAT1_IMEI, {ConfigDataType::DATATYPE_STRING, "cat1_modemver", "pls poweron 4G first" },//CONFIGMODEL_ITEM_CAT1_MODEMVER, {ConfigDataType::DATATYPE_STRING, "cat1_pyver", "pls poweron 4G first" },//CONFIGMODEL_ITEM_CAT1_PYVER, - {ConfigDataType::DATATYPE_INT, "ppp_baudrate", "1000000" },//CONFIGMODEL_ITEM_PPP_BAUDRATE, + {ConfigDataType::DATATYPE_INT, "ppp_baudrate", "2000000" },//CONFIGMODEL_ITEM_PPP_BAUDRATE, {ConfigDataType::DATATYPE_INT, "language_id", "0" },//CONFIGMODEL_ITEM_LANGUAGE_ID, //默认选择中文 {ConfigDataType::DATATYPE_STRING, "language_code", "zh" },//CONFIGMODEL_ITEM_LANGUAGE_CODE, //默认没有选择语言 {ConfigDataType::DATATYPE_INT, "timezone", "32" },//CONFIGMODEL_ITEM_TIMEZONE, //单位刻钟 默认+8 小时 = 4*8 = 32 刻钟 diff --git a/code/sdk/zhihui/ppp/example/ppp_at_cmd.c b/code/sdk/zhihui/ppp/example/ppp_at_cmd.c index 45bc06fc1..50f867d49 100644 --- a/code/sdk/zhihui/ppp/example/ppp_at_cmd.c +++ b/code/sdk/zhihui/ppp/example/ppp_at_cmd.c @@ -2464,7 +2464,7 @@ static errcode_t at_ppp_set_config_baudrate(uint8_t *para, uint32_t paraLen, cha ppp_print_info("PPP SET BAUDRATE: Successfully set PPP baudrate from %d to %d in config model\n", current_baudrate, baudrate); ppp_print_info("PPP SET BAUDRATE: Note: This change will take effect after PPP module restart\n"); - errcode_t rett = ppp_at_set_baudrate(baudrate); + errcode_t rett = ppp_api_set_baudrate_in_all_mode(baudrate); ppp_print_info("PPP SET BAUDRATE: Successfully set PPP baudrate to %d, ret: %d\n ", baudrate,rett); return ERRCODE_SUCC; } diff --git a/code/sdk/zhihui/ppp/include/ppp_api.h b/code/sdk/zhihui/ppp/include/ppp_api.h index 69eee3620..c70a86fd5 100644 --- a/code/sdk/zhihui/ppp/include/ppp_api.h +++ b/code/sdk/zhihui/ppp/include/ppp_api.h @@ -62,6 +62,13 @@ errcode_t ppp_ppp_mode_pause(void); */ errcode_t ppp_ppp_mode_resume(void); +/** + * @brief 设置PPP波特率 + * @param baudrate 波特率 + * @return 错误码 + */ +errcode_t ppp_api_set_baudrate_in_all_mode(uint32_t baudrate); + /* PPP数据接收线程函数已移至ppp_lwip_thread.c */ /** diff --git a/code/sdk/zhihui/ppp/src/ppp_api.c b/code/sdk/zhihui/ppp/src/ppp_api.c index c5cdd1e14..e5a4b8ca7 100644 --- a/code/sdk/zhihui/ppp/src/ppp_api.c +++ b/code/sdk/zhihui/ppp/src/ppp_api.c @@ -1904,6 +1904,86 @@ errcode_t ppp_api_get_default_netif(char* netif_name, uint32_t buffer_size) return ERRCODE_SUCC; } +errcode_t ppp_api_set_baudrate_in_all_mode(uint32_t baudrate) +{ + errcode_t ret = ERRCODE_SUCC; + uint8_t need_resume = 0; + uint8_t need_deinit_at = 0; + + // 1. 如果在 PPP 模式,先暂停 + if(ppp_serial_get_mode() == PPP_SERIAL_MODE_PPP_DATA) { + PPP_DEBUG_INFO("In PPP mode, pausing..."); + if (ppp_ppp_mode_pause() != ERRCODE_SUCC) { + PPP_DEBUG_ERROR("Failed to pause PPP mode"); + return ERRCODE_FAIL; + } + need_resume = 1; + + // 2. 暂停后需要初始化 AT handler 才能执行 AT 命令 + PPP_DEBUG_INFO("Initializing AT handler for command execution..."); + ppp_error_t at_ret = ppp_at_handler_init(SIO_UART_BUS, g_ppp_config.baudrate, true); + if (at_ret != PPP_ERR_OK) { + PPP_DEBUG_ERROR("Failed to initialize AT handler: %d", at_ret); + // 尝试恢复 PPP 模式 + ppp_ppp_mode_resume(); + return ERRCODE_FAIL; + } + need_deinit_at = 1; + } else { + PPP_DEBUG_INFO("Already in AT mode"); + need_resume = 0; + need_deinit_at = 0; + } + + // 3. 执行 AT 命令更新信息 + PPP_DEBUG_CRITICAL("Starting baudrate set... %u",baudrate); + if(ppp_at_set_baudrate(baudrate) != ERRCODE_SUCC) { + PPP_DEBUG_ERROR("Failed to set baudrate"); + ret = ERRCODE_FAIL; + } + + // 4. 如果需要,去初始化 AT handler 并恢复 PPP 模式 + if (need_resume) { + // 先去初始化 AT handler + if (need_deinit_at) { + PPP_DEBUG_INFO("Deinitializing AT handler..."); + ppp_at_handler_deinit(); + } + + // 然后恢复 PPP 模式 + PPP_DEBUG_INFO("Resuming PPP mode..."); + errcode_t resume_ret = ppp_ppp_mode_resume(); + if (resume_ret != ERRCODE_SUCC) { + PPP_DEBUG_ERROR("Failed to resume PPP mode: %d", resume_ret); + PPP_DEBUG_ERROR("Forcing PPP mode recovery..."); + + // 强制恢复到 PPP 模式 + ppp_serial_switch_to_ppp_mode(); + + #if PPP_USE_INTERRUPT_MODE + ppp_error_t int_ret = ppp_interrupt_enable(); + if (int_ret != PPP_ERR_OK) { + PPP_DEBUG_ERROR("Failed to enable interrupt after forced recovery: %d", int_ret); + } else { + PPP_DEBUG_INFO("PPP interrupt mode re-enabled after forced recovery"); + } + #else + ppp_error_t thread_ret = ppp_lwip_start_receive_thread(); + if (thread_ret != PPP_ERR_OK) { + PPP_DEBUG_ERROR("Failed to start receive thread after forced recovery: %d", thread_ret); + } else { + PPP_DEBUG_INFO("PPP receive thread restarted after forced recovery"); + } + #endif + + PPP_DEBUG_WARN("PPP mode forcefully recovered, but connection may be unstable"); + ret = ERRCODE_FAIL; + } + } + + return ret; +} + errcode_t ppp_api_update_netinfo_in_all_mode(void) { errcode_t ret = ERRCODE_SUCC; diff --git a/code/sdk/zhihui/ppp/src/ppp_interrupt.c b/code/sdk/zhihui/ppp/src/ppp_interrupt.c index 75df7cd90..b09a3b064 100644 --- a/code/sdk/zhihui/ppp/src/ppp_interrupt.c +++ b/code/sdk/zhihui/ppp/src/ppp_interrupt.c @@ -36,12 +36,12 @@ #define PPP_PING_PONG_BUFFER_SIZE 2048 // 每个buffer大小(2KB) #endif -#define PPP_PING_PONG_BUFFER_COUNT 3 // 三缓冲模式(改为3个) -#define PPP_PING_PONG_TIMEOUT_MS 30 // buffer超时时间(30ms) +#define PPP_PING_PONG_BUFFER_COUNT 4 // 三缓冲模式(改为3个) +#define PPP_PING_PONG_TIMEOUT_MS 50 // buffer超时时间(30ms) /* PPP中断消息队列配置 */ #define PPP_IRQ_MSG_QUEUE_SIZE 16 // 队列深度(乒乓模式下无需太大) -#define PPP_IRQ_PROCESS_TASK_PRIO 24 // 处理线程优先级 +#define PPP_IRQ_PROCESS_TASK_PRIO 28 // 处理线程优先级 #define PPP_IRQ_PROCESS_STACK_SIZE 4096 // 处理线程栈大小 /* 乒乓缓冲区状态 */