feat: update COM port terminology and refine button styling for touch support
This commit is contained in:
+4
-4
@@ -13,7 +13,7 @@ def _serial_module():
|
||||
try:
|
||||
import serial
|
||||
except ImportError as exc:
|
||||
raise HTTPException(status_code=500, detail="MCU 串口功能需要安裝 pyserial") from exc
|
||||
raise HTTPException(status_code=500, detail="MCU COM Port功能需要安裝 pyserial") from exc
|
||||
return serial
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ def write_mcu_command_response(params: MCUWriteParams):
|
||||
|
||||
target_port = (params.port or MCU_SERIAL_PORT).strip()
|
||||
if not target_port:
|
||||
raise HTTPException(status_code=400, detail="MCU 串口不可為空")
|
||||
raise HTTPException(status_code=400, detail="MCU COM Port不可為空")
|
||||
|
||||
serial = _serial_module()
|
||||
payload = (cmd + "\r\n").encode("ascii", errors="strict")
|
||||
@@ -39,7 +39,7 @@ def write_mcu_command_response(params: MCUWriteParams):
|
||||
written = ser.write(payload)
|
||||
ser.flush()
|
||||
except serial.SerialException as exc:
|
||||
raise HTTPException(status_code=500, detail=f"MCU 串口傳送失敗: {str(exc)}") from exc
|
||||
raise HTTPException(status_code=500, detail=f"MCU COM Port傳送失敗: {str(exc)}") from exc
|
||||
|
||||
return {
|
||||
"status": "ok",
|
||||
@@ -55,7 +55,7 @@ def list_mcu_ports_response():
|
||||
try:
|
||||
from serial.tools import list_ports
|
||||
except ImportError as exc:
|
||||
raise HTTPException(status_code=500, detail="MCU 串口清單功能需要安裝 pyserial") from exc
|
||||
raise HTTPException(status_code=500, detail="MCU COM Port清單功能需要安裝 pyserial") from exc
|
||||
|
||||
ports = [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user