From 316e753247dd65ae8f6d72b2df821437538a6710 Mon Sep 17 00:00:00 2001 From: Alsey Coleman Miller Date: Mon, 18 Nov 2024 05:16:07 -0500 Subject: [PATCH] #154 Add Embedded Swift support for `ATTOpcode.description` --- Sources/BluetoothGATT/ATTOpcode.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Sources/BluetoothGATT/ATTOpcode.swift b/Sources/BluetoothGATT/ATTOpcode.swift index 312c30a35..6c71d96d5 100644 --- a/Sources/BluetoothGATT/ATTOpcode.swift +++ b/Sources/BluetoothGATT/ATTOpcode.swift @@ -67,6 +67,17 @@ public enum ATTOpcode: UInt8, Sendable, CaseIterable { case handleValueConfirmation = 0x1E } +// MARK: - CustomStringConvertible + +#if hasFeature(Embedded) +extension ATTOpcode: CustomStringConvertible { + + public var description: String { + "0x" + rawValue.toHexadecimal() + } +} +#endif + // MARK: - Opcode Type /// ATT protocol opcode categories.