Activity Level¶
The Activity Level regroups the features that are related to the operation of using the scanner.
Enabling or Disabling a Barcode Symbology¶
In the event where there are several type of barcodes close to each other and to avoid scanning the wrong barcode, it might be useful to enable only the barcode symbology or symbologies the application needs.
Enabling or Disabling a Barcode Symbology persists in the Scanner. It is best to first read if the Symbology is already enabled before trying to enable it.
Here is a code showing how to enable a specific Barcode Symbology:
function onSetUpcASymbology(enable) {
let upcaStatus = SocketMobile.CaptureDataSourceStatus.Disable;
if(enable) {
upcaStatus = SocketMobile.CaptureDataSourceStatus.Enable;
}
let property = new SocketMobile.CaptureProperty(
SocketMobile.CapturePropertyIds.DataSourceDevice,
SocketMobile.CapturePropertyTypes.DataSource,
{
id: SocketMobile.CaptureDataSourceID.SymbologyUpcA,
status: upcaStatus,
flags: SocketMobile.CaptureDataSourceFlags.Status
}
);
captureDevice.setProperty(property)
.catch(err => {
setStatus(`unable to set the UPC A DataSource: ${err}`);
});
}
Scanning Through glossy surface such as a windshield¶
TBD
Scanning a computer screen¶
TBD
Stand Mode configuration¶
Some scanners support the Stand Mode (At this time, the 7Xi, 7Qi and D750).
The Stand Mode defines the behavior of the scanner when it’s on or off the Charge Stand.
There are 4 modes:
Mobile Mode: This is the default mode. In this mode the scanner works like a normal hand held scanner. The reading of a barcode is accomplished by pressing the trigger button. The scanner will try to connect to the host upon startup, until a timeout occurs.
Stand Mode: In Stand mode, the scanner is configured into presentation mode. The presentation mode automatically triggers a barcode read when a barcode is detected in front of the scanner without any other user intervention. In this mode the scanner will try indefinitely to connect to the host. It doesn’t have any timeout to shutdown or hibernate as it assumes it is always powered.
Detect Mode: The Detect mode requires a stand. When the scanner is in position in the stand it switches in presentation mode. A barcode can be automatically read just by presenting it in front of the scanner. The power off timer is disabled, and the scanner tries to connect to the host indefinitely. It can be removed from the stand and it will stay in presentation mode. Barcodes can be read without the need of pressing on the trigger button. Once off the stand, the power off timers become operational and if the scanner is not connected to a host, it will try to connect a few times before giving up.
Auto Mode: This mode is a mix of the Stand mode and the Mobile mode. It behaves as described in the Stand mode when the scanner is in position in the Charge Stand, and it behaves as described in the Mobile mode when the scanner is no longer in position in the stand and the user presses the trigger button. If the trigger button is never pressed while out of the stand, the scanner stays in presentation mode and automatically reads barcodes that are presented in front of it. As soon as the trigger button is pressed while the scanner is not in the stand, it switches to the Mobile mode. It switches back to the presentation mode as soon as it rests on the stand.
Following is a sample code that shows how to read the stand mode of a scanner and to change it to Auto Mode if necessary:
function configureStandMode() {
let property = new SocketMobile.CaptureProperty(
SocketMobile.CapturePropertyIds.StandConfigDevice,
SocketMobile.CapturePropertyTypes.None,
{}
);
captureDevice.getProperty(property)
.then( ({value}) => {
console.log(`stand mode: ${value}`);
if(value !== SocketMobile.StandConfig.AutoMode) {
property = new SocketMobile.CaptureProperty(
SocketMobile.CapturePropertyIds.StandConfigDevice,
SocketMobile.CapturePropertyTypes.Ulong,
SocketMobile.StandConfig.AutoMode
);
return captureDevice.setProperty(property)
}
})
.catch(err => {
console.log(`configuring stand mode fails with error: `, err);
});
}
Triggering a Scanner¶
In some cases it could be convenient to present a Trigger button in the UI (on the screen).
Here is a sample of a button handler to trigger a scan:
function onScanButton() {
const action = SocketMobile.Trigger.Start;
const property = new SocketMobile.CaptureProperty(
SocketMobile.CapturePropertyIds.TriggerDevice,
SocketMobile.CapturePropertyTypes.Byte,
action
);
captureDevice.setProperty(property)
.catch(err => {
console.log(`error when triggering a scan: ${err}`);
});
}
Note
The Scanner Trigger Button can also be disabled or enabled. Please refer to Disable the Trigger Scanner Button.