com.buglabs.bug.sysfs
Class ADXL34xDevice
java.lang.Object
com.buglabs.bug.sysfs.SysfsNode
com.buglabs.bug.sysfs.ADXL34xDevice
public class ADXL34xDevice
- extends SysfsNode
Exposes sysfs entry for ADXL34x devices to Java clients.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ADXL34xDevice
public ADXL34xDevice(java.io.File root)
- Parameters:
root - file root in sysfs for device entry.
getPosition
public java.lang.String getPosition()
- Returns:
- The position as reported from sysfs.
getName
public java.lang.String getName()
- Returns:
- the name of the device
getRate
public java.lang.String getRate()
- Returns:
- the rate
getCalibrate
public java.lang.String getCalibrate()
- Returns:
- the calibration as reported by sysfs.
getSlot
public int getSlot()
- Returns:
- the slot # the device is attached to.
getDevice
public static ADXL34xDevice getDevice(int slot)
- Get ADXL34xDevice at specified slot.
- Parameters:
slot - 0, 2, 4 are acceptable values.
- Returns:
- ADXL34xDevice or null if ADXL device not attached at specified slot.
getDevices
public static ADXL34xDevice[] getDevices()
- Returns:
- An array of ADXL34 devices or null if no device exists.
BUG 2.0 can contain a maximum of 3 devices. The array index is meaningless.