Builder
class Builder
| kotlin.Any | |
| ↳ | android.net.wifi.p2p.WifiP2pUsdBasedServiceDiscoveryConfig.Builder |
Builder for WifiP2pUsdBasedServiceDiscoveryConfig.
Summary
| Public constructors | |
|---|---|
Builder()Constructs a Builder with default values. |
|
| Public methods | |
|---|---|
| WifiP2pUsdBasedServiceDiscoveryConfig |
build()Build |
| WifiP2pUsdBasedServiceDiscoveryConfig.Builder |
Specifies the band requested for service discovery. |
| WifiP2pUsdBasedServiceDiscoveryConfig.Builder |
setFrequenciesMhz(frequenciesMhz: IntArray)Set the frequencies requested for service discovery. |
Public constructors
Public methods
build
fun build(): WifiP2pUsdBasedServiceDiscoveryConfig
Build WifiP2pUsdBasedServiceDiscoveryConfig given the current requests made on the builder.
| Return | |
|---|---|
WifiP2pUsdBasedServiceDiscoveryConfig |
WifiP2pUsdBasedServiceDiscoveryConfig constructed based on builder method calls. This value cannot be null. |
setBand
fun setBand(band: Int): WifiP2pUsdBasedServiceDiscoveryConfig.Builder
Specifies the band requested for service discovery. The band should be one of the following band constants defined in ScanResult#WIFI_BAND_24_GHZ, ScanResult#WIFI_BAND_5_GHZ or ScanResult#WIFI_BAND_6_GHZ
setBand(int) and setFrequenciesMhz(int[]) are mutually exclusive. Setting operating band and frequency both is invalid.
Optional. ScanResult#UNSPECIFIED by default.
| Parameters | |
|---|---|
band |
Int: The requested band. |
| Return | |
|---|---|
WifiP2pUsdBasedServiceDiscoveryConfig.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null. |
| Exceptions | |
|---|---|
java.lang.IllegalArgumentException |
- if the band specified is not one among the list of bands mentioned above. |
setFrequenciesMhz
fun setFrequenciesMhz(frequenciesMhz: IntArray): WifiP2pUsdBasedServiceDiscoveryConfig.Builder
Set the frequencies requested for service discovery.
setBand(int) and setFrequenciesMhz(int[]) are mutually exclusive. Setting band and frequencies both is invalid.
Optional. 2437 by default.
| Parameters | |
|---|---|
frequenciesMhz |
IntArray: Frequencies in MHz to scan for services. This value cannot be an empty array of frequencies. This value cannot be null. |
| Return | |
|---|---|
WifiP2pUsdBasedServiceDiscoveryConfig.Builder |
Instance of Builder to enable chaining of the builder method. This value cannot be null. |