public void explicitSend(byte[] a) { // serial.write(a); if (a != null && serial != null) { Log.d("MAESTRO: SEND: ", HexData.hexToString(a)); // serial.syncWrite(a, 5000); // serial.syncRead(buffer, 5000); serial.write(a); try { Thread.sleep(200); } catch (InterruptedException e) { e.printStackTrace(); } // Log.d("MAESTRO: ", String.valueOf(i)); } }
/* * This function will be called from MainActivity to write data through Serial Port */ public void write(byte[] data) { if (serialPort != null) serialPort.write(data); }