Builder
class Builder
| kotlin.Any | |
| ↳ | android.net.wifi.aware.AwareDataPathRequest.Builder |
A builder class for a Wi-Fi Aware data path request to set up a data path with a peer device.
Summary
| Public constructors | |
|---|---|
Builder() |
|
| Public methods | |
|---|---|
| AwareDataPathRequest |
build()Build the |
| AwareDataPathRequest.Builder |
setDataPathSecurityConfig(securityConfig: WifiAwareDataPathSecurityConfig)Configure security config for the Wi-Fi Aware connection being requested. |
| AwareDataPathRequest.Builder |
Configure the port number which will be used to create a connection over this link. |
| AwareDataPathRequest.Builder |
setTransportProtocol(transportProtocol: Int)Configure the transport protocol which will be used to create a connection over this link. |
Public constructors
Builder
Builder()
Public methods
build
fun build(): AwareDataPathRequest
Build the AwareDataPathRequest object.
| Return | |
|---|---|
AwareDataPathRequest |
the AwareDatapathRequest object. This value cannot be null. |
setDataPathSecurityConfig
fun setDataPathSecurityConfig(securityConfig: WifiAwareDataPathSecurityConfig): AwareDataPathRequest.Builder
Configure security config for the Wi-Fi Aware connection being requested. This method is optional - if not called, then an Open (unencrypted) connection will be created.
| Parameters | |
|---|---|
securityConfig |
WifiAwareDataPathSecurityConfig: The (optional) security config to be used to encrypt the link. This value cannot be null. |
| Return | |
|---|---|
AwareDataPathRequest.Builder |
the current Builder builder, enabling chaining of builder methods. This value cannot be null. |
setPort
fun setPort(port: Int): AwareDataPathRequest.Builder
Configure the port number which will be used to create a connection over this link. This configuration should only be done on the server device, e.g. the device creating the java.net.ServerSocket.
Notes:
- The server device must be the Publisher device!
- The port information can only be specified on secure links, specified using
setDataPathSecurityConfig(WifiAwareDataPathSecurityConfig)
| Parameters | |
|---|---|
port |
Int: A positive integer indicating the port to be used for communication. Value is between 1 and 65535 inclusive |
| Return | |
|---|---|
AwareDataPathRequest.Builder |
the current Builder builder, enabling chaining of builder methods. This value cannot be null. |
setTransportProtocol
fun setTransportProtocol(transportProtocol: Int): AwareDataPathRequest.Builder
Configure the transport protocol which will be used to create a connection over this link. This configuration should only be done on the server device, e.g. the device creating the java.net.ServerSocket for TCP.
Notes:
- The server device must be the Publisher device!
- The transport protocol information can only be specified on secure links, specified using
setDataPathSecurityConfig(WifiAwareDataPathSecurityConfig).
| Parameters | |
|---|---|
transportProtocol |
Int: The transport protocol to be used for communication. Value is between 0 and 255 inclusive |
| Return | |
|---|---|
AwareDataPathRequest.Builder |
the current Builder builder, enabling chaining of builder methods. This value cannot be null. |