DittoRemotePeer

public struct DittoRemotePeer : Codable
extension DittoRemotePeer: Identifiable

A summary snapshot of the types of connections currently active to a remote Ditto peer.

  • The network ID as found in a peer’s announce string. This uniquely identifies a given peer.

    Declaration

    Swift

    public let networkId: String
  • The device name of the remote peer.

    Declaration

    Swift

    public let deviceName: String
  • The connections that are currently active with the remote peer.

    Declaration

    Swift

    public let connections: [String]
  • Received Signal Strength Indicator

    This value is primarily derived from Bluetooth Low Energy, so if the device’s Bluetooth settings are not enabled, then this value will be nil even though there might be a connection from another transport.

    Declaration

    Swift

    public let rssi: Float?
  • 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.

    Declaration

    Swift

    public var approximateDistanceInMeters: Float?
  • Initializes a DittoRemotePeer with a device name and connections. There should be no reason to manually initialize a DittoRemotePeer. Instead, you should use the Ditto.observePeers() function to receive updates about which peers Ditto has observed in the nearby mesh network.

    Declaration

    Swift

    public init(networkId: String, deviceName: String, connections: [String], rssi: Float? = nil, approximateDistanceInMeters: Float? = nil)

Identifiable

  • id

    Declaration

    Swift

    public var id: String { get }