public final class GenericDeviceConfig extends java.lang.Object implements PeripheralConfig<GenericDevice>, PeripheralConfig.HardwareAddressing
GenericDeviceConfig class encapsulates the hardware addressing information of generic device.
Note
that it does not encapsulates static or dynamic configuration parameters; and that configuration parameters
should be set using the GenericDevice.setControl method.
An instance of GenericDeviceConfig can be passed to the PeripheralManager.open(PeripheralConfig) or
PeripheralManager.open(Class, PeripheralConfig) method to open the designated generic device with the specified
configuration. A PeripheralConfigInvalidException is thrown when attempting to open a peripheral device with
an invalid or unsupported configuration.PeripheralConfig.HardwareAddressingDEFAULT| Constructor and Description |
|---|
GenericDeviceConfig(int deviceNumber,
int channelNumber)
Creates a new
GenericDeviceConfig with the specified hardware addressing information . |
GenericDeviceConfig(java.lang.String deviceName)
Creates a new
GenericDeviceConfig with the specified hardware addressing information. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Checks two
GenericDeviceConfig objects for equality. |
int |
getChannelNumber()
Gets the configured channel number.
|
java.lang.String |
getDeviceName()
Gets the configured device name (such as to its device file name on UNIX systems).
|
int |
getDeviceNumber()
Gets the configured device number.
|
int |
hashCode()
Returns the hash code value for this object.
|
public GenericDeviceConfig(int deviceNumber,
int channelNumber)
GenericDeviceConfig with the specified hardware addressing information .deviceNumber - the hardware controller's number (a positive or zero integer) or PeripheralConfig.DEFAULT.channelNumber - the hardware device's number (a positive or zero integer) or PeripheralConfig.DEFAULT.java.lang.IllegalArgumentException - if any of the following is true:
deviceNumber is not in the defined range;channelNumber is not in the defined range.public GenericDeviceConfig(java.lang.String deviceName)
GenericDeviceConfig with the specified hardware addressing information.deviceName - the device name (such as to its device file name on UNIX systems).java.lang.NullPointerException - if deviceName is null.public int getChannelNumber()
PeripheralConfig.DEFAULT.public int getDeviceNumber()
getDeviceNumber in interface PeripheralConfig.HardwareAddressingPeripheralConfig.DEFAULT.public java.lang.String getDeviceName()
getDeviceName in interface PeripheralConfig.HardwareAddressingnull.public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
GenericDeviceConfig objects for equality.equals in class java.lang.Objectobj - the object to test for equality with this object.true if obj is a GenericDeviceConfig and has
the same hardware addressing information and configuration parameter values
as this GenericDeviceConfig object.Copyright © 2012, 2013, Oracle and/or its affiliates. All rights reserved.
Legal Notices