BluetoothSocketSettings
class BluetoothSocketSettings
kotlin.Any | |
↳ | android.bluetooth.BluetoothSocketSettings |
Defines parameters for creating Bluetooth server and client socket channels.
Used with BluetoothAdapter.listenUsingSocketSettings
to create a server socket and BluetoothDevice.createUsingSocketSettings
to create a client socket.
Summary
Nested classes | |
---|---|
Builder for |
Public methods | |
---|---|
Int |
Returns the L2CAP PSM value used for a BluetoothSocket#TYPE_LE socket. |
String? |
Returns the RFCOMM service name used for a BluetoothSocket#TYPE_RFCOMM socket. |
UUID? |
Returns the RFCOMM service UUID used for a BluetoothSocket#TYPE_RFCOMM socket. |
Int |
Returns the type of the Bluetooth socket. |
Boolean |
Checks if authentication is enabled for the Bluetooth socket. |
Boolean |
Checks if encryption is enabled for the Bluetooth socket. |
String |
toString() Returns a |
Public methods
getL2capPsm
fun getL2capPsm(): Int
Returns the L2CAP PSM value used for a BluetoothSocket#TYPE_LE socket.
Return | |
---|---|
Int |
Value is between 128 and 255 inclusive |
getRfcommServiceName
fun getRfcommServiceName(): String?
Returns the RFCOMM service name used for a BluetoothSocket#TYPE_RFCOMM socket.
Defaults to null
.
getRfcommUuid
fun getRfcommUuid(): UUID?
Returns the RFCOMM service UUID used for a BluetoothSocket#TYPE_RFCOMM socket.
Defaults to null
.
getSocketType
fun getSocketType(): Int
Returns the type of the Bluetooth socket.
Defaults to BluetoothSocket#TYPE_RFCOMM
.
isAuthenticationRequired
fun isAuthenticationRequired(): Boolean
Checks if authentication is enabled for the Bluetooth socket.
Defaults to false
.
isEncryptionRequired
fun isEncryptionRequired(): Boolean
Checks if encryption is enabled for the Bluetooth socket.
Defaults to false
.
toString
fun toString(): String
Returns a String
that describes each BluetoothSocketSettings parameter current value.
Return | |
---|---|
String |
a string representation of the object. |