How to detect EMDK barcode manager scanner beamtime timeouts in the android application?


Audience

Hi Team,

I am using a mobile computer zebra TC52x device to scan barcodes in the android application. In order to use the barcode scanner, I am using the zebra SDK Symbol.XamarinEMDK(7.0.0.14). I am selecting the 2D barcode imager scanner when we initialize the scanner with trigger type SOFTALWAYS and put it on IDLE state then after a few seconds it auto turns off the scanner beam laser light on the device and the application does not notify this anything in this case.

So we want to notify our app when the scanner beam light turns off automatically.

Please let us know how we can achieve this in our Android application.

Thanks

Submitted by James Swinton … on May 13, 2022 Permalink

Hi,

You'd need to use the IStatusListener interface to be notified of changes in the scanner status: https://techdocs.zebra.com/emdk-for-xamarin/latest/api/barcode/Scanner_…

We have a diagram of our scanner states available here: https://techdocs.zebra.com/emdk-for-android/4-2/guide/scanner/

You can also configure the timeout of the scanner beam using our API: https://techdocs.zebra.com/emdk-for-android/6-7/api/reference/com/symbo…

Submitted by sheetal.sharma… on May 19, 2022 Permalink

Hi Team,

Thanks for the response.

I have tried to configure the beam timeout using the below code snippet as per the suggested API documentation. Initially, the default value of this variable is 0 and then we set it to 15 seconds but the scanner beam turns off exactly after 5 seconds irrespective of whether the value is 0 or 15 seconds. So it does not have any effect on the scanner.

ScannerConfig config = scanner.GetConfig();
config.ReaderParams.ReaderSpecific.LaserSpecific.BeamTimer = 15000;

Also as per the API documentation if the value is 0 then it will indefinitely stay ON but actually, it is not.

I am using the EMDK barcode manager for scanning in Zebra TC52x mobile device

Scanner - 2D barcode imager
Trigger type - Soft Always
Use case - we start the scanner and do not scan any barcode(Standby mode) then after 5 seconds scanner beam turns off automatically and for this we did not get any state change in the Status changed listener.

So please let me know if we are missing anything.

Thanks
Sheetal

Submitted by James Swinton … on May 19, 2022 Permalink

Hi,

Are you calling setConfig after adjusting the beamtimer to apply the setting to the scanner?

Additionally, you'll need to call .addStatusListener() on an instance of the scanner object to receive status notifications in your app.

Thanks,

James

Submitted by sheetal.sharma… on May 19, 2022 Permalink

Hi,
Yes, I am calling setConfig after adjusting the beamtimer to apply the settings to the scanner. Please find the below snippet that we have implemented in our app.

ScannerConfig config = scanner.GetConfig();
....
config.ReaderParams.ReaderSpecific.LaserSpecific.BeamTimer = 15000;
scanner.SetConfig(config);

Yes, I have already called the .addStatusListener() as per the Xamarin.Android implementation as I am developing it in Xamarin technology. Also, the status listener is already calling for other cases except when the scanner auto-off the beam after 5 seconds.

Please let me know if we are missing anything.

Thank
Sheetal

Submitted by sheetal.sharma… on May 19, 2022 Permalink

Hi,
Yes, I am calling setConfig after adjusting the beamtimer to apply the settings to the scanner. Please find the below snippet that we have implemented in our app.

ScannerConfig config = scanner.GetConfig();
....
config.ReaderParams.ReaderSpecific.LaserSpecific.BeamTimer = 15000;
scanner.SetConfig(config);

Yes, I have already called the .addStatusListener() as per the Xamarin.Android implementation as I am developing it in Xamarin technology. Also, the status listener is already calling for other cases except when the scanner auto-off the beam after 5 seconds.

Please let me know if we are missing anything.

Thank
Sheetal