霍尼维尔的EDA51扫描适配

This commit is contained in:
wujie
2023-04-10 16:17:49 +08:00
parent 27216aa2af
commit 2485332d77
3 changed files with 13 additions and 6 deletions

View File

@ -14,7 +14,8 @@ public enum BrandEnum {
ROCKCHIP("瑞芯微电子", "rockchip"), ROCKCHIP("瑞芯微电子", "rockchip"),
TEST("测试设备", "test"), TEST("测试设备", "test"),
IDATA("匿名设备", "idata"), IDATA("匿名设备", "idata"),
HONEY_WELL("霍尼维尔", "mobiwire"), HONEY_WELL_EDA50P("霍尼维尔EDA50P", "mobiwire"),
HONEY_WELL_EDA51("霍尼维尔EDA51", "honeywell"),
ALPS("阿尔卑斯", "alps"); ALPS("阿尔卑斯", "alps");
private String name; private String name;

View File

@ -86,7 +86,8 @@ public class MainActivity extends AppCompatActivity implements ResultListener{
case ALPS: case ALPS:
adapter = new AlpsAdapter(this, this); adapter = new AlpsAdapter(this, this);
break; break;
case HONEY_WELL: case HONEY_WELL_EDA50P:
case HONEY_WELL_EDA51:
adapter = new HoneywellAdapter(this, this); adapter = new HoneywellAdapter(this, this);
break; break;
} }

View File

@ -57,10 +57,15 @@ public class HoneywellAdapter implements Adapter {
} }
public void openContinueScan(){ public void openContinueScan(){
/**
* 扫描正常 if("eda50p".equals(Build.MODEL.toLowerCase())){ // 扫描正常
*/ intent = new Intent(context, ScanServiceEDA50P.class);
if("eda50p".equals(Build.MODEL.toLowerCase())){ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context.getApplicationContext().startForegroundService(intent);
}else {
context.getApplicationContext().startService(intent);
}
}else if("eda51".equals(Build.MODEL.toLowerCase())){ // 扫描正常
intent = new Intent(context, ScanServiceEDA50P.class); intent = new Intent(context, ScanServiceEDA50P.class);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context.getApplicationContext().startForegroundService(intent); context.getApplicationContext().startForegroundService(intent);