Main Page | Packages | Class List | Directories | File List | Class Members

TicTacCom Class Reference

Collaboration diagram for TicTacCom:

Collaboration graph
[legend]
List of all members.

Public Member Functions

int[] getReceivedData ()
void send (int player, int x, int y, int z)
void receive ()
 TicTacCom (TicTacMain p, int r)
void run ()
void debug (String st)
void deviceDiscovered (RemoteDevice btDevice, DeviceClass cod)
void inquiryCompleted (int discType)
void servicesDiscovered (int transID, ServiceRecord[] servRecord)
void serviceSearchCompleted (int transID, int responseCode)

Static Public Attributes

static final int ROLE_SERVEUR = 0
static final int ROLE_CLIENT = 1
static final UUID RFCOMM_UUID = new UUID(0x0003)

Package Functions

void init (int r)
void initServer () throws BluetoothStateException, IOException, Exception
void initClient () throws Exception

Package Attributes

TicTacMain parent
int role
int clientResponseCode = -1
Thread thread = new Thread(this)
boolean initOK = false
boolean newData = false
int toSendData [] = new int[4]
boolean readRequest = false
int readData [] = new int[4]
boolean newReceivedData = false

Private Attributes

DiscoveryAgent discoveryAgent
RemoteDevice[] remoteDevices
UUID[] uuidSet
String serviceUrl
StreamConnectionNotifier notifier
StreamConnection conn
LocalDevice localDevice
ServiceRecord serviceRecord
InputStream input
OutputStream output
boolean stopThread = false

Static Private Attributes

static String serverUrl = "btspp://localhost:" + RFCOMM_UUID + ";name=rfcommtest;authorize=true"

Detailed Description

Classe de gestion asynchrones des communications.

Author:
Béatrice Frey et Cyril Crassin

Definition at line 28 of file TicTacCom.java.


Constructor & Destructor Documentation

TicTacCom.TicTacCom TicTacMain  p,
int  r
 

Constructeur.

Parameters:
p Application source.
r Role.

Definition at line 114 of file TicTacCom.java.

References init(), parent, role, and thread.

Here is the call graph for this function:


Member Function Documentation

void TicTacCom.debug String  st  ) 
 

Definition at line 188 of file TicTacCom.java.

Referenced by deviceDiscovered(), initClient(), inquiryCompleted(), servicesDiscovered(), and serviceSearchCompleted().

void TicTacCom.deviceDiscovered RemoteDevice  btDevice,
DeviceClass  cod
 

Callback de découverte d'un périphérique.

Definition at line 234 of file TicTacCom.java.

References debug(), discoveryAgent, RFCOMM_UUID, and uuidSet.

Here is the call graph for this function:

int [] TicTacCom.getReceivedData  ) 
 

Recuperation des infos recues.

Definition at line 79 of file TicTacCom.java.

References readData.

void TicTacCom.init int  r  )  [package]
 

Initialisation de la communication.

Definition at line 193 of file TicTacCom.java.

References initClient(), initServer(), and role.

Referenced by run(), and TicTacCom().

Here is the call graph for this function:

void TicTacCom.initClient  )  throws Exception [package]
 

Initialisation du client.

Definition at line 222 of file TicTacCom.java.

References debug(), discoveryAgent, and localDevice.

Referenced by init().

Here is the call graph for this function:

void TicTacCom.initServer  )  throws BluetoothStateException, IOException, Exception [package]
 

Initialisation du serveur.

Definition at line 211 of file TicTacCom.java.

References conn, initOK, localDevice, notifier, and serverUrl.

Referenced by init().

void TicTacCom.inquiryCompleted int  discType  ) 
 

Definition at line 252 of file TicTacCom.java.

References debug().

Here is the call graph for this function:

void TicTacCom.receive  ) 
 

Mise en attende du coup de l'autre joueur.

Definition at line 102 of file TicTacCom.java.

References newReceivedData, and readRequest.

void TicTacCom.run  ) 
 

Debut du thread. Initialisation et envois/receptions de données.

Definition at line 128 of file TicTacCom.java.

References conn, init(), initOK, input, newData, newReceivedData, notifier, output, readData, readRequest, role, ROLE_SERVEUR, serviceUrl, stopThread, and toSendData.

Here is the call graph for this function:

void TicTacCom.send int  player,
int  x,
int  y,
int  z
 

Envoi d'un coup.

Parameters:
player Joueur qui a joué.
x Position en X du coup.
y Position en Y du coup.
z Position en Z du coup

Definition at line 90 of file TicTacCom.java.

References newData, and toSendData.

