Server Beacon ------------- ServerBeacon class -- Has the main() method -- Handles all the necessary setup to get the desktop computer on which it's running to broadcast the appropriate information. -- Reads in a file named by the first command-line argument. -- Converts the information in the file to a byte array, then instantiates and starts a Broadcaster with this byte array as a parameter. Broadcaster class -- Extends Thread class. -- Constructed with the byte array that will be broadcasted over 802.11. -- Has constants BCAST_ADDR, MIN_WAIT, MAX_WAIT, and PORTNUM. -- run() method has main loop that goes forever until an IO exception occurs. -- Each loop iteration, send datagram broadcast with the byte array information and play special wave file. -- At end of loop, sleep beteween MIN_WAIT and MAX_WAIT amount of time. Mobile Client ------------- MobileClient class -- Has an UltrasoundListener class, which has an UltrasoundDetector class. -- Will decide when to listen for ultrasound based on the reception of 802.11 broadcasts. -- Associates 802.11 broadcasts with ultrasound detections, deciding the location of the device. -- Have reference to external application that instantiated MobileClient object because external application needs to register as a listener of room updates. -- MobileClient class constructor takes a reference to the external application that instantiated it, initializes the 802.11 communication system and the UltrasoundListener object that it will use to detect ultrasound. At the end of this constructor, a Listener object, which extends the Thread class, will be instantiated with the proper parameters and started. -- Listener thread uses both the MobileClient object's datagram socket for receiving 802.11 messages and the MobileClient object's UltrasoundListener object for detecting ultrasound. -- Listener thread runs once and terminates, performing the following sequence: ---- 1) Call socket.receive() using MobileClient object's socket. This method blocks until an 802.11 message is received. ---- 2) Instantiate and run a new Listener thread with the same parameters so that new 802.11 messages are not missed while the current thread runs to completion. ---- 3) Call the UltrasoundListener object's listen() method, followed by this object's analyze() method in order to obtain a boolean decision regarding the presence of ultrasound. ---- 4) Invoke a callback method on the object that instantiated this thread in order to inform it of the new information that was obtained from the combined 802.11/ultrasound reception. -- MobileClient class must have an update() method that takes an 802.11 message and an ultrasound boolean decision as parameters. This method will be called by the Listener threads and decides whether or not a room change has occurred. If the update() method decides that a room update has occurred, it invokes the external application's roomChanged() method so that the external application receives an appropriate update event to inform it of the recent room change.