Scan API: Aila Scanner

Added in version 8.0

Kiosk Pro Enterprise supports 1D and 2D barcode scanning through Aila’s line of kiosk and handheld scanners for iOS.  Supported barcode types for this integration include UPC-EAN, QR, Code 128, Code 39, PDF417, and Interleaved 2 of 5. 

These scanners use a mirrored camera system for barcode capture and recognition and the audio jack for communication with the app. Current models can be viewed on their site at  http://ailatech.com/.

Functions

Callbacks

Related Settings

Requirements

  • Access JavaScript API
    • By Import - recommended, works both online & offline, requires inclusion of kiosk_functions.js prior to any of the following calls.
    • By Injection - only works offline, may not be available 'onload'.
  • Connection to a supported Aila scanner

Sample Code

This sample code relies on the JavaScript APIs built into Kiosk Pro and will not run successfully in other browsers or within our in-app help interface.  

To run sample code, set the app's homepage to  http://www.kioskproapp.com/scan-aila

Download Sample Code


kp_padlockScan_getHardwareClass

This function triggers a check of the type of Alia scanner currently connected through the device's audio jack.

Format
kp_padlockScan_getHardwareClass();
		

Status

Kiosk Pro will immediately call  kp_padlockScan_hardwareClassDidChange with the current status.


kp_padlockScan_getScanningState

This function triggers a check of the current state of the Alia scanner currently connected.

Format
kp_padlockScan_getScanningState();
		

Status

Kiosk Pro will immediately call  kp_padlockScan_scanningStateDidChange with the current status.


kp_padlockScan_start

This function turns on the scanner unit, readying it to scan. Certain parameters, including scanning mode, motion detection and the type of bar codes supported, are pulled from Kiosk Pro's settings.

Format
kp_padlockScan_start();
		

Status

Kiosk Pro will immediately call  kp_padlockScan_scanningStateDidChange with the current status.

Once the scanner has been started and a scan has been received, the app will return the results with  kp_padlockScan_scanningDidFinish.


kp_padlockScan_stop

This function turns off the scanner unit. If scanning is not currently in the progress, this function effectively does nothing.

Format
kp_padlockScan_stop();
		

Status

Kiosk Pro will immediately call  kp_padlockScan_scanningStateDidChange with the current status.


kp_padlockScan_beep

This function triggers an audible alert beep from the scanner unit. It is also possible to trigger a beep automatically following a successful scan using the  Automatically Beep on Scan setting.

Format
kp_padlockScan_beep();
		

Status

This function does not return any confirmation or status update.


kp_padlockScan_hardwareClassDidChange

This callback is triggered when a powered Aila scanner is connected through the audio jack or any time ' kp_padlockScan_getHardwareClass' is called.

Format
kp_padlockScan_hardwareClassDidChange(hardwareClass);
		
Return values
  • hardwareClass = type of hardware connected as integer. Possible values are:
    • 0 = no scanner connected.
    • 1 = kiosk scanner connected.
    • 2 = hand-held, mobile scanner connected.

kp_padlockScan_scanningStateDidChange

This callback is triggered when the connected scanner is powered on or off through calls in the API or any time ' kp_padlockScan_getScanningState' is called.

Format
kp_padlockScan_scanningStateDidChange(scanning);
		
Return values
  • scanning = current state of scanner as a boolean. Possible values are:
    • 1 = scanner is on.
    • 0 or undefined = scanner is off.

kp_padlockScan_scanningDidFinish

This callback is triggered whenever the scanner complete a successful scan.

If source image contains a valid code but this code does not match a supported type of code (as defined in Kiosk Pro settings) or if the source image does not contain a valid code, then this callback will not be triggered and the scan will be ignored.

Format
kp_padlockScan_scanningDidFinish(scanType, scanData);
		
Return values
  • scanType = type of bar code as integer. The following codes are possible:
    • 1 = UPC-EAN
    • 2 = QR Code
    • 4 = Code 128
    • 8 = Code 39
    • 16 = Interleaved 2 of 5
  • scanData = decrypted code as string.

Still stuck? How can we help? How can we help?