GraphicService::GetInstance()->PostGraphicEvent(std::bind(ACLConnectionSuss, *bdAddr));
int earphoneConnectStatus = 1;
SendMsgToUIService(HAND_BLUETOOTH_EARPHONE_CONNECT_STATUS_NOTIFY, 0, &earphoneConnectStatus, sizeof(earphoneConnectStatus));
+ /* 与回调状态一致上报,避免 ln_bt_report_earphone_connection_status 二次读栈导致错序弹窗 */
+ GraphicService::GetInstance()->PostGraphicEvent([]() { ln_send_bluetooth_status_report("CONNECTED", true); });
}
if (connState == PROFILE_STATE_DISCONNECTED) {
if (!ret) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "a2dp disc: gap_br_set_bt_scan_mode ret = 0x%x", ret);
}
+ GraphicService::GetInstance()->PostGraphicEvent([]() { ln_send_bluetooth_status_report("DISCONNECTED", true); });
}
- //上报蓝牙耳机连接状态
- GraphicService::GetInstance()-> PostGraphicEvent([]() { ln_bt_report_earphone_connection_status(true); }); // 显示弹窗
}
uint8_t A2dpSrcPlayingState=0;
static void stress_test_save_task(void *arg)
{
uint32_t msg = 0;
- uint32_t copy_count = 0;
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "stress_test_save: task started (periodic memcpy only, no file)");
+ UNUSED(arg);
+ // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "stress_test_save: task started (periodic memcpy only, no file)");
for (;;) {
uint32_t timeout_ms = g_stress_test_active_for_save ? 1000 : osWaitForever; /* 产测中每 1 秒唤醒 */
osStatus_t st = osMessageQueueGet(g_stress_save_queue, &msg, nullptr, timeout_ms);
if (st != osOK && g_stress_test_active_for_save) {
/* 超时且产测进行中:重复内存拷贝,拉高 CPU */
stress_test_do_copy_only();
- copy_count++;
- if (copy_count % 10 == 1) { /* 每 10 秒打印一次,便于确认在运行 */
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "stress_test_save: memcpy running, count=%u", copy_count);
- }
}
}
}
if (g_stress_save_queue) {
osThreadAttr_t attr = {0};
attr.name = "stress_save";
- attr.stack_size = 1024;
+ /* 原 1024 易 stack overflow;保留足额栈以容纳 osMessageQueueGet 等调用链 */
+ attr.stack_size = 4096;
attr.priority = osPriorityBelowNormal;
if (osThreadNew(stress_test_save_task, nullptr, &attr) != nullptr) {
g_stress_save_created = true;