iMin's desktop series models all support direct access to the cash box. The cash box uses the RJ12 interface. Developers can control the cash box by sending data to the RJ12 interface; Developers can open the money box by sending instructions directly. The money box has two operations: opening the money box and checking the status of the money box.

Cash Box SDK Downloads

Open the money box

                  public void cmdGpioPwrOn() { String cmd = "echo 1 > /sys/class/neostra_gpioctl/dev/gpioctl " + "\n"; try { Process exeEcho = Runtime.getRuntime().exec("sh"); exeEcho.getOutputStream().write(cmd.getBytes()); exeEcho.getOutputStream().flush(); Log.i(TAG, " " + cmd); // statusText.setText(String.format(getString(R.string.rj12_status), getString(R.string.open))); } catch (Exception e) { Log.i(TAG, "cmdGpioPwrOn faild"); ((Button) findViewById(R.id.btn_Fail)).setVisibility(View.VISIBLE); } }

Check cash box status

                  public void readStatus() { String cmd = "cat /sys/class/neostra_gpioctl/dev/gpioctl_sns" + "\n"; ExeCommand exeCommand = new ExeCommand(); status = exeCommand.run(cmd, 10000).getResult(); runOnUiThread(new Runnable() { @Override public void run() { selectStatusCount++; if (selectStatusCount == 1) { statusValue = status.trim(); } //0 is open ,1 is close if (!TextUtils.isEmpty(status) && status.trim().equals("0")) { String value = String.format(getString(R.string.rj12_status), getString(R.string.open), getString(R.string.close)); int index = value.indexOf(getString(R.string.open), 0); int lastIndex = getString(R.string.open).length(); SpannableStringBuilder ssb = new SpannableStringBuilder(value); ssb.setSpan(new ForegroundColorSpan(Color.GREEN), index, lastIndex + index, Spannable.SPAN_EXCLUSIVE_INCLUSIVE); statusText.setText(ssb); if (!TextUtils.isEmpty(statusValue) && (!statusValue.equals("0") || isClose)) {//If the first entry is closed, it means that the money box was opened isOpen = true; } } else { String value = String.format(getString(R.string.rj12_status), getString(R.string.close), getString(R.string.open)); int index = value.indexOf(getString(R.string.close), 0); int lastIndex = getString(R.string.close).length(); SpannableString ssb = new SpannableString(value); ssb.setSpan(new ForegroundColorSpan(Color.RED), index, lastIndex + index, Spannable.SPAN_EXCLUSIVE_INCLUSIVE); statusText.setText(ssb); if (!TextUtils.isEmpty(statusValue) && (statusValue.equals("0") || isOpen)) {//If the first entry is opend, it means that the money box was closed isClose = true; } } if (isOpen && isClose) { ((Button) findViewById(R.id.btn_Pass)).setVisibility(View.VISIBLE); } } }); exeCommand.closeStream(); }