|
|||||||||
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 (but not service discovery) events. The reason for omitting
service discovery is because NXT only allows one service: SPP (Serial Port Profile).
It would be possible to implement the two service discovery methods but it would be
complicated, require more memory usage (ServiceRecord and DataElement) and is not very
useful. This interface provides two methods for discovering devices.
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 canceled. |
static int |
INQUIRY_TERMINATED
Indicates device discovery 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. |
Field Detail |
---|
static final int INQUIRY_COMPLETED
inquiryCompleted(int)
method.
The value of INQUIRY_COMPLETED is 0x00 (0).
inquiryCompleted(int)
,
DiscoveryAgent.startInquiry(int, javax.bluetooth.DiscoveryListener)
,
Constant Field Valuesstatic final int INQUIRY_TERMINATED
inquiryCompleted(int)
method.
The value of INQUIRY_TERMINATED is 0x05 (5).
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).
inquiryCompleted(int)
,
DiscoveryAgent.startInquiry(int, 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 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(DiscoveryListener)
. 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
INQUIRY_COMPLETED
,
INQUIRY_TERMINATED
,
INQUIRY_ERROR
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |