Barcode Reader Implementation

  1. Power-on the barcode reader, and then set the scan mode.
  2. Open a connection with the barcode reader. When the barcode reader is open, it is possible to scan as often as is needed, the barcode event will return each scanned item as soon as it has been read.
  3. Power-off the barcode reader.

To access the BR do the following:

Copy
public void GetBarcodeReader()
{
  if (this.barcodeReaderService == null)
  {
    if (eaManagement is IBarcodeReader)
    {
      this.barcodeReaderService = ((IBarcodeReader)eaManagement).GetBarcodeReaderService();
      this.barcodeReaderService.BarcodeRead += OnBarcodeRead;
    }
  }
}

The interface includes a function called OverrideScanEvent that returns true or false.

  • True: An event must be overridden in the POS (AltaPay A920) before PowerOn is called, PowerOn will activate the barcode reader immediately.
  • False: The device will handle the event internally, scan when the user activates functional keys on the device.

Check if the plugin handles the scan event internally:

Copy
if (this.barcodeReaderService != null)
{
  if (!this.barcodeReaderService.OverrideScanEvent())
  {
    await Task.Run(() => 
    {
      this.barcodeReaderService.SetMode(ScanMode.SingleScanMode);
      this.barcodeReaderService.PowerOn();
    });
  }
  else
  {
    ShowAlert("Barcode reader", "Activate scan on event");
  }
}

AltaPay A920

The AltaPay device will turn on the camera as soon as the PowerOn function is called.

The device manufacturer recommends overriding the volume buttons and that must be done in the POS (or the alternate software using LS Pay).