代码之家  ›  专栏  ›  技术社区  ›  Serve Laurijssen

在Zebra Datawedge应用程序中添加正确的捆绑订单

  •  0
  • Serve Laurijssen  · 技术社区  · 3 年前

    我开发了一款android应用程序,带有Zebra RS5100手指扫描仪。到目前为止,扫描仪与设备配对,然后我手动打开“Datawedge”,启用最小长度为4、最大长度为20的codabar。

    根据文件

    https://techdocs.zebra.com/datawedge/6-9/guide/api/setconfig/

    可以在Bundle+Intent中设置“decoder_codabar”、“decoder_codabar_length1”和“decoder_codabar_length2”。

    要传递给SendBroadcast的包及其设置的正确列表是什么?以下代码启用datawedge中的配置文件,并将扫描仪输入设置为启用。但除此之外,没有其他例子。 我应该创建一个新的Bundle并将其添加到bParams Bundle,还是将设置添加到bParams Bundle本身?

    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;
    }
    
    0 回复  |  直到 3 年前
        1
  •  1
  •   Serve Laurijssen    3 年前

    终于弄明白了,也许有一天会有人发现它的用处。

    只是加上

        barCodeProps.PutString("decoder_codabar_enabled", "true");
        barCodeProps.PutString("decoder_codabar_length1", "3");
    

    这还不够。 只有在将“扫描仪自动选择”添加到捆绑包中后,它才起作用。

    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");