Java Doc for BluetoothStack.java in  » 6.0-JDK-Modules » j2me » com » sun » midp » jsr082 » bluetooth » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » com.sun.midp.jsr082.bluetooth 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.midp.jsr082.bluetooth.BluetoothStack

All known Subclasses:   com.sun.midp.jsr082.bluetooth.GenericBluetoothStack,
BluetoothStack
abstract public class BluetoothStack (Code)
Represents native Bluetooth stack provided by the system. Provides services such as device and service discovery.


Field Summary
 VectorinquiryHistory
     Contains results of ongoing inquiry to avoid reporting the same inquiry result twice.
 intpollRequests
     Keeps the count of pending requests.

Constructor Summary
protected  BluetoothStack()
     Class constructor.

Method Summary
public  StringaskFriendlyNameSync(String addr)
     Retrieves friendly name from a remote device synchronously.
public  booleanauthenticateSync(String addr)
     Performs remote device authentication synchronously.
public  booleancancelInquiry(DiscoveryListener listener)
     Removes the device from inquiry mode.
native public  booleanenable()
     Enables Bluetooth radio.
public  booleanencryptSync(String addr, boolean enable)
     Sets encryption mode synchronously.
native public  intgetAccessCode()
     Retrieves the inquiry access code that the local Bluetooth device is scanning for during inquiry scans.
native public  intgetDeviceClass()
     Returns class of device including service classes.
public static synchronized  BluetoothStackgetEnabledInstance()
     Returns a BluetoothStack object and guarantees that Bluetooth radio is on.
public static synchronized  BluetoothStackgetInstance()
     Returns a BluetoothStack object.
native public  StringgetLocalAddress()
     Returns Bluetooth address of the local device.
native public  StringgetLocalName()
     Returns user-friendly name for the local device.
native public  booleanisEnabled()
     Checks if the Bluetooth radio is enabled.
 voidonAuthenticationComplete(int handle, boolean result)
     Called when an authentication request is completed.
 voidonEncryptionChange(int handle, boolean result)
     Called when a set encryption request is completed.
 voidonInquiryComplete(boolean success)
     Called when an inquiry request is completed.
 voidonInquiryResult(InquiryResult result)
     Called when an inquiry result is obtained.
 voidonNameRetrieve(String addr, String name)
     Called when a name retrieval request is completed.
public  voidpollEvents()
     Checks for Bluetooth events and processes them.
native protected  intreadData(byte[] data)
     Reads binary event data from the native porting layer.
abstract protected  BluetoothEventretrieveEvent()
     Retrieves Bluetooth event.
native public  booleansetAccessCode(int accessCode)
     Sets the inquiry access code that the local Bluetooth device is scanning for during inquiry scans.
native public  booleansetServiceClasses(int classes)
     Sets major service class bits of the device.
public  booleanstartInquiry(int accessCode, DiscoveryListener listener)
     Places the device into inquiry mode.
public synchronized  voidstartPolling()
     Starts a supplementary polling thread.
public synchronized  voidstopPolling()
     Cancels event polling for one request.
native protected static  StringstringUTF8(byte[] buffer, int offset, int length)
     Creates Java String object from UTF-8 encoded string.

Field Detail
inquiryHistory
Vector inquiryHistory(Code)
Contains results of ongoing inquiry to avoid reporting the same inquiry result twice.



pollRequests
int pollRequests(Code)
Keeps the count of pending requests.




Constructor Detail
BluetoothStack
protected BluetoothStack()(Code)
Class constructor.




Method Detail
askFriendlyNameSync
public String askFriendlyNameSync(String addr)(Code)
Retrieves friendly name from a remote device synchronously.
Parameters:
  addr - remote device address friendly name of the remote device, or nullif the name could not be retrieved



authenticateSync
public boolean authenticateSync(String addr)(Code)
Performs remote device authentication synchronously.
Parameters:
  addr - remote device address true if authentication was successful,false otherwise



cancelInquiry
public boolean cancelInquiry(DiscoveryListener listener)(Code)
Removes the device from inquiry mode.
Parameters:
  listener - the listener that is receiving inquiry events true if the inquiry was canceled, false otherwise



enable
native public boolean enable()(Code)
Enables Bluetooth radio. true if Bluetooth is enabled, false otherwise



encryptSync
public boolean encryptSync(String addr, boolean enable)(Code)
Sets encryption mode synchronously.
Parameters:
  addr - remote device address
