Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/bluetooth/BluetoothSocketSettings#nestedclasses) \| [Methods](https://developer.android.com/reference/android/bluetooth/BluetoothSocketSettings#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/bluetooth/BluetoothSocketSettings#inhmethods)

# BluetoothSocketSettings

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/bluetooth/BluetoothSocketSettings "View this page in Kotlin") \|Java


`
public

final

class
BluetoothSocketSettings
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.bluetooth.BluetoothSocketSettings |

<br />

*** ** * ** ***

Defines parameters for creating Bluetooth server and client socket channels.

Used with `https://developer.android.com/reference/android/bluetooth/BluetoothAdapter#listenUsingSocketSettings(android.bluetooth.BluetoothSocketSettings)` to create a server socket and
`https://developer.android.com/reference/android/bluetooth/BluetoothDevice#createUsingSocketSettings(android.bluetooth.BluetoothSocketSettings)` to create a client socket.
**See also:**

- `https://developer.android.com/reference/android/bluetooth/BluetoothAdapter#listenUsingSocketSettings(android.bluetooth.BluetoothSocketSettings)`
- `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#createUsingSocketSettings(android.bluetooth.BluetoothSocketSettings)`

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/bluetooth/BluetoothSocketSettings.Builder` Builder for `https://developer.android.com/reference/android/bluetooth/BluetoothSocketSettings`. |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/bluetooth/BluetoothSocketSettings#getL2capPsm()() ` Returns the L2CAP PSM value used for a BluetoothSocket#TYPE_LE socket. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/bluetooth/BluetoothSocketSettings#getRfcommServiceName()() ` Returns the RFCOMM service name used for a BluetoothSocket#TYPE_RFCOMM socket. |
| ` https://developer.android.com/reference/java/util/UUID` | ` https://developer.android.com/reference/android/bluetooth/BluetoothSocketSettings#getRfcommUuid()() ` Returns the RFCOMM service UUID used for a BluetoothSocket#TYPE_RFCOMM socket. |
| ` int` | ` https://developer.android.com/reference/android/bluetooth/BluetoothSocketSettings#getSocketType()() ` Returns the type of the Bluetooth socket. |
| ` boolean` | ` https://developer.android.com/reference/android/bluetooth/BluetoothSocketSettings#isAuthenticationRequired()() ` Checks if authentication is enabled for the Bluetooth socket. |
| ` boolean` | ` https://developer.android.com/reference/android/bluetooth/BluetoothSocketSettings#isEncryptionRequired()() ` Checks if encryption is enabled for the Bluetooth socket. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/bluetooth/BluetoothSocketSettings#toString()() ` Returns a `https://developer.android.com/reference/java/lang/String` that describes each BluetoothSocketSettings parameter current value. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Public methods

### getL2capPsm

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getL2capPsm ()
```

Returns the L2CAP PSM value used for a BluetoothSocket#TYPE_LE socket.

<br />

| Returns ||
|---|---|
| `int` | Value is between 128 and 255 inclusive <br /> |

### getRfcommServiceName

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getRfcommServiceName ()
```

Returns the RFCOMM service name used for a BluetoothSocket#TYPE_RFCOMM socket.

Defaults to `null`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | <br /> |

### getRfcommUuid

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public UUID getRfcommUuid ()
```

Returns the RFCOMM service UUID used for a BluetoothSocket#TYPE_RFCOMM socket.

Defaults to `null`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/UUID` | <br /> |

### getSocketType

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getSocketType ()
```

Returns the type of the Bluetooth socket.

Defaults to `BluetoothSocket#TYPE_RFCOMM`.

<br />

| Returns ||
|---|---|
| `int` | Value is one of the following: - `https://developer.android.com/reference/android/bluetooth/BluetoothSocket#TYPE_RFCOMM` - `https://developer.android.com/reference/android/bluetooth/BluetoothSocket#TYPE_SCO` - `https://developer.android.com/reference/android/bluetooth/BluetoothSocket#TYPE_L2CAP` - `https://developer.android.com/reference/android/bluetooth/BluetoothSocket#TYPE_LE` |

### isAuthenticationRequired

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isAuthenticationRequired ()
```

Checks if authentication is enabled for the Bluetooth socket.

Defaults to `false`.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### isEncryptionRequired

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isEncryptionRequired ()
```

Checks if encryption is enabled for the Bluetooth socket.

Defaults to `false`.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### toString

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String toString ()
```

Returns a `https://developer.android.com/reference/java/lang/String` that describes each BluetoothSocketSettings parameter current value.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representation of the object. <br /> |