How to: Configure Datalogic devices through an Intent

The configuration of a Datalogic device can be done in different ways: S2D, EMM+OEMCOnfig or SDK. Recently, a new method was introduced based only on sending Intent directly to the system.

Applies to:
Devices that integrate SDK ver 1.29 (only method 1), devices that integrate SDK ver 1.32 (any methods). Some properties may not be available on all devices.

Method 1 - Datalogic SDK:
Starting from SDK version 1.29, in the class Intents, an action intent called ACTION_CONFIGURATION_COMMIT is exposed.
The ACTION_CONFIGURATION_COMMIT Intent can be used to apply a configuration to a Datalogic device.
It is possible to pass to this Intent an extra, as an input, called EXTRA_CONFIGURATION_CHANGED_MAP.
That extra accepts an Object Map with the schema Map<Key, Value>, which will contain the list of parameters to be modified. The “Key” of the Map<Key, Value> is an Integer that represents the ID of the property, the “Value“ is represented by a String.
The list of available parameters is linked below.

https://datalogic.github.io/android-sdk-docs/reference/com/datalogic/device/configuration/PropertyID.html
For some devices, especially for properties that do not involve the Scan Engine, a reboot is required.
When the property is set and requires a reboot, the system sends an Intent, ACTION_CONFIGURATION_BOOT_REQUIRED , or, if the setting is done through UI, a message is showed:

image

For the following example, the set of the WIFI BAND requires a reboot.

Example (device used Joya Touch 22 ):
Disable the code 128 family and enable only the 2.4 GHz Wi-Fi.
In the Class under “WIFI_GROUP” I can find the option “WIFI_BAND_SELECTION”,

The “Key” is “WIFI_BAND_SELECTION”

And “WIFI_BAND24_GHZ” is the “Value” to insert as a String.

So, navigating in the same way the tree for Code128, you can easily configure an intent like this:

import com.datalogic.device.configuration.PropertyID;

Intent intent = new Intent(Intents.ACTION_CONFIGURATION_COMMIT); 

HashMap map = new HashMap(); 
map.put(PropertyID.WIFI_BAND_SELECTION, WifiBandSelection.WIFI_BAND_24_GHZ.toString()); 
map.put(PropertyID.CODE128_ENABLE, "false") 
intent.putExtra(Intents.EXTRA_CONFIGURATION_CHANGED_MAP, map); 
mContext.sendBroadcast(intent);

Reboot the device to apply the configuration.

Method 2 - ADB:
Starting from SDK version 1.32 the extra can also be passed as a Sting or a list of String,
see this link.

Example: ADB with the extra data as a List

adb shell am broadcast -a com.datalogic.device.intent.action.configuration.COMMIT --esal com.datalogic.device.intent.extra.configuration.CHANGED_MAP “WIFI_BAND_SELECTION=WIFI_BAND_24_GHZ,CODE128_ENABLE=false”

Reboot the device to apply the configuration.

Example: ADB with the extra data as a String

adb shell am broadcast -a com.datalogic.device.intent.action.configuration.COMMIT --es com.datalogic.device.intent.extra.configuration.CHANGED_MAP “WIFI_BAND_SELECTION=WIFI_BAND_24_GHZ,CODE128_ENABLE=false”

Reboot the device to apply the configuration.

Method 3 - MDM:
The Method N2 can also be sent through an MDM that support Intents:

SOTI:

sendIntent -b “intent:#Intent;action=com.datalogic.device.intent.action.configuration.COMMIT;S.com.datalogic.device.intent.extra.configuration.CHANGED_MAP=WIFI_BAND_SELECTION=WIFI_BAND_24_GHZ,CODE128_ENABLE=false;end”

Reboot the device to apply the configuration.

Airwatch:
The syntax used by Airwatch doesn’t allow to translate the Intent from ADB to the Airwatch syntax like this:

mode=implicit,broadcast=true,action=com.datalogic.device.intent.action.configuration.COMMIT,extraString=com.datalogic.device.intent.extra.configuration.CHANGED_MAP=WIFI_BAND_SELECTION=WIFI_BAND_24_GHZ,CODE128_ENABLE=false

The agent is not able to parse, so you need to pass through S2D Studio:

  1. Create a S2D Profile (see more) and in the “Scripts” section add the “BROADCAST” command:

-a com.datalogic.device.intent.action.configuration.COMMIT --es com.datalogic.device.intent.extra.configuration.CHANGED_MAP “WIFI_BAND_SELECTION=WIFI_BAND_24_GHZ,CODE128_ENABLE=false”

  1. In the last step of the creation of the profile you can remove the update of S2D agent, in this way you will not need to download any file to your device.

  1. Copy the encripted data and pass them to the extraString=data=pasteEncryptedDataHere.

mode=explicit,broadcast=true,action=datalogic.scan2deploy.intent.action.START_SERVICE,package=com.datalogic.scan2deploy,class=com.datalogic.scan2deploy.S2dServiceReceiver,extraString=encoding=v2,extraString=data= T0lRjchz74fNiI4YUO0Xf6vEScCP8pp8Fj3aUMp4I//qgdP/iTJqlEpBFyCGffEM+yFcUmIzMIYMZN/mRKNIBUtxlAWW3hN+vswfNJX1qhSX3hCXPKYT39XGlm72RkYItZoKVNUwjDULMIbFfKcIeGCMdZJNs2pDBIzHQDgAmOWmktViXXy90fa184xE99CpVZG8lglAYd9GDQHvF5ZF11DvMylC5a2iX0VbL2LeW+eSLfECgYVaX42e9Noww+PJCgMYMBaBMLcgbd9qhFHpyxf1nxuAQXX8ysyDD4b1uwusxZhteOR8nFDH7S37Ay8dP4NdQRJh3IqtWLEayecUYtwKVMbNJLqryrMD6n613rgTQt2sWOBzWwzZVx6fdAZQ9KtnDEz1+iM3ZQICkt5zV6ZMNy8HvJawRoOe62WUQHqHfGSAGvlyVnCOxS8oCQQnwpALI6AIY3bGwQQDGksUG+HcRXhVevK9RmKkbk4ckT9Vhuxrs4fQc6ZySLl91C8N

  1. Reboot the device to apply the configuration.

Donato Cataldo
L3 Mobile Computer Support Engineer

1 Like