GSW Browser - GSW Scanner API

This documentation will show a basic example of how to use the GSW Unified Scanner API



Overview


The Georgia SoftWorks Scanner Plugin for GSW ConnectBot provides unified interface to all supported scanners manufactured by CipherLab, Honeywell, Keyence, Datalogic, and Zebra.


The GSW Scanner Object is gswscanner. To utilize a manufacturer specfic object, simply replace gswscanner with the syntax: gsw[manufacturer_name]scanner (without the brackets).
All other API functionality will operate in the same was as documented below.


The supported manufacturer names are:



General Rules

  1. All API functions and member variable are available through navigator.gswscanner object, for example navigator.gswscanner.listen.
  2. Method initialize must be called before any other method with the exception of isAvailable.
  3. Successful call to claim disables Data Wedge until release is called.
  4. The Error callback receives an error message as its argument


Member Variables

API
This member variable holds string representing the name of interface being used as selected by the GSW ConnectBot.



Methods

1. Initialize(success_callback, error_callback)


This method needs to be called first to activate the plugin. initialize calls claim automatically.

2. claim(success_callback, error_callback)


This method is used to take control of the scanner. Please notice that this method is called automatically by initialize. This method must be called after release to regain control of the scanner.

3. listen(success_callback, error_callback)


This method is used to start listening for scanner data. Scanner data will be received in the callback to listen as an object with the following properties:

4. release()


This method is used to release control of the scanner. It is necessary to call claim before being able to receive scanner events again.

5. softwareTriggerStart(success_callback, error_callback)


This method is used to configure the scanner to use software trigger instead of hardware trigger. Scanner data will be received in the callback to softwareTriggerStart as an object with the following properties:

It is necessary to call softwareTriggerStop to switch off this mode of operation

6. softwareTriggerStop(success_callback, error_callback)


This method is used to switch off the software trigger mode initiated by softwareTriggerStart

7. enableTrigger(success_callback, error_callback)


This method is used to re-enable the hardware trigger after a successful call to disableTrigger

8. disableTrigger(success_callback, error_callback)


This method is used to disable the hardware trigger after a successful call to enableTrigger. Call enableTrigger to re-enable the hardware trigger after a successful call to this method.

9. isAvailable()


This method returns true if our preliminary check indicates that GSW scanner support is available on given device, otherwise it returns false.