cordovadatawedge

DataWedge set picklist programmatically


I am using a TC25 and would like to set the Picklist option in Zebra's Datawedge by passing a set_config intent to the DataWedge service.

I am using a cordova app and am sending the intent using this plugin.

The relevant code is below:

var paramList = {  
  "picklist": "2" //enable software picklist  
};   

//config params  
var profileConfig = {  
      "PROFILE_NAME": "my_profile_name",  
      "PROFILE_ENABLED": "true",  
      "CONFIG_MODE": "UPDATE",  
      "PLUGIN_CONFIG": {  
        "PLUGIN_NAME": "BARCODE",  
        "PARAM_LIST": paramList  
      }  
    };


//below code sends the intent to datawedge  
window.plugins.intentShim.sendBroadcast({    
  action: 'com.symbol.datawedge.api.ACTION',    
  extras: {    
    "com.symbol.datawedge.api.SET_CONFIG": profileConfig,    
    "SEND_RESULT": "true"   
  }    
},    
  function () { },    
  function () { } 

I am using a TC25, I am able to create the profile, associate the profile and scanning works and I'm able to get the barcode output, the error is with setting the params of the profile. The error it returns is "Invalid Params"


Solution

  • When updating the config for the barcode, we need to specify the scanner selection for it to work, so we need to modify paramList as shown below:

    var paramList = {  
      "scanner_selection": "auto",
      "picklist": "2" //enable software picklist  
    };