/**@class android.bluetooth.BluetoothSocket
 implements java.io.Closeable

@extends java.lang.Object

 A connected or connecting Bluetooth socket.

 <p>The interface for Bluetooth Sockets is similar to that of TCP sockets:
 {@link java.net.Socket} and {@link java.net.ServerSocket}. On the server
 side, use a {@link android.bluetooth.BluetoothServerSocket} to create a listening server
 socket. When a connection is accepted by the {@link android.bluetooth.BluetoothServerSocket},
 it will return a new {@link android.bluetooth.BluetoothSocket} to manage the connection.
 On the client side, use a single {@link android.bluetooth.BluetoothSocket} to both initiate
 an outgoing connection and to manage the connection.

 <p>The most common type of Bluetooth socket is RFCOMM, which is the type
 supported by the Android APIs. RFCOMM is a connection-oriented, streaming
 transport over Bluetooth. It is also known as the Serial Port Profile (SPP).

 <p>To create a {@link android.bluetooth.BluetoothSocket} for connecting to a known device, use
 {@link android.bluetooth.BluetoothDevice#createRfcommSocketToServiceRecord
 android.bluetooth.BluetoothDevice.createRfcommSocketToServiceRecord()}.
 Then call {@link #connect}() to attempt a connection to the remote device.
 This call will block until a connection is established or the connection
 fails.

 <p>To create a {@link android.bluetooth.BluetoothSocket} as a server (or "host"), see the
 {@link android.bluetooth.BluetoothServerSocket} documentation.

 <p>Once the socket is connected, whether initiated as a client or accepted
 as a server, open the IO streams by calling {@link #getInputStream} and
 {@link #getOutputStream} in order to retrieve {@link java.io.InputStream}
 and {@link java.io.OutputStream} objects, respectively, which are
 automatically connected to the socket.

 <p>{@link android.bluetooth.BluetoothSocket} is thread
 safe. In particular, {@link #close} will always immediately abort ongoing
 operations and close the socket.

 <p class="note"><strong>Note:</strong>
 Requires the {@link android.Manifest.permission#BLUETOOTH} permission.

 <div class="special reference">
 <h3>Developer Guides</h3>
 <p>For more information about using Bluetooth, read the
 <a href="{@docRoot}guide/topics/connectivity/bluetooth.html">Bluetooth</a> developer guide.</p>
 </div>

 {@see BluetoothServerSocket}
 {@see java.io.InputStream}
 {@see java.io.OutputStream}
*/
var BluetoothSocket = {

/**@hide */
MAX_RFCOMM_CHANNEL : "30",
/**RFCOMM socket */
TYPE_RFCOMM : "1",
/**SCO socket */
TYPE_SCO : "2",
/**L2CAP socket */
TYPE_L2CAP : "3",
/**L2CAP socket on BR/EDR transport
 @hide
*/
TYPE_L2CAP_BREDR : "3",
/**L2CAP socket on LE transport
 @hide
*/
TYPE_L2CAP_LE : "4",
/**Get the remote device this socket is connecting, or connected, to.
@return {Object {android.bluetooth.BluetoothDevice}} remote device
*/
getRemoteDevice : function(  ) {},

/**Get the input stream associated with this socket.
 <p>The input stream will be returned even if the socket is not yet
 connected, but operations on that stream will throw IOException until
 the associated socket is connected.
@return {Object {java.io.InputStream}} InputStream
*/
getInputStream : function(  ) {},

/**Get the output stream associated with this socket.
 <p>The output stream will be returned even if the socket is not yet
 connected, but operations on that stream will throw IOException until
 the associated socket is connected.
@return {Object {java.io.OutputStream}} OutputStream
*/
getOutputStream : function(  ) {},

/**Get the connection status of this socket, ie, whether there is an active connection with
 remote device.
@return {Boolean} true if connected false if not connected
*/
isConnected : function(  ) {},

/**Attempt to connect to a remote device.
 <p>This method will block until a connection is made or the connection
 fails. If this method returns without an exception then this socket
 is now connected.
 <p>Creating new connections to
 remote Bluetooth devices should not be attempted while device discovery
 is in progress. Device discovery is a heavyweight procedure on the
 Bluetooth adapter and will significantly slow a device connection.
 Use {@link android.bluetooth.BluetoothAdapter#cancelDiscovery()} to cancel an ongoing
 discovery. Discovery is not managed by the Activity,
 but is run as a system service, so an application should always call
 {@link android.bluetooth.BluetoothAdapter#cancelDiscovery()} even if it
 did not directly request a discovery, just to be sure.
 <p>{@link #close} can be used to abort this call from another thread.
@throws IOException on error, for example connection failure
*/
connect : function(  ) {},

/**
*/
close : function(  ) {},

/**Get the maximum supported Transmit packet size for the underlying transport.
 Use this to optimize the writes done to the output socket, to avoid sending
 half full packets.
@return {Number} the maximum supported Transmit packet size for the underlying transport.
*/
getMaxTransmitPacketSize : function(  ) {},

/**Get the maximum supported Receive packet size for the underlying transport.
 Use this to optimize the reads done on the input stream, as any call to read
 will return a maximum of this amount of bytes - or for some transports a
 multiple of this value.
@return {Number} the maximum supported Receive packet size for the underlying transport.
*/
getMaxReceivePacketSize : function(  ) {},

/**Get the type of the underlying connection.
@return {Number} one of {@link #TYPE_RFCOMM}, {@link #TYPE_SCO} or {@link #TYPE_L2CAP}
*/
getConnectionType : function(  ) {},

/**Change if a SDP entry should be automatically created.
 Must be called before calling .bind, for the call to have any effect.
@param {Boolean} excludeSdp <li>TRUE - do not auto generate SDP record. <li>FALSE - default - auto
 generate SPP SDP record.
@hide 
*/
setExcludeSdp : function(  ) {},

/**Set the LE Transmit Data Length to be the maximum that the BT Controller is capable of. This
 parameter is used by the BT Controller to set the maximum transmission packet size on this
 connection. This function is currently used for testing only.
@hide 
*/
requestMaximumTxDataLength : function(  ) {},


};