Skip to content

Commit

Permalink
Added preconditions for HCI LE commands
Browse files Browse the repository at this point in the history
  • Loading branch information
colemancda committed Nov 28, 2017
1 parent 0a4b04c commit 643a693
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/LowEnergyCommandParameter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public extension LowEnergyCommand {

public init(data: LowEnergyAdvertisingData, length: UInt8) {

precondition(length <= 31, "LE Advertising Data can only be 31 octets")

self.length = length
self.data = data
}
Expand Down Expand Up @@ -156,6 +158,8 @@ public extension LowEnergyCommand {

public init(data: LowEnergyScanData, length: UInt8) {

precondition(length <= 31, "LE Scan Response Data can only be 31 octets")

self.length = length
self.data = data
}
Expand Down

0 comments on commit 643a693

Please sign in to comment.