Class Flock.ExamineListener

java.lang.Object
  |
  +--Flock.ExamineListener
All Implemented Interfaces:
SerialConnectionListener
Enclosing class:
Flock

class Flock.ExamineListener
extends java.lang.Object
implements SerialConnectionListener

A class for listening to data elicited by the EXAMINE command. So far it understands the following types of data: 1) measurement rate; and 2) reference frame


Field Summary
(package private)  int addr
          An id to match the address of the bird this goes with
(package private)  byte[] data
          The raw bytes that are read
(package private)  byte param
          The examine parameter which tells us what kind of data is coming in.
(package private)  int size
          The size in bytes of the data that this is listening for.
 
Constructor Summary
(package private) Flock.ExamineListener()
           
(package private) Flock.ExamineListener(int id)
          Initializes the listener with the address of the bird it is listening for.
 
Method Summary
 void dataAvailable(java.io.InputStream str)
          /** Interface for SerialConnectionListener.
(package private)  short[] paramDataToWords()
          Return the parameter data into short words.
(package private)  void setParam(byte param)
          Set the param that goes with the Examine command.
(package private)  void setSize(int nsize)
          Sets the number of bytes that the listener will listen for.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

size

int size
The size in bytes of the data that this is listening for.

data

byte[] data
The raw bytes that are read

addr

int addr
An id to match the address of the bird this goes with

param

byte param
The examine parameter which tells us what kind of data is coming in.
Constructor Detail

Flock.ExamineListener

Flock.ExamineListener()

Flock.ExamineListener

Flock.ExamineListener(int id)
Initializes the listener with the address of the bird it is listening for.
Method Detail

setSize

void setSize(int nsize)
Sets the number of bytes that the listener will listen for.

setParam

void setParam(byte param)
Set the param that goes with the Examine command.

paramDataToWords

short[] paramDataToWords()
Return the parameter data into short words. Note, that data returned from Examine commands is not byte shifted

dataAvailable

public void dataAvailable(java.io.InputStream str)
/** Interface for SerialConnectionListener.
Specified by:
dataAvailable in interface SerialConnectionListener