Package com.zebra.scannercontrol
Class SDKHandler
- java.lang.Object
-
- com.zebra.scannercontrol.SDKHandler
-
- All Implemented Interfaces:
IDcsSdkApi
public class SDKHandler extends java.lang.Object implements IDcsSdkApi
Class which acts as a gateway to the SDK
-
-
Field Summary
Fields Modifier and Type Field Description static int
BLUETOOTH_MAC_ADDRESS_CHARACTER_COUNT
static java.lang.String
MAC_ADDRESS_FORMATTING_REGULAR_EXPRESSION
static java.lang.String
REPLACEMENT_DELIMITER
static int
sleepDuration
-
Constructor Summary
Constructors Constructor Description SDKHandler(Context context)
SDKHandler(Context context, boolean enableSTCEnabledState)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DCSSDKDefs.DCSSDK_RESULT
dcssdkClearBTAddress()
Method to clear the Bluetooth address stored in SDK.DCSSDKDefs.DCSSDK_RESULT
dcssdkClose()
Method to close the communication with SDKDCSSDKDefs.DCSSDK_RESULT
dcssdkEnableAutomaticSessionReestablishment(boolean enable, int fromScannerID)
Method requests to enable/disable "Automatic communication session reestablishment" option for a particular scanner.DCSSDKDefs.DCSSDK_RESULT
dcssdkEnableAvailableScannersDetection(boolean enable)
Method requests to enable/disable "Available scanners detection" option.DCSSDKDefs.DCSSDK_RESULT
dcssdkEnableBluetoothScannersDiscovery(boolean enable)
Method requests to enable/disable "Bluetooth scanners discovery" option.DCSSDKDefs.DCSSDK_RESULT
dcssdkEstablishCommunicationSession(int scannerID)
Method requests to establish communication session with a particular available scanner.java.lang.String
dcssdkExecuteCommandOpCodeInXMLForScanner(DCSSDKDefs.DCSSDK_COMMAND_OPCODE opCode, java.lang.String inXML)
Method provides synchronous execution of a particular method via an opcode.DCSSDKDefs.DCSSDK_RESULT
dcssdkExecuteCommandOpCodeInXMLForScanner(DCSSDKDefs.DCSSDK_COMMAND_OPCODE opCode, java.lang.String inXML, java.lang.StringBuilder outXML)
Method provides synchronous execution of a particular method via an opcode.DCSSDKDefs.DCSSDK_RESULT
dcssdkExecuteCommandOpCodeInXMLForScanner(DCSSDKDefs.DCSSDK_COMMAND_OPCODE opCode, java.lang.String inXML, java.lang.StringBuilder outXML, int scannerID)
Method provides synchronous execution of a particular method via an opcode.DCSSDKDefs.DCSSDK_RESULT
dcssdkExecuteSSICommandOpCodeInXMLForScanner(DCSSDKDefs.DCSSDK_COMMAND_OPCODE opCode, java.lang.String inXML, java.lang.StringBuilder outXML, int scannerID)
Method provides synchronous execution SSI command of a particular method via an opcode.java.util.List<DCSScannerInfo>
dcssdkGetActiveScannersList()
Method to fetch the list of active(connected via bluetooth) scannersDCSSDKDefs.DCSSDK_RESULT
dcssdkGetActiveScannersList(java.util.List<DCSScannerInfo> activeScannersList)
Method to fetch the list of active(connected via bluetooth) scannersjava.util.List<DCSScannerInfo>
dcssdkGetAvailableScannersList()
Method to fetch the list of available(paired via bluetooth) scannersDCSSDKDefs.DCSSDK_RESULT
dcssdkGetAvailableScannersList(java.util.List<DCSScannerInfo> availableScannersList)
Method to fetch the list of available(paired via bluetooth) scannersIDCConfig
dcssdkGetIDCConfig()
Method to get the IDCConfig information stored in SDK.BarCodeView
dcssdkGetPairingBarcode(DCSSDKDefs.DCSSDK_BT_PROTOCOL bluetoothProtocol, DCSSDKDefs.DCSSDK_BT_SCANNER_CONFIG defaultOption)
Method provides pairing barcode for Bluetooth scannersBarCodeView
dcssdkGetPairingBarcode(DCSSDKDefs.DCSSDK_BT_PROTOCOL bluetoothProtocol, DCSSDKDefs.DCSSDK_BT_SCANNER_CONFIG defaultOption, java.lang.String bluetoothMAC)
Method provides pairing barcode for Bluetooth scannersBarCodeView
dcssdkGetUSBSNAPIWithImagingBarcode()
Method provides connection barcode for USB scannersjava.lang.String
dcssdkGetVersion()
Method to return the version of the SDK.DCSSDKDefs.DCSSDK_RESULT
dcssdkSetBTAddress(java.lang.String bluetoothMAC)
Method to set the Bluetooth address of the device.DCSSDKDefs.DCSSDK_RESULT
dcssdkSetDelegate(IDcsSdkApiDelegate delegate)
Registers a particular object which conforms toIDcsSdkApiDelegate
interface as a receiver of SDK notifications.DCSSDKDefs.DCSSDK_RESULT
dcssdkSetIDCConfig(IDCConfig idcConfig)
Method to set the IDC configuration information for SDK.DCSSDKDefs.DCSSDK_RESULT
dcssdkSetOperationalMode(DCSSDKDefs.DCSSDK_MODE operationalMode)
Method to set the operational mode(If multiple modes are suppoted)DCSSDKDefs.DCSSDK_RESULT
dcssdkSetSTCEnabledState(boolean enable)
Method set Scanner Control App STC(Scan to connect) enabled state.DCSSDKDefs.DCSSDK_RESULT
dcssdkStartScanForAvailableDevices()
Method to scan all the currently available Bluetooth Devices.DCSSDKDefs.DCSSDK_RESULT
dcssdkStartScanForTopologyChanges()
Scan for topology changesDCSSDKDefs.DCSSDK_RESULT
dcssdkStopScanningDevices()
Method to stop current Bluetooth Devices scanning.DCSSDKDefs.DCSSDK_RESULT
dcssdkSubsribeForEvents(int sdkEventsMask)
Method to enable providing of notifications of requested types.DCSSDKDefs.DCSSDK_RESULT
dcssdkTerminateCommunicationSession(int scannerID)
Method requests to terminate communication session with a particular active scanner.DCSSDKDefs.DCSSDK_RESULT
dcssdkUnsubsribeForEvents(int sdkEventsMask)
Method to disable providing of notification of requested types.
-
-
-
Field Detail
-
BLUETOOTH_MAC_ADDRESS_CHARACTER_COUNT
public static final int BLUETOOTH_MAC_ADDRESS_CHARACTER_COUNT
- See Also:
- Constant Field Values
-
MAC_ADDRESS_FORMATTING_REGULAR_EXPRESSION
public static final java.lang.String MAC_ADDRESS_FORMATTING_REGULAR_EXPRESSION
- See Also:
- Constant Field Values
-
REPLACEMENT_DELIMITER
public static final java.lang.String REPLACEMENT_DELIMITER
- See Also:
- Constant Field Values
-
sleepDuration
public static final int sleepDuration
- See Also:
- Constant Field Values
-
-
Method Detail
-
dcssdkSetDelegate
public DCSSDKDefs.DCSSDK_RESULT dcssdkSetDelegate(IDcsSdkApiDelegate delegate)
Description copied from interface:IDcsSdkApi
Registers a particular object which conforms toIDcsSdkApiDelegate
interface as a receiver of SDK notifications. Registration of a particular object which conforms toIDcsSdkApiDelegate
interface is required to receive notifications from the SDK.- Specified by:
dcssdkSetDelegate
in interfaceIDcsSdkApi
- Parameters:
delegate
- Delegate which will be implemented by the app- Returns:
- Success/Failure of the operation(One of
DCSSDKDefs.DCSSDK_RESULT
)
-
dcssdkClose
public DCSSDKDefs.DCSSDK_RESULT dcssdkClose()
Description copied from interface:IDcsSdkApi
Method to close the communication with SDK- Specified by:
dcssdkClose
in interfaceIDcsSdkApi
- Returns:
- Success/Failure of the operation(One of
DCSSDKDefs.DCSSDK_RESULT
)
-
dcssdkGetVersion
public java.lang.String dcssdkGetVersion()
Description copied from interface:IDcsSdkApi
Method to return the version of the SDK.- Specified by:
dcssdkGetVersion
in interfaceIDcsSdkApi
- Returns:
- SDK Version
-
dcssdkGetPairingBarcode
public BarCodeView dcssdkGetPairingBarcode(DCSSDKDefs.DCSSDK_BT_PROTOCOL bluetoothProtocol, DCSSDKDefs.DCSSDK_BT_SCANNER_CONFIG defaultOption, java.lang.String bluetoothMAC)
Description copied from interface:IDcsSdkApi
Method provides pairing barcode for Bluetooth scanners- Specified by:
dcssdkGetPairingBarcode
in interfaceIDcsSdkApi
- Parameters:
bluetoothProtocol
- Protocol to be switcheddefaultOption
- Configuration to be usedbluetoothMAC
- Bluetooth MAC address to be used- Returns:
BarCodeView
-
dcssdkGetPairingBarcode
public BarCodeView dcssdkGetPairingBarcode(DCSSDKDefs.DCSSDK_BT_PROTOCOL bluetoothProtocol, DCSSDKDefs.DCSSDK_BT_SCANNER_CONFIG defaultOption)
Description copied from interface:IDcsSdkApi
Method provides pairing barcode for Bluetooth scanners- Specified by:
dcssdkGetPairingBarcode
in interfaceIDcsSdkApi
- Parameters:
bluetoothProtocol
- Protocol to be switcheddefaultOption
- Configuration to be used- Returns:
BarCodeView
-
dcssdkSetBTAddress
public DCSSDKDefs.DCSSDK_RESULT dcssdkSetBTAddress(java.lang.String bluetoothMAC)
Description copied from interface:IDcsSdkApi
Method to set the Bluetooth address of the device. This address will be used when SDK cannot determine Bluetooth MAC address automatically.- Specified by:
dcssdkSetBTAddress
in interfaceIDcsSdkApi
- Parameters:
bluetoothMAC
- Bluetooth MAC address to be used- Returns:
- Success/Failure of the operation(One of
DCSSDKDefs.DCSSDK_RESULT
)
-
dcssdkClearBTAddress
public DCSSDKDefs.DCSSDK_RESULT dcssdkClearBTAddress()
Description copied from interface:IDcsSdkApi
Method to clear the Bluetooth address stored in SDK.- Specified by:
dcssdkClearBTAddress
in interfaceIDcsSdkApi
- Returns:
- Success/Failure of the operation(One of
DCSSDKDefs.DCSSDK_RESULT
)
-
dcssdkGetUSBSNAPIWithImagingBarcode
public BarCodeView dcssdkGetUSBSNAPIWithImagingBarcode()
Description copied from interface:IDcsSdkApi
Method provides connection barcode for USB scanners- Specified by:
dcssdkGetUSBSNAPIWithImagingBarcode
in interfaceIDcsSdkApi
- Returns:
BarCodeView
-
dcssdkStartScanForTopologyChanges
public DCSSDKDefs.DCSSDK_RESULT dcssdkStartScanForTopologyChanges()
Description copied from interface:IDcsSdkApi
Scan for topology changes- Specified by:
dcssdkStartScanForTopologyChanges
in interfaceIDcsSdkApi
- Returns:
- Success/Failure of the operation(One of
DCSSDKDefs.DCSSDK_RESULT
)
-
dcssdkSetOperationalMode
public DCSSDKDefs.DCSSDK_RESULT dcssdkSetOperationalMode(DCSSDKDefs.DCSSDK_MODE operationalMode)
Description copied from interface:IDcsSdkApi
Method to set the operational mode(If multiple modes are suppoted)- Specified by:
dcssdkSetOperationalMode
in interfaceIDcsSdkApi
- Parameters:
operationalMode
- Operational mode to be set(one ofDCSSDKDefs.DCSSDK_MODE
)- Returns:
- Success/Failure of the operation(One of
DCSSDKDefs.DCSSDK_RESULT
)
-
dcssdkSubsribeForEvents
public DCSSDKDefs.DCSSDK_RESULT dcssdkSubsribeForEvents(int sdkEventsMask)
Description copied from interface:IDcsSdkApi
Method to enable providing of notifications of requested types.- Specified by:
dcssdkSubsribeForEvents
in interfaceIDcsSdkApi
- Parameters:
sdkEventsMask
- Mask which decides the subscription status- Returns:
- Success/Failure of the operation(One of
DCSSDKDefs.DCSSDK_RESULT
)
-
dcssdkUnsubsribeForEvents
public DCSSDKDefs.DCSSDK_RESULT dcssdkUnsubsribeForEvents(int sdkEventsMask)
Description copied from interface:IDcsSdkApi
Method to disable providing of notification of requested types.- Specified by:
dcssdkUnsubsribeForEvents
in interfaceIDcsSdkApi
- Parameters:
sdkEventsMask
- Unsubscription option flags.- Returns:
- Success/Failure of the operation(One of
DCSSDKDefs.DCSSDK_RESULT
)
-
dcssdkGetAvailableScannersList
public DCSSDKDefs.DCSSDK_RESULT dcssdkGetAvailableScannersList(java.util.List<DCSScannerInfo> availableScannersList)
Description copied from interface:IDcsSdkApi
Method to fetch the list of available(paired via bluetooth) scanners- Specified by:
dcssdkGetAvailableScannersList
in interfaceIDcsSdkApi
- Parameters:
availableScannersList
- List of scanners which should be updated- Returns:
- Success/Failure of the operation(One of
DCSSDKDefs.DCSSDK_RESULT
)
-
dcssdkGetAvailableScannersList
public java.util.List<DCSScannerInfo> dcssdkGetAvailableScannersList()
Description copied from interface:IDcsSdkApi
Method to fetch the list of available(paired via bluetooth) scanners- Specified by:
dcssdkGetAvailableScannersList
in interfaceIDcsSdkApi
- Returns:
- List of available scanners)
-
dcssdkStartScanForAvailableDevices
public DCSSDKDefs.DCSSDK_RESULT dcssdkStartScanForAvailableDevices()
Description copied from interface:IDcsSdkApi
Method to scan all the currently available Bluetooth Devices.- Specified by:
dcssdkStartScanForAvailableDevices
in interfaceIDcsSdkApi
- Returns:
- Success/Failure of the operation(One of
DCSSDKDefs.DCSSDK_RESULT
)
-
dcssdkStopScanningDevices
public DCSSDKDefs.DCSSDK_RESULT dcssdkStopScanningDevices()
Description copied from interface:IDcsSdkApi
Method to stop current Bluetooth Devices scanning.- Specified by:
dcssdkStopScanningDevices
in interfaceIDcsSdkApi
- Returns:
- Success/Failure of the operation(One of
DCSSDKDefs.DCSSDK_RESULT
)
-
dcssdkGetActiveScannersList
public DCSSDKDefs.DCSSDK_RESULT dcssdkGetActiveScannersList(java.util.List<DCSScannerInfo> activeScannersList)
Description copied from interface:IDcsSdkApi
Method to fetch the list of active(connected via bluetooth) scanners- Specified by:
dcssdkGetActiveScannersList
in interfaceIDcsSdkApi
- Parameters:
activeScannersList
- List of scanners which should be updated- Returns:
- Success/Failure of the operation(One of
DCSSDKDefs.DCSSDK_RESULT
)
-
dcssdkGetActiveScannersList
public java.util.List<DCSScannerInfo> dcssdkGetActiveScannersList()
Description copied from interface:IDcsSdkApi
Method to fetch the list of active(connected via bluetooth) scanners- Specified by:
dcssdkGetActiveScannersList
in interfaceIDcsSdkApi
- Returns:
- List of active scanners)
-
dcssdkEstablishCommunicationSession
public DCSSDKDefs.DCSSDK_RESULT dcssdkEstablishCommunicationSession(int scannerID)
Description copied from interface:IDcsSdkApi
Method requests to establish communication session with a particular available scanner.- Specified by:
dcssdkEstablishCommunicationSession
in interfaceIDcsSdkApi
- Parameters:
scannerID
- Unique identifier of a particular scanner assigned by SDK- Returns:
- Success/Failure of the operation(One of
DCSSDKDefs.DCSSDK_RESULT
)
-
dcssdkTerminateCommunicationSession
public DCSSDKDefs.DCSSDK_RESULT dcssdkTerminateCommunicationSession(int scannerID)
Description copied from interface:IDcsSdkApi
Method requests to terminate communication session with a particular active scanner.- Specified by:
dcssdkTerminateCommunicationSession
in interfaceIDcsSdkApi
- Parameters:
scannerID
- Unique identifier of a particular scanner assigned by SDK.- Returns:
- Success/Failure of the operation(One of
DCSSDKDefs.DCSSDK_RESULT
)
-
dcssdkEnableAvailableScannersDetection
public DCSSDKDefs.DCSSDK_RESULT dcssdkEnableAvailableScannersDetection(boolean enable)
Description copied from interface:IDcsSdkApi
Method requests to enable/disable "Available scanners detection" option.- Specified by:
dcssdkEnableAvailableScannersDetection
in interfaceIDcsSdkApi
- Parameters:
enable
- (true/false) based on whether the option should be enabled or disabled- Returns:
- Success/Failure of the operation(One of
DCSSDKDefs.DCSSDK_RESULT
)
-
dcssdkEnableBluetoothScannersDiscovery
public DCSSDKDefs.DCSSDK_RESULT dcssdkEnableBluetoothScannersDiscovery(boolean enable)
Description copied from interface:IDcsSdkApi
Method requests to enable/disable "Bluetooth scanners discovery" option.- Specified by:
dcssdkEnableBluetoothScannersDiscovery
in interfaceIDcsSdkApi
- Parameters:
enable
- (true/false) based on whether the option should be enabled or disabled- Returns:
- Success/Failure of the operation(One of
DCSSDKDefs.DCSSDK_RESULT
)
-
dcssdkSetSTCEnabledState
public DCSSDKDefs.DCSSDK_RESULT dcssdkSetSTCEnabledState(boolean enable)
Description copied from interface:IDcsSdkApi
Method set Scanner Control App STC(Scan to connect) enabled state.- Specified by:
dcssdkSetSTCEnabledState
in interfaceIDcsSdkApi
- Parameters:
enable
- (true/false) based on whether the option should be enabled or disabled- Returns:
- Success/Failure of the operation(One of
DCSSDKDefs.DCSSDK_RESULT
)
-
dcssdkEnableAutomaticSessionReestablishment
public DCSSDKDefs.DCSSDK_RESULT dcssdkEnableAutomaticSessionReestablishment(boolean enable, int fromScannerID)
Description copied from interface:IDcsSdkApi
Method requests to enable/disable "Automatic communication session reestablishment" option for a particular scanner.- Specified by:
dcssdkEnableAutomaticSessionReestablishment
in interfaceIDcsSdkApi
- Parameters:
enable
- true/false for enabling/disablingfromScannerID
- identifier of a particular scanner assigned by SDK.- Returns:
- Success/Failure of the operation(One of
DCSSDKDefs.DCSSDK_RESULT
)
-
dcssdkExecuteCommandOpCodeInXMLForScanner
public DCSSDKDefs.DCSSDK_RESULT dcssdkExecuteCommandOpCodeInXMLForScanner(DCSSDKDefs.DCSSDK_COMMAND_OPCODE opCode, java.lang.String inXML, java.lang.StringBuilder outXML, int scannerID)
Description copied from interface:IDcsSdkApi
Method provides synchronous execution of a particular method via an opcode.- Specified by:
dcssdkExecuteCommandOpCodeInXMLForScanner
in interfaceIDcsSdkApi
- Parameters:
opCode
- Opcode for the commandinXML
- Relevant argument list for the opcode, structured into an XML string.outXML
- Results of method execution, structured into an XML string.scannerID
- Unique identifier of a particular scanner assigned by SDK.- Returns:
- Success/Failure of the operation(One of
DCSSDKDefs.DCSSDK_RESULT
)
-
dcssdkExecuteCommandOpCodeInXMLForScanner
public DCSSDKDefs.DCSSDK_RESULT dcssdkExecuteCommandOpCodeInXMLForScanner(DCSSDKDefs.DCSSDK_COMMAND_OPCODE opCode, java.lang.String inXML, java.lang.StringBuilder outXML)
Description copied from interface:IDcsSdkApi
Method provides synchronous execution of a particular method via an opcode.- Specified by:
dcssdkExecuteCommandOpCodeInXMLForScanner
in interfaceIDcsSdkApi
- Parameters:
opCode
- Opcode for the commandinXML
- Relevant argument list for the opcode, structured into an XML string.outXML
- Results of method execution, structured into an XML string.- Returns:
- Success/Failure of the operation(One of
DCSSDKDefs.DCSSDK_RESULT
)
-
dcssdkExecuteCommandOpCodeInXMLForScanner
public java.lang.String dcssdkExecuteCommandOpCodeInXMLForScanner(DCSSDKDefs.DCSSDK_COMMAND_OPCODE opCode, java.lang.String inXML)
Description copied from interface:IDcsSdkApi
Method provides synchronous execution of a particular method via an opcode.- Specified by:
dcssdkExecuteCommandOpCodeInXMLForScanner
in interfaceIDcsSdkApi
- Parameters:
opCode
- Opcode for the commandinXML
- Relevant argument list for the opcode, structured into an XML string.- Returns:
- outXma for execute command with given opcode and inXml.
-
dcssdkExecuteSSICommandOpCodeInXMLForScanner
public DCSSDKDefs.DCSSDK_RESULT dcssdkExecuteSSICommandOpCodeInXMLForScanner(DCSSDKDefs.DCSSDK_COMMAND_OPCODE opCode, java.lang.String inXML, java.lang.StringBuilder outXML, int scannerID)
Description copied from interface:IDcsSdkApi
Method provides synchronous execution SSI command of a particular method via an opcode.- Specified by:
dcssdkExecuteSSICommandOpCodeInXMLForScanner
in interfaceIDcsSdkApi
- Parameters:
opCode
- Opcode for the commandinXML
- Relevant argument list for the opcode, structured into an XML string.outXML
- Results of method execution, structured into an XML string.- Returns:
- Success/Failure of the operation(One of
DCSSDKDefs.DCSSDK_RESULT
)
-
dcssdkSetIDCConfig
public DCSSDKDefs.DCSSDK_RESULT dcssdkSetIDCConfig(IDCConfig idcConfig)
Description copied from interface:IDcsSdkApi
Method to set the IDC configuration information for SDK. This configuration information is used to send either Binary Data event or seperate Image and Barcode events for IDC data.- Specified by:
dcssdkSetIDCConfig
in interfaceIDcsSdkApi
- Parameters:
idcConfig
- IDCConfig Object which has IDC configuration information- Returns:
- Success/Failure of the operation(One of
DCSSDKDefs.DCSSDK_RESULT
)
-
dcssdkGetIDCConfig
public IDCConfig dcssdkGetIDCConfig()
Description copied from interface:IDcsSdkApi
Method to get the IDCConfig information stored in SDK.- Specified by:
dcssdkGetIDCConfig
in interfaceIDcsSdkApi
- Returns:
- IDCConfig object(
IDCConfig
)
-
-