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 (Data source):
if let device = lastDevice as CaptureHelperDevice! {
device.getDataSourceInfoFromId(.idCode93, withCompletionHandler: { (result: SKTResult, dataSource: SKTCaptureDataSource?) in
if result == SKTCaptureErrors.E_NOERROR {
if let dataSource = dataSourceInfo {
if dataSource.status == .enabled {
print("Symbology is enabled then disable it")
let newValue = SKTCaptureDataSource()
newValue.id = dataSource.id
newValue.flags = .status
newValue.status = .disabled
device.setDataSourceInfo(newValue, withCompletionHandler: { (result: SKTResult) in
print("setting the symbology returned \(result.rawValue)")
})
} else {
print("Symbology is already disabled \(dataSource.status.rawValue)")
}
}
}
})
}
SKTCaptureHelperDevice* device = _lastDeviceConnected;
[device getDataSourceInfo:SKTCaptureDataSourceIDSymbologyCode39 completionHandler:^(SKTResult result, SKTCaptureDataSource *dataSource) {
NSLog(@"getting Code 39 symbology state returns %ld", (long)result);
if(result == SKTCaptureE_NOERROR){
if (dataSource.Status == SKTCaptureDataSourceStatusEnable) {
NSLog(@"The Code 39 symbology is enabled, then disable it...");
dataSource.Status = SKTCaptureDataSourceStatusDisable;
[device setDataSourceInfo:dataSource completionHandler:^(SKTResult result) {
NSLog(@"Disabling Code 39 symbology returns %ld",(long)result);
}];
}
else{
NSLog(@"Code 39 symbology is already disabled");
}
}
}];
In this code lastDevice
is a CaptureHelperDevice
instance that has been set in the
didNotifyArrivalForDevice
delegate.
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:
if let device = lastDevice as CaptureHelperDevice! {
device.getStandConfigWithCompletionHandler({ (result: SKTResult, config: SKTCaptureStandConfig?) in
print("getting stand mode config returned: \(result.rawValue)")
if result == SKTCaptureErrors.E_NOERROR {
if var standMode = config as SKTCaptureStandConfig! {
print("the stand mode is not set to auto, do it now")
if standMode != SKTCaptureStandConfig.autoMode {
standMode = .autoMode
device.setStandConfig(standMode, withCompletionHandler: { (result: SKTResult) in
print("setting stand mode returned: \(result.rawValue)")
})
}
}
}
})
}
SKTCaptureHelperDevice* device = _lastDeviceConnected;
[device getStandConfigWithCompletionHandler:^(SKTResult result, SKTCaptureStandConfig config) {
NSLog(@"Getting the stand configuration returns %ld",(long)result);
if(result == SKTCaptureE_NOERROR){
if( config != SKTCaptureStandConfigAutoMode){
NSLog(@"Stand Mode is not in Auto mode, change it now");
config = SKTCaptureStandConfigAutoMode;
[device setStandConfig:config completionHandler:^(SKTResult result) {
NSLog(@"Setting the stand configuration returns %ld",(long)result);
}];
}
else {
NSLog(@"Stand mode is already in Auto Mode");
}
}
}];
lastDevice
in this code is a CaptureHelperDevice
instance set in the didNotifyArrivalForDevice
delegate.
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:
@IBAction func didPressScanButton() {
if let device = lastDevice as CaptureHelperDevice! {
device.setTrigger(.start, withCompletionHandler: { (result: SKTResult, _ propertyResult: SKTCaptureProperty?) in
print("start the trigger returned \(result.rawValue)")
})
}
}
-(IBAction)didPressTriggerButton {
SKTCaptureHelperDevice* device = _lastDeviceConnected;
[device setTrigger:SKTCaptureTriggerStart completionHandler:^(SKTResult result, SKTCaptureProperty *propertyResult) {
NSLog(@"Triggering the scanner returns %ld",(long)result);
}];
}
lastDevice
is a CaptureHelperDevice
instance set in the
didNotifyArrivalForDevice
delegate to keep a reference of the last device
connected.
Note
The Scanner Trigger Button can also be disabled or enabled. Please refer to Disable the Trigger Scanner Button.
Triggering a Scanner continuously¶
In some cases it could be convenient to present a Trigger continous button in the UI (on the screen). Here is a sample of a button handler to trigger a scan continously:
@IBAction func didPressScanButtonContinous() {
if let device = lastDevice as CaptureHelperDevice! {
device.setTrigger(.continuousScan, withCompletionHandler: { (result: SKTResult, _ propertyResult: SKTCaptureProperty?) in
print("start the trigger continously returned \(result.rawValue)")
})
}
}
-(IBAction)didPressTriggerButton {
SKTCaptureHelperDevice* device = _lastDeviceConnected;
[device setTrigger:SKTCaptureTriggerContinuousScan completionHandler:^(SKTResult result, SKTCaptureProperty *propertyResult) {
NSLog(@"Triggering the scanner returns %ld",(long)result);
}];
}
lastDevice
is a CaptureHelperDevice
instance set in the didNotifyArrivalForDevice
delegate to keep a reference of the last device connected.
Triggering a Scanner for Combo devices i.e. S370¶
For a combo device like the S370 which has 2 devices, you can handle the trigger separately.
First identify your devices:
func didNotifyArrivalForDevice(_ device: CaptureHelperDevice, withResult result: SKTResult) {
print("didNotifyArrivalForDevice: \(String(describing: device.deviceInfo.name))")
if device.deviceInfo.deviceType == .NFCS370 {
myNfcReader = device
} else if device.deviceInfo.deviceType == .scannerS370 {
myBarcodeScanner = device
}
}
Then you can make a setTrigger
for the device you wish:
@IBAction func didPressNfcReaderScanButton() {
if let device = myNfcReader as CaptureHelperDevice! {
device.setTrigger(.start, withCompletionHandler: { (result: SKTResult, _ propertyResult: SKTCaptureProperty?) in
print("start the trigger returned \(result.rawValue)")
})
}
}
@IBAction func didPressBarcodeScannerScanButton() {
if let device = myBarcodeScanner as CaptureHelperDevice! {
device.setTrigger(.start, withCompletionHandler: { (result: SKTResult, _ propertyResult: SKTCaptureProperty?) in
print("start the trigger returned \(result.rawValue)")
})
}
}
myNfcReader
and myBarcodeScanner
are CaptureHelperDevice
instances set in the
didNotifyArrivalForDevice
delegate to keep a reference of those connected devices.
Note
There are values to the property Trigger:
Start: this will start read continuously
Start until read: this will start read and stops once a barcode/tag has been read
Stop: stops the device to read a barcode/tag