AwareDataPathRequest.Builder
public
static
final
class
AwareDataPathRequest.Builder
extends Object
| java.lang.Object | |
| ↳ | 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(WifiAwareDataPathSecurityConfig securityConfig)
Configure security config for the Wi-Fi Aware connection being requested. |
AwareDataPathRequest.Builder
|
setPort(int port)
Configure the port number which will be used to create a connection over this link. |
AwareDataPathRequest.Builder
|
setTransportProtocol(int transportProtocol)
Configure the transport protocol which will be used to create a connection over this link. |
Inherited methods | |
|---|---|
Public constructors
Builder
public Builder ()
Public methods
build
public AwareDataPathRequest build ()
Build the AwareDataPathRequest object.
| Returns | |
|---|---|
AwareDataPathRequest |
the ERROR(/AwareDatapathRequest) object.
This value cannot be null. |
setDataPathSecurityConfig
public AwareDataPathRequest.Builder setDataPathSecurityConfig (WifiAwareDataPathSecurityConfig securityConfig)
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. |
| Returns | |
|---|---|
AwareDataPathRequest.Builder |
the current Builder builder, enabling chaining of builder
methods.
This value cannot be null. |
setPort
public AwareDataPathRequest.Builder setPort (int port)
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
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 |
| Returns | |
|---|---|
AwareDataPathRequest.Builder |
the current Builder builder, enabling chaining of builder
methods.
This value cannot be null. |
setTransportProtocol
public AwareDataPathRequest.Builder setTransportProtocol (int transportProtocol)
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 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 |
| Returns | |
|---|---|
AwareDataPathRequest.Builder |
the current Builder builder, enabling chaining of builder
methods.
This value cannot be null. |