Added in API level 33

ServiceDiscoveryInfo

class ServiceDiscoveryInfo
kotlin.Any
   ↳ android.net.wifi.aware.ServiceDiscoveryInfo

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

Summary

Public methods
MutableList<ByteArray!>

Get the filter which resulted in this service discovery.

String?

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

AwarePairingConfig?

Get the discovered device's pairing config.

Int

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

PeerHandle

Get the peer handle for the peer matching our discovery operation

ByteArray?

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

ByteArray?

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

Public methods

getMatchFilters

Added in API level 33
fun getMatchFilters(): MutableList<ByteArray!>

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.

Return
MutableList<ByteArray!> 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
fun getPairedAlias(): String?

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

getPairingConfig

Added in API level 34
fun getPairingConfig(): AwarePairingConfig?

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

Return
AwarePairingConfig? This value may be null.

getPeerCipherSuite

Added in API level 33
fun getPeerCipherSuite(): Int

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

Return
Int peerCipherSuite An integer represent the cipher suite used to encrypt the data-path. Value is either 0 or a combination of android.net.wifi.aware.Characteristics#WIFI_AWARE_CIPHER_SUITE_NONE, android.net.wifi.aware.Characteristics#WIFI_AWARE_CIPHER_SUITE_NCS_SK_128, android.net.wifi.aware.Characteristics#WIFI_AWARE_CIPHER_SUITE_NCS_SK_256, android.net.wifi.aware.Characteristics#WIFI_AWARE_CIPHER_SUITE_NCS_PK_128, and android.net.wifi.aware.Characteristics#WIFI_AWARE_CIPHER_SUITE_NCS_PK_256

getPeerHandle

Added in API level 33
fun getPeerHandle(): PeerHandle

Get the peer handle for the peer matching our discovery operation

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

getScid

Added in API level 33
fun getScid(): ByteArray?

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

Return
ByteArray? An arbitrary byte array represent the security context identifier. null if Security context identifier is not set.

getServiceSpecificInfo

Added in API level 33
fun getServiceSpecificInfo(): ByteArray?

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

Return
ByteArray? An arbitrary byte array represent the service specific information. null if service specific information is not set.