LittleBlueToothCharacteristic

public struct LittleBlueToothCharacteristic : Identifiable
extension LittleBlueToothCharacteristic: Equatable, Hashable

A representation of a bluetooth characteristic

  • id

    The CBUUID of the characteristic

    Declaration

    Swift

    public let id: CBUUID
  • The CBUUID of the service

    Declaration

    Swift

    public let service: CBUUID
  • Properties of the characteristic. They are mapped from CBCharacteristicProperties

    Declaration

    Swift

    public let properties: Properties
  • Inner value of the CBCaharacteristic

    Declaration

    Swift

    public var rawValue: Data? { get }
  • Initialize a LittleBlueToothCharacteristic.

    Declaration

    Swift

    public init(characteristic: LittleBlueToothCharacteristicIndentifier, for service: LittleBlueToothServiceIndentifier, properties: LittleBlueToothCharacteristic.Properties)

    Parameters

    characteristic

    the LittleBlueToothCharacteristicIndentifier instance, basically a string

    service

    the LittleBlueToothServiceIndentifier instance, basically a string

    properties

    an option set of properties

    Return Value

    An instance of LittleBlueToothCharacteristic.

  • Initialize a LittleBlueToothCharacteristic from a CBCharacteristic

    Declaration

    Swift

    public init(with characteristic: CBCharacteristic)

    Parameters

    characteristic

    the CBCharacteristic instance that you want to use

    Return Value

    An instance of LittleBlueToothCharacteristic.

  • A helper method to get a concrete value from the value contained in the characteristic. The type must conform to the Readable protocol

    Throws

    If the transformation from the Data to the T type cannot be made an error is thrown

    Declaration

    Swift

    public func value<T>() throws -> T where T : Readable

    Parameters

    characteristic

    the CBCharacteristic instance that you want to use

    Return Value

    An instance of of the requested type.

  • If two LittleBlueToothCharacteristic are compared and they have the same characteristic and service identifier they are equal

    Declaration

    Swift

    public static func == (lhs: `Self`, rhs: `Self`) -> Bool
  • Combute the hash of a LittleBlueToothCharacteristic

    Declaration

    Swift

    public func hash(into hasher: inout Hasher)
  • Permitted operations on the characteristic they already exist in CBCharacteristic need to remap when initialized from CBCharacteristic

    See more

    Declaration

    Swift

    struct Properties : OptionSet