Device

struct Device

A device is created when a new Bluetooth connection is made.

It is used to keep track of connected devices and keep a reference in memory of newly connected devices since connections are dropped otherwise.

  • The unique identifier of a new Bluetooth connection.

    Declaration

    Swift

    let uuid: String
  • RSSI is the signal strength to a device. The closer to 0 the better.

    Declaration

    Swift

    var rssi: Int
  • The name of a device if it is broadcasting one.

    Declaration

    Swift

    let name: String
  • The actual reference to the device as a CBPeripheral.

    Declaration

    Swift

    let peripheral: CBPeripheral
  • Updated the RSSI when a device has its connection refreshed.

    Declaration

    Swift

    mutating func updateRSSI(RSSI: Int)

    Parameters

    RSSI

    The RSSI as an Int. The closer to 0 the better the connection.