|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.tinyos.tinydb.TinyDBNetwork
TinyDBNetwork is responsible for getting and sending results and queries over the network
Field Summary | |
static byte |
DATA_MSG_ID
|
static byte |
MSG_SIZE
|
static byte |
QUERY_MSG_ID
|
static short |
UART_ADDR
|
static byte |
UART_MSG_ID
|
Constructor Summary | |
TinyDBNetwork(net.tinyos.message.MoteIF mif)
Constructor |
Method Summary | |
void |
abortQuery(net.tinyos.tinydb.TinyDBQuery query)
Send message to abort the specified query out over the radio |
void |
addQuery(net.tinyos.tinydb.TinyDBQuery q)
A new query has begun running. |
void |
addResultListener(net.tinyos.tinydb.ResultListener rl)
Add a listener to be notified when any query result arrives |
void |
addResultListener(net.tinyos.tinydb.ResultListener rl,
boolean aggResults,
int qid)
Add a listener to be notified when a query result for the specified query id arrives |
static int |
getBaseBcastInterval()
Return baseBcastInterval, which controls how often data messages are sent out from the base station so that nodes can see the root. |
void |
messageReceived(int addr,
net.tinyos.message.Message m)
Process a radio message Assumes results are QueryResults -- parses them, and maintains the following data structures: - most recent epoch heard for each query - most recent (paritially aggregated) result for each query Notifies ResultListeners for all results every time a value arries Notifies ResultListeners for raw results for a pariticular query id every time a result for that query arrives Notifies ResultListeners for processed results from the current epoch every time a new epoch begins; the aggregate combines results that are from the same epoch and are not obviously bogus (e.g. |
void |
removeQuery(net.tinyos.tinydb.TinyDBQuery q)
A query has stopped running |
void |
removeResultListener(net.tinyos.tinydb.ResultListener rl)
Remove a specific result listener |
void |
run()
Background thread used to periodically send information from the root down into the network; current this information includes: a message index (so that children can choose root as parent) information about the typical number of senders during an epoch (so that children can schedule comm) an epoch number (per query). |
void |
sendQuery(net.tinyos.tinydb.TinyDBQuery q)
Send the specified query out over the radio |
static void |
setBaseBcastInterval(int interval)
Set the base station data message broadcast interval |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final byte QUERY_MSG_ID
public static final byte DATA_MSG_ID
public static final byte UART_MSG_ID
public static final byte MSG_SIZE
public static final short UART_ADDR
Constructor Detail |
public TinyDBNetwork(net.tinyos.message.MoteIF mif)
mif
- The MoteIF used to send / receive messages from the motesMethod Detail |
public void addResultListener(net.tinyos.tinydb.ResultListener rl, boolean aggResults, int qid)
rl
- The ResultListener to addaggResults
- Does the listener want processed (e.g. combined aggregate) results,
or raw results?qid
- The query id this listener is interested inpublic void addResultListener(net.tinyos.tinydb.ResultListener rl)
rl
- The listener to registerpublic void removeResultListener(net.tinyos.tinydb.ResultListener rl)
rl
- The listener to removepublic void messageReceived(int addr, net.tinyos.message.Message m)
messageReceived
in interface net.tinyos.message.MessageListener
public void run()
run
in interface java.lang.Runnable
public void addQuery(net.tinyos.tinydb.TinyDBQuery q)
addQuery
in interface QueryListener
public void removeQuery(net.tinyos.tinydb.TinyDBQuery q)
removeQuery
in interface QueryListener
public void sendQuery(net.tinyos.tinydb.TinyDBQuery q) throws java.io.IOException
java.io.IOException
public void abortQuery(net.tinyos.tinydb.TinyDBQuery query)
public static int getBaseBcastInterval()
public static void setBaseBcastInterval(int interval)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |