Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  
  /*
   *  Copyright (C) 2010-2011 Oracle Corporation
   *
   *  This file is part of the VirtualBox SDK, as available from
   *  http://www.virtualbox.org.  This library is free software; you can
   *  redistribute it and/or modify it under the terms of the GNU Lesser General
   *  Public License as published by the Free Software Foundation, in version 2.1
   *  as it comes in the "COPYING.LIB" file of the VirtualBox SDK distribution.
  *  This library is distributed in the hope that it will be useful, but WITHOUT
  *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
  *  License for more details.
  *
  * ISerialPort.java
  *
  * DO NOT EDIT! This is a generated file.
  * Generated from: src/VBox/Main/idl/VirtualBox.xidl (VirtualBox's interface definitions in XML)
  * Generator: src/VBox/Main/glue/glue-java.xsl
  */
 
 package org.virtualbox_4_2;
 
 import javax.xml.ws.*;
 import java.util.List;

The ISerialPort interface represents the virtual serial port device. The virtual serial port device acts like an ordinary serial port inside the virtual machine. This device communicates to the real serial port hardware in one of two modes: host pipe or host device. In host pipe mode, the #path attribute specifies the path to the pipe on the host computer that represents a serial port. The #server attribute determines if this pipe is created by the virtual machine process at machine startup or it must already exist before starting machine execution. In host device mode, the #path attribute specifies the name of the serial port device on the host computer. There is also a third communication mode: the disconnected mode. In this mode, the guest OS running inside the virtual machine will be able to detect the serial port, but all port write operations will be discarded and all port read operations will return no data.

See also:
IMachine.getSerialPort(java.lang.Long) Interface ID: {937F6970-5103-4745-B78E-D28DCF1479A8}
 
 public class ISerialPort extends IUnknown {
 
     public ISerialPort(String wrappedVboxPortType port) {
           super(wrappedport);
     }
Slot number this serial port is plugged into. Corresponds to the value you pass to IMachine.getSerialPort(java.lang.Long) to obtain this instance.

Returns:
Long
 
     public Long getSlot() {
       try {
          Long retVal = .iSerialPortGetSlot();
          return retVal;
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Flag whether the serial port is enabled. If disabled, the serial port will not be reported to the guest OS.

Returns:
Boolean
 
     public Boolean getEnabled() {
       try {
          Boolean retVal = .iSerialPortGetEnabled();
          return retVal;
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
Flag whether the serial port is enabled. If disabled, the serial port will not be reported to the guest OS.

Parameters:
value Boolean
    public void setEnabled(Boolean value) {
      try {
        .iSerialPortSetEnabled(value);
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Base I/O address of the serial port.

Returns:
Long
    public Long getIOBase() {
      try {
         Long retVal = .iSerialPortGetIOBase();
         return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Base I/O address of the serial port.

Parameters:
value Long
    public void setIOBase(Long value) {
      try {
        .iSerialPortSetIOBase(value);
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
IRQ number of the serial port.

Returns:
Long
    public Long getIRQ() {
      try {
         Long retVal = .iSerialPortGetIRQ();
         return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
IRQ number of the serial port.

Parameters:
value Long
    public void setIRQ(Long value) {
      try {
        .iSerialPortSetIRQ(value);
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
How is this port connected to the host. NOTE: Changing this attribute may fail if the conditions for getPath() are not met.

Returns:
org.virtualbox_4_2.PortMode
      try {
         return org.virtualbox_4_2.PortMode.fromValue(retVal.value());
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
How is this port connected to the host. NOTE: Changing this attribute may fail if the conditions for getPath() are not met.

Parameters:
value org.virtualbox_4_2.PortMode
    public void setHostMode(org.virtualbox_4_2.PortMode value) {
      try {
        .iSerialPortSetHostMode(, org.virtualbox_4_2.jaxws.PortMode.fromValue(value.name()));
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Flag whether this serial port acts as a server (creates a new pipe on the host) or as a client (uses the existing pipe). This attribute is used only when getHostMode() is PortMode_HostPipe.

Returns:
Boolean
    public Boolean getServer() {
      try {
         Boolean retVal = .iSerialPortGetServer();
         return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Flag whether this serial port acts as a server (creates a new pipe on the host) or as a client (uses the existing pipe). This attribute is used only when getHostMode() is PortMode_HostPipe.

Parameters:
value Boolean
    public void setServer(Boolean value) {
      try {
        .iSerialPortSetServer(value);
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Path to the serial port's pipe on the host when getHostMode() is PortMode_HostPipe, or the host serial device name when getHostMode() is PortMode_HostDevice. For both cases, setting a null or empty string as the attribute's value is an error. Otherwise, the value of this property is ignored.

Returns:
String
    public String getPath() {
      try {
         String retVal = .iSerialPortGetPath();
         return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Path to the serial port's pipe on the host when getHostMode() is PortMode_HostPipe, or the host serial device name when getHostMode() is PortMode_HostDevice. For both cases, setting a null or empty string as the attribute's value is an error. Otherwise, the value of this property is ignored.

Parameters:
value String
    public void setPath(String value) {
      try {
        .iSerialPortSetPath(value);
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
    public static ISerialPort queryInterface(IUnknown obj) {
       return obj == null ?  null : new ISerialPort(obj.getWrapped(), obj.getRemoteWSPort());
    }
New to GrepCode? Check out our FAQ X