5 Replies Latest reply on Aug 12, 2014 6:14 AM by Georgiy Permyakov

    ReaderParams.illumination_mode won't setup in EMDK 2.1

    Georgiy Permyakov

      Hi everyone,

       

      I'm creating and applying new DataCapture profile like this:

      this.profileManager = (ProfileManager)emdkMgr.getInstance(FEATURE_TYPE.PROFILE);
      this.profileConfig = new ProfileConfig();
      profileConfig.dataCapture.barcode.scanner_input_enabled = ENABLED_STATE.TRUE;
      profileConfig.dataCapture.barcode.scannerSelection = DEVICETYPES.INTERNAL_CAMERA1;
      profileConfig.dataCapture.barcode.readerParams.illumination_mode = ILLUMINATION_MODE.ON;
      profileConfig.dataCapture.barcode.readerParams.picklist = PICK_LIST.CENTERED;
      profileConfig.profileName = this.profile_name;
      
      
      ... (other minor settings, such as data formatting options)
      
      
      this.profileManager.processProfile(profileConfig.profileName, ProfileManager.PROFILE_FLAG.SET, this.profileConfig);
      

       

      All the settings seems to be applied (checked from DataWedge app). Scanner is set to Camera, pick-list is activated, but illumination is always OFF, no matter what mode I set in code.

      From DataWedge app it sets up correctly (in the same profile).

      Also, profile created this way can't be read using ProfileManager.PROFILE_FLAG.GET. Results show "SUCCESS", but no data is transferred to ProfileConfig.

       

      Looks more like a bug than the feature for me.

      Any ideas on workaround? Thanks.

        • Re: ReaderParams.illumination_mode won't setup in EMDK 2.1
          Georgiy Permyakov

          Little update.

          1) Testing on TC55 device.

          2) Problem seems to be somewhere in transforming ProfileConfig object into XML and storing in internal repository. Wrong syntax or something.

          • Re: ReaderParams.illumination_mode won't setup in EMDK 2.1
            Rob Galvin

            Hi Georgiy How are you checking on if illumination mode is working? Is it just wrong in the DataWedge UI or did you actually trigger the scanner and not see the correct behavior? The PROFILE_FLAG.GET will only return what was stored in the profile. It does not actually retrieve what DataWedge currently has stored (so if you process a profile and then go into DW and make changes, the PROFILE_FLAG.GET will only return what the profile definition has not what DW has) Re: 2) Problem seems to be somewhere in transforming ProfileConfig object into XML and storing in internal repository. Wrong syntax or something. Are you seeing an error somewhere? Can you share a log file or snippet? Thanks

              • Re: ReaderParams.illumination_mode won't setup in EMDK 2.1
                Georgiy Permyakov

                Hi Robert. Thanks for the reply.

                I'm checking illumination both ways, by triggering scanner (by software trigger as well) and by checking the profile in DataWedge. In both cases all settings are clearly reflected except for illumination.

                The behavior of PROFILE_FLAG.GET you describe differs from the Docs: "If the profileFlag is set to SET, and if the given profile is not available in the EMDKConfig.xml, it will look for valid profile in extraData argument and if present, the profile will be added to the internal XML volatile repository and also applied to the device...  If profileFlag is set to GET and if the profile is present in the internal repository, it will be returned in extraData". So, from the Docs I expect SET to create profile in internal repo from ProfileConfig object and GET to retrieve it back. By "applying to the device" I understand sending some kind of reference to the profile in repo for DW. Docs are outdated or I just don't get something?

                About (2) - I'm not seeing any errors, it's just a guess. I'm not sure how to trace this behavior, logcat doesn't show much of what EMDK is doing. Maybe it is possible to get the XML right after ProfileManager creates it, any ideas where to look for the file?

                  • Re: ReaderParams.illumination_mode won't setup in EMDK 2.1
                    Deven Bhagwan Pawar

                    Hello Georgiy,

                     

                    When you set the Illumination Mode ON using Wizard, you will see the code something like "<parm name="illumination_mode" value="torch"/>" in EMDKConfig.xml file. This works fine.

                     

                    But now when you set the Illumination Mode ON using ProfileConfig, the code that gets generated in the background is something like "<parm name="illumination_mode" value="1"/>". This does not work because you can see the value is "1" and not "torch" in the response.

                     

                    The team is working on this issue and it will be resolved soon. Meanwhile if you still want to set it using "processProfile" method, then you can pass the xml response as a string in "processProfile" method with value torch for Illumination Mode, which works fine.

                     

                    Please find the sample code which turns the Illumination Mode ON by setting XML response string in "processProfile" method.

                     

                    // Prepare XML to modify the existing profile

                      String[] modifyData = new String[1];

                     

                    // Set the parameters in XML

                    modifyData[0] = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"

                      + "<wap-provisioningdoc><characteristic type=\"Profile\">"

                      + "\"<parm name=\"ProfileName\" value=\"BarcodeProfile\"/>"

                      + "<parm name=\"ModifiedDate\" value=\"Mon Aug 11 20:21:56 GMT 2014\"/>"

                      + "<characteristic type=\"Barcode\" version=\"0.1\">"

                      + "<parm name=\"scanner_input_enabled\" value=\"true\"/>"

                      + "<parm name=\"scannerSelection\" value=\"INTERNAL_CAMERA1\"/>"

                      + "<characteristic type=\"Decoders\"><parm name=\"decoder_ean13\" value=\"true\"/>"

                      + "<parm name=\"decoder_ean8\" value=\"true\"/></characteristic>"

                      + "<characteristic type=\"ReaderParams\"><parm name=\"illumination_mode\" value=\"torch\"/></characteristic>"

                      + "</characteristic></characteristic>"

                      + "</wap-provisioningdoc>";

                     

                    // Call process profile to modify the profile of specified profile

                      // name

                      EMDKResults results = profileManager.processProfile(profileName,

                      ProfileManager.PROFILE_FLAG.SET, modifyData);

                     

                    This should work and turn on the Illumination.

                     

                    Thanks,