|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
dk.itu.smds.torusman.BTSender
public class BTSender
The class BTSender handles actions that need to be taken to be able to send information of the current player to all the other players on the bluetooth network.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary |
|---|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Fields inherited from interface javax.bluetooth.DiscoveryListener |
|---|
INQUIRY_COMPLETED, INQUIRY_ERROR, INQUIRY_TERMINATED, SERVICE_SEARCH_COMPLETED, SERVICE_SEARCH_DEVICE_NOT_REACHABLE, SERVICE_SEARCH_ERROR, SERVICE_SEARCH_NO_RECORDS, SERVICE_SEARCH_TERMINATED |
| Constructor Summary | |
|---|---|
BTSender()
Instantiates a new BT sender. |
|
| Method Summary | |
|---|---|
void |
deviceDiscovered(javax.bluetooth.RemoteDevice R,
javax.bluetooth.DeviceClass arg1)
Prints out that a device has been discovered and searches for the relevant service on the discovery agent. |
java.lang.String |
getURL(int i)
Gets the URL of the index from the device list. |
void |
inquiryCompleted(int arg0)
Prints out that the inquiry has been completed. |
void |
run()
Sleeps the thread for 5 seconds to let the game get up and running and then gets the agent and inquires. |
void |
sendMove(ManData m,
byte x,
byte y)
Send the move to all the other players in the vector list. |
void |
sendScore(byte manId,
byte teamId,
int points)
Sends the score to all the other players in the vector list. |
void |
servicesDiscovered(int arg0,
javax.bluetooth.ServiceRecord[] servRecord)
Add the remote bluetooth device to the device list so that packages can later be sent and received. |
void |
serviceSearchCompleted(int arg0,
int arg1)
Prints out that the search for services has been completed. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BTSender()
| Method Detail |
|---|
public void sendScore(byte manId,
byte teamId,
int points)
manId - the man idteamId - the team idpoints - the points
public void sendMove(ManData m,
byte x,
byte y)
m - the ManDatax - the new xy - the new y
public void deviceDiscovered(javax.bluetooth.RemoteDevice R,
javax.bluetooth.DeviceClass arg1)
deviceDiscovered in interface javax.bluetooth.DiscoveryListenerR - the remote devicearg1 - the class of the deviceDiscoveryListener.deviceDiscovered(javax.bluetooth.RemoteDevice, javax.bluetooth.DeviceClass)public void inquiryCompleted(int arg0)
inquiryCompleted in interface javax.bluetooth.DiscoveryListenerDiscoveryListener.inquiryCompleted(int)
public void serviceSearchCompleted(int arg0,
int arg1)
serviceSearchCompleted in interface javax.bluetooth.DiscoveryListenerDiscoveryListener.serviceSearchCompleted(int, int)
public void servicesDiscovered(int arg0,
javax.bluetooth.ServiceRecord[] servRecord)
servicesDiscovered in interface javax.bluetooth.DiscoveryListenerservRecord - the list of services on a specific deviceDiscoveryListener.servicesDiscovered(int, javax.bluetooth.ServiceRecord[])public java.lang.String getURL(int i)
i - the index
public void run()
run in interface java.lang.Runnablerun in class java.lang.ThreadThread.run()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||