Skip to content

Commit

Permalink
#154 Add Embedded Swift support for ATTOpcode.description
Browse files Browse the repository at this point in the history
  • Loading branch information
colemancda committed Nov 18, 2024
1 parent 9eb2785 commit 316e753
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Sources/BluetoothGATT/ATTOpcode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 316e753

Please sign in to comment.