Stay organized with collections
Save and categorize content based on your preferences.
PeerHandle
open class PeerHandle
Opaque object used to represent a Wi-Fi Aware peer. Obtained from discovery sessions in DiscoverySessionCallback.onServiceDiscovered(PeerHandle, byte[], java.util.List)
or received messages in DiscoverySessionCallback.onMessageReceived(PeerHandle, byte[])
, and used when sending messages e,g, DiscoverySession.sendMessage(PeerHandle, int, byte[])
, or when configuring a network link to a peer, e.g. DiscoverySession.createNetworkSpecifierOpen(PeerHandle)
or DiscoverySession.createNetworkSpecifierPassphrase(PeerHandle, String)
.
Note that while a PeerHandle
can be used to track a particular peer (i.e. you can compare the values received from subsequent messages) - it is good practice not to rely on it. Instead use an application level peer identifier encoded in the message, DiscoverySession.sendMessage(PeerHandle, int, byte[])
, and/or in the Publish configuration's service-specific information field, PublishConfig.Builder.setServiceSpecificInfo(byte[])
, or match filter, PublishConfig.Builder.setMatchFilter(java.util.List)
.
A parcelable handle object is available with ParcelablePeerHandle
.
Summary
Public methods
equals
open fun equals(other: Any?): Boolean
Parameters |
obj |
the reference object with which to compare. |
Return |
Boolean |
true if this object is the same as the obj argument; false otherwise. |
hashCode
open fun hashCode(): Int
Return |
Int |
a hash code value for this object. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-01-23 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-01-23 UTC."],[],[]]