Is it possible to use EMDK (Barcodemanager) and DataWedge profile simultaneously?

s sadf weafwfwef 3 years 7 months ago
151 1 0

On my devices (TC51 and TC75x) I have a service running that uses the EMDK to interact with the scanner device. This service provides an interface to our company apps to configure the scanner device (enable/disable the scanner, set decoder params ...) and receive scan events. On the same device I need to run a third party app that uses a DataWedge profile and receives scan events per Intent.
 
When I try to use the thrird party app (or e.g the Zebra DWDemo) it does not work until I start the DataWedge App on the device and after that my EMDK-using service seem to get in trouble. I get exceptions like this:
 
08-15 13:57:17.765 574-5002/? E/ScannerFramework: [StateMachine::IsTransitionValid] Tx code is invalid for both scanner and user
08-15 13:57:17.765 574-5002/? E/ScannerFramework: [StackAdapter::SetParameter] Unable to set parameters, invalid state machine state :5
...
08-15 14:01:28.284 2483-28015/? D/com.symbol.emdk.emdkservice.barcode.SvcScanner: #EMDK-SVC# scanner read() called
08-15 14:01:28.284 574-909/? E/ScannerFramework: getframeThreadProc already Stopped
08-15 14:01:28.284 2483-2499/? D/tag: com.symbol.emdk.emdkservice.barcode.SvcScanEventCallback_HL > debug. =========SVC SS MANAGER======== PID: 2483
08-15 14:01:28.284 2483-2499/? D/tag: com.symbol.emdk.emdkservice.barcode.SvcScanEventCallback_HL > debug.heap native: allocated 4,180.16KB of 5,720.00KB (1,540.09KB free)
08-15 14:01:28.284 2483-2499/? D/tag: com.symbol.emdk.emdkservice.barcode.SvcScanEventCallback_HL > debug.heap native: allocated 4.08MB of 5.59MB (1.50MB free)
08-15 14:01:28.284 2483-2499/? D/tag: com.symbol.emdk.emdkservice.barcode.SvcScanEventCallback_HL > debug.memory: allocated: 9.00MB of 192.00MB (5.00MB free)
08-15 14:01:28.284 2483-2499/? D/tag: com.symbol.emdk.emdkservice.barcode.SvcScanEventCallback_HL > debug.memory: allocated: 9,972.00KB of 196,608.00KB (5,713.00KB free)
08-15 14:01:28.285 2483-2499/? D/com.symbol.emdk.emdkservice.barcode.SvcScanEventCallback: onScanEvent...STATUS: SCAN_STATUS_ENABLED
08-15 14:01:28.291 574-909/? V/libimgkit: DecDeInit+
08-15 14:01:28.296 2483-2499/? D/tag: com.symbol.emdk.emdkservice.barcode.SvcScanEventCallback_HL > debug. =========SVC SS MANAGER======== PID: 2483
08-15 14:01:28.296 2483-2499/? D/tag: com.symbol.emdk.emdkservice.barcode.SvcScanEventCallback_HL > debug.heap native: allocated 4,182.53KB of 5,720.00KB (1,537.47KB free)
08-15 14:01:28.297 2483-2499/? D/tag: com.symbol.emdk.emdkservice.barcode.SvcScanEventCallback_HL > debug.heap native: allocated 4.08MB of 5.59MB (1.50MB free)
08-15 14:01:28.297 2483-2499/? D/tag: com.symbol.emdk.emdkservice.barcode.SvcScanEventCallback_HL > debug.memory: allocated: 9.00MB of 192.00MB (5.00MB free)
08-15 14:01:28.297 2483-2499/? D/tag: com.symbol.emdk.emdkservice.barcode.SvcScanEventCallback_HL > debug.memory: allocated: 9,972.00KB of 196,608.00KB (5,704.00KB free)
08-15 14:01:28.314 574-909/? E/ScannerFramework: [ScannerContext::RemoveDataSubscriber] Subscriber not present in subscriber list
08-15 14:01:28.314 574-909/? E/ScannerFramework: Transition from 1 to 1 is invalid
08-15 14:01:28.314 2483-5823/? D/com.symbol.emdk.emdkservice.barcode.SvcScanner: end - disable
08-15 14:01:28.314 2483-2506/? D/com.symbol.emdk.emdkservice.barcode.SvcScanEventCallback: onScanEvent...STATUS: SCAN_STATUS_IDLE
08-15 14:01:28.319 2483-5823/? D/com.symbol.emdk.emdkservice.barcode.SvcScanner: #EMDK-SVC# start - scanSubmitRead
08-15 14:01:28.319 2483-2506/? D/tag: com.symbol.emdk.emdkservice.barcode.SvcScanEventCallback_HL > debug. =========SVC SS MANAGER======== PID: 2483
08-15 14:01:28.319 2483-2506/? D/tag: com.symbol.emdk.emdkservice.barcode.SvcScanEventCallback_HL > debug.heap native: allocated 4,185.27KB of 5,720.00KB (1,534.77KB free)
08-15 14:01:28.319 2483-2506/? D/tag: com.symbol.emdk.emdkservice.barcode.SvcScanEventCallback_HL > debug.heap native: allocated 4.09MB of 5.59MB (1.50MB free)
08-15 14:01:28.319 2483-2506/? D/tag: com.symbol.emdk.emdkservice.barcode.SvcScanEventCallback_HL > debug.memory: allocated: 9.00MB of 192.00MB (5.00MB free)
08-15 14:01:28.320 2483-2506/? D/tag: com.symbol.emdk.emdkservice.barcode.SvcScanEventCallback_HL > debug.memory: allocated: 9,972.00KB of 196,608.00KB (5,697.00KB free)
08-15 14:01:28.320 574-574/? E/ScannerFramework: [StateMachine::IsTransitionValid] Tx code is invalid for both scanner and user
08-15 14:01:28.320 574-574/? E/ScannerFramework: [StackAdapter::ReadSubmit] Unable to subit read invalid state for user
08-15 14:01:28.320 2483-2506/? D/com.symbol.emdk.emdkservice.barcode.SvcScanEventCallback: onScanEvent...Triggering: DISABLED
08-15 14:01:28.320 2483-5823/? W/System.err: com.symbol.scanning.Scanner$ScannerExceptions: Scanner is in an invalid state to make the operation
08-15 14:01:28.320 2483-5823/? W/System.err:     at com.symbol.scanning.Scanner.createScannerException(Scanner.java:375)
08-15 14:01:28.320 2483-5823/? W/System.err:     at com.symbol.scanning.Scanner.readSubmit(Scanner.java:2420)
08-15 14:01:28.320 2483-5823/? W/System.err:     at com.symbol.scanning.Scanner.scanSubmitRead(Scanner.java:2782)
08-15 14:01:28.320 2483-5823/? W/System.err:     at com.symbol.emdk.emdkservice.barcode.SvcScanner$8.run(SvcScanner.java:842)
08-15 14:01:28.320 2483-5823/? W/System.err:     at android.os.Handler.handleCallback(Handler.java:739)
08-15 14:01:28.320 2483-5823/? W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:95)
08-15 14:01:28.320 2483-5823/? W/System.err:     at android.os.Looper.loop(Looper.java:148)
08-15 14:01:28.320 2483-5823/? W/System.err:     at android.os.HandlerThread.run(HandlerThread.java:61)
08-15 14:01:28.320 2483-5823/? D/com.symbol.emdk.emdkservice.barcode.SvcScanner: #EMDK-SVC# end - scanSubmitRead
08-15 14:01:28.322 2483-3765/? D/com.symbol.emdk.emdkservice.barcode.SvcScanner: unRegisterStatusNotification called
08-15 14:01:28.322 2483-5823/? D/com.symbol.emdk.emdkservice.barcode.SvcScanner: start - unRegisterScanEventCallback
08-15 14:01:28.322 2483-5823/? D/com.symbol.emdk.emdkservice.barcode.SvcScanner: end - unRegisterScanEventCallback
08-15 14:01:28.323 2483-2506/? D/com.symbol.emdk.emdkservice.barcode.SvcScanEventCallback: onScanEvent...STATUS: SCAN_STATUS_IDLE
 
 
Is it possible to use EMDK Barcodemanager and DataWedge profile simultaneously?
Do I have to reestablish the connection after the DataWedge was used by another App? If so, why is EMDKManager.EMDKListener callback onClosed() not called?

Please Register or Login to post a reply

1 Replies

E Efkan YILMAZ

Hi,

The EMDK was not designed to be used in a background service shared between applications.  There is some state machine ensuring that whenever an application comes to the foreground that uses the EMDK, Datawedge is disabled and similarly, whenever an application comes to the foreground which uses Datawedge, the correct profile and scanner settings are applied.  It looks like running EMDK in a background service is causing some issue between these interactions.

> Is it possible to use EMDK Barcodemanager and DataWedge profile simultaneously?
No, they are mutually exclusive.

> Do I have to reestablish the connection after the DataWedge was used by another App? If so, why is EMDKManager.EMDKListener callback onClosed() not called?
1. Yes, I think that would be the best idea but the EMDK will not automatically close itself, the best solution would be for you to close the scanner and release the EMDK Manager *before* switching to an application that is going to use DataWedge.

2. It might have been easier to just use DataWedge for all your company applications with different DataWedge profiles defining the different parameters in use, the DW API could also be used to enable or disable the scanner from the app.

3. The opposite possibility is for the new app to not use DataWedge at all but you to add logic to your existing service to send intents to this app whenever a scan is received and this app is in the foreground.

I suspect the best solution for you is to just disable EMDK when it is not required (1).

CONTACT
Can’t find what you’re looking for?