next up previous contents
Next: The cricketdaemon.clientlib.data.BeaconRecord Class Up: Clientlib API Previous: The cricketdaemon.clientlib.Callback Class   Contents

The cricketdaemon.clientlib.data.CricketData Class

The callback handler accepts a CricketData object, which contains updates to location values computed by the CricketDaemon. CricketData implements the following observer methods for accessing location values.

Before invoking an observer method, the callback handler should verify that the corresponding type bit is set in the callback mask. If the type bit is not set in the callback mask, the corresponding observer methods in CricketData will return null or an invalid value.

public long getHWTimeStamp() 
public long getTimeStamp()

These methods return a millisecond time stamp value of the latest distance measurement that caused ServerBroker to generate the current location update. getHWTimeStamp returns the hardware time stamp from the Cricket device while getTimeStamp returns the time stamp from the host device running CricketDaemon. The getHWTimeStamp is more accurate because the high-level host device time stamp suffers from jitters that last up to several hundred milliseconds. The less accurate getTimeStamp method is provided to allow applications to set timers that use the host device's local clock.

public String getCurrentSpace()
public BeaconRecord getCurrentSpaceObject()

A callback handler may invoke these methods when the SPACE type bit is set in the callback mask. The getCurrentSpace method returns the string describing the current space in which the listener is located (i.e., the string advertised by the beacon.that is currently closest to the listener). The getCurrentSpaceObject method returns a BeaconRecord object that contains various attribute values that describe the beacon that is currently closest to the listener.

public ArrayList getBeaconsHeard()

A callback handler may invoke this method when either or both of BEACONSHEARDLIST or BEACONSTAT type bits are set in the callback mask. It returns an ArrayList of BeaconRecords containing various attribute values that describe the set of beacons that the listener has detected in CricketDaemon's current history window.

public Position getDevicePosition()

A callback handler may invoke this method when either or both of the DEVICECOORD or POSERR type bits are set in the callback mask. It returns a Position object that describes the current location coordinates of the Cricket listener.


next up previous contents
Next: The cricketdaemon.clientlib.data.BeaconRecord Class Up: Clientlib API Previous: The cricketdaemon.clientlib.Callback Class   Contents
Michel Goraczko 2004-12-02