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 object.

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:

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 transport protocol number is assigned by the Internet Assigned Numbers Authority (IANA) https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml.

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.