I would like to create SimulScan templates by code

Hi everyone,

I will be using SimulScan in my current project so I tried the example application and ported it's functionality into my application.

The sample uses some pregenerated template files, which can be created in your SimulScan template manager. Let's say there are default templates for 2, 5, 10, .... barcodes.

Using your template manager, you can also create a custom template for any number of barcodes (max 99).

But in my use case, the number of barcodes that will be scanned will differ from task to task. So for example the user will get a task to scan 50 unique boxes.

By default there will be a simulscan template of lets say 30 codes. The user will scan 30 boxes and there will still be 20 boxes left to scan on the table.

Since SimulScan expects a predefined number of barcodes, the template for 30 codes will no longer work for the remaining 20 boxes, so the user will have to change the template to 20 codes.

However the number of total boxes will variate from task to task, so maybe on another task he will have to scan 47 boxes. Again he will scan 30 boxes, and be left with 17.

The application knows how many boxes are still left, and could automatically change the simulscan template to correspond with the number of boxes. But in order to do so in the »example« way, I would have to generate a template file for every number of codes.

The other solution is (I did some reverse engineering of actual template files, and I found out they are just Base64 encoded XML files) to generate the actual templates in code (dynamically) by generating the XML document, encoding it into Base64 and passing it to simulscan manager API.

However, the value (I guess this is the template signature) inside <mainfs> and <templatefs> tags is different for each template, and I found out that if the value is not the same as in a generated template (for some N where N is the number of barcodes in the template) the template will not work, and the scanning just goes on indefinitely or hangs the entire device. I would like to know if there is an algorithm or a way, how to calculate the value of those tags in order for my generated templates to work.

I'm guessing I could spend some amount in hours trying to reverse engineer this also, but I'm wondering if there is an easier way for this?