Rho Scanner Event

Hi all,

I'm having an issue with the Scanner while using a MC95. I'm able to turn the scanner on and scan a barcode but when the barcode event fires the object sent to the event doesn't contain any of the data I scanned. When I try to do barcode.data I'm receiving 'undefined'.

Thanks for any help.

Chris

edit: Code being used:

function enableScanner() {

scanner.enabled = true;

Rho.Barcode.take({}, onBarcodeEvent);

}

function onBarcodeEvent (barcode) {

alert("bc " + barcode.data);

document.getElementById('meterNum').value = barcode.data;

}

Peter Arcuri
Just a thought, is it

Just a thought, is it possible that DataWedge is enabled on the MC95? In this case pressing the scan trigger the data is captured by DW and directed to the keyboard buffer. This will superceed the Rho API.

Launch DataWedge and ensure it is disabled.

Hope this helps.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Chris Child
DataWedge is not on this

DataWedge is not on this device. Our previous mobile framework used the motorola API to do scans as well.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Peter Arcuri
Presumably the previous app

Presumably the previous app is not running on the device while running the Rho app. What version of OS is running on the MC95? Which BSP build?

A good test would be to try your app on another device in order to help determine if the issue is whether or not hardware related.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Chris Child
Yes you're correct the other

Yes you're correct the other app is not running while I'm trying out the Rho app. The MC95 is running 6.5.3 and I'm not sure what BSP is sorry.

I'll give another device a try and see if there is a difference.

Thanks for the help so far!

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Peter Arcuri
The BSP build is located in

The BSP build is located in Start/systems/system info… specifically under OEM version:  xx-xx.xxxx

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Chris Child
OEM Version is 03.37.0002

OEM Version is 03.37.0002

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Peter Arcuri
If the device you're using is

If the device you're using is specifically a MC9596 then you could alternatively update the OS  build to v04.41.03…

snapshot.png

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Glenn Sayer
Chris,can you provide the

Chris,

can you provide the code that you are using to enable the scanner and also the callback function code.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Chris Child
Posted to my original

Posted to my original question.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Robert Galvin
What method are you using to

What method are you using to turn the scanner on? There are two ways to do it and they both have different callback return params

barcode.take will return an object that has the data in object.barcode

barcode.enable will return an object that has data in object.data

Also look at - if you set this up, you will have your answer on what is being returned object wise in a few minutes.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Peter Arcuri
Correct me if I'm wrong but I

Correct me if I'm wrong but I believe Chris is using the BarcodeExample project… below is relevant excerpt from the app:

        Rho.Barcode.enable( {} , function (e){

                //here is where the callback will occur

                // e is a Barcode callback return object

                // callback params

                //data : STRING The data decoded by the scanner or imaging device

                //source : STRING The source device and human readable decoder type of the decoded barcode or symbol

                //type : STRING Hex value representing the decoder type

                //time : STRING The time at which the decode occurred (hh:mm:ss)

                //length : STRING The length of the decoded barcode or symbol

                //direction : STRINGThe direction the barcode was scanned, either forward, reverse or unavailable

                $('ul').html('<li>' + e.data + '</li>');

                $('ul').append('<li>' + e.source + '</li>');

                $('ul').append('<li>' + e.type + '</li>');

                $('ul').append('<li>' + e.time + '</li>');

                $('ul').append('<li>' + e.length + '</li>');

                $('ul').append('<li>' + e.direction + '</li>');

                //document.getElementById('ul').html('<li>' + e.data + '</li>');

                //document.getElementById('ul').append('<li>' + e.direction + '</li>');

            }

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Chris Child
I am using an example app, as

I am using an example app, as reference, that was sent to me by a sales rep but it does not look like this.

Here is the example I was sent:

function enableScanner1()

{

     alert("asdf");

     Rho.Barcode.take({}, onBarcodeEvent);

     flash(3);

}

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Robert Galvin
yeah so like I said

yeah so like I said previously, the take returns .barcode not .data

function onBarcodeEvent (barcode) {

alert("bc " + barcode.barcode);

document.getElementById('meterNum').value = barcode.data;

}Screen Shot 2013-11-13 at 11.25.50 AM.jpg

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Chris Child
Yes you're right. This is

Yes you're right.

This is what I was sent in the example project hence why I got confused. This is not the first error I've found either so I think I'll just stop using this project.

function onBarcodeEvent (barcode)

{

     alert ("bc" + barcode);

     document.getElementById('barcode-data').value = barcode.data;

     document.getElementById('barcode-source').value = barcode.source;

     document.getElementById('barcode-type').value = barcode.type;

     document.getElementById('barcode-time').value = barcode.time;

     document.getElementById('barcode-length').value = barcode.length;

     document.getElementById('barcode-event').value = barcode.event;

     flash(3);

}

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Chris Child
Weinre sounds like exactly

Weinre sounds like exactly what I've been in need of. I was stuck trying to figure out how to view what was actually being passed to the callback.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments