[FIX] 通用版下位機 COM port 改為與中國醫相同
General 的下位機硬體與中國醫(Cmuh)相同(晟崴為最新硬體),故 COM port 應接 ttyS1/ttyS2 而非原本的 ttyS7/ttyS6。 ComPort.getFilepath() 改為:只有晟崴(Chengwai) 用最新的 ttyS7/ttyS6, 其餘(General + Cmuh)用 ttyS1/ttyS2。晟崴/中國醫接線不變,僅 General 調整。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
588da4a2eb
commit
275d6d1fa9
@ -46,17 +46,14 @@ public enum ComPort {
|
||||
}
|
||||
|
||||
public String getFilepath() {
|
||||
// 下位機接線:晟崴(Chengwai) 為最新硬體,使用 ttyS7/ttyS6;
|
||||
// 通用版(General) 與中國醫(Cmuh) 下位機相同,使用 ttyS1/ttyS2。
|
||||
boolean isChengwai = "Chengwai".equalsIgnoreCase(com.unibuy.smartdevice.BuildConfig.FLAVOR_project);
|
||||
if (this == COM_PORT_S1) {
|
||||
if ("Cmuh".equalsIgnoreCase(com.unibuy.smartdevice.BuildConfig.FLAVOR_project)) {
|
||||
return "/dev/ttyS1";
|
||||
}
|
||||
return "/dev/ttyS7";
|
||||
return isChengwai ? "/dev/ttyS7" : "/dev/ttyS1";
|
||||
}
|
||||
if (this == COM_PORT_S2) {
|
||||
if ("Cmuh".equalsIgnoreCase(com.unibuy.smartdevice.BuildConfig.FLAVOR_project)) {
|
||||
return "/dev/ttyS2";
|
||||
}
|
||||
return "/dev/ttyS6";
|
||||
return isChengwai ? "/dev/ttyS6" : "/dev/ttyS2";
|
||||
}
|
||||
return filepath;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user