Builder
class Builder
| kotlin.Any | |
| ↳ | android.net.L2capNetworkSpecifier.Builder |
A builder class for L2capNetworkSpecifier.
Summary
| Public constructors | |
|---|---|
Builder() |
|
| Public methods | |
|---|---|
| L2capNetworkSpecifier |
build()Create the L2capNetworkSpecifier object. |
| L2capNetworkSpecifier.Builder |
setHeaderCompression(headerCompression: Int)Set the header compression mechanism to use for this network. |
| L2capNetworkSpecifier.Builder |
Set the Protocol/Service Multiplexer (PSM) for the client to connect to. |
| L2capNetworkSpecifier.Builder |
setRemoteAddress(remoteAddress: MacAddress?)Set the remote address for the client to connect to. |
| L2capNetworkSpecifier.Builder |
Set the role to use for this network. |
Public constructors
Public methods
build
fun build(): L2capNetworkSpecifier
Create the L2capNetworkSpecifier object.
| Return | |
|---|---|
L2capNetworkSpecifier |
This value cannot be null. |
setHeaderCompression
fun setHeaderCompression(headerCompression: Int): L2capNetworkSpecifier.Builder
Set the header compression mechanism to use for this network. If not set, defaults to HEADER_COMPRESSION_ANY. This option must be specified (i.e. must not be set to HEADER_COMPRESSION_ANY) when requesting or reserving a new network.
| Parameters | |
|---|---|
headerCompression |
Int: the header compression mechanism to use. Value is android.net.L2capNetworkSpecifier#HEADER_COMPRESSION_ANY, android.net.L2capNetworkSpecifier#HEADER_COMPRESSION_NONE, or android.net.L2capNetworkSpecifier#HEADER_COMPRESSION_6LOWPAN |
| Return | |
|---|---|
L2capNetworkSpecifier.Builder |
This value cannot be null. |
setPsm
fun setPsm(psm: Int): L2capNetworkSpecifier.Builder
Set the Protocol/Service Multiplexer (PSM) for the client to connect to. If not set, defaults to PSM_ANY.
| Parameters | |
|---|---|
psm |
Int: the Protocol/Service Multiplexer (PSM) to connect to. Value is between 0 and 255 inclusive |
| Return | |
|---|---|
L2capNetworkSpecifier.Builder |
This value cannot be null. |
setRemoteAddress
fun setRemoteAddress(remoteAddress: MacAddress?): L2capNetworkSpecifier.Builder
Set the remote address for the client to connect to. Only valid for client networks. If not set, the specifier matches any MAC address.
| Parameters | |
|---|---|
remoteAddress |
MacAddress?: the MAC address to connect to, or null to match any MAC address. |
| Return | |
|---|---|
L2capNetworkSpecifier.Builder |
This value cannot be null. |
setRole
fun setRole(role: Int): L2capNetworkSpecifier.Builder
Set the role to use for this network. If not set, defaults to ROLE_ANY.
| Parameters | |
|---|---|
role |
Int: the role to use. Value is android.net.L2capNetworkSpecifier#ROLE_ANY, android.net.L2capNetworkSpecifier#ROLE_CLIENT, or android.net.L2capNetworkSpecifier#ROLE_SERVER |
| Return | |
|---|---|
L2capNetworkSpecifier.Builder |
This value cannot be null. |