SDK v1.38 improvements on GoodRead notification LEDs management.

When a new barcode is decoded, all Datalogic devices automatically notify the user through various audio, visual or sensory effects, such as emitting a GoodRead tone, turning on a device LED (red during capture, green when decoding is complete), turning on a GreenSpot™ light projected directly onto the code just read, or vibrating (if supported by the device).

All these good read feedbacks can be enabled and customized through the "DLSettings / Scanner&decoder / GoodRead" and "DLSettings / Scanner&decoder / Notification" menus:

  

The LED used for the GoodRead natively is a bi-colored LED (only red and green), which by default is used for notifying the user about scanning status operations:
•  OFF (no active scanning);
•  RED (scanning in progress);
•  GREEN (barcode read).

In the vast majority of application, these features fully meet the needs of users.
Some applications, however, use these notification systems to give the user more advanced information than a simple "GoodRead", such as information about the validation of a content, or of the actual presence of the barcode within a database.

This is why it has always been possible to disconnect these automatic feedbacks and make their own use. Haptic and auditory feedback can be played through the standard Android API. Light feedback related to Datalogic LEDs (GreenSpot™ and GoodRead LED), can be driven through the LedManager class of the Datalogic SDK's namespace com.datalogic.device.notification.

In earlier versions of the SDK up to v1.38, the available LEDs were:

-          A general notification LED (LED_NOTIFICATION, typically a red LED on the most part of the devices)
-          The GreenSpot™ LED (LED_GREEN_SPOT)
-          The GoodRead LED (LED_GOOD_READ, the green LED light on the device’s case that by default turns on when a new code is read) 

For Memor 30/35 device family and any future devices, with the latest SDK update v1.38Datalogic has introduced a new the LED_SCANNER enum, to give a full-control over the GoodRead bi-colored LED components on that device.

This update is included stating from the new Memor 30/35 FW 1.07.003 and expands functionality, allowing developers to use both existing red and green components to efficiently manipulate LED functionality, while maintaining full compatibility with existing SDK implementations and ensuring seamless integration with previously developed applications.

In conclusion, from SDK 1.38 onwards, the available LEDs are:

-          LED_NOTIFICATION:  A general notification LED, typically a red LED on the most part of the devices
-          LED_GREEN_SPOT: The GreenSpot™ LED
-          LED_GOOD_READ: The GoodRead LED, preserved for backward compatibility, which controls the green component only of the GoodRead LED
-          LED_SCANNER (new): The GoodRead bi-color LED, to control both the red and the green components of the GoodRead LED.

Since LED_SCANNER operates a multicolor LED, the green or red color component can be specified with an additional Color argument in the setLed() method in this way:

Turn the LED(s) on:

led.setLed(Led.LED_SCANNER, true, Color.RED  );               //Red channel ON
led.setLed(Led.LED_SCANNER, true, Color.GREEN);               //Green channel ON
led.setLed(Led.LED_SCANNER, true, Color.RED | Color.GREEN );  //Both channels Red and Green ON
led.setLed(Led.LED_SCANNER, true);                            //Both channels Red and Green ON

Turn the LED(s) off:

led.setLed(Led.LED_SCANNER, false, Color.argb(255,255,0,0) );  //LED fully OFF
led.setLed(Led.LED_SCANNER, false, Color.GREEN );              //LED fully OFF
led.setLed(Led.LED_SCANNER, false);                            //LED fully OFF

See also:

LedManager class: https://datalogic.github.io/android-sdk-docs/reference/com/datalogic/device/notification/LedManager.html
Led enum: https://datalogic.github.io/android-sdk-docs/reference/com/datalogic/device/notification/Led.html
Datalogic SDK sample library:
https://datalogic.github.io/android/samples