Skip to content

Commit

Permalink
enable picklist for ossZebraScanner, add the cache status reader for …
Browse files Browse the repository at this point in the history
…ScannerServiceAPI
  • Loading branch information
alfred kallas authored and marcanpilami committed Mar 16, 2022
1 parent e63f246 commit 5135c51
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.enioka.scanner.bt.api.Scanner;
import com.enioka.scanner.data.Barcode;
import com.enioka.scanner.sdk.zebraoss.commands.Beep;
import com.enioka.scanner.sdk.zebraoss.commands.InitCommand;
import com.enioka.scanner.sdk.zebraoss.commands.LedOff;
import com.enioka.scanner.sdk.zebraoss.commands.LedOn;
import com.enioka.scanner.sdk.zebraoss.commands.ManagementCommandGetAttribute;
Expand All @@ -19,6 +20,8 @@
import com.enioka.scanner.sdk.zebraoss.commands.RequestRevision;
import com.enioka.scanner.sdk.zebraoss.commands.ScanDisable;
import com.enioka.scanner.sdk.zebraoss.commands.ScanEnable;
import com.enioka.scanner.sdk.zebraoss.commands.SetPickListMode;
import com.enioka.scanner.sdk.zebraoss.commands.StartSession;
import com.enioka.scanner.sdk.zebraoss.data.ParamSend;
import com.enioka.scanner.sdk.zebraoss.data.ReplyRevision;
import com.enioka.scanner.sdk.zebraoss.data.RsmAttribute;
Expand Down Expand Up @@ -236,10 +239,10 @@ public void onTimeout() {
// Request scanner configuration
startStatusCacheRefresh(null);

//this.btScanner.runCommand(new InitCommand(), null);
//this.btScanner.runCommand(new SetPickListMode((byte) 2), null);
//this.btScanner.runCommand(new ScanEnable(), null);
//this.btScanner.runCommand(new StartSession(), null);
this.btScanner.runCommand(new InitCommand(), null);
this.btScanner.runCommand(new SetPickListMode((byte) 2), null);
this.btScanner.runCommand(new ScanEnable(), null);
this.btScanner.runCommand(new StartSession(), null);

// We are already connected if the scanner could be created...
initCallback.onConnectionSuccessful(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,14 @@ public String getFirstScannerStatus(String key) {
return null;
}

@Override
public String getFirstScannerStatus(String key, boolean allowCache) {
if (!this.scanners.isEmpty()) {
return this.scanners.get(0).getStatus(key, allowCache);
}
return null;
}

@Override
public List<Scanner> getConnectedScanners() {
return scanners;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,7 @@ public interface ScannerServiceApi {

String getFirstScannerStatus(String key);

String getFirstScannerStatus(String key, boolean allowCache);

List<Scanner> getConnectedScanners();
}

0 comments on commit 5135c51

Please sign in to comment.