|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DiscoveryListener
The DiscoveryListener
interface allows an application
to receive device discovery and service discovery events.
This interface provides four methods, two for discovering
devices and two for discovering services.
Field Summary | ||
---|---|---|
static int |
INQUIRY_COMPLETED
Indicates the normal completion of device discovery. |
|
static int |
INQUIRY_ERROR
Indicates that the inquiry request failed to complete normally, but was not cancelled. |
|
static int |
INQUIRY_TERMINATED
Indicates device discovery has been canceled by the application and did not complete. |
|
static int |
SERVICE_SEARCH_COMPLETED
Indicates the normal completion of service discovery. |
|
static int |
SERVICE_SEARCH_DEVICE_NOT_REACHABLE
Indicates the service search could not be completed because the remote device provided to DiscoveryAgent.searchServices() could not be
reached. |
|
static int |
SERVICE_SEARCH_ERROR
Indicates the service search terminated with an error. |
|
static int |
SERVICE_SEARCH_NO_RECORDS
Indicates the service search has completed with no service records found on the device. |
|
static int |
SERVICE_SEARCH_TERMINATED
Indicates the service search has been canceled by the application and did not complete. |
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. |
|
void |
serviceSearchCompleted(int transID,
int respCode)
Called when a service search is completed or was terminated because of an error. |
|
void |
servicesDiscovered(int transID,
ServiceRecord[] servRecord)
Called when service(s) are found during a service search. |
Field Detail |
---|
static final int INQUIRY_COMPLETED
inquiryCompleted()
method.
The value of INQUIRY_COMPLETED
is 0x00 (0).
DiscoveryListener.inquiryCompleted(int)
,
DiscoveryAgent.startInquiry(int, javax.bluetooth.DiscoveryListener)
,
Constant Field Valuesstatic final int INQUIRY_TERMINATED
inquiryCompleted()
method.
The value of INQUIRY_TERMINATED
is 0x05 (5).
DiscoveryListener.inquiryCompleted(int)
,
DiscoveryAgent.startInquiry(int, javax.bluetooth.DiscoveryListener)
,
DiscoveryAgent.cancelInquiry(javax.bluetooth.DiscoveryListener)
,
Constant Field Valuesstatic final int INQUIRY_ERROR
The value of INQUIRY_ERROR
is 0x07 (7).
DiscoveryListener.inquiryCompleted(int)
,
DiscoveryAgent.startInquiry(int, javax.bluetooth.DiscoveryListener)
,
Constant Field Valuesstatic final int SERVICE_SEARCH_COMPLETED
serviceSearchCompleted()
method.
The value of SERVICE_SEARCH_COMPLETED
is 0x01 (1).
DiscoveryListener.serviceSearchCompleted(int, int)
,
DiscoveryAgent.searchServices(int[], javax.bluetooth.UUID[], javax.bluetooth.RemoteDevice, javax.bluetooth.DiscoveryListener)
,
Constant Field Valuesstatic final int SERVICE_SEARCH_TERMINATED
serviceSearchCompleted()
method.
The value of SERVICE_SEARCH_TERMINATED
is 0x02 (2).
DiscoveryListener.serviceSearchCompleted(int, int)
,
DiscoveryAgent.searchServices(int[], javax.bluetooth.UUID[], javax.bluetooth.RemoteDevice, javax.bluetooth.DiscoveryListener)
,
DiscoveryAgent.cancelServiceSearch(int)
,
Constant Field Valuesstatic final int SERVICE_SEARCH_ERROR
serviceSearchCompleted()
method.
The value of SERVICE_SEARCH_ERROR
is 0x03 (3).
DiscoveryListener.serviceSearchCompleted(int, int)
,
DiscoveryAgent.searchServices(int[], javax.bluetooth.UUID[], javax.bluetooth.RemoteDevice, javax.bluetooth.DiscoveryListener)
,
Constant Field Valuesstatic final int SERVICE_SEARCH_NO_RECORDS
serviceSearchCompleted()
method.
The value of SERVICE_SEARCH_NO_RECORDS
is 0x04 (4).
DiscoveryListener.serviceSearchCompleted(int, int)
,
DiscoveryAgent.searchServices(int[], javax.bluetooth.UUID[], javax.bluetooth.RemoteDevice, javax.bluetooth.DiscoveryListener)
,
Constant Field Valuesstatic final int SERVICE_SEARCH_DEVICE_NOT_REACHABLE
DiscoveryAgent.searchServices()
could not be
reached.
Used with the serviceSearchCompleted()
method.
The value of SERVICE_SEARCH_DEVICE_NOT_REACHABLE
is 0x06 (6).
DiscoveryListener.serviceSearchCompleted(int, int)
,
DiscoveryAgent.searchServices(int[], javax.bluetooth.UUID[], javax.bluetooth.RemoteDevice, javax.bluetooth.DiscoveryListener)
,
Constant Field ValuesMethod Detail |
---|
void deviceDiscovered(RemoteDevice btDevice, DeviceClass cod)
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)
void servicesDiscovered(int transID, ServiceRecord[] servRecord)
transID
- the transaction ID of the service search that is
posting the resultservice
- a list of services found during the search requestDiscoveryAgent.searchServices(int[], javax.bluetooth.UUID[], javax.bluetooth.RemoteDevice, javax.bluetooth.DiscoveryListener)
void serviceSearchCompleted(int transID, int respCode)
respCode
argument include
SERVICE_SEARCH_COMPLETED
,
SERVICE_SEARCH_TERMINATED
,
SERVICE_SEARCH_ERROR
,
SERVICE_SEARCH_NO_RECORDS
and
SERVICE_SEARCH_DEVICE_NOT_REACHABLE
. The following
table describes when each respCode
will be used:
respCode | Reason |
---|---|
SERVICE_SEARCH_COMPLETED |
if the service search completed normally |
SERVICE_SEARCH_TERMINATED |
if the service search request was cancelled by a call to
DiscoveryAgent.cancelServiceSearch() |
SERVICE_SEARCH_ERROR |
if an error occurred while processing the request |
SERVICE_SEARCH_NO_RECORDS |
if no records were found during the service search |
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 |
transID
- the transaction ID identifying the request which
initiated the service searchrespCode
- the response code that indicates the
status of the transactionvoid inquiryCompleted(int discType)
discType
will be
INQUIRY_COMPLETED
if the inquiry ended normally or
INQUIRY_TERMINATED
if the inquiry was canceled by a call to
DiscoveryAgent.cancelInquiry()
. The discType
will be INQUIRY_ERROR
if an error occurred while
processing the inquiry causing the inquiry to end abnormally.
discType
- the type of request that was completed; either
INQUIRY_COMPLETED
, INQUIRY_TERMINATED
, or
INQUIRY_ERROR
DiscoveryListener.INQUIRY_COMPLETED
,
DiscoveryListener.INQUIRY_TERMINATED
,
DiscoveryListener.INQUIRY_ERROR
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.