void TicTacCom.servicesDiscovered int  transID,
ServiceRecord[]  servRecord
 

Un service a ete decouvert.

Definition at line 258 of file TicTacCom.java.

References debug(), and serviceUrl.

Here is the call graph for this function:

void TicTacCom.serviceSearchCompleted int  transID,
int  responseCode
 

Fin de la recherche de service.

Definition at line 268 of file TicTacCom.java.

References clientResponseCode, debug(), initOK, and serviceUrl.

Here is the call graph for this function:


Member Data Documentation

int TicTacCom.clientResponseCode = -1 [package]
 

Definition at line 50 of file TicTacCom.java.

Referenced by serviceSearchCompleted().

StreamConnection TicTacCom.conn [private]
 

Definition at line 54 of file TicTacCom.java.

Referenced by initServer(), and run().

DiscoveryAgent TicTacCom.discoveryAgent [private]
 

Agent de découverte de périphériques.

Definition at line 42 of file TicTacCom.java.

Referenced by deviceDiscovered(), and initClient().

boolean TicTacCom.initOK = false [package]
 

Definition at line 66 of file TicTacCom.java.

Referenced by initServer(), run(), and serviceSearchCompleted().

InputStream TicTacCom.input [private]
 

Definition at line 57 of file TicTacCom.java.

Referenced by run().

LocalDevice TicTacCom.localDevice [private]
 

Definition at line 55 of file TicTacCom.java.

Referenced by initClient(), and initServer().

boolean TicTacCom.newData = false [package]
 

Definition at line 68 of file TicTacCom.java.

Referenced by run(), and send().

boolean TicTacCom.newReceivedData = false [package]
 

Definition at line 75 of file TicTacCom.java.

Referenced by receive(), and run().

StreamConnectionNotifier TicTacCom.notifier [private]
 

Definition at line 53 of file TicTacCom.java.

Referenced by initServer(), and run().

OutputStream TicTacCom.output [private]
 

Definition at line 58 of file TicTacCom.java.

Referenced by run().

TicTacMain TicTacCom.parent [package]
 

Application source.

Definition at line 31 of file TicTacCom.java.

Referenced by TicTacCom().

int TicTacCom.readData[] = new int[4] [package]
 

Definition at line 72 of file TicTacCom.java.

Referenced by getReceivedData(), and run().

boolean TicTacCom.readRequest = false [package]
 

Definition at line 71 of file TicTacCom.java.

Referenced by receive(), and run().

RemoteDevice [] TicTacCom.remoteDevices [private]
 

Liste des périphériques trouvés.

Definition at line 44 of file TicTacCom.java.

final UUID TicTacCom.RFCOMM_UUID = new UUID(0x0003) [static]
 

Identification partagée par le client et le serveur.

Definition at line 39 of file TicTacCom.java.

Referenced by deviceDiscovered().

int TicTacCom.role [package]
 

Role: Client->1, Serveur->0 .

Definition at line 33 of file TicTacCom.java.

Referenced by init(), run(), and TicTacCom().

final int TicTacCom.ROLE_CLIENT = 1 [static]
 

Definition at line 36 of file TicTacCom.java.

final int TicTacCom.ROLE_SERVEUR = 0 [static]
 

Definition at line 35 of file TicTacCom.java.

Referenced by run().

String TicTacCom.serverUrl = "btspp://localhost:" + RFCOMM_UUID + ";name=rfcommtest;authorize=true" [static, private]
 

Definition at line 60 of file TicTacCom.java.

Referenced by initServer().

ServiceRecord TicTacCom.serviceRecord [private]
 

Definition at line 56 of file TicTacCom.java.

String TicTacCom.serviceUrl [private]
 

URL du service trouvé sur le serveur

Definition at line 49 of file TicTacCom.java.

Referenced by run(), servicesDiscovered(), and serviceSearchCompleted().

boolean TicTacCom.stopThread = false [private]
 

Definition at line 62 of file TicTacCom.java.

Referenced by run().

Thread TicTacCom.thread = new Thread(this) [package]
 

Definition at line 64 of file TicTacCom.java.

Referenced by TicTacCom().

int TicTacCom.toSendData[] = new int[4] [package]
 

Definition at line 69 of file TicTacCom.java.

Referenced by run(), and send().

UUID [] TicTacCom.uuidSet [private]
 

Definition at line 46 of file TicTacCom.java.

Referenced by deviceDiscovered().


The documentation for this class was generated from the following file:
Generated on Sat Jun 11 20:14:02 2005 for TicTacToe3D by  doxygen 1.4.3