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

Public methods
AwareDataPathRequest

Build the AwareDataPathRequest object.

AwareDataPathRequest.Builder

Configure security config for the Wi-Fi Aware connection being requested.

AwareDataPathRequest.Builder
setPort(port: Int)

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:

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 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
Return
AwareDataPathRequest.Builder the current Builder builder, enabling chaining of builder methods.
This value cannot be null.