|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpeer2me.network.Network
peer2me.network.bluetooth.BluetoothNetwork
This class is a bluetooth specific sub class of the Network class and implements all the abstract methods of it's parent class in a bluetooth context. It uses the bluetooth Java API, JSR-82, to perform operations on the bluetooth hardware of the mobile device.
Constructor Summary | |
BluetoothNetwork()
Constructor. |
Method Summary | |
void |
connectionEstablished()
This method is called from the ConnectionListener.run() when the acceptAndOpen() method in ConnectionListener.run() is done. |
void |
connectToNode(java.lang.String nodeAddress)
This method establishes a connection to the chosen node. |
java.lang.String |
getNodeAddress(java.lang.Object input)
This method returns the node address. |
java.lang.String |
getRemoteNodeName(java.lang.Object input)
This method fetches the name of the remote node. |
java.lang.String |
getUUIDString()
This method returns the UUID string used as an identifier in the discovery process. |
void |
init()
Initiates the network instance. |
void |
nodeFound(java.lang.Object input)
Called when the same MIDlet is found on a remote device. |
void |
searchForNodes()
Starts a search for devices running the same MIDlet |
void |
sendDataPackage(DataPackage dataPackage,
java.lang.String[] recipients)
This method is used by the FrameworkFrontEnd to send a data package of any sort to a remote node. |
void |
serviceDiscoveryError()
What to do when something went wrong during servicediscovery. |
void |
serviceSearchCompleted()
Sets the boolean serviceSearchCompleted = true. |
Methods inherited from class peer2me.network.Network |
getApplicationId, getConnectionListener, getFrameworkFrontEnd, getInstance, getInstance, setApplicationId, setConnectionListener, setFrameworkFrontEnd |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BluetoothNetwork()
Method Detail |
public void init() throws javax.bluetooth.BluetoothStateException
init
in class Network
javax.bluetooth.BluetoothStateException
- Failed to initiate the networkpublic void connectionEstablished()
connectionEstablished
in class Network
public void searchForNodes() throws java.io.IOException
searchForNodes
in class Network
java.io.IOException
- Error during the searchpublic void nodeFound(java.lang.Object input)
nodeFound
in class Network
input
- Either a ServiceRecord or a StreamConnection that describes the characteristics of the Bluetooth service foundpublic java.lang.String getRemoteNodeName(java.lang.Object input)
getRemoteNodeName
in class Network
input
- An object representing the connection to the found node.
public void connectToNode(java.lang.String nodeAddress)
connectToNode
in class Network
nodeAddress
- The address to the node to connect topublic void serviceSearchCompleted()
serviceSearchCompleted
in interface BluetoothServiceDiscoveryListener
public void serviceDiscoveryError()
serviceDiscoveryError
in interface BluetoothServiceDiscoveryListener
public java.lang.String getNodeAddress(java.lang.Object input) throws java.io.IOException
getNodeAddress
in class Network
input
- String "localNode" to retreive the address of the local device.
A ServiceRecord or StreamConnection object to retreive the address of a
remote device.
java.io.IOException
public void sendDataPackage(DataPackage dataPackage, java.lang.String[] recipients)
sendDataPackage
in class Network
dataPackage
- The data package to be sentrecipients
- A list containing addresses to the recipient nodespublic java.lang.String getUUIDString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |