Skip to content

Commit

Permalink
Make Sendable & Codable
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuniwak committed Jul 23, 2024
1 parent 7487887 commit 369c91f
Show file tree
Hide file tree
Showing 23 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Sources/BLEInternal/HexEncoding.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation


public enum HexEncoding: String, Equatable {
public enum HexEncoding: String, Equatable, Codable, Sendable {
case upper = "%02hhX"
case lower = "%02hhx"

Expand Down
2 changes: 1 addition & 1 deletion Sources/BLEInternal/HexEncodingError.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
public enum HexEncodingError: Error, Equatable {
public enum HexEncodingError: Error, Equatable, Codable, Sendable {
case oddNumberOfCharacters(hexString: String)
case invalidCharacter(hexString: String)
case mixedCase(hexString: String)
Expand Down
2 changes: 1 addition & 1 deletion Sources/BLEInternal/UUIDError.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
public struct UUIDError: Error, Equatable, CustomStringConvertible {
public struct UUIDError: Error, Equatable, CustomStringConvertible, Codable, Sendable {
public let description: String

public init(_ description: String) {
Expand Down
2 changes: 1 addition & 1 deletion Sources/BLEMacro/AssertCCCD.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Fuzi


public struct AssertCCCD: Equatable {
public struct AssertCCCD: Equatable, Codable, Sendable {
public let description: String?


Expand Down
2 changes: 1 addition & 1 deletion Sources/BLEMacro/AssertCharacteristic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import struct Foundation.UUID
import Fuzi


public struct AssertCharacteristic: Equatable {
public struct AssertCharacteristic: Equatable, Codable, Sendable {
public let description: String?
public let uuid: UUID
public let properties: [Property]
Expand Down
2 changes: 1 addition & 1 deletion Sources/BLEMacro/AssertDescriptor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import struct Foundation.UUID
import Fuzi


public struct AssertDescriptor: Equatable {
public struct AssertDescriptor: Equatable, Codable, Sendable {
public let description: String?
public let uuid: UUID

Expand Down
2 changes: 1 addition & 1 deletion Sources/BLEMacro/AssertService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Fuzi
import BLEInternal


public struct AssertService: Equatable {
public struct AssertService: Equatable, Codable, Sendable {
public let description: String?
public let uuid: UUID
public let assertCharacteristics: [AssertCharacteristic]
Expand Down
2 changes: 1 addition & 1 deletion Sources/BLEMacro/AssertValue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Fuzi
import BLEInternal


public struct AssertValue: Equatable {
public struct AssertValue: Equatable, Codable, Sendable {
public let description: String?
public let value: Value

Expand Down
2 changes: 1 addition & 1 deletion Sources/BLEMacro/Icon.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Fuzi


public struct Icon: RawRepresentable, Equatable {
public struct Icon: RawRepresentable, Equatable, Codable, Sendable {
public typealias RawValue = String

public let rawValue: String
Expand Down
2 changes: 1 addition & 1 deletion Sources/BLEMacro/Macro.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Fuzi


public struct Macro: Equatable {
public struct Macro: Equatable, Codable, Sendable {
public let name: String
public let icon: Icon
public let assertServices: [AssertService]
Expand Down
2 changes: 1 addition & 1 deletion Sources/BLEMacro/MacroXMLError.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import BLEInternal


public enum MacroXMLError: Error, Equatable {
public enum MacroXMLError: Error, Equatable, Codable, Sendable {
case bothValueAndValueStringAttributesPresent(element: String?)
case malformedSleepTimeoutAttribute(element: String?, timeoutString: String)
case malformedUUIDAttribute(element: String?, attribute: String, uuidString: String)
Expand Down
2 changes: 1 addition & 1 deletion Sources/BLEMacro/Operation.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Fuzi


public enum Operation: Equatable {
public enum Operation: Equatable, Codable, Sendable {
case write(Write)
case writeDescriptor(WriteDescriptor)
case read(Read)
Expand Down
2 changes: 1 addition & 1 deletion Sources/BLEMacro/Property.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Fuzi


public struct Property: Equatable {
public struct Property: Equatable, Codable, Sendable {
public let name: PropertyName
public let requirement: PropertyRequirement?

Expand Down
2 changes: 1 addition & 1 deletion Sources/BLEMacro/PropertyName.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Fuzi


public struct PropertyName: RawRepresentable, Hashable, Codable {
public struct PropertyName: RawRepresentable, Hashable, Codable, Sendable {
public typealias RawValue = String
public let rawValue: String

Expand Down
2 changes: 1 addition & 1 deletion Sources/BLEMacro/PropertyRequirement.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Fuzi


public struct PropertyRequirement: RawRepresentable, Equatable, Codable {
public struct PropertyRequirement: RawRepresentable, Equatable, Codable, Sendable {
public typealias RawValue = String

public let rawValue: String
Expand Down
2 changes: 1 addition & 1 deletion Sources/BLEMacro/Read.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import struct Foundation.UUID
import Fuzi


public struct Read: Equatable {
public struct Read: Equatable, Codable, Sendable {
public let description: String?
public let serviceUUID: UUID
public let characteristicUUID: UUID
Expand Down
2 changes: 1 addition & 1 deletion Sources/BLEMacro/Sleep.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Fuzi


public struct Sleep: Equatable {
public struct Sleep: Equatable, Codable, Sendable {
public let description: String?
public let timeout: UInt

Expand Down
2 changes: 1 addition & 1 deletion Sources/BLEMacro/Value.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Fuzi
import BLEInternal


public enum Value: Equatable {
public enum Value: Equatable, Codable, Sendable {
typealias RawValue = String

case data(data: Data, encoding: HexEncoding)
Expand Down
2 changes: 1 addition & 1 deletion Sources/BLEMacro/WaitForNotification.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import struct Foundation.UUID
import Fuzi


public struct WaitForNotification: Equatable {
public struct WaitForNotification: Equatable, Codable, Sendable {
public let description: String?
public let serviceUUID: UUID
public let characteristicUUID: UUID
Expand Down
2 changes: 1 addition & 1 deletion Sources/BLEMacro/Write.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import struct Foundation.UUID
import Fuzi


public struct Write: Equatable {
public struct Write: Equatable, Codable, Sendable {
public let description: String?
public let serviceUUID: UUID
public let characteristicUUID: UUID
Expand Down
2 changes: 1 addition & 1 deletion Sources/BLEMacro/WriteDescriptor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import struct Foundation.UUID
import Fuzi


public struct WriteDescriptor: Equatable {
public struct WriteDescriptor: Equatable, Codable, Sendable {
public let description: String?
public let uuid: UUID
public let serviceUUID: UUID
Expand Down
2 changes: 1 addition & 1 deletion Sources/BLEMacro/WritingType.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Fuzi


public struct WritingType: RawRepresentable, Equatable {
public struct WritingType: RawRepresentable, Hashable, Codable, Sendable {
public typealias RawValue = String
public let rawValue: String

Expand Down
4 changes: 2 additions & 2 deletions Sources/BLEMacro/XMLWriter.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
public struct XMLElement {
public struct XMLElement: Equatable, Codable, Sendable {
public var tag: String
public var attributes: [String: String]
public var children: [XMLElement]
Expand All @@ -11,7 +11,7 @@ public struct XMLElement {
}


public class XMLWriter {
public final class XMLWriter {
private var stream: TextOutputStream


Expand Down

0 comments on commit 369c91f

Please sign in to comment.