LittleBlueToothCharacteristic
public struct LittleBlueToothCharacteristic : Identifiable
extension LittleBlueToothCharacteristic: Equatable, Hashable
A representation of a bluetooth characteristic
-
Properties of the characteristic. They are mapped from
CBCharacteristicPropertiesDeclaration
Swift
public let properties: Properties -
Inner value of the
CBCaharacteristicDeclaration
Swift
public var rawValue: Data? { get } -
Initialize a
LittleBlueToothCharacteristic.Declaration
Swift
public init(characteristic: LittleBlueToothCharacteristicIndentifier, for service: LittleBlueToothServiceIndentifier, properties: LittleBlueToothCharacteristic.Properties)Parameters
characteristicthe
LittleBlueToothCharacteristicIndentifierinstance, basically a stringservicethe
LittleBlueToothServiceIndentifierinstance, basically a stringpropertiesan option set of properties
Return Value
An instance of
LittleBlueToothCharacteristic. -
Initialize a
LittleBlueToothCharacteristicfrom aCBCharacteristicDeclaration
Swift
public init(with characteristic: CBCharacteristic)Parameters
characteristicthe
CBCharacteristicinstance that you want to useReturn 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
ReadableprotocolThrows
If the transformation from theDatato theTtype cannot be made an error is thrownDeclaration
Swift
public func value<T>() throws -> T where T : ReadableParameters
characteristicthe
CBCharacteristicinstance that you want to useReturn Value
An instance of of the requested type.
-
If two
LittleBlueToothCharacteristicare compared and they have the same characteristic and service identifier they are equalDeclaration
Swift
public static func == (lhs: `Self`, rhs: `Self`) -> Bool -
Combute the hash of a
LittleBlueToothCharacteristicDeclaration
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 moreDeclaration
Swift
struct Properties : OptionSet
View on GitHub
LittleBlueToothCharacteristic Structure Reference