public class HardwareDeviceManager extends java.lang.Object implements DeviceManager
DeviceManager.UsbDeviceType| Modifier and Type | Field and Description |
|---|---|
static java.lang.Object |
scanDevicesLock |
static java.lang.String |
TAG |
static java.lang.String |
TAG_USB_SCAN |
| Constructor and Description |
|---|
HardwareDeviceManager(Context context,
SyncdDevice.Manager manager)
ModernRoboticsUsbDeviceManager constructor
|
| 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 lynxModule,
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) |
protected I2cDeviceSynch |
createI2cDeviceSynch(I2cController controller,
int channel,
java.lang.String name) |
I2cDeviceSynch |
createI2cDeviceSynch(RobotCoreLynxModule lynxModule,
DeviceConfiguration.I2cChannel channel,
java.lang.String name) |
protected I2cDeviceSynchSimple |
createI2cDeviceSynchSimple(I2cController controller,
int channel,
java.lang.String name) |
protected I2cDeviceSynchSimple |
createI2cDeviceSynchSimple(RobotCoreLynxModule lynxModule,
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 lynxModule,
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)
Note: unlike other creation methods, creating a Lynx USB device will succeed even if
the device is already open (in which case it will return a new delegate to the existing
instance).
|
ColorSensor |
createModernRoboticsI2cColorSensor(I2cController controller,
DeviceConfiguration.I2cChannel channel,
java.lang.String name)
Create an instance of a ColorSensor
|
ColorSensor |
createModernRoboticsI2cColorSensor(RobotCoreLynxModule lynxModule,
DeviceConfiguration.I2cChannel channel,
java.lang.String name) |
GyroSensor |
createModernRoboticsI2cGyroSensor(I2cController controller,
DeviceConfiguration.I2cChannel channel,
java.lang.String name)
Create an instance of a GyroSensor
|
GyroSensor |
createModernRoboticsI2cGyroSensor(RobotCoreLynxModule lynxModule,
DeviceConfiguration.I2cChannel channel,
java.lang.String name) |
TouchSensor |
createMRDigitalTouchSensor(DigitalChannelController digitalChannelController,
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 lynxModule,
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
|
static RobotUsbManager |
createUsbManager() |
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 bus,
I2cDeviceConfigurationType type,
java.lang.String name) |
WebcamName |
createWebcamName(SerialNumber serialNumber,
java.lang.String name)
Creates a
WebcamName from the indicated serialized contents |
ScannedDevices |
scanForUsbDevices()
Returns a map from serial number to UsbDeviceType
|
protected void |
scanForWebcams(ScannedDevices scannedDevices) |
public static final java.lang.String TAG
public static final java.lang.String TAG_USB_SCAN
public static final java.lang.Object scanDevicesLock
public HardwareDeviceManager(Context context,
SyncdDevice.Manager manager)
context - Context of current Android appmanager - event loop managerRobotCoreException - if unable to open FTDI D2XX managerpublic static RobotUsbManager createUsbManager()
public ScannedDevices scanForUsbDevices() throws RobotCoreException
scanForUsbDevices in interface DeviceManagerRobotCoreException - if unable to open a deviceprotected void scanForWebcams(ScannedDevices scannedDevices)
public RobotCoreLynxUsbDevice createLynxUsbDevice(SerialNumber serialNumber, java.lang.String name) throws RobotCoreException, java.lang.InterruptedException
createLynxUsbDevice in interface DeviceManagerRobotCoreExceptionjava.lang.InterruptedExceptionpublic DcMotorController createUsbDcMotorController(SerialNumber serialNumber, java.lang.String name) throws RobotCoreException, java.lang.InterruptedException
DeviceManagercreateUsbDcMotorController in interface DeviceManagerserialNumber - serial number of controllerRobotCoreException - if unable to create instancejava.lang.InterruptedExceptionpublic DcMotor createDcMotor(DcMotorController controller, int portNumber, MotorConfigurationType motorType, java.lang.String name)
DeviceManagercreateDcMotor in interface DeviceManagercontroller - DC Motor controller this motor is attached toportNumber - physical port number on the controllermotorType - the optional type we know of for this motorpublic DcMotor createDcMotorEx(DcMotorController controller, int portNumber, MotorConfigurationType motorType, java.lang.String name)
createDcMotorEx in interface DeviceManagerpublic ServoController createUsbServoController(SerialNumber serialNumber, java.lang.String name) throws RobotCoreException, java.lang.InterruptedException
DeviceManagercreateUsbServoController in interface DeviceManagerserialNumber - serial number of controllerRobotCoreException - if unable to create instancejava.lang.InterruptedExceptionpublic Servo createServo(ServoController controller, int portNumber, java.lang.String name)
DeviceManagercreateServo in interface DeviceManagercontroller - Servo controller this servo is attached toportNumber - physical port number on the controllerpublic CRServo createCRServo(ServoController controller, int portNumber, java.lang.String name)
createCRServo in interface DeviceManagerpublic Servo createServoEx(ServoControllerEx controller, int portNumber, java.lang.String name, ServoConfigurationType servoType)
createServoEx in interface DeviceManagerpublic CRServo createCRServoEx(ServoControllerEx controller, int portNumber, java.lang.String name, ServoConfigurationType servoType)
createCRServoEx in interface DeviceManagerpublic HardwareDevice createCustomServoDevice(ServoController controller, int portNumber, ServoConfigurationType servoConfigurationType)
createCustomServoDevice in interface DeviceManagerpublic HardwareDevice createLynxCustomServoDevice(ServoControllerEx controller, int portNumber, ServoConfigurationType servoConfigurationType)
createLynxCustomServoDevice in interface DeviceManagerpublic DeviceInterfaceModule createDeviceInterfaceModule(SerialNumber serialNumber, java.lang.String name) throws RobotCoreException, java.lang.InterruptedException
createDeviceInterfaceModule in interface DeviceManagerserialNumber - serial number of Core Device Interface moduleRobotCoreException - if unable to create instancejava.lang.InterruptedExceptionpublic LegacyModule createUsbLegacyModule(SerialNumber serialNumber, java.lang.String name) throws RobotCoreException, java.lang.InterruptedException
DeviceManagercreateUsbLegacyModule in interface DeviceManagerserialNumber - serial number of legacy moduleRobotCoreException - if unable to create instancejava.lang.InterruptedExceptionpublic DcMotorController createHTDcMotorController(LegacyModule legacyModule, int physicalPort, java.lang.String name)
DeviceManagercreateHTDcMotorController in interface DeviceManagerlegacyModule - Legacy Module this device is connected tophysicalPort - port number on the Legacy Module this device is connected topublic RobotCoreLynxModule createLynxModule(RobotCoreLynxUsbDevice lynxUsbDevice, int moduleAddress, boolean isParent, java.lang.String name)
DeviceManagercreateLynxModule in interface DeviceManagerpublic WebcamName createWebcamName(SerialNumber serialNumber, java.lang.String name) throws RobotCoreException, java.lang.InterruptedException
DeviceManagerWebcamName from the indicated serialized contentscreateWebcamName in interface DeviceManagerRobotCoreExceptionjava.lang.InterruptedExceptionpublic ServoController createHTServoController(LegacyModule legacyModule, int physicalPort, java.lang.String name)
DeviceManagercreateHTServoController in interface DeviceManagerlegacyModule - Legacy Module this device is connected tophysicalPort - port number on the Legacy Module this device is connected topublic CompassSensor createHTCompassSensor(LegacyModule legacyModule, int physicalPort, java.lang.String name)
DeviceManagercreateHTCompassSensor in interface DeviceManagerlegacyModule - Legacy Module this device is connected tophysicalPort - port number on the Legacy Module this device is connected topublic TouchSensor createMRDigitalTouchSensor(DigitalChannelController digitalChannelController, int physicalPort, java.lang.String name)
DeviceManagercreateMRDigitalTouchSensor in interface DeviceManagerdigitalChannelController - controller this device is connected tophysicalPort - the port number of the device on that controllername - the name of this device in the hardware mappublic AccelerationSensor createHTAccelerationSensor(LegacyModule legacyModule, int physicalPort, java.lang.String name)
DeviceManagercreateHTAccelerationSensor in interface DeviceManagerlegacyModule - Legacy Module this device is connected tophysicalPort - port number on the Legacy Module this device is connected topublic LightSensor createHTLightSensor(LegacyModule legacyModule, int physicalPort, java.lang.String name)
DeviceManagercreateHTLightSensor in interface DeviceManagerlegacyModule - Legacy Module this device is connected tophysicalPort - port number on the Legacy Module this device is connected topublic GyroSensor createHTGyroSensor(LegacyModule legacyModule, int physicalPort, java.lang.String name)
DeviceManagercreateHTGyroSensor in interface DeviceManagerlegacyModule - Legacy Module this device is connected tophysicalPort - port number on the Legacy Module this device is connected topublic IrSeekerSensor createHTIrSeekerSensor(LegacyModule legacyModule, int physicalPort, java.lang.String name)
DeviceManagercreateHTIrSeekerSensor in interface DeviceManagerlegacyModule - Legacy Module this device is connected tophysicalPort - port number on the Legacy Module this device is connected topublic IrSeekerSensor createMRI2cIrSeekerSensorV3(I2cController i2cController, DeviceConfiguration.I2cChannel channel, java.lang.String name)
DeviceManagercreateMRI2cIrSeekerSensorV3 in interface DeviceManageri2cController - the I2cController this device is connected tochannel - port number on the Device Interface Module this device is connected topublic IrSeekerSensor createMRI2cIrSeekerSensorV3(RobotCoreLynxModule lynxModule, DeviceConfiguration.I2cChannel channel, java.lang.String name)
createMRI2cIrSeekerSensorV3 in interface DeviceManagerpublic UltrasonicSensor createNxtUltrasonicSensor(LegacyModule legacyModule, int physicalPort, java.lang.String name)
DeviceManagercreateNxtUltrasonicSensor in interface DeviceManagerlegacyModule - Legacy Module this device is connected tophysicalPort - port number on the Legacy Module this device is connected topublic TouchSensor createNxtTouchSensor(LegacyModule legacyModule, int physicalPort, java.lang.String name)
createNxtTouchSensor in interface DeviceManagerlegacyModule - the Legacy Module this sensor is attached tophysicalPort - port number on Legacy Module it's connected topublic TouchSensorMultiplexer createHTTouchSensorMultiplexer(LegacyModule legacyModule, int port, java.lang.String name)
createHTTouchSensorMultiplexer in interface DeviceManagerlegacyModule - the Legacy Module this sensor is attached toport - port number on Legacy Module this sensor is connected to.public HardwareDevice createAnalogSensor(AnalogInputController controller, int channel, AnalogSensorConfigurationType type)
createAnalogSensor in interface DeviceManagercontroller - Analog Input Controller Module this device is connected topublic AnalogOutput createAnalogOutputDevice(AnalogOutputController controller, int channel, java.lang.String name)
createAnalogOutputDevice in interface DeviceManagercontroller - Analog Output Controller Module this device is connected topublic HardwareDevice createDigitalDevice(DigitalChannelController controller, int channel, DigitalIoDeviceConfigurationType type)
createDigitalDevice in interface DeviceManagercontroller - Device Interface Module this device is connected topublic PWMOutput createPwmOutputDevice(PWMOutputController controller, int channel, java.lang.String name)
createPwmOutputDevice in interface DeviceManagercontroller - PWM Output Controller Module this device is connected topublic I2cDevice createI2cDevice(I2cController controller, DeviceConfiguration.I2cChannel channel, java.lang.String name)
createI2cDevice in interface DeviceManagercontroller - I2c Controller Module this device is conneced tochannel - the channel it's connected to on the Controllerpublic HardwareDevice createUserI2cDevice(I2cController controller, DeviceConfiguration.I2cChannel channel, I2cDeviceConfigurationType type, java.lang.String name)
DeviceManagercreateUserI2cDevice in interface DeviceManagerpublic HardwareDevice createUserI2cDevice(RobotCoreLynxModule lynxModule, DeviceConfiguration.I2cChannel bus, I2cDeviceConfigurationType type, java.lang.String name)
createUserI2cDevice in interface DeviceManagerpublic ColorSensor createAdafruitI2cColorSensor(I2cController controller, DeviceConfiguration.I2cChannel channel, java.lang.String name)
DeviceManagercreateAdafruitI2cColorSensor in interface DeviceManagercontroller - Device Interface Module this sensor is connected tochannel - the I2C port on the Device Interface this module is connected topublic ColorSensor createAdafruitI2cColorSensor(RobotCoreLynxModule lynxModule, DeviceConfiguration.I2cChannel channel, java.lang.String name)
createAdafruitI2cColorSensor in interface DeviceManagerpublic ColorSensor createLynxColorRangeSensor(RobotCoreLynxModule lynxModule, DeviceConfiguration.I2cChannel channel, java.lang.String name)
createLynxColorRangeSensor in interface DeviceManagerpublic ColorSensor createHTColorSensor(LegacyModule controller, int channel, java.lang.String name)
DeviceManagercreateHTColorSensor in interface DeviceManagercontroller - Legacy Module this sensor is attached tochannel - the I2C port it's connected topublic ColorSensor createModernRoboticsI2cColorSensor(I2cController controller, DeviceConfiguration.I2cChannel channel, java.lang.String name)
DeviceManagercreateModernRoboticsI2cColorSensor in interface DeviceManagercontroller - Device Interface Module this sensor is attached tochannel - the I2C port it's connected topublic ColorSensor createModernRoboticsI2cColorSensor(RobotCoreLynxModule lynxModule, DeviceConfiguration.I2cChannel channel, java.lang.String name)
createModernRoboticsI2cColorSensor in interface DeviceManagerpublic GyroSensor createModernRoboticsI2cGyroSensor(I2cController controller, DeviceConfiguration.I2cChannel channel, java.lang.String name)
DeviceManagercreateModernRoboticsI2cGyroSensor in interface DeviceManagercontroller - module this device is connected tochannel - i2c connection channelpublic GyroSensor createModernRoboticsI2cGyroSensor(RobotCoreLynxModule lynxModule, DeviceConfiguration.I2cChannel channel, java.lang.String name)
createModernRoboticsI2cGyroSensor in interface DeviceManagerpublic LED createLED(DigitalChannelController controller, int channel, java.lang.String name)
DeviceManagercreateLED in interface DeviceManagercontroller - Digital Channel Controller this LED is connected tochannel - the digital port it's connected topublic I2cDeviceSynch createI2cDeviceSynch(RobotCoreLynxModule lynxModule, DeviceConfiguration.I2cChannel channel, java.lang.String name)
createI2cDeviceSynch in interface DeviceManagerprotected I2cDeviceSynchSimple createI2cDeviceSynchSimple(I2cController controller, int channel, java.lang.String name)
protected I2cDeviceSynchSimple createI2cDeviceSynchSimple(RobotCoreLynxModule lynxModule, DeviceConfiguration.I2cChannel channel, java.lang.String name)
protected I2cDeviceSynch createI2cDeviceSynch(I2cController controller, int channel, java.lang.String name)