WifiP2pUsdBasedServiceConfig.Builder


public static final class WifiP2pUsdBasedServiceConfig.Builder
extends Object

java.lang.Object
   ↳ android.net.wifi.p2p.nsd.WifiP2pUsdBasedServiceConfig.Builder


Builder used to build WifiP2pUsdBasedServiceConfig objects for USD based service discovery and advertisement.

Summary

Public constructors

Builder(String serviceName)

Constructor for Builder.

Public methods

WifiP2pUsdBasedServiceConfig build()

Build WifiP2pUsdBasedServiceConfig given the current requests made on the builder.

WifiP2pUsdBasedServiceConfig.Builder setServiceProtocolType(int serviceProtocolType)

Specify the service discovery protocol type.

WifiP2pUsdBasedServiceConfig.Builder setServiceSpecificInfo(byte[] serviceSpecificInfo)

Specify service specific information content determined by the application.

Inherited methods

Public constructors

Builder

public Builder (String serviceName)

Constructor for Builder.

Parameters
serviceName String: The service name defining the service. The maximum allowed length of the service name is 100 bytes. This value cannot be null.

Public methods

build

public WifiP2pUsdBasedServiceConfig build ()

Build WifiP2pUsdBasedServiceConfig given the current requests made on the builder.

Returns
WifiP2pUsdBasedServiceConfig WifiP2pUsdBasedServiceConfig constructed based on builder method calls. This value cannot be null.

setServiceProtocolType

public WifiP2pUsdBasedServiceConfig.Builder setServiceProtocolType (int serviceProtocolType)

Specify the service discovery protocol type.

Optional. SERVICE_PROTOCOL_TYPE_GENERIC by default.

Parameters
serviceProtocolType int: One of the SERVICE_PROTOCOL_TYPE_* or a non-negative number set by the service layer. Value is between 0 and 255 inclusive

Returns
WifiP2pUsdBasedServiceConfig.Builder The builder to facilitate chaining builder.setXXX(..).setXXX(..). This value cannot be null.

setServiceSpecificInfo

public WifiP2pUsdBasedServiceConfig.Builder setServiceSpecificInfo (byte[] serviceSpecificInfo)

Specify service specific information content determined by the application.

Optional. Empty by default.

Parameters
serviceSpecificInfo byte: A byte-array of service-specific information available to the application to send additional information. The maximum allowed length of this byte-array is 1024 bytes. This value may be null.

Returns
WifiP2pUsdBasedServiceConfig.Builder The builder to facilitate chaining builder.setXXX(..).setXXX(..). This value cannot be null.