DittoConnection

data class DittoConnection

Represents a connection between two peers in a Ditto mesh network.

Constructors

Link copied to clipboard
fun DittoConnection(    id: String,     peer1: DittoPeerKey,     peer2: DittoPeerKey,     connectionType: DittoConnectionType,     approximateDistanceInMeters: Double?)
Link copied to clipboard
fun DittoConnection(    id: String,     peerKeyString1: String,     peerKeyString2: String,     connectionType: DittoConnectionType,     approximateDistanceInMeters: Double?)

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int

Properties

Link copied to clipboard
val approximateDistanceInMeters: Double?

Gets an estimate of distance to the remote peer. This value is inaccurate. The environment, hardware, and several other factors can greatly affect this value. It is currently derived from RSSI.

Link copied to clipboard
val connectionType: DittoConnectionType

Type of transport enabling this connection.

Link copied to clipboard
val id: String

This ID is deterministic for any two peers and a given connection type.

Link copied to clipboard
val peer1: DittoPeerKey

The peer key of one end of the connection.

Link copied to clipboard
val peer2: DittoPeerKey

The peer key of the other end of the connection.

Link copied to clipboard
val peerKeyString1: String

The peer key of the peer at one end of the connection, as a string.

Link copied to clipboard
val peerKeyString2: String

The peer key of the peer at the other end of the connection, as a string.