Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions components/ts_api/src/ts_api_lpmu_access.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "ts_scp.h"
#include "ts_ssh_client.h"
#include "ts_ssh_hosts_config.h"
#include "ts_usb_mux.h"
#include "esp_log.h"
#include "freertos/FreeRTOS.h"
#include "freertos/semphr.h"
Expand Down Expand Up @@ -403,6 +404,18 @@ static esp_err_t api_lpmu_access_start(const cJSON *params, ts_api_result_t *res
return ESP_ERR_INVALID_STATE;
}

if (!ts_usb_mux_is_configured()) {
lpmu_unlock();
ts_api_result_error(result, TS_API_ERR_HARDWARE, "USB MUX 未配置,无法确认是否已切换到 LPMU");
return ESP_ERR_INVALID_STATE;
}

if (ts_usb_mux_get_target() != TS_USB_MUX_LPMU) {
lpmu_unlock();
ts_api_result_error(result, TS_API_ERR_HARDWARE, "请先将 USB 切换到 LPMU 后再接入上层网络");
return ESP_ERR_INVALID_STATE;
}

memset(&s_status, 0, sizeof(s_status));
s_status.run_id = ++s_next_run_id;
if (s_next_run_id == 0) {
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.8
0.4.9
Loading