Skip to content

Commit

Permalink
Updated HCILEAdvertisingReport
Browse files Browse the repository at this point in the history
Reports should use `LowEnergyAdvertisingData` instead of `Data` for the
advertised or response data.
  • Loading branch information
colemancda committed Aug 15, 2018
1 parent c594c44 commit 4268909
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Sources/HCILEAdvertisingReport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public struct HCILEAdvertisingReport: HCIEventParameter {
public let address: Address // Address

/// Advertising or scan response data
public let responseData: Data // Data
public let responseData: LowEnergyAdvertisingData // Data

/// RSSI
///
Expand Down Expand Up @@ -103,7 +103,11 @@ public struct HCILEAdvertisingReport: HCIEventParameter {

let responseData = Data(data[9 ..< (9 + length)])
assert(responseData.count == length)
self.responseData = responseData

guard let advertisingData = LowEnergyAdvertisingData(data: responseData)
else { return nil }

self.responseData = advertisingData

// not enough bytes
guard data.count == (Report.length + length)
Expand Down

0 comments on commit 4268909

Please sign in to comment.