|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
Broadcaster
This class periodically broadcasts its host computer's room information via 802.11. Concurrently with this broadcast, an ultrasound pulse is emitted from the speakers. Any nearby mobile clients listening for these broadcasts will hear the 802.11 room information and the ultrasound pulse, thus correctly identifying its location.
The ultrasound pulse comes from a WAV file whose name is hard-coded into this class as a constant, and the room information to transmit is passed into this class's constructor.
Field Summary | |
static java.lang.String |
DEFAULTMSG
|
static java.lang.String |
GROUPADDR
|
int |
MAXTIME
|
int |
MINTIME
|
static int |
PORTNUM
|
static java.lang.String |
WAVEFILE
|
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
Broadcaster()
This is a default constructor that is provided in the case that an array of bytes containing room-identifying information is not provided. |
|
Broadcaster(byte[] msg)
This is the main class constructor. |
Method Summary | |
void |
run()
This is where all the thread activity occurs in a continous loop. |
void |
terminate()
This method is used by external classes running this Broadcaster thread. |
void |
update(javax.sound.sampled.LineEvent event)
This method is called by the 'audioClip' data line whenever an event occurs. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String WAVEFILE
public static final java.lang.String GROUPADDR
public static final int PORTNUM
public static final java.lang.String DEFAULTMSG
public int MINTIME
public int MAXTIME
Constructor Detail |
public Broadcaster()
public Broadcaster(byte[] msg)
msg
- Array of bytes containing room-identifying informationMethod Detail |
public void run()
run
in interface java.lang.Runnable
public void terminate()
public void update(javax.sound.sampled.LineEvent event)
update
in interface javax.sound.sampled.LineListener
event
- The line event that has occured in the clip object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |