EMDK profile Code128 length limits not working

Hello,

I'm trying to use an EMDK profile with length limitations for a Code128 barcode.

The target device is a TC56 with MX version 6.2.0.13

I created the profile through the profile manager of EMDK for Android v6.9.

The profile I'm using: see attached files

Code128 configuration:

<characteristic type="Code128">

          <parm name="decoder_code128_length1" value="16"/>

          <parm name="decoder_code128_length2" value="25"/>

          <parm name="decoder_code128_redundancy" value="false"/>

          <parm name="decoder_code128_enable_plain" value="true"/>

          <parm name="decoder_code128_enable_ean128" value="true"/>

          <parm name="decoder_code128_enable_isbt128" value="true"/>

          <parm name="decoder_code128_isbt128_concat_mode" value="0"/>

          <parm name="decoder_code128_check_isbt_table" value="false"/>

          <parm name="decoder_code128_security_level" value="1"/>

          <parm name="code128_enable_marginless_decode" value="false"/>

          <parm name="code128_ignore_fnc4" value="false"/>

</characteristic>

I applied the profile through the async API as described here. Debugging the callback methods that would indicate the profile could not be applied or that they would contain an error give no indications something went wrong. I've also included the my EMDK wrapper implementation in the attached files.

While scanning works, the length limits to only allow barcodes between 16 and 25 characters is not working. For example, I'm able to scan the following barcode contents (Received in AsyncUpdateScanData.doInBackground and AsyncUpdateScanData.onPostExecute):

  • A12345
  • This is way longer than 25 characters

When using the same configuration in Datawedge, the length limitations work.

Am I doing something wrong or is there something else I need to do to enable the length limitations when using the EMDK?

Anonymous (not verified)
If the same configuration

If the same configuration works in DataWedge then it is likely some issue with the configuration.  Can you try setting decoder_code128_enable_ean128 to false or disabling all decoders other than Code 128 (I note in your EMDKConfig.xml you have many others set to true, perhaps enable_ean128 is causing the barcode to be converted to gs1_databar which IS being successfully decoded)

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Kevin Debrabandere
I've tried disabling the

I've tried disabling the other decoders, but the length limitations still don't seem to work.

I've created a small sample app to demonstrate this and attached it to this post. The zip archive also contains the two barcodes I'm using to test the length limitations.

Is there something else I can try?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Kevin Debrabandere
I forgot to add the

I forgot to add the attachment in my previous post.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
I tried running the sample

I tried running the sample app and it did feel like something strange was going on - I realised that although the app creates "TestProfile", it is not associated with com.sandbox.emdktestapp (see Manage Profiles - Zebra Technologies TechDocs  section 'associate the profile...').  I tried associating manually but since the profile is re-created whenever your app has onCreate() called, DataWedge keeps defaulting back to Profile 0 (default).  When I modified Profile 0 to adjust the Code 128 min & max lengths the barcodes would not scan, as expected, so I think your problem is with app association.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Kevin Debrabandere
Thanks. I tried adding the

Thanks. I tried adding the following app association to the profile:

<characteristic type="ActivitySelection" version="0.1">

  <parm name="emdk\_name" value=""/>

  <characteristic type="Application">

  <parm name="PrefixAppName" value="false"/>

  <parm name="package" value="com.sandbox.emdktestapp"/>

  <characteristic type="Activities">

  <parm name="activity" value="*"/>

  </characteristic>

  </characteristic>

</characteristic>

But that didn't work.

Then I thought maybe the scanner getting initialized before the profile is actually ready and applied could be the issue (also visible in the logs), so I move the initilizeScanner() call to the onData(ProfileManager.ResultData resultData) method in case the profile was successfully applied. This seems to work perfectly, also with the other decoders enabled.

Now I wonder, since the EMDK profile manager creates a DataWedge profile from the provided EMDKConfig.xml, would it be possible to just specify an existing DataWedge profile to be used by the EMDK? This way our users could do their profile configuration themselves, based on their specific needs. Defining an empty profile (with just the ActivitySelection characteristic) seems to overwrite all settings in the DataWedge profile with the same name to default settings.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
I missed the fact that you

I missed the fact that you were using BOTH the EMDK and DataWedge(!)  So, you should only be using either EMDK for scanning OR DataWedge for Scanning.  "would it be possible to just specify an existing DataWedge profile to be used by the EMDK" - The DW profile defines the configuration for DW but the EMDK needs to be configured in code, so you can use either / or but you cannot use both in the same application.  The scanning framework will disable DataWedge for an app if it detects that the EMDK is in use, that is probably why it started working once you moved the code around.

Incidentally, the Data Capture profiles are being deprecated... more information is available in this guide:   and it gives a bit more background

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Kevin Debrabandere
Thanks for the information. I

Thanks for the information. I have now moved our implementation to use Datawedge intents instead of using the EMDK, since we want our users to be able to configure their decoders based on their requirements.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments