WifiP2pUsdBasedServiceConfig
class WifiP2pUsdBasedServiceConfig : Parcelable
| kotlin.Any | |
| ↳ | android.net.wifi.p2p.nsd.WifiP2pUsdBasedServiceConfig |
A class for creating a USD based service discovery configuration for use with WifiP2pServiceInfo.
or WifiP2pServiceRequest.
For the details of the configuration, refer Wi-Fi Alliance Wi-Fi Direct R2 specification - Appendix H - Unsynchronized Service Discovery (as defined in Wi-Fi Aware) and section 4.2.13 USD frame format.
Summary
| Nested classes | |
|---|---|
|
Builder used to build |
|
| Constants | |
|---|---|
| static Int |
Bonjour service protocol type |
| static Int |
Generic service protocol type |
| Inherited constants | |
|---|---|
| Public constructors | |
|---|---|
| Public methods | |
|---|---|
| Int |
Implement the Parcelable interface |
| Boolean |
Indicates whether some other object is "equal to" this one. |
| static Int |
Maximum allowed length of service specific information that can be set in the USD service configuration. |
| String |
Get the service name of this USD service configuration. |
| Int |
Get the service protocol type of this USD service configuration. |
| ByteArray? |
Get the service specific info of this USD service configuration. |
| Int |
hashCode()Returns a hash code value for the object. |
| String |
toString()Generates a string of all the defined elements. |
| Unit |
writeToParcel(dest: Parcel, flags: Int)Implement the Parcelable interface |
| Properties | |
|---|---|
| static Parcelable.Creator<WifiP2pUsdBasedServiceConfig!> |
Implement the Parcelable interface |
Constants
SERVICE_PROTOCOL_TYPE_BONJOUR
static val SERVICE_PROTOCOL_TYPE_BONJOUR: Int
Bonjour service protocol type
Value: 1SERVICE_PROTOCOL_TYPE_GENERIC
static val SERVICE_PROTOCOL_TYPE_GENERIC: Int
Generic service protocol type
Value: 2Public constructors
Public methods
describeContents
fun describeContents(): Int
Implement the Parcelable interface
| Return | |
|---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or
|
equals
fun equals(other: Any?): Boolean
Indicates whether some other object is "equal to" this one.
The equals method implements an equivalence relation on non-null object references:
- It is reflexive: for any non-null reference value
x,x.equals(x)should returntrue. - It is symmetric: for any non-null reference values
xandy,x.equals(y)should returntrueif and only ify.equals(x)returnstrue. - It is transitive: for any non-null reference values
x,y, andz, ifx.equals(y)returnstrueandy.equals(z)returnstrue, thenx.equals(z)should returntrue. - It is consistent: for any non-null reference values
xandy, multiple invocations ofx.equals(y)consistently returntrueor consistently returnfalse, provided no information used inequalscomparisons on the objects is modified. - For any non-null reference value
x,x.equals(null)should returnfalse.
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| Parameters | |
|---|---|
obj |
the reference object with which to compare. |
| Return | |
|---|---|
Boolean |
true if this object is the same as the obj argument; false otherwise. |
getMaxAllowedServiceSpecificInfoLength
static fun getMaxAllowedServiceSpecificInfoLength(): Int
Maximum allowed length of service specific information that can be set in the USD service configuration. See also Builder.setServiceSpecificInfo(byte[]).
getServiceName
fun getServiceName(): String
Get the service name of this USD service configuration. See also Builder.
| Return | |
|---|---|
String |
UTF-8 string defining the service. This value cannot be null. |
getServiceProtocolType
fun getServiceProtocolType(): Int
Get the service protocol type of this USD service configuration. See also Builder.setServiceProtocolType(int).
| Return | |
|---|---|
Int |
A non-negative service layer protocol type. Value is between 0 and 255 inclusive |
getServiceSpecificInfo
fun getServiceSpecificInfo(): ByteArray?
Get the service specific info of this USD service configuration. See also Builder.setServiceSpecificInfo(byte[]) .
| Return | |
|---|---|
ByteArray? |
A byte-array of service specification information, or null if unset. |
hashCode
fun hashCode(): Int
Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.
The general contract of hashCode is:
- Whenever it is invoked on the same object more than once during an execution of a Java application, the
hashCodemethod must consistently return the same integer, provided no information used inequalscomparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application. - If two objects are equal according to the
equalsmethod, then calling thehashCodemethod on each of the two objects must produce the same integer result. - It is not required that if two objects are unequal according to the
equalsmethod, then calling thehashCodemethod on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
| Return | |
|---|---|
Int |
a hash code value for this object. |
toString
fun toString(): String
Generates a string of all the defined elements.
| Return | |
|---|---|
String |
a compiled string representing all elements |
writeToParcel
fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
Implement the Parcelable interface
| Parameters | |
|---|---|
dest |
Parcel: This value cannot be null. |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of the following:
|
Properties
CREATOR
static val CREATOR: Parcelable.Creator<WifiP2pUsdBasedServiceConfig!>
Implement the Parcelable interface