Class RemoteNXTIOPort

    • Field Detail

      • port

        protected int port
      • typ

        protected int typ
      • dc

        protected static byte[] dc
      • currentMode

        protected int currentMode
    • Constructor Detail

      • RemoteNXTIOPort

        public RemoteNXTIOPort​(NXTCommand nxtCommand)
    • Method Detail

      • getName

        public java.lang.String getName()
        Return the string representing this port
        Specified by:
        getName in interface IOPort
        Returns:
        the port name
      • getMode

        public int getMode()
        Get the current operating mode of the sensor
        Specified by:
        getMode in interface BasicSensorPort
        Returns:
        the current mode
      • getType

        public int getType()
        Get the current type setting. Note that types are typically used to control the operation of Legacy and i2c sensors. They are normally not used for EV3 sensors.
        Specified by:
        getType in interface BasicSensorPort
        Returns:
        the current sensor type
      • setMode

        public boolean setMode​(int mode)
        Set the current operating mode for the sensor attached to the port.
        Specified by:
        setMode in interface BasicSensorPort
        Parameters:
        mode - the new mode
        Returns:
        true if the mode has been accepted
      • setType

        public boolean setType​(int type)
        Set the operating type for the attached sensor. Normally type setting is only used with legacy sensors and for i2c devices (to set the speed and operating voltage). It is not normally used with EV3 sensors.
        Specified by:
        setType in interface BasicSensorPort
        Returns:
        true if type accepted
      • open

        public boolean open​(int typ,
                            int port,
                            RemoteNXTPort ref)
        Open the sensor port. Ensure that the port is only opened once.
        Parameters:
        typ - The type of port motor/sensor
        port - the port number
        ref - the Port ref for this port
        Returns:
        true if success
      • close

        public void close()
        Close the port, the port can not be used after this call.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface IOPort
      • setPinMode

        public boolean setPinMode​(int mode)
        Set the port pins up ready for use.
        Specified by:
        setPinMode in interface IOPort
        Parameters:
        mode - The EV3 pin mode
        Returns:
        true if the operation succeeds false if it fails