question: public int writeTelegram ( char [ ] buffer , int type , Object id ) { int result = 0 ; try { String msg = new String ( buffer ) ; msg += "\n" ; wrtr . write ( msg . getBytes ( ) ) ; result = buffer . length ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; } return ( result ) ; }
target:  write a telegram to serial port