public void run() {
        while (!exiting) {
            if (!queue.isEmpty()) {
                // wait for a small interval before attempting next transmission
                try {
                    String data = queue.take();

                    if (serial.isOpen()) {
                        serial.write(data);
                        serial.flush();
                    }

                    Thread.sleep(delay);
                } catch (IOException ioe) {
                    ioe.printStackTrace();
                } catch (InterruptedException e) {
                    //e.printStackTrace();
                }
            }
        }
    }
public void run ( ) { while ( ! exiting ) { if ( ! queue . isEmpty ( ) ) { try { String data = queue . take ( ) ; if ( serial . isOpen ( ) ) { serial . write ( data ) ; serial . flush ( ) ; } Thread . sleep ( delay ) ; } catch ( IOException ioe ) { ioe . printStackTrace ( ) ; } catch ( InterruptedException e ) { } } } }
<p>
This method is called when this monitoring thread starts
</p>