de.avetana.bluetooth.test
Class InqTest
java.lang.Object
de.avetana.bluetooth.test.InqTest
- All Implemented Interfaces:
- DiscoveryListener
- public class InqTest
- extends java.lang.Object
- implements DiscoveryListener
|
Constructor Summary |
InqTest(java.lang.String addr,
java.lang.String uuid)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InqTest
public InqTest(java.lang.String addr,
java.lang.String uuid)
throws java.lang.Exception
deviceDiscovered
public void deviceDiscovered(RemoteDevice btDevice,
DeviceClass cod)
- Description copied from interface:
DiscoveryListener
- Called when a device is found during an inquiry. An inquiry
searches for devices that are discoverable. The same device may be returned multiple times.
- Specified by:
deviceDiscovered in interface DiscoveryListener
- Parameters:
btDevice - the device that was found during the inquirycod - the service classes, major device class, and minor device class of the remote device- See Also:
DiscoveryAgent.startInquiry(int, javax.bluetooth.DiscoveryListener)
servicesDiscovered
public void servicesDiscovered(int transID,
ServiceRecord[] servRecord)
- Description copied from interface:
DiscoveryListener
- Called when service(s) are found during a service search.
- Specified by:
servicesDiscovered in interface DiscoveryListener
- Parameters:
transID - the transaction ID of the service search that is posting the result- See Also:
DiscoveryAgent.searchServices(int[], javax.bluetooth.UUID[], javax.bluetooth.RemoteDevice, javax.bluetooth.DiscoveryListener)
serviceSearchCompleted
public void serviceSearchCompleted(int transID,
int respCode)
- Description copied from interface:
DiscoveryListener
- Called when a service search is completed or was terminated because of an error. Legal status values in the
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 |
- Specified by:
serviceSearchCompleted in interface DiscoveryListener
- Parameters:
transID - the transaction ID identifying the request which initiated the service searchrespCode - the response code that indicates the status of the transaction
inquiryCompleted
public void inquiryCompleted(int discType)
- Description copied from interface:
DiscoveryListener
- Called when an inquiry is completed. The
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.
- Specified by:
inquiryCompleted in interface DiscoveryListener
- Parameters:
discType - the type of request that was completed; either
INQUIRY_COMPLETED, INQUIRY_TERMINATED, or INQUIRY_ERROR- See Also:
DiscoveryListener.INQUIRY_COMPLETED,
DiscoveryListener.INQUIRY_TERMINATED,
DiscoveryListener.INQUIRY_ERROR
main
public static void main(java.lang.String[] args)
throws java.lang.Exception
- Throws:
java.lang.Exception