Class SerialPortCommandShell

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void destroy()
      Terminate the process
      int exitValue()
      Returns the exit value for the process
      java.io.InputStream getErrorStream()
      Gets the error output stream of the process Note: some implementations (e.g.
      java.io.InputStream getInputStream()
      Gets an InputStream which can be used to read the standard output stream of the process Note: some implementations (e.g.
      java.io.OutputStream getOutputStream()
      Gets an output stream which can be used to write to the standard input stream of the process
      IRemoteProcessBuilder getProcessBuilder()
      Get the process builder used to create this process
      IRemoteConnection getRemoteConnection()
      Get the connection that is used by this process
      <T extends IRemoteProcess.Service>
      T
      getService​(java.lang.Class<T> service)
      Get the service for this remote process that implements the given interface.
      <T extends IRemoteProcess.Service>
      boolean
      hasService​(java.lang.Class<T> service)
      Does this remote process support the given service.
      boolean isCompleted()
      Check if the remote process has completed.
      int waitFor()
      Wait until the process has terminated Note: some implementations (e.g.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SerialPortCommandShell

        public SerialPortCommandShell​(IRemoteConnection remoteConnection,
                                      org.eclipse.cdt.serial.SerialPort serialPort)
                               throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • exitValue

        public int exitValue()
        Description copied from interface: IRemoteProcess
        Returns the exit value for the process
        Specified by:
        exitValue in interface IRemoteProcess
        Returns:
        the exit value
      • getErrorStream

        public java.io.InputStream getErrorStream()
        Description copied from interface: IRemoteProcess
        Gets the error output stream of the process Note: some implementations (e.g. JSch) will not work correctly if the remote process generates stdout or stderr but the calling thread does not read the corresponding output or error streams.
        Specified by:
        getErrorStream in interface IRemoteProcess
        Returns:
        the output stream connected to the standard error of the process
      • getInputStream

        public java.io.InputStream getInputStream()
        Description copied from interface: IRemoteProcess
        Gets an InputStream which can be used to read the standard output stream of the process Note: some implementations (e.g. JSch) will not work correctly if the remote process generates stdout or stderr but the calling thread does not read the corresponding input or error streams.
        Specified by:
        getInputStream in interface IRemoteProcess
        Returns:
        the input stream connected to the standard output of the process
      • getOutputStream

        public java.io.OutputStream getOutputStream()
        Description copied from interface: IRemoteProcess
        Gets an output stream which can be used to write to the standard input stream of the process
        Specified by:
        getOutputStream in interface IRemoteProcess
        Returns:
        the output stream connected to the standard input of the process
      • waitFor

        public int waitFor()
                    throws java.lang.InterruptedException
        Description copied from interface: IRemoteProcess
        Wait until the process has terminated Note: some implementations (e.g. JSch) will not work correctly if the remote process generates stdout or stderr but the calling thread does not read the corresponding input or error streams.
        Specified by:
        waitFor in interface IRemoteProcess
        Returns:
        the exit value of the process
        Throws:
        java.lang.InterruptedException - if the current thread is interrupted by another thread while it is waiting
      • isCompleted

        public boolean isCompleted()
        Description copied from interface: IRemoteProcess
        Check if the remote process has completed. Note: some implementations (e.g. JSch) will not work correctly if the remote process generates stdout or stderr but the calling thread does not read the corresponding input or error streams.
        Specified by:
        isCompleted in interface IRemoteProcess
        Returns:
        true if remote process has completed
      • getService

        public <T extends IRemoteProcess.Service> T getService​(java.lang.Class<T> service)
        Description copied from interface: IRemoteProcess
        Get the service for this remote process that implements the given interface.
        Specified by:
        getService in interface IRemoteProcess
        Parameters:
        service - the interface the required service must implements
        Returns:
        the desired service or null if there is no such service available
      • hasService

        public <T extends IRemoteProcess.Service> boolean hasService​(java.lang.Class<T> service)
        Description copied from interface: IRemoteProcess
        Does this remote process support the given service.
        Specified by:
        hasService in interface IRemoteProcess
        Parameters:
        service - The service to be tested
        Returns:
        true if this connection supports the service