Builder
class Builder
kotlin.Any | |
↳ | android.net.wifi.p2p.nsd.WifiP2pUsdBasedServiceConfig.Builder |
Builder used to build WifiP2pUsdBasedServiceConfig
objects for USD based service discovery and advertisement.
Summary
Public constructors | |
---|---|
Constructor for |
Public methods | |
---|---|
WifiP2pUsdBasedServiceConfig |
build() Build |
WifiP2pUsdBasedServiceConfig.Builder |
setServiceProtocolType(serviceProtocolType: Int) Specify the service discovery protocol type. |
WifiP2pUsdBasedServiceConfig.Builder |
setServiceSpecificInfo(serviceSpecificInfo: ByteArray?) Specify service specific information content determined by the application. |
Public constructors
Builder
Builder(serviceName: String)
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
fun build(): WifiP2pUsdBasedServiceConfig
Build WifiP2pUsdBasedServiceConfig
given the current requests made on the builder.
Return | |
---|---|
WifiP2pUsdBasedServiceConfig |
WifiP2pUsdBasedServiceConfig constructed based on builder method calls. This value cannot be null . |
setServiceProtocolType
fun setServiceProtocolType(serviceProtocolType: Int): WifiP2pUsdBasedServiceConfig.Builder
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 |
Return | |
---|---|
WifiP2pUsdBasedServiceConfig.Builder |
The builder to facilitate chaining builder.setXXX(..).setXXX(..) . This value cannot be null . |
setServiceSpecificInfo
fun setServiceSpecificInfo(serviceSpecificInfo: ByteArray?): WifiP2pUsdBasedServiceConfig.Builder
Specify service specific information content determined by the application.
Optional. Empty by default.
Parameters | |
---|---|
serviceSpecificInfo |
ByteArray?: 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 . |
Return | |
---|---|
WifiP2pUsdBasedServiceConfig.Builder |
The builder to facilitate chaining builder.setXXX(..).setXXX(..) . This value cannot be null . |