|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectexample.bluetooth.demo.BTImageClient
final class BTImageClient
Initialize BT device, search for BT services, presents them to user and picks his/her choice, finally download the choosen image and present it to user.
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 | |
---|---|
BTImageClient(GUIImageClient parent)
Constructs the bluetooth server, but it is initialized in the different thread to "avoid dead lock". |
Method Summary | |
---|---|
(package private) void |
cancelLoad()
Cancel's the image download. |
(package private) void |
cancelSearch()
Cancel's the devices/services search. |
(package private) void |
destroy()
Destroy a work with bluetooth - exits the accepting thread and close notifier. |
void |
deviceDiscovered(javax.bluetooth.RemoteDevice btDevice,
javax.bluetooth.DeviceClass cod)
Invoked by system when a new remote device is found - remember the found device. |
void |
inquiryCompleted(int discType)
Invoked by system when device discovery is done. |
(package private) void |
requestLoad(java.lang.String name)
Sets the request to load the specified image. |
(package private) void |
requestSearch()
Sets the request to search the devices/services. |
void |
run()
Process the search/download requests. |
void |
servicesDiscovered(int transID,
javax.bluetooth.ServiceRecord[] servRecord)
|
void |
serviceSearchCompleted(int transID,
int respCode)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
BTImageClient(GUIImageClient parent)
Method Detail |
---|
public void run()
run
in interface java.lang.Runnable
public void deviceDiscovered(javax.bluetooth.RemoteDevice btDevice, javax.bluetooth.DeviceClass cod)
deviceDiscovered
in interface javax.bluetooth.DiscoveryListener
public void inquiryCompleted(int discType)
Use a trick here - just remember the discType and process its evaluation in another thread.
inquiryCompleted
in interface javax.bluetooth.DiscoveryListener
public void servicesDiscovered(int transID, javax.bluetooth.ServiceRecord[] servRecord)
servicesDiscovered
in interface javax.bluetooth.DiscoveryListener
public void serviceSearchCompleted(int transID, int respCode)
serviceSearchCompleted
in interface javax.bluetooth.DiscoveryListener
void requestSearch()
void cancelSearch()
void requestLoad(java.lang.String name)
void cancelLoad()
void destroy()
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |