Skip to content

Commit

Permalink
Added default random UUID for GATT Attribute initializers
Browse files Browse the repository at this point in the history
  • Loading branch information
colemancda committed Apr 2, 2016
1 parent 91bf86e commit c269faf
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Sources/GATTAttributes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ public extension GATT {

public var includedServices: [IncludedService]

public init(UUID: Bluetooth.UUID, primary: Bool = true, characteristics: [Characteristic] = [], includedServices: [IncludedService] = []) {
public init(UUID: Bluetooth.UUID = .Bit128(SwiftFoundation.UUID()),
primary: Bool = true,
characteristics: [Characteristic] = [],
includedServices: [IncludedService] = []) {

self.UUID = UUID
self.characteristics = characteristics
Expand Down Expand Up @@ -55,7 +58,7 @@ public extension GATT {

public var descriptors: [Descriptor]

public init(UUID: Bluetooth.UUID,
public init(UUID: Bluetooth.UUID = .Bit128(SwiftFoundation.UUID()),
value: Data = Data(),
permissions: [Permission] = [],
properties: [Property] = [],
Expand All @@ -78,7 +81,9 @@ public extension GATT {

public var permissions: [Permission]

public init(UUID: Bluetooth.UUID, value: [UInt8] = [], permissions: [Permission] = []) {
public init(UUID: Bluetooth.UUID = .Bit128(SwiftFoundation.UUID()),
value: [UInt8] = [],
permissions: [Permission] = []) {

self.UUID = UUID
self.value = value
Expand Down

0 comments on commit c269faf

Please sign in to comment.