4 Replies Latest reply on Nov 26, 2012 6:21 AM by Roger Whitehead

    Scanner API changed?

      We had an app working with the scanner under BSP20.  We just upgraded to BSP24 (with the brief intermediate step of BSP22), and the scanner no longer works in our application.  What has changed?  Where can I find updated API documentation?

       

      Here's our existing scanner code:

       

          function enableScanner() {
         //scanTimeout doesn't seem to work as we expected e.g. to turn off the scanner after a timeout in NPAPI
              scanner.scanTimeout = 3000;
         scanner.code128 = 'enabled';
              //scanner.decodeEvent = 'decodeEvent(%s, %s, %s)';
              scanner.enable();
         scanner.decodeEvent = 'doScan(%json)';
          }

       

      Then in the page's .live('pageshow', function(){

      ...

          if ( typeof scanner != 'undefined')
              scanner.decodeEvent = 'doScan(%json)';

      ...

          try{
         enableScanner();
         }
         catch(e){_alert('Error with scanner. Cannot be enabled.');}

       

       

      }