我开发了一个带有斑马RS5100指纹扫描仪的安卓应用程序。到目前为止,扫描仪与设备配对,然后我手动打开"Datawedge“,启用codabar,最小长度为4,最大长度为20。
根据文件所说
https://techdocs.zebra.com/datawedge/6-9/guide/api/setconfig/
可以在Bundle + Intent中设置'decoder_codabar‘、'decoder_codabar_length1’和'decoder_codabar_length2‘。
要传递给SendBroadcast的捆绑包及其设置的正确列表是什么?下面的代码在datawedge中启用配置文件,并将扫描仪输入设置为启用。但更深一层的是,没有例子。我应该创建一个新的捆绑包并将其添加到bParams捆绑包中,还是将设置添加到bParams捆绑包本身?
public static Intent Init()
{
Bundle bMain = new Bundle();
bMain.PutString("PROFILE_NAME", "SorterApp");
bMain.PutString("PROFILE_ENABLED", "true");
bMain.PutString("CONFIG_MODE", "UPDATE");
Bundle bConfig = new Bundle();
bConfig.PutString("PLUGIN_NAME", "BARCODE");
bConfig.PutString("RESET_CONFIG", "false");
Bundle bParams = new Bundle();
bParams.PutString("scanner_input_enabled", "true");
bConfig.PutBundle("PARAM_LIST", bParams);
bMain.PutBundle("PLUGIN_CONFIG", bConfig);
// decoder_codabar ??????
// decoder_i2of5 ????????
// decoder_codabar_length1 ?????
Intent dataWedgeIntent = new Intent();
dataWedgeIntent.SetAction("com.symbol.datawedge.api.ACTION");
dataWedgeIntent.PutExtra("com.symbol.datawedge.api.SET_CONFIG", bMain);
return dataWedgeIntent;
}发布于 2021-10-20 13:20:33
最终弄明白了,也许有一天会有人发现它的用处。
只是添加
barCodeProps.PutString("decoder_codabar_enabled", "true");
barCodeProps.PutString("decoder_codabar_length1", "3");是不够的。只有在将scanner_selection auto添加到捆绑包之后,它才能工作。
barCodeProps.PutString("scanner_selection", "auto");下面是完整的函数
public static Intent Init()
{
Bundle profileConfig = new Bundle();
profileConfig.PutString("PROFILE_NAME", "RopsSorterApp");
profileConfig.PutString("PROFILE_ENABLED", "true");
profileConfig.PutString("CONFIG_MODE", "OVERWRITE");
Bundle barCodeConfig = new Bundle();
barCodeConfig.PutString("PLUGIN_NAME", "BARCODE");
barCodeConfig.PutString("RESET_CONFIG", "true");
Bundle barCodeProps = new Bundle();
barCodeProps.PutString("scanner_selection", "auto");
barCodeProps.PutString("scanner_input_enabled", "true");
barCodeProps.PutString("decoder_codabar_enabled", "true");
barCodeProps.PutString("decoder_codabar_length1", "3");
barCodeProps.PutString("decoder_i2of5", "true");
barCodeProps.PutString("decoder_i2of5_length1", "3");
barCodeConfig.PutBundle("PARAM_LIST", barCodeProps);
profileConfig.PutBundle("PLUGIN_CONFIG", barCodeConfig);
Intent dataWedgeIntent = new Intent();
dataWedgeIntent.SetAction("com.symbol.datawedge.api.ACTION");
dataWedgeIntent.PutExtra("com.symbol.datawedge.api.SET_CONFIG", profileConfig);
return dataWedgeIntent;
}然后将意图广播到datawedge应用程序。
SendBroadcast(AutoConfig.Init());请注意,使用覆盖重置所有其他设置
bMain.PutString("CONFIG_MODE", "OVERWRITE");如果您不想使用更新
bMain.PutString("CONFIG_MODE", "UPDATE");https://stackoverflow.com/questions/69642798
复制相似问题