Parameters:
  enable - true if the encryption needs to be enabled,false otherwise true if authentication was successful,false otherwise



getAccessCode
native public int getAccessCode()(Code)
Retrieves the inquiry access code that the local Bluetooth device is scanning for during inquiry scans. inquiry access code, or -1 if the information could notbe retrieved



getDeviceClass
native public int getDeviceClass()(Code)
Returns class of device including service classes. class of device value, or -1 if the information could notbe retrieved



getEnabledInstance
public static synchronized BluetoothStack getEnabledInstance() throws BluetoothStateException(Code)
Returns a BluetoothStack object and guarantees that Bluetooth radio is on. an instance of BluetoothStack subclass
throws:
  BluetoothStateException - if BluetoothStack is off andcannot be turned on.



getInstance
public static synchronized BluetoothStack getInstance()(Code)
Returns a BluetoothStack object. an instance of BluetoothStack subclass



getLocalAddress
native public String getLocalAddress()(Code)
Returns Bluetooth address of the local device. Bluetooth address of the local device, or null ifthe address could not be retrieved



getLocalName
native public String getLocalName()(Code)
Returns user-friendly name for the local device. User-friendly name for the local device, or null ifthe name could not be retrieved



isEnabled
native public boolean isEnabled()(Code)
Checks if the Bluetooth radio is enabled. true if Bluetooth is enabled, false otherwise



onAuthenticationComplete
void onAuthenticationComplete(int handle, boolean result)(Code)
Called when an authentication request is completed.
Parameters:
  handle - connection handle for an ACL connection
Parameters:
  result - indicates whether the operation was successful



onEncryptionChange
void onEncryptionChange(int handle, boolean result)(Code)
Called when a set encryption request is completed.
Parameters:
  handle - connection handle for an ACL connection
Parameters:
  result - indicates whether the operation was successful



onInquiryComplete
void onInquiryComplete(boolean success)(Code)
Called when an inquiry request is completed.
Parameters:
  success - indicates whether inquiry completed successfully



onInquiryResult
void onInquiryResult(InquiryResult result)(Code)
Called when an inquiry result is obtained.
Parameters:
  result - inquiry result object



onNameRetrieve
void onNameRetrieve(String addr, String name)(Code)
Called when a name retrieval request is completed.
Parameters:
  addr - Bluetooth address of a remote device
Parameters:
  name - friendly name of the device



pollEvents
public void pollEvents()(Code)
Checks for Bluetooth events and processes them.



readData
native protected int readData(byte[] data)(Code)
Reads binary event data from the native porting layer. This data can be interpreted differently by different subclasses of BluetoothStack.
Parameters:
  data - byte array to be filled with data number of bytes read



retrieveEvent
abstract protected BluetoothEvent retrieveEvent()(Code)
Retrieves Bluetooth event. a Bluetooth event object



setAccessCode
native public boolean setAccessCode(int accessCode)(Code)
Sets the inquiry access code that the local Bluetooth device is scanning for during inquiry scans.
Parameters:
  accessCode - inquiry access code to be set (valid values are in therange 0x9e8b00 to 0x9e8b3f), or 0 to take the device out ofdiscoverable mode true if the operation succeeded, false otherwise



setServiceClasses
native public boolean setServiceClasses(int classes)(Code)
Sets major service class bits of the device.
Parameters:
  classes - an integer whose binary representation indicates the majorservice class bits that should be set true if the operation succeeded, false otherwise



startInquiry
public boolean startInquiry(int accessCode, DiscoveryListener listener)(Code)
Places the device into inquiry mode.
Parameters:
  accessCode - the type of inquiry
Parameters:
  listener - the event listener that will receive discovery events true if the inquiry was started, false otherwise



startPolling
public synchronized void startPolling()(Code)
Starts a supplementary polling thread.



stopPolling
public synchronized void stopPolling()(Code)
Cancels event polling for one request. Polling thread will continue to run unless there are no other pending requests.



stringUTF8
native protected static String stringUTF8(byte[] buffer, int offset, int length)(Code)
Creates Java String object from UTF-8 encoded string.
Parameters:
  buffer - buffer containing the string in UTF-8 format
Parameters:
  offset - offset of the first character in the buffer
Parameters:
  length - length of the encoded string in bytes Java String object containing the string in UTF-16 format



Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.