feat(core): micropython 板卡文件管理 右键菜单添加 上传下载 选项

This commit is contained in:
王立帮
2025-08-21 21:40:18 +08:00
parent 4a45323c82
commit 30f3da24b1
11 changed files with 171 additions and 14 deletions

View File

@@ -211,7 +211,7 @@ class AmpyExt extends Ampy {
this.#active_ = false;
}
async get(filename, timeout = 5000) {
async get(filename, encoding = 'utf8', timeout = 5000) {
if (!this.isActive()) {
throw new Error(Msg.Lang['ampy.portIsNotOpen']);
}
@@ -222,7 +222,11 @@ class AmpyExt extends Ampy {
if (dataError) {
return '';
}
return this.#device_.decode(this.unhexlify(data));
if (encoding === 'utf8') {
return this.#device_.decode(this.unhexlify(data));
} else {
return this.unhexlify(data);
}
}
async put(filename, data, timeout = 5000) {