Skip to content

Commit 11bd15b

Browse files
committed
Sample app adjusted to breaking changes
1 parent 0171729 commit 11bd15b

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

Example/iOSDFULibrary/DFU Test Performer/DFUTestSet.swift

+4-10
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import CoreBluetooth
3434

3535
enum DFUTestError : Error {
3636
case fileNotFound
37-
case invalidFirmware
3837
}
3938

4039
typealias AdvertisingData = [String : Any]
@@ -82,10 +81,9 @@ class FilterBy {
8281

8382
class Option {
8483

85-
static let prn : (UInt16) -> ServiceModifier = {
86-
aPRNValue in
84+
static let prn : (UInt16) -> ServiceModifier = { prn in
8785
return {
88-
initiator in initiator.packetReceiptNotificationParameter = aPRNValue
86+
initiator in initiator.packetReceiptNotificationParameter = prn
8987
}
9088
}
9189

@@ -97,14 +95,10 @@ class Option {
9795
extension DFUFirmware {
9896

9997
private static func from(urlToZipFile url: URL?, type: DFUFirmwareType) throws -> DFUFirmware {
100-
guard url != nil else {
98+
guard let url = url else {
10199
throw DFUTestError.fileNotFound
102100
}
103-
let firmware = DFUFirmware(urlToZipFile: url!, type: type)
104-
guard firmware != nil else {
105-
throw DFUTestError.invalidFirmware
106-
}
107-
return firmware!
101+
return try DFUFirmware(urlToZipFile: url, type: type)
108102
}
109103

110104
static func from(zip name: String, locatedIn subdirectory: String) throws -> DFUFirmware {

0 commit comments

Comments
 (0)