lrw.msg.org
Class MessageFormater

java.lang.Object
  extended bylrw.msg.org.MessageFormater
All Implemented Interfaces:
net.tinyos.message.MessageListener, Subject

public class MessageFormater
extends java.lang.Object
implements net.tinyos.message.MessageListener, Subject


Constructor Summary
MessageFormater()
           
 
Method Summary
 void attach(Observer observer)
          each observer object that wants to register himself by a subject has to call the attach function, otherwise the subject will not be able to inform it when that state in our when it receives an new message
 void createInitMsg()
          creates the init message that is used to initialize the mote network
 void fireUpdate()
          informs the observer object on receiving new messages from the motes
 FodesyMsg getFodesyMsg()
           
 net.tinyos.message.MoteIF getMote()
           
 java.lang.String[] getMoteData()
          will be called by the controller on update and sends the data array to the gui
 void messageReceived(int dstaddr, net.tinyos.message.Message msg)
          notifies MessageFormater when a new message has been received (non-Javadoc)
 void sendMsg(FodesyMsg message)
          sends a message to the mote connected to the pc
 void setMoteData(java.lang.String[] data)
          sets the data that will be displayed afterwards by the gui into moteData array
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageFormater

public MessageFormater()
Method Detail

attach

public void attach(Observer observer)
each observer object that wants to register himself by a subject has to call the attach function, otherwise the subject will not be able to inform it when that state in our when it receives an new message

Specified by:
attach in interface Subject
Parameters:
observer -

fireUpdate

public void fireUpdate()
informs the observer object on receiving new messages from the motes

Specified by:
fireUpdate in interface Subject

messageReceived

public void messageReceived(int dstaddr,
                            net.tinyos.message.Message msg)
notifies MessageFormater when a new message has been received (non-Javadoc)

Specified by:
messageReceived in interface net.tinyos.message.MessageListener
See Also:
MessageListener.messageReceived(int, net.tinyos.message.Message)

sendMsg

public void sendMsg(FodesyMsg message)
sends a message to the mote connected to the pc

Parameters:
message -

createInitMsg

public void createInitMsg()
creates the init message that is used to initialize the mote network


setMoteData

public void setMoteData(java.lang.String[] data)
sets the data that will be displayed afterwards by the gui into moteData array


getMoteData

public java.lang.String[] getMoteData()
will be called by the controller on update and sends the data array to the gui

Specified by:
getMoteData in interface Subject

getMote

public net.tinyos.message.MoteIF getMote()

getFodesyMsg

public FodesyMsg getFodesyMsg()