DiscoveryData

public class DiscoveryData

This is a class, as opposed to a struct, because I want to make sure that it is referenced, and not copied.

  • This holds the advertisement data that came with the discovery.

    Declaration

    Swift

    public var advertisementData: AdvertisementData?
  • This is the signal strength, at the time of discovery, in dBm. This is also updated, as we receive RSSI change notifications.

    Declaration

    Swift

    public var rssi: Int
  • This is the peripheral wrapper that is instantiated when the device is connected. It is nil, if the device is not connected. It is a strong reference.

    Declaration

    Swift

    public var peripheralInstance: CGA_Bluetooth_Peripheral? { get set }
  • The Peripheral is capable of sending writes back (without response).

    Declaration

    Swift

    public var canSendWriteWithoutResponse: Bool { get }
  • The assigned Peripheral Name

    Declaration

    Swift

    public var name: String { get }
  • This is true, if the Peripheral advertisement data indicates the Peripheral can be connected.

    Declaration

    Swift

    public var canConnect: Bool { get }
  • This is the “Local Name,” from the advertisement data.

    Declaration

    Swift

    public var localName: String { get }
  • This is the local name, if available, or the Peripheral name, if the local name is not available.

    Declaration

    Swift

    public var preferredName: String { get }
  • Returns the ID UUID as a String.

    Declaration

    Swift

    public var identifier: String { get }
  • Returns true, if the peripheral is currently connected.

    Declaration

    Swift

    public var isConnected: Bool { get }
  • Returns true, if the peripheral is currently disconnected (as opposed to connecting/disconnecting/connected).

    Declaration

    Swift

    public var isDisconnected: Bool { get }
  • Returns true, if the peripheral is currently undergoing connection.

    Declaration

    Swift

    public var isConnecting: Bool { get }
  • Returns true, if the peripheral is currently undergoing disconnection.

    Declaration

    Swift

    public var isDisconnecting: Bool { get }
  • This asks the Central Manager to ignore this device.

    Declaration

    Swift

    @discardableResult
    public func ignore() -> Bool

    Return Value

    True, if the ignore worked.

  • This asks the Central Manager to “unignore” this device.

    Declaration

    Swift

    @discardableResult
    public func unignore() -> Bool

    Return Value

    True, if the unignore worked.

  • This asks the Central Manager to connect this device.

    Declaration

    Swift

    @discardableResult
    public func connect() -> Bool

    Return Value

    True, if the attempt worked (not a guarantee of success, though).

  • This asks the Central Manager to disconnect this device.

    Declaration

    Swift

    @discardableResult
    public func disconnect() -> Bool

    Return Value

    True, if the attempt worked (not a guarantee of success, though).

  • Cancels the timeout.

    Declaration

    Swift

    public func clear()