LittleBlueToothCharacteristic
public struct LittleBlueToothCharacteristic : Identifiable
extension LittleBlueToothCharacteristic: Equatable, Hashable
A representation of a bluetooth characteristic
-
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 stringservice
the
LittleBlueToothServiceIndentifier
instance, basically a stringproperties
an option set of properties
Return Value
An instance of
LittleBlueToothCharacteristic
. -
Initialize a
LittleBlueToothCharacteristic
from aCBCharacteristic
Declaration
Swift
public init(with characteristic: CBCharacteristic)
Parameters
characteristic
the
CBCharacteristic
instance 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
Readable
protocolThrows
If the transformation from theData
to theT
type cannot be made an error is thrownDeclaration
Swift
public func value<T>() throws -> T where T : Readable
Parameters
characteristic
the
CBCharacteristic
instance that you want to useReturn Value
An instance of of the requested type.
-
If two
LittleBlueToothCharacteristic
are 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
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 moreDeclaration
Swift
struct Properties : OptionSet