com.qualcomm.robotcore.hardware

## Interface DeviceManager

-     public interface DeviceManager

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `DeviceManager.UsbDeviceType` Enum of known USB Device Types

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `ColorSensor` | `createAdafruitI2cColorSensor(I2cController controller, DeviceConfiguration.I2cChannel channel, java.lang.String name)` Create an instance of a ColorSensor
    `ColorSensor` | `createAdafruitI2cColorSensor(RobotCoreLynxModule module, DeviceConfiguration.I2cChannel channel, java.lang.String name)`
    `AnalogOutput` | `createAnalogOutputDevice(AnalogOutputController controller, int channel, java.lang.String name)`
    `HardwareDevice` | `createAnalogSensor(AnalogInputController controller, int channel, AnalogSensorConfigurationType type)`
    `CRServo` | `createCRServo(ServoController controller, int portNumber, java.lang.String name)`
    `CRServo` | `createCRServoEx(ServoControllerEx controller, int portNumber, java.lang.String name, ServoConfigurationType servoType)`
    `HardwareDevice` | `createCustomServoDevice(ServoController controller, int portNumber, ServoConfigurationType servoConfigurationType)`
    `DcMotor` | `createDcMotor(DcMotorController controller, int portNumber, MotorConfigurationType motorType, java.lang.String name)` Create an instance of a DcMotor
    `DcMotor` | `createDcMotorEx(DcMotorController controller, int portNumber, MotorConfigurationType motorType, java.lang.String name)`
    `DeviceInterfaceModule` | `createDeviceInterfaceModule(SerialNumber serialNumber, java.lang.String name)`
    `HardwareDevice` | `createDigitalDevice(DigitalChannelController controller, int channel, DigitalIoDeviceConfigurationType type)`
    `AccelerationSensor` | `createHTAccelerationSensor(LegacyModule legacyModule, int physicalPort, java.lang.String name)` Create an instance of a AccelerationSensor
    `ColorSensor` | `createHTColorSensor(LegacyModule controller, int channel, java.lang.String name)` Create an instance of a ColorSensor
    `CompassSensor` | `createHTCompassSensor(LegacyModule legacyModule, int physicalPort, java.lang.String name)` Create an instance of a NxtCompassSensor
    `DcMotorController` | `createHTDcMotorController(LegacyModule legacyModule, int physicalPort, java.lang.String name)` Create an instance of an NXT DcMotorController
    `GyroSensor` | `createHTGyroSensor(LegacyModule legacyModule, int physicalPort, java.lang.String name)` Create an instance of a GyroSensor
    `IrSeekerSensor` | `createHTIrSeekerSensor(LegacyModule legacyModule, int physicalPort, java.lang.String name)` Create an instance of a IrSeekerSensor
    `LightSensor` | `createHTLightSensor(LegacyModule legacyModule, int physicalPort, java.lang.String name)` Create an instance of a LightSensor
    `ServoController` | `createHTServoController(LegacyModule legacyModule, int physicalPort, java.lang.String name)` Create an instance of an NXT ServoController
    `TouchSensorMultiplexer` | `createHTTouchSensorMultiplexer(LegacyModule legacyModule, int port, java.lang.String name)`
    `I2cDevice` | `createI2cDevice(I2cController controller, DeviceConfiguration.I2cChannel channel, java.lang.String name)`
    `I2cDeviceSynch` | `createI2cDeviceSynch(RobotCoreLynxModule module, DeviceConfiguration.I2cChannel channel, java.lang.String name)`
    `LED` | `createLED(DigitalChannelController controller, int channel, java.lang.String name)` Create an instance of an LED
    `ColorSensor` | `createLynxColorRangeSensor(RobotCoreLynxModule module, DeviceConfiguration.I2cChannel channel, java.lang.String name)`
    `HardwareDevice` | `createLynxCustomServoDevice(ServoControllerEx controller, int portNumber, ServoConfigurationType servoConfigurationType)`
    `RobotCoreLynxModule` | `createLynxModule(RobotCoreLynxUsbDevice lynxUsbDevice, int moduleAddress, boolean isParent, java.lang.String name)` Creates an instance of a LynxModule
    `RobotCoreLynxUsbDevice` | `createLynxUsbDevice(SerialNumber serialNumber, java.lang.String name)` Creates an instance of a Lynx USB device
    `ColorSensor` | `createModernRoboticsI2cColorSensor(I2cController controller, DeviceConfiguration.I2cChannel channel, java.lang.String name)` Create an instance of a ColorSensor
    `ColorSensor` | `createModernRoboticsI2cColorSensor(RobotCoreLynxModule module, DeviceConfiguration.I2cChannel channel, java.lang.String name)`
    `GyroSensor` | `createModernRoboticsI2cGyroSensor(I2cController i2cController, DeviceConfiguration.I2cChannel channel, java.lang.String name)` Create an instance of a GyroSensor
    `GyroSensor` | `createModernRoboticsI2cGyroSensor(RobotCoreLynxModule module, DeviceConfiguration.I2cChannel channel, java.lang.String name)`
    `TouchSensor` | `createMRDigitalTouchSensor(DigitalChannelController digitalController, int physicalPort, java.lang.String name)` Create an instance of a Modern Robotics TouchSensor on a digital controller
    `IrSeekerSensor` | `createMRI2cIrSeekerSensorV3(I2cController i2cController, DeviceConfiguration.I2cChannel channel, java.lang.String name)` Create an instance of a IrSeekerSensorV3
    `IrSeekerSensor` | `createMRI2cIrSeekerSensorV3(RobotCoreLynxModule module, DeviceConfiguration.I2cChannel channel, java.lang.String name)`
    `TouchSensor` | `createNxtTouchSensor(LegacyModule legacyModule, int physicalPort, java.lang.String name)`
    `UltrasonicSensor` | `createNxtUltrasonicSensor(LegacyModule legacyModule, int physicalPort, java.lang.String name)` Create an instance of an UltrasonicSensor
    `PWMOutput` | `createPwmOutputDevice(PWMOutputController controller, int channel, java.lang.String name)`
    `Servo` | `createServo(ServoController controller, int portNumber, java.lang.String name)` Create an instance of a Servo
    `Servo` | `createServoEx(ServoControllerEx controller, int portNumber, java.lang.String name, ServoConfigurationType servoType)`
    `DcMotorController` | `createUsbDcMotorController(SerialNumber serialNumber, java.lang.String name)` Create an instance of a DcMotorController
    `LegacyModule` | `createUsbLegacyModule(SerialNumber serialNumber, java.lang.String name)` Create an instance of a LegacyModule
    `ServoController` | `createUsbServoController(SerialNumber serialNumber, java.lang.String name)` Create an instance of a ServoController
    `HardwareDevice` | `createUserI2cDevice(I2cController controller, DeviceConfiguration.I2cChannel channel, I2cDeviceConfigurationType type, java.lang.String name)` Returns a new instance of a user-defined sensor type.
    `HardwareDevice` | `createUserI2cDevice(RobotCoreLynxModule lynxModule, DeviceConfiguration.I2cChannel channel, I2cDeviceConfigurationType type, java.lang.String name)`
    `WebcamName` | `createWebcamName(SerialNumber serialNumber, java.lang.String name)` Creates a `WebcamName` from the indicated serialized contents
    `ScannedDevices` | `scanForUsbDevices()` Get a listing of currently connected USB devices

- - ### Method Detail

    - #### scanForUsbDevices

          ScannedDevices scanForUsbDevices()
                                    throws RobotCoreException

      Get a listing of currently connected USB devices

      This method will attempt to open all USB devices that are using an FTDI USB chipset. It will then probe the device to determine if it is a Modern Robotics device. Finally, it will close the device.

      Because of the opening and closing of devices, it is recommended that this method is not called while any FTDI devices are in use.

      Returns:
        a map of serial numbers to Modern Robotics device types
      Throws:
        `RobotCoreException` - if unable to open a device

    - #### createUsbDcMotorController

          DcMotorController createUsbDcMotorController(SerialNumber serialNumber,
                                                       java.lang.String name)
                                                throws RobotCoreException,
                                                       java.lang.InterruptedException

      Create an instance of a DcMotorController
      Parameters:
        `serialNumber` - serial number of controller
      Returns:
        an instance of a DcMotorController
      Throws:
        `RobotCoreException` - if unable to create instance
        `java.lang.InterruptedException`

    - #### createDcMotor

          DcMotor createDcMotor(DcMotorController controller,
                                int portNumber,
                                MotorConfigurationType motorType,
                                java.lang.String name)

      Create an instance of a DcMotor
      Parameters:
        `controller` - DC Motor controller this motor is attached to
        `portNumber` - physical port number on the controller
        `motorType` - the optional type we know of for this motor
      Returns:
        an instance of a DcMotor

    - #### createDcMotorEx

          DcMotor createDcMotorEx(DcMotorController controller,
                                  int portNumber,
                                  MotorConfigurationType motorType,
                                  java.lang.String name)

    - #### createUsbServoController

          ServoController createUsbServoController(SerialNumber serialNumber,
                                                   java.lang.String name)
                                            throws RobotCoreException,
                                                   java.lang.InterruptedException

      Create an instance of a ServoController
      Parameters:
        `serialNumber` - serial number of controller
      Returns:
        an instance of a ServoController
      Throws:
        `RobotCoreException` - if unable to create instance
        `java.lang.InterruptedException`

    - #### createServo

          Servo createServo(ServoController controller,
                            int portNumber,
                            java.lang.String name)

      Create an instance of a Servo
      Parameters:
        `controller` - Servo controller this servo is attached to
        `portNumber` - physical port number on the controller
      Returns:
        an instance of a Servo

    - #### createServoEx

          Servo createServoEx(ServoControllerEx controller,
                              int portNumber,
                              java.lang.String name,
                              ServoConfigurationType servoType)

    - #### createCRServo

          CRServo createCRServo(ServoController controller,
                                int portNumber,
                                java.lang.String name)

    - #### createCRServoEx

          CRServo createCRServoEx(ServoControllerEx controller,
                                  int portNumber,
                                  java.lang.String name,
                                  ServoConfigurationType servoType)

    - #### createCustomServoDevice

          HardwareDevice createCustomServoDevice(ServoController controller,
                                                 int portNumber,
                                                 ServoConfigurationType servoConfigurationType)

    - #### createLynxCustomServoDevice

          HardwareDevice createLynxCustomServoDevice(ServoControllerEx controller,
                                                     int portNumber,
                                                     ServoConfigurationType servoConfigurationType)

    - #### createUsbLegacyModule

          LegacyModule createUsbLegacyModule(SerialNumber serialNumber,
                                             java.lang.String name)
                                      throws RobotCoreException,
                                             java.lang.InterruptedException

      Create an instance of a LegacyModule
      Parameters:
        `serialNumber` - serial number of legacy module
      Returns:
        an instance of a LegacyModule
      Throws:
        `RobotCoreException` - if unable to create instance
        `java.lang.InterruptedException`

    - #### createDeviceInterfaceModule

          DeviceInterfaceModule createDeviceInterfaceModule(SerialNumber serialNumber,
                                                            java.lang.String name)
                                                     throws RobotCoreException,
                                                            java.lang.InterruptedException

      Parameters:
        `serialNumber` - serial number of Core Device Interface module
      Returns:
        - an instance of a Core Device Interface Module
      Throws:
        `RobotCoreException` - if unable to create instance
        `java.lang.InterruptedException`

    - #### createNxtTouchSensor

          TouchSensor createNxtTouchSensor(LegacyModule legacyModule,
                                           int physicalPort,
                                           java.lang.String name)

      Parameters:
        `legacyModule` - the Legacy Module this sensor is attached to
        `physicalPort` - port number on Legacy Module it's connected to
      Returns:
        an instance of the NXT Touch Sensor

    - #### createHTTouchSensorMultiplexer

          TouchSensorMultiplexer createHTTouchSensorMultiplexer(LegacyModule legacyModule,
                                                                int port,
                                                                java.lang.String name)

      Parameters:
        `legacyModule` - the Legacy Module this sensor is attached to
        `port` - port number on Legacy Module this sensor is connected to.
      Returns:
        an instance of the NXT Touch Sensor Multiplexer

    - #### createAnalogSensor

          HardwareDevice createAnalogSensor(AnalogInputController controller,
                                            int channel,
                                            AnalogSensorConfigurationType type)

      Parameters:
        `controller` - Analog Input Controller Module this device is connected to
      Returns:
        - an instance of an Analog Input device

    - #### createAnalogOutputDevice

          AnalogOutput createAnalogOutputDevice(AnalogOutputController controller,
                                                int channel,
                                                java.lang.String name)

      Parameters:
        `controller` - Analog Output Controller Module this device is connected to
      Returns:
        - an instance of an Analog Output device

    - #### createDigitalDevice

          HardwareDevice createDigitalDevice(DigitalChannelController controller,
                                             int channel,
                                             DigitalIoDeviceConfigurationType type)

      Parameters:
        `controller` - Device Interface Module this device is connected to
        `type` -
      Returns:
        - an instance of an Digital Channel device

    - #### createPwmOutputDevice

          PWMOutput createPwmOutputDevice(PWMOutputController controller,
                                          int channel,
                                          java.lang.String name)

      Parameters:
        `controller` - PWM Output Controller Module this device is connected to
      Returns:
        - an instance of an Digital Channel device

    - #### createI2cDevice

          I2cDevice createI2cDevice(I2cController controller,
                                    DeviceConfiguration.I2cChannel channel,
                                    java.lang.String name)

      Parameters:
        `controller` - I2c Controller Module this device is conneced to
        `channel` - the channel it's connected to on the Controller
      Returns:
        an instance of an I2c Channel device

    - #### createI2cDeviceSynch

          I2cDeviceSynch createI2cDeviceSynch(RobotCoreLynxModule module,
                                              DeviceConfiguration.I2cChannel channel,
                                              java.lang.String name)

    - #### createUserI2cDevice

          HardwareDevice createUserI2cDevice(I2cController controller,
                                             DeviceConfiguration.I2cChannel channel,
                                             I2cDeviceConfigurationType type,
                                             java.lang.String name)

      Returns a new instance of a user-defined sensor type.

    - #### createUserI2cDevice

          HardwareDevice createUserI2cDevice(RobotCoreLynxModule lynxModule,
                                             DeviceConfiguration.I2cChannel channel,
                                             I2cDeviceConfigurationType type,
                                             java.lang.String name)

    - #### createHTDcMotorController

          DcMotorController createHTDcMotorController(LegacyModule legacyModule,
                                                      int physicalPort,
                                                      java.lang.String name)

      Create an instance of an NXT DcMotorController
      Parameters:
        `legacyModule` - Legacy Module this device is connected to
        `physicalPort` - port number on the Legacy Module this device is connected to
      Returns:
        a DcMotorController

    - #### createLynxUsbDevice

          RobotCoreLynxUsbDevice createLynxUsbDevice(SerialNumber serialNumber,
                                                     java.lang.String name)
                                              throws RobotCoreException,
                                                     java.lang.InterruptedException

      Creates an instance of a Lynx USB device
      Parameters:
        `serialNumber` -
      Returns:
      Throws:
        `RobotCoreException`
        `java.lang.InterruptedException`

    - #### createLynxModule

          RobotCoreLynxModule createLynxModule(RobotCoreLynxUsbDevice lynxUsbDevice,
                                               int moduleAddress,
                                               boolean isParent,
                                               java.lang.String name)

      Creates an instance of a LynxModule
      Parameters:
        `lynxUsbDevice` -
        `moduleAddress` -
      Returns:

    - #### createWebcamName

          WebcamName createWebcamName(SerialNumber serialNumber,
                                      java.lang.String name)
                               throws RobotCoreException,
                                      java.lang.InterruptedException

      Creates a `WebcamName` from the indicated serialized contents
      Throws:
        `RobotCoreException`
        `java.lang.InterruptedException`

    - #### createHTServoController

          ServoController createHTServoController(LegacyModule legacyModule,
                                                  int physicalPort,
                                                  java.lang.String name)

      Create an instance of an NXT ServoController
      Parameters:
        `legacyModule` - Legacy Module this device is connected to
        `physicalPort` - port number on the Legacy Module this device is connected to
      Returns:
        a ServoController

    - #### createHTCompassSensor

          CompassSensor createHTCompassSensor(LegacyModule legacyModule,
                                              int physicalPort,
                                              java.lang.String name)

      Create an instance of a NxtCompassSensor
      Parameters:
        `legacyModule` - Legacy Module this device is connected to
        `physicalPort` - port number on the Legacy Module this device is connected to
      Returns:
        a CompassSensor

    - #### createMRDigitalTouchSensor

          TouchSensor createMRDigitalTouchSensor(DigitalChannelController digitalController,
                                                 int physicalPort,
                                                 java.lang.String name)

      Create an instance of a Modern Robotics TouchSensor on a digital controller
      Parameters:
        `digitalController` - controller this device is connected to
        `physicalPort` - the port number of the device on that controller
        `name` - the name of this device in the hardware map
      Returns:
        a TouchSensor

    - #### createHTAccelerationSensor

          AccelerationSensor createHTAccelerationSensor(LegacyModule legacyModule,
                                                        int physicalPort,
                                                        java.lang.String name)

      Create an instance of a AccelerationSensor
      Parameters:
        `legacyModule` - Legacy Module this device is connected to
        `physicalPort` - port number on the Legacy Module this device is connected to
      Returns:
        an AccelerationSensor

    - #### createHTLightSensor

          LightSensor createHTLightSensor(LegacyModule legacyModule,
                                          int physicalPort,
                                          java.lang.String name)

      Create an instance of a LightSensor
      Parameters:
        `legacyModule` - Legacy Module this device is connected to
        `physicalPort` - port number on the Legacy Module this device is connected to
      Returns:
        a LightSensor

    - #### createHTIrSeekerSensor

          IrSeekerSensor createHTIrSeekerSensor(LegacyModule legacyModule,
                                                int physicalPort,
                                                java.lang.String name)

      Create an instance of a IrSeekerSensor
      Parameters:
        `legacyModule` - Legacy Module this device is connected to
        `physicalPort` - port number on the Legacy Module this device is connected to
      Returns:
        an IrSeekerSensor

    - #### createMRI2cIrSeekerSensorV3

          IrSeekerSensor createMRI2cIrSeekerSensorV3(I2cController i2cController,
                                                     DeviceConfiguration.I2cChannel channel,
                                                     java.lang.String name)

      Create an instance of a IrSeekerSensorV3
      Parameters:
        `i2cController` - the `I2cController` this device is connected to
        `channel` - port number on the Device Interface Module this device is connected to
      Returns:
        an IrSeekerSensor

    - #### createMRI2cIrSeekerSensorV3

          IrSeekerSensor createMRI2cIrSeekerSensorV3(RobotCoreLynxModule module,
                                                     DeviceConfiguration.I2cChannel channel,
                                                     java.lang.String name)

    - #### createNxtUltrasonicSensor

          UltrasonicSensor createNxtUltrasonicSensor(LegacyModule legacyModule,
                                                     int physicalPort,
                                                     java.lang.String name)

      Create an instance of an UltrasonicSensor
      Parameters:
        `legacyModule` - Legacy Module this device is connected to
        `physicalPort` - port number on the Legacy Module this device is connected to
      Returns:
        an UltrasonicSensor

    - #### createHTGyroSensor

          GyroSensor createHTGyroSensor(LegacyModule legacyModule,
                                        int physicalPort,
                                        java.lang.String name)

      Create an instance of a GyroSensor
      Parameters:
        `legacyModule` - Legacy Module this device is connected to
        `physicalPort` - port number on the Legacy Module this device is connected to
      Returns:
        a GyroSensor

    - #### createModernRoboticsI2cGyroSensor

          GyroSensor createModernRoboticsI2cGyroSensor(I2cController i2cController,
                                                       DeviceConfiguration.I2cChannel channel,
                                                       java.lang.String name)

      Create an instance of a GyroSensor
      Parameters:
        `i2cController` - module this device is connected to
        `channel` - i2c connection channel
      Returns:
        a GyroSensor

    - #### createModernRoboticsI2cGyroSensor

          GyroSensor createModernRoboticsI2cGyroSensor(RobotCoreLynxModule module,
                                                       DeviceConfiguration.I2cChannel channel,
                                                       java.lang.String name)

    - #### createAdafruitI2cColorSensor

          ColorSensor createAdafruitI2cColorSensor(I2cController controller,
                                                   DeviceConfiguration.I2cChannel channel,
                                                   java.lang.String name)

      Create an instance of a ColorSensor
      Parameters:
        `controller` - Device Interface Module this sensor is connected to
        `channel` - the I2C port on the Device Interface this module is connected to
      Returns:
        a ColorSensor

    - #### createAdafruitI2cColorSensor

          ColorSensor createAdafruitI2cColorSensor(RobotCoreLynxModule module,
                                                   DeviceConfiguration.I2cChannel channel,
                                                   java.lang.String name)

    - #### createLynxColorRangeSensor

          ColorSensor createLynxColorRangeSensor(RobotCoreLynxModule module,
                                                 DeviceConfiguration.I2cChannel channel,
                                                 java.lang.String name)

    - #### createHTColorSensor

          ColorSensor createHTColorSensor(LegacyModule controller,
                                          int channel,
                                          java.lang.String name)

      Create an instance of a ColorSensor
      Parameters:
        `controller` - Legacy Module this sensor is attached to
        `channel` - the I2C port it's connected to
      Returns:
        a ColorSensor

    - #### createModernRoboticsI2cColorSensor

          ColorSensor createModernRoboticsI2cColorSensor(I2cController controller,
                                                         DeviceConfiguration.I2cChannel channel,
                                                         java.lang.String name)

      Create an instance of a ColorSensor
      Parameters:
        `controller` - Device Interface Module this sensor is attached to
        `channel` - the I2C port it's connected to
      Returns:
        a ColorSensor

    - #### createModernRoboticsI2cColorSensor

          ColorSensor createModernRoboticsI2cColorSensor(RobotCoreLynxModule module,
                                                         DeviceConfiguration.I2cChannel channel,
                                                         java.lang.String name)

    - #### createLED

          LED createLED(DigitalChannelController controller,
                        int channel,
                        java.lang.String name)

      Create an instance of an LED
      Parameters:
        `controller` - Digital Channel Controller this LED is connected to
        `channel` - the digital port it's connected to
      Returns:
        an LED