2 Replies Latest reply on Jun 7, 2018 12:54 AM by Tomasz Paluszkiewicz

    CS4070 issues with LED notifications

    Tomasz Paluszkiewicz

      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 "<inArgs>" +
                          "<scannerID>" + connectedScannerID + "</scannerID>" +
                          "<cmdArgs>" +
                              "<arg-int>" + value +"</arg-int>" +
                          "</cmdArgs>" +
                      "</inArgs>";
          }
      
      

       

      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 off
      

      scanner toggles amber LED and freezes.

       

      I have also tried following:

      private String prepareInXML(){
          return "<inArgs>" +
                      "<scannerID>" + connectedScannerID + "</scannerID>" +
                      "<cmdArgs>" +
                          "<arg-int>47,17,48</arg-int>" +
                      "</cmdArgs>" +
                  "</inArgs>";
      }
      

       

       

      and with semicolons:

      private String prepareInXML(){
          return "<inArgs>" +
                      "<scannerID>" + connectedScannerID + "</scannerID>" +
                      "<cmdArgs>" +
                          "<arg-int>47;17;48</arg-int>" +
                      "</cmdArgs>" +
                  "</inArgs>";
      }
      

       

      also with arguments split:

      private String prepareInXML(){
          return "<inArgs>" +
                      "<scannerID>" + connectedScannerID + "</scannerID>" +
                      "<cmdArgs>" +
                          "<arg-int>47</arg-int>" +
                          "<arg-int>17</arg-int>" +
                          "<arg-int>48</arg-int>" +
                      "</cmdArgs>" +
                  "</inArgs>";
      }
      

       

      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?