public synchronized Boolean sendRaw ( byte ... rawBytes ) { if ( ! start ( ) ) { log . error ( "Firmata library is not connected / started! Cannot send bytes {}" , FirmataHelper . bytesToHexString ( rawBytes ) ) ; return false ; } try { serialPort . getOutputStream ( ) . write ( rawBytes ) ; return true ; } catch ( IOException e ) { log . error ( "Unable to transmit raw bytes through serial port. Bytes: {}" , FirmataHelper . bytesToHexString ( rawBytes ) ) ; stop ( ) ; } return false ; }
Send a series of raw bytes over the serial port to a Firmata supported device .