Commit 9dea0b3b by pye52

Merge branch 'new_master' into new_for_phone

parents c3797dce 57ae0b72
...@@ -9,12 +9,13 @@ public class QRCodeScanFactory { ...@@ -9,12 +9,13 @@ public class QRCodeScanFactory {
private static final String TPS_PORT = "/dev/ttyS0"; private static final String TPS_PORT = "/dev/ttyS0";
private static final String QUAD_PORT = "/dev/ttyS6"; private static final String QUAD_PORT = "/dev/ttyS6";
public static IQRCodeScan create() throws Exception { public static IQRCodeScan create() throws Exception {
if (Build.MODEL.contains(TPS)) { String model = Build.MODEL;
if (model.contains(TPS)) {
return new TPS(TPS_PORT); return new TPS(TPS_PORT);
} else if (Build.DEVICE.contains(QUAD)) { } else if (model.contains(QUAD)) {
return new QUAD(QUAD_PORT); return new QUAD(QUAD_PORT);
} else { } else {
throw new RuntimeException("不明设备型号: " + Build.DEVICE); throw new RuntimeException("不明设备型号: " + model);
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment