Hi and welcome everyone
I am having problem with CS4070. My company has bought a couple of those, for ticket check-ins at events we are organizing.
My task is to write an Android app for those scanners.
I did manage to get the scanning functionality working (despite outdated PDF / YouTube guides), but commanding LED is driving me nuts.
No matter how I approach this issue, LED will just not work. Bepper works just fine, but whenever I use opcode for controlling LED, scanner freezes: no scan is returned an no beep.
I use following code:
private void performOpcodeSetAction(int codeValue) { String inXML = prepareInXML(codeValue); int scannerID = connectedScannerID; //getIntent().getIntExtra(Constants.SCANNER_ID, -1); if (scannerID != -1) { StringBuilder outXML = new StringBuilder();// sdkHandler.dcssdkExecuteCommandOpCodeInXMLForScanner(DCSSDKDefs.DCSSDK_COMMAND_OPCODE.DCSSDK_SET_ACTION,inXML,outXML,connectedScannerID); new MyAsyncTask(scannerID, DCSSDKDefs.DCSSDK_COMMAND_OPCODE.DCSSDK_SET_ACTION,sdkHandler,outXML).execute(inXML); } else { Toast.makeText(this, R.string.scanner_invalid, Toast.LENGTH_SHORT).show(); } Log.i(TAG, "OPCODE SET_ACTION : " + codeValue); } private String prepareInXML(int value){ return "" + "" + connectedScannerID + "" + "" + "" + value +"" + "" + ""; }
and then, I call the action by just supplying proper opcode:
performOpcodeSetAction(17); //low long beep
and that works.
BUT...
when I try to add LED control, like:
performOpcodeSetAction(47);// red LED on performOpcodeSetAction(17);// low long beep performOpcodeSetAction(48);// red LED offscanner toggles amber LED and freezes.
I have also tried following:
private String prepareInXML(){ return "" + "" + connectedScannerID + "" + "" + "47,17,48" + "" + "";}
and with semicolons:
private String prepareInXML(){ return "" + "" + connectedScannerID + "" + "" + "47;17;48" + "" + "";}
also with arguments split:
private String prepareInXML(){ return "" + "" + connectedScannerID + "" + "" + "47" + "17" + "48" + "" + "";}
none of the above worked.
Android devices, I am using are on API 22 (android version 5.1)
scanners have been updated with latest firmware (although, scanning the firmware version barcode returns old version number)
What am I doing wrong? Anyone kind enough to help me out on this one?
0 Replies