From: luozheng <1732036298@qq.com> Date: Thu, 24 Jul 2025 03:57:01 +0000 (+0800) Subject: application文件夹下wstp文件夹合并提交 X-Git-Tag: leiniao_debug_1.0.0_20250922_020716~219 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=a1dae57acd6301535e53f56a4a491a6d80b06955;p=mirrors%2FFD230.git application文件夹下wstp文件夹合并提交 --- diff --git a/code/sdk/application/wstp/at_service/app/app_at_process.c b/code/sdk/application/wstp/at_service/app/app_at_process.c index b8f53242c..25d054a06 100644 --- a/code/sdk/application/wstp/at_service/app/app_at_process.c +++ b/code/sdk/application/wstp/at_service/app/app_at_process.c @@ -2875,3 +2875,24 @@ void app_at_process(uint8_t *data, uint32_t data_len) } g_app_diag_flag = false; } + +uint32_t test_get_mem_info(uint8_t memType, uint32_t *used, uint32_t *free) +{ +#if LOSCFG_MEM_TASK_STAT && defined __LITEOS__ + void *heapMan = NULL; + LOS_MEM_POOL_STATUS status; + if (memType) { + heapMan = OS_EXTEND_MEM_ADDR; + } else { + heapMan = OS_SYS_MEM_ADDR; + } + if (LOS_MemInfoGet(heapMan, &status) != LOS_NOK) { + *used = status.uwTotalUsedSize; + *free = status.uwTotalFreeSize; + printf("test_get_mem_info used = %d, free = %d\n", *used, *free); + } else { + printf("test_get_mem_info fail\n"); + } +#endif + return 0; +} diff --git a/code/sdk/application/wstp/at_service/app/app_cmd_manager.c b/code/sdk/application/wstp/at_service/app/app_cmd_manager.c index 0b2dc24b8..9c8014034 100644 --- a/code/sdk/application/wstp/at_service/app/app_cmd_manager.c +++ b/code/sdk/application/wstp/at_service/app/app_cmd_manager.c @@ -31,6 +31,8 @@ #include "app_test_fs.h" #include "log_file.h" #include "diag_msg.h" +#include "chip_io.h" +#include "chip_exception_utils.h" #define ARRAY_COUNT(array) (sizeof(array) / sizeof(array[0])) @@ -223,14 +225,6 @@ static uint32_t parse_emmc_set_driver_cap_handle(uint8_t *para, uint32_t para_le return ERRCODE_SUCC; } -static uint32_t parse_heap_info_handle(uint8_t *para, uint32_t para_len, char *str_cmd) -{ - unused(str_cmd); - - app_pkg_msg_send(HEAPINFO, DIAG_CONTROL_FALSE, para, para_len); - return ERRCODE_SUCC; -} - static uint32_t parse_stack_info_handle(uint8_t *para, uint32_t para_len, char *str_cmd) { unused(str_cmd); @@ -1036,8 +1030,54 @@ static uint32_t app_sdio_test(uint8_t *para, uint32_t para_len, char *str_cmd) } #endif +static uint32_t parse_heap_info_handle(uint8_t *para, uint32_t para_len, char *str_cmd) +{ + unused(str_cmd); + app_pkg_msg_send(HEAPINFO, DIAG_CONTROL_FALSE, para, para_len); + return ERRCODE_SUCC; +} + +static uint32_t app_test_mcu_bus_status(uint8_t *para, uint32_t para_len, char *str_cmd) +{ + unused(str_cmd); + test_mcu_bus(); + wstp_print("\r\nOK~\r\n"); + return ERRCODE_SUCC; +} + +static uint32_t app_test_rw_error(uint8_t *para, uint32_t para_len, char *str_cmd) +{ + unused(str_cmd); + wstp_print("\r\nOK~\r\n"); + writew(0x0, 0); + return ERRCODE_SUCC; +} + +static uint32_t app_test_watchdog_error(uint8_t *para, uint32_t para_len, char *str_cmd) +{ + unused(str_cmd); + wstp_print("\r\nOK~\r\n"); + osal_irq_lock(); + while(1) { + } + return ERRCODE_SUCC; +} + +static uint32_t app_test_hard_fault_dog_error(uint8_t *para, uint32_t para_len, char *str_cmd) +{ + unused(str_cmd); + wstp_print("\r\nOK~\r\n"); + writew(SPI_HOST_CLOCK_REG, 0x0110); // 关闭sdio的配置时钟,构造访问sdio硬件狗超时场景 + uint16_t value =readw(SPI_HOST_REG_FOR_HADR_DOG_TEST); //访问sdio的配置寄存器 + return ERRCODE_SUCC; +} + static const at_cmd_table_t g_app_cmd[] = { /* 无参数无特殊处理AT命令 */ + { "AT^TESTMCUBUS", app_test_mcu_bus_status, "" }, //测试总线状态 + { "AT^TESTRWERROR", app_test_rw_error, "" }, //测试普通的读写超时异常 + { "AT^TESTWATCHDOGERROR", app_test_watchdog_error, "" }, //测试普通的狗超时异常 + { "AT^TESTHARDDOGERROR", app_test_hard_fault_dog_error, "" }, //测试硬件狗超时异常 { "AT^HEAPINFO", parse_heap_info_handle, "" }, { "AT^STACKINFO", parse_stack_info_handle, "" }, /* 直接发A核的命令 */ diff --git a/code/sdk/application/wstp/at_service/graphic/sample/gpu_sample.c b/code/sdk/application/wstp/at_service/graphic/sample/gpu_sample.c index 55382c6b9..bad768f8e 100644 --- a/code/sdk/application/wstp/at_service/graphic/sample/gpu_sample.c +++ b/code/sdk/application/wstp/at_service/graphic/sample/gpu_sample.c @@ -351,6 +351,8 @@ td_void wstp_gpu_sample_process(int argc, char *argv[]) print_mipi_and_dpu_reg(argc - 1, argv + 1); } else if (strcmp((char *)argv[0], "dpu_save_fb") == 0) { dfx_dpu_save_fb_enable(argc - 1, argv + 1); + } else if (strcmp((char *)argv[0], "vau_print") == 0) { + vau_dfx_print(argc - 1, argv + 1); } else if (strcmp((char *)argv[0], "vau_proc") == 0) { vau_dfx_proc_read(argc - 1, argv + 1); } else if (strcmp((char *)argv[0], "vau_api_print") == 0) { diff --git a/code/sdk/application/wstp/at_service/ohosfwk/CMakeLists.txt b/code/sdk/application/wstp/at_service/ohosfwk/CMakeLists.txt index f1e52277e..c18054782 100644 --- a/code/sdk/application/wstp/at_service/ohosfwk/CMakeLists.txt +++ b/code/sdk/application/wstp/at_service/ohosfwk/CMakeLists.txt @@ -15,13 +15,11 @@ set(PRIVATE_HEADER ${ROOT_DIR}/openharmony/foundation/aafwk/aafwk_lite/include/aafwk/aafwk_lite/frameworks/abilitymgr_lite/include ${ROOT_DIR}/openharmony/foundation/aafwk/aafwk_lite/include/appexecfwk/appexecfwk_lite/interfaces/kits ${ROOT_DIR}/application/wearable/ohos_deps - ${ROOT_DIR}/application/wearable/nativeapp/nativeui/uiservice/include ${ROOT_DIR}/open_source/openharmony/third_party/cJSON ${ROOT_DIR}/middleware/services/gui/uikit/utils/interfaces/kits ${ROOT_DIR}/middleware/services/gui/uikit/utils/interfaces/innerkits ${ROOT_DIR}/open_source/openharmony/base/global/resmgr_lite/interfaces/innerkits/include ${ROOT_DIR}/open_source/openharmony/foundation/appexecfwk/appexecfwk_lite/include/appexecfwk/appexecfwk_lite/services/bundlemgr_lite/include - ${ROOT_DIR}/application/wearable/nativeapp/nativeui/applist/include ${ROOT_DIR}/open_source/openharmony/base/sensors/location/sample ${ROOT_DIR}/open_source/openharmony/base/sensors/sample ) diff --git a/code/sdk/application/wstp/at_service/ohosfwk/ohosfwk_at_process.cpp b/code/sdk/application/wstp/at_service/ohosfwk/ohosfwk_at_process.cpp index 54163c3ac..46c28fcb4 100644 --- a/code/sdk/application/wstp/at_service/ohosfwk/ohosfwk_at_process.cpp +++ b/code/sdk/application/wstp/at_service/ohosfwk/ohosfwk_at_process.cpp @@ -13,14 +13,14 @@ #include "bundlems_slite_client.h" #include "abilityms_slite_client.h" #include "gt_bundle_manager_service.h" -#include "ui_service.h" +#include "uiservice/ui_service.h" #include "sign_mode.h" #include "NativeAbility.h" #include "ability_manager.h" #include "js_fwk_common.h" #include "global.h" #include "msg_center_customer.h" -#include "ApplistModel.h" +#include "applist/ApplistModel.h" #include "bundle_manager.h" #include #ifdef SUPPORT_AT_LOCATION @@ -30,7 +30,6 @@ #ifdef SUPPORT_AT_SENSOR #include "sensor_sample.h" #endif -#include #define ARRAY_COUNT(array) (sizeof(array) / sizeof(array[0])) #define OHOSFWK_MAX_ARGC 8 @@ -38,6 +37,8 @@ #define OHOSFWK_SUCCESS 0 #define OHOSFWK_FAILED (-1) +#define MAX_PAGE 100 +#define ARGC_NUM 2 static void ReceiveCallback(const uint8_t resultCode, const void *resultMessage) { @@ -507,6 +508,38 @@ static uint32_t OhosfwkATCmdSensor(uint8_t *para, uint32_t paraLen, char *strCom return ret; } #endif + +static uint32_t OhosfwkATSwitchSlicePage(uint8_t *para, uint32_t paraLen, char *strCommonCmd) +{ + unused(strCommonCmd); + uint8_t argv[OHOSFWK_MAX_ARGC][OHOSFWK_MAX_ARGV_LEN] = {0}; + uint32_t argc = 0; + + int ret = ConvertCmdToParam(para, paraLen, argv, &argc); + if (ret != OHOSFWK_SUCCESS) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OhosATTestPageCmd ATCMD Convert Command Failed"); + return ERRCODE_FAIL; + } + if (argc != ARGC_NUM) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OhosATTestPageCmd ATCMD Set Parameter Failed"); + return ERRCODE_FAIL; + } + + char *sliceStr = (char *)argv[0]; + char *pageStr = (char *)argv[1]; + uint32_t sliceIndex = atoi(sliceStr); + uint32_t pageIndex = atoi(pageStr); + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "OhosATTestPageCmd(), sliceIndex = %[d], pageIndex = %[d]", sliceIndex, + pageIndex); + if (sliceIndex > VIEW_INVALIDE_APP || pageIndex > MAX_PAGE) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OhosATTestPageCmd sliceIndex/pageIndex too larget!", sliceIndex, + pageIndex); + return ERRCODE_FAIL; + } + OHOS::NativeAbility::GetInstance().SwitchSlice(sliceIndex, pageIndex); + return ERRCODE_SUCC; +} + static const at_cmd_table_t g_ohosfwk_cmd[] = { {(char *)"AT^OHOSFWK_AM_EXIT_JSAPP", OhosfwkATCmdAmExitJsApp, (char *)"00 00 00 00"}, {(char *)"AT^OHOSFWK_BM_INSTALL", OhosfwkATCmdBmInstall, (char *)"00 00 00 01"}, @@ -525,6 +558,7 @@ static const at_cmd_table_t g_ohosfwk_cmd[] = { #ifdef SUPPORT_AT_SENSOR {(char *)"AT^OHOSFWK_SENSOR", OhosfwkATCmdSensor, (char *)"00 00 00 09"}, #endif + {(char *)"AT^SWITCH_SLICE_PAGE", OhosfwkATSwitchSlicePage, (char *)"00 00 00 13"}, // 界面切换AT指令方便测试使用; }; at_cmd_table_t *get_ohosfwk_cmd_table(uint32_t *cmd_count)