Class SerialDriver.JSSCConnection

    • Method Detail

      • setEncoding

        public void setEncoding​(java.nio.charset.Charset charset)
        Specified by:
        setEncoding in interface Connection
      • getEncoding

        public java.nio.charset.Charset getEncoding()
        Specified by:
        getEncoding in interface Connection
      • write

        public void write​(java.lang.String toWrite)
                   throws VISAException
        Description copied from interface: Connection
        Writes the specified string over the connection.
        Specified by:
        write in interface Connection
        Parameters:
        toWrite - String to write
        Throws:
        VISAException - Upon something going wrong with VISA
      • readBytes

        public byte[] readBytes​(int bufferSize)
                         throws VISAException
        Description copied from interface: Connection
        Attempts to read the given number of bytes from the connection. Will return if either the number of bytes is reached or the specified EOS terminator is found. Will time-out if neither of these conditions are met within the value specified by setTMO(...).
        Specified by:
        readBytes in interface Connection
        Parameters:
        bufferSize - The number of bytes to read
        Returns:
        Array of bytes read (trimmed)
        Throws:
        VISAException - Upon something going wrong
      • setReadTerminator

        public void setReadTerminator​(long character)
        Description copied from interface: Connection
        Sets the "End of String" terminator, in numerical form. This is the terminator used for reading from the connection, to specify the end of a message from the instrument. For example:

        line-feed: \n = 0x0A carriage-return \r = 0x0D CR-LF \r\n = 0x0D0A

        Specified by:
        setReadTerminator in interface Connection
        Parameters:
        character - The terminator to look for (numerical representation)
      • setReadTerminator

        public void setReadTerminator​(java.lang.String character)
        Description copied from interface: Connection
        Sets the "End of String" terminator, in String form. This is the terminator used for reading from the connection, to specify the end of a message from the instrument.
        Specified by:
        setReadTerminator in interface Connection
        Parameters:
        character - The terminator to look from (String representation)
      • setTimeout

        public void setTimeout​(int timeout)
                        throws VISAException
        Description copied from interface: Connection
        Sets the time-out, in milli-seconds, to use on this connection.
        Specified by:
        setTimeout in interface Connection
        Parameters:
        timeout - Time-out, in milli-seconds
        Throws:
        VISAException - Upon something going wrong