com.buglabs.bug.sysfs
Class ADXL34xDevice

java.lang.Object
  extended by com.buglabs.bug.sysfs.SysfsNode
      extended by com.buglabs.bug.sysfs.ADXL34xDevice

public class ADXL34xDevice
extends SysfsNode

Exposes sysfs entry for ADXL34x devices to Java clients.


Field Summary
 
Fields inherited from class com.buglabs.bug.sysfs.SysfsNode
root
 
Constructor Summary
ADXL34xDevice(java.io.File root)
           
 
Method Summary
 java.lang.String getCalibrate()
           
static ADXL34xDevice getDevice(int slot)
          Get ADXL34xDevice at specified slot.
static ADXL34xDevice[] getDevices()
           
 java.lang.String getName()
           
 java.lang.String getPosition()
           
 java.lang.String getRate()
           
 int getSlot()
           
 
Methods inherited from class com.buglabs.bug.sysfs.SysfsNode
getFirstLineofFile, pad, parseHexInt, parseInt, parseMultiInt, println
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ADXL34xDevice

public ADXL34xDevice(java.io.File root)
Parameters:
root - file root in sysfs for device entry.
Method Detail

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.