|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpeer2me.network.bluetooth.BluetoothServiceDiscovery
This class is responsible for doing the low level Bluetooth discovery operations. The class initializes seqential device discovery, and searches for services (the same MIDlet built upon the Peer2Me framework) on each of the found devices.
Field Summary |
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 | |
BluetoothServiceDiscovery()
Constructor. |
Method Summary | |
void |
deviceDiscovered(javax.bluetooth.RemoteDevice remoteDevice,
javax.bluetooth.DeviceClass deviceClass)
This method is called by the javax.bluetooth.DiscoveryAgent (agent) whenever a bluetooth device is discovered |
void |
doDeviceDiscovery()
This method starts the discovery process. |
void |
inquiryCompleted(int discType)
This method is called by the javax.bluetooth.DiscoveryAgent (agent) when the discovery process is completed |
void |
servicesDiscovered(int transId,
javax.bluetooth.ServiceRecord[] serviceRecord)
This method is called by the javax.bluetooth.DiscoveryAgent (agent) whenever one or more services (read: Peer2Me framework) are found on a remote device |
void |
serviceSearchCompleted(int transID,
int respCode)
This method is called by the javax.bluetooth.DiscoveryAgent (agent) when the search for services (read: Peer2Me framework) is completed |
void |
startServiceSearch(java.lang.String address)
This method is used to re-establish a connection to a device when we have the address. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BluetoothServiceDiscovery()
Method Detail |
public void doDeviceDiscovery() throws javax.bluetooth.BluetoothStateException
javax.bluetooth.BluetoothStateException
- Error getting reference to LocalDevicepublic void deviceDiscovered(javax.bluetooth.RemoteDevice remoteDevice, javax.bluetooth.DeviceClass deviceClass)
deviceDiscovered
in interface javax.bluetooth.DiscoveryListener
remoteDevice
- The device discovereddeviceClass
- The device class of the discovered devicepublic void servicesDiscovered(int transId, javax.bluetooth.ServiceRecord[] serviceRecord)
servicesDiscovered
in interface javax.bluetooth.DiscoveryListener
transId
- The transaction ID of the service search that is posting the resultserviceRecord
- A list of services found during the search requestpublic void serviceSearchCompleted(int transID, int respCode)
serviceSearchCompleted
in interface javax.bluetooth.DiscoveryListener
transID
- The transaction ID of the service search that is posting the resultrespCode
- The response code that indicates the status of the transactionpublic void inquiryCompleted(int discType)
inquiryCompleted
in interface javax.bluetooth.DiscoveryListener
discType
- The type of request that was completed; either INQUIRY_COMPLETED, INQUIRY_TERMINATED, or INQUIRY_ERRORpublic void startServiceSearch(java.lang.String address)
address
- The address to the device
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |