Added in API level 33

ServiceDiscoveryInfo


public final class ServiceDiscoveryInfo
extends Object

java.lang.Object
   ↳ android.net.wifi.aware.ServiceDiscoveryInfo


An object providing information about a Wi-Fi Aware discovery session with a specific peer.

Summary

Public methods

List<byte[]> getMatchFilters()

Get the filter which resulted in this service discovery.

String getPairedAlias()

Get the paired device alias if the discovered device has already paired.

AwarePairingConfig getPairingConfig()

Get the discovered device's pairing config.

int getPeerCipherSuite()

Get the cipher suite type specified by the publish session to be used for data-path setup.

PeerHandle getPeerHandle()

Get the peer handle for the peer matching our discovery operation

byte[] getScid()

Get the Security context identifier is associate with PMK for data path security config.

byte[] getServiceSpecificInfo()

The service specific information (arbitrary byte array) provided by the peer as part of its discovery configuration.

Inherited methods

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Public methods

getMatchFilters

Added in API level 33
public List<byte[]> getMatchFilters ()

Get the filter which resulted in this service discovery. For PublishConfig.PUBLISH_TYPE_UNSOLICITED, SubscribeConfig.SUBSCRIBE_TYPE_PASSIVE discovery sessions this is the publisher's match filter. For PublishConfig.PUBLISH_TYPE_SOLICITED, SubscribeConfig.SUBSCRIBE_TYPE_ACTIVE discovery sessions this is the subscriber's match filter.

Returns
List<byte[]> A list of byte arrays representing the match filter. An empty list if match filter is not set. This value cannot be null.

getPairedAlias

Added in API level 34
public String getPairedAlias ()

Get the paired device alias if the discovered device has already paired. If not null device will automatically start the NAN pairing verification, DiscoverySessionCallback.onPairingVerificationSucceed(PeerHandle, String) will trigger when verification is finished

Returns
String

getPairingConfig

Added in API level 34
public AwarePairingConfig getPairingConfig ()

Get the discovered device's pairing config. Can be used for the following pairing setup or bootstrapping request.

Returns
AwarePairingConfig This value may be null.

See also:

getPeerCipherSuite

Added in API level 33
public int getPeerCipherSuite ()

Get the cipher suite type specified by the publish session to be used for data-path setup.

getPeerHandle

Added in API level 33
public PeerHandle getPeerHandle ()

Get the peer handle for the peer matching our discovery operation

Returns
PeerHandle An opaque handle representing the discovered peer. This value cannot be null.

getScid

Added in API level 33
public byte[] getScid ()

Get the Security context identifier is associate with PMK for data path security config. Only use for Characteristics.WIFI_AWARE_CIPHER_SUITE_NCS_PK_128 and Characteristics.WIFI_AWARE_CIPHER_SUITE_NCS_PK_256 to get the PMKID set by WifiAwareDataPathSecurityConfig.Builder.setPmkId(byte[]) from publish session. This can help the Wi-Fi Aware data-path setup to select the correct PMK/PMKID

Returns
byte[] An arbitrary byte array represent the security context identifier. null if Security context identifier is not set.

getServiceSpecificInfo

Added in API level 33
public byte[] getServiceSpecificInfo ()

The service specific information (arbitrary byte array) provided by the peer as part of its discovery configuration.

Returns
byte[] An arbitrary byte array represent the service specific information. null if service specific information is not set.