|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.intel.bluetooth.SelectServiceHandler
public class SelectServiceHandler
Implementation of DiscoveryAgent.selectService().
Your application should not use this class directly.
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 | |
---|---|
SelectServiceHandler(DiscoveryAgent agent)
|
Method Summary | |
---|---|
void |
deviceDiscovered(RemoteDevice btDevice,
DeviceClass cod)
Called when a device is found during an inquiry. |
void |
inquiryCompleted(int discType)
Called when an inquiry is completed. |
String |
selectService(UUID uuid,
int security,
boolean master)
Attempts to locate a service that contains uuid in the
ServiceClassIDList of its service record. |
void |
servicesDiscovered(int transID,
ServiceRecord[] servRecord)
Called when service(s) are found during a service search. |
void |
serviceSearchCompleted(int transID,
int respCode)
Called when a service search is completed or was terminated because of an error. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SelectServiceHandler(DiscoveryAgent agent)
Method Detail |
---|
public String selectService(UUID uuid, int security, boolean master) throws BluetoothStateException
uuid
in the
ServiceClassIDList of its service record. This method will return a
string that may be used in Connector.open()
to establish a
connection to the service. How the service is selected if there are
multiple services with uuid
and which devices to search is
implementation dependent.
uuid
- the UUID to search for in the ServiceClassIDListsecurity
- specifies the security requirements for a connection to this
service; must be one of
ServiceRecord.NOAUTHENTICATE_NOENCRYPT
,
ServiceRecord.AUTHENTICATE_NOENCRYPT
, or
ServiceRecord.AUTHENTICATE_ENCRYPT
master
- determines if this client must be the master of the
connection; true
if the client must be the
master; false
if the client can be the master
or the slave
uuid
; or null
if no service
could be found with a UUID of uuid
in the
ServiceClassIDList
BluetoothStateException
- if the Bluetooth system cannot start the request due to
the current state of the Bluetooth system
NullPointerException
- if uuid
is null
IllegalArgumentException
- if security
is not
ServiceRecord.NOAUTHENTICATE_NOENCRYPT
,
ServiceRecord.AUTHENTICATE_NOENCRYPT
, or
ServiceRecord.AUTHENTICATE_ENCRYPT
ServiceRecord.NOAUTHENTICATE_NOENCRYPT
,
ServiceRecord.AUTHENTICATE_NOENCRYPT
,
ServiceRecord.AUTHENTICATE_ENCRYPT
public void deviceDiscovered(RemoteDevice btDevice, DeviceClass cod)
DiscoveryListener
DiscoveryListener.deviceDiscovered()
method only once for each
individual discovered remote device.
deviceDiscovered
in interface DiscoveryListener
btDevice
- the device that was found during the inquirycod
- - the service classes, major device class, and minor device
class of the remote deviceDiscoveryAgent.startInquiry(int, javax.bluetooth.DiscoveryListener)
public void inquiryCompleted(int discType)
DiscoveryListener
discType
will be
DiscoveryListener.INQUIRY_COMPLETED
if the inquiry ended normally or DiscoveryListener.INQUIRY_TERMINATED
if the inquiry was canceled by a call to
DiscoveryAgent.cancelInquiry(DiscoveryListener)
. The discType
will be
DiscoveryListener.INQUIRY_ERROR
if an error occurred while processing the inquiry causing the
inquiry to end abnormally.
inquiryCompleted
in interface DiscoveryListener
discType
- the type of request that was completed; either
DiscoveryListener.INQUIRY_COMPLETED
, DiscoveryListener.INQUIRY_TERMINATED
,
or DiscoveryListener.INQUIRY_ERROR
DiscoveryListener.INQUIRY_COMPLETED
,
DiscoveryListener.INQUIRY_TERMINATED
,
DiscoveryListener.INQUIRY_ERROR
public void serviceSearchCompleted(int transID, int respCode)
DiscoveryListener
respCode
argument include
DiscoveryListener.SERVICE_SEARCH_COMPLETED
, DiscoveryListener.SERVICE_SEARCH_TERMINATED
,
DiscoveryListener.SERVICE_SEARCH_ERROR
, DiscoveryListener.SERVICE_SEARCH_NO_RECORDS
and
DiscoveryListener.SERVICE_SEARCH_DEVICE_NOT_REACHABLE
. The following table describes when
each respCode
will be used:
respCode | Reason |
---|---|
DiscoveryListener.SERVICE_SEARCH_COMPLETED |
if the service search completed normally |
DiscoveryListener.SERVICE_SEARCH_TERMINATED |
if the service search request was cancelled by a call to
DiscoveryAgent.cancelServiceSearch(int) |
DiscoveryListener.SERVICE_SEARCH_ERROR |
if an error occurred while processing the request |
DiscoveryListener.SERVICE_SEARCH_NO_RECORDS |
if no records were found during the service search |
DiscoveryListener.SERVICE_SEARCH_DEVICE_NOT_REACHABLE |
if the device specified in the search request could not be reached or the local device could not establish a connection to the remote device |
serviceSearchCompleted
in interface DiscoveryListener
transID
- the transaction ID identifying the request which
initiated the service searchrespCode
- the response code that indicates the status of the transactionpublic void servicesDiscovered(int transID, ServiceRecord[] servRecord)
DiscoveryListener
servicesDiscovered
in interface DiscoveryListener
transID
- the transaction ID of the service search that is posting the
resultservRecord
- a list of services found during the search requestDiscoveryAgent.searchServices(int[], javax.bluetooth.UUID[],
javax.bluetooth.RemoteDevice, javax.bluetooth.DiscoveryListener)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |