diff --git a/Sources/BluetoothGATT/GATTDateTime.swift b/Sources/BluetoothGATT/GATTDateTime.swift index 2d8e2693b..c18fa87b8 100644 --- a/Sources/BluetoothGATT/GATTDateTime.swift +++ b/Sources/BluetoothGATT/GATTDateTime.swift @@ -51,8 +51,13 @@ public struct GATTDateTime: GATTCharacteristic, Equatable, Hashable, Sendable { self.minute = minute self.second = second } +} + +// MARK: - DataConvertible + +extension GATTDateTime: DataConvertible { - internal static var length: Int { 7 } + public static var length: Int { 7 } public init?(data: Data) { @@ -78,6 +83,10 @@ public struct GATTDateTime: GATTCharacteristic, Equatable, Hashable, Sendable { data += minute.rawValue data += second.rawValue } + + public var dataLength: Int { + Self.length + } } #if canImport(Foundation)