IntenFilter for zebra WS50 scan event

154 Views Asked by At

I used to have a zebra scanner device running where a broadcatreceiver event was registered

var filter = new IntentFilter("com.rs5100.data");

RegisterReceiver(receiver, filter);

the action string was defined in the dataWedge app and scan events were received.

Now I'm trying to get it running on a zebra ws50 device, but I cant figure out what action to register the BroadcastReceiver to. When scanning logcat emits:

scanner data received: Bundle[{com.motorolasolutions.emdk.datawedge.source=scanner, com.symbol.datawedge.source=scanner, com.symbol.datawedge.label_type=LABEL-TYPE-CODABAR, com.motorolasolutions.emdk.datawedge.data_string=C9991C, com.symbol.datawedge.data_string=C9991C, com.symbol.datawedge.scanner_identifier=INTERNAL_IMAGER, com.motorolasolutions.emdk.datawedge.label_type=LABEL-TYPE-CODABAR, com.motorolasolutions.emdk.datawedge.decode_data=[[B@b604fd], com.symbol.datawedge.decode_data=[[B@b604fd], com.symbol.datawedge.decoded_mode=single_decode}]

but no matter what action I try, the scan is not received in the application.

  • com.symbol.datawedge.api.ACTION
  • com.symbol.datawedge.DWDEMO
  • com.symbol.datawedge.intent.ACTION_DATAWEDGE_BROADCAST

or do something with a Bundle? As that is what logcat emit. Bundle{....}

1

There are 1 best solutions below

0
On BEST ANSWER

Programmatically sending Intent to Zebra's Datawedge app worked. I snipped out some settings where barcode scanner settings were chenged

    public static Intent ConfigWS50()
    {
        Bundle bMain = new Bundle();

        bMain.PutString("PROFILE_NAME", "SorterApp");
        bMain.PutString("PROFILE_ENABLED", "true");
        bMain.PutString("CONFIG_MODE", "UPDATE");

        Bundle sorterAppBundle = new Bundle();
        sorterAppBundle.PutString("PACKAGE_NAME", "com.fips.RopsSorterApp");
        sorterAppBundle.PutStringArray("ACTIVITY_LIST", new string[] { "*" });

        bMain.PutParcelableArray("APP_LIST", new Bundle[] { sorterAppBundle });

        Bundle barCodeConfig = new Bundle();
        barCodeConfig.PutString("PLUGIN_NAME", "BARCODE");
        barCodeConfig.PutString("RESET_CONFIG", "true");

        Bundle ipOutput = new Bundle();
        ipOutput.PutString("PLUGIN_NAME", "IP");
        ipOutput.PutString("RESET_CONFIG", "true");

        Bundle ipOutputProps = new Bundle();
        ipOutputProps.PutString("ip_output_enabled", "false");

        ipOutput.PutBundle("PARAM_LIST", ipOutputProps);
        bMain.PutBundle("PLUGIN_CONFIG", ipOutput);

        Bundle barCodeProps = new Bundle();
        barCodeProps.PutString("scanner_selection", "auto");
        barCodeProps.PutString("scanner_input_enabled", "true");

        barCodeConfig.PutBundle("PARAM_LIST", barCodeProps);

        Bundle bConfigIntent = new Bundle();
        Bundle intentOutput = new Bundle();
        intentOutput.PutString("intent_output_enabled", "true");
        intentOutput.PutString("intent_action", "com.device.data");
        intentOutput.PutString("intent_category", Intent.CategoryDefault);
        intentOutput.PutInt("intent_delivery", 2);

        bConfigIntent.PutString("PLUGIN_NAME", "INTENT");
        bConfigIntent.PutString("RESET_CONFIG", "true");
        bConfigIntent.PutBundle("PARAM_LIST", intentOutput);

        bMain.PutParcelableArray("PLUGIN_CONFIG", new Bundle[] { bConfigIntent, barCodeConfig });

        Intent dataWedgeIntent = new Intent();
        dataWedgeIntent.SetAction("com.symbol.datawedge.api.ACTION");
        dataWedgeIntent.PutExtra("com.symbol.datawedge.api.SET_CONFIG", bMain);

        return dataWedgeIntent;
    }

SendBroadcast(AutoConfig.ConfigWS50());

Then every app can subscribe to the registered intent action and make to use the same string as com.device.data.

intentOutput.PutString("intent_action", "com.device.data");