Skip to content

Commit f73213f

Browse files
authored
Merge pull request #460 from NordicSemiconductor/develop
Version 4.11.1
2 parents 8f935c6 + e23dac0 commit f73213f

File tree

22 files changed

+62
-119
lines changed

22 files changed

+62
-119
lines changed

Example/Podfile.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- iOSDFULibrary (4.11.0):
2+
- iOSDFULibrary (4.11.1):
33
- ZIPFoundation (= 0.9.11)
44
- ZIPFoundation (0.9.11)
55

@@ -15,7 +15,7 @@ EXTERNAL SOURCES:
1515
:path: "../"
1616

1717
SPEC CHECKSUMS:
18-
iOSDFULibrary: 65f745d4224ac06625d60b3fc51aad2dec60346a
18+
iOSDFULibrary: 3500ac00451aa7d8ec48a752e91099669a2c1d27
1919
ZIPFoundation: b1f0de4eed33e74a676f76e12559ab6b75990197
2020

2121
PODFILE CHECKSUM: 16697609d795697cac6384a823bc962ccbddb9d0

Example/Pods/Local Podspecs/iOSDFULibrary.podspec.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Manifest.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Pods.xcodeproj/project.pbxproj

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/iOSDFULibrary-iOS.xcscheme

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/iOSDFULibrary-macOS.xcscheme

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Target Support Files/iOSDFULibrary-iOS/iOSDFULibrary-iOS-Info.plist

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Target Support Files/iOSDFULibrary-macOS/iOSDFULibrary-macOS-Info.plist

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/iOSDFULibrary.xcodeproj/project.pbxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@
345345
isa = PBXProject;
346346
attributes = {
347347
LastSwiftUpdateCheck = 0920;
348-
LastUpgradeCheck = 1250;
348+
LastUpgradeCheck = 1300;
349349
ORGANIZATIONNAME = CocoaPods;
350350
TargetAttributes = {
351351
37E4ADEF2008CA1C005464DD = {

Example/iOSDFULibrary.xcodeproj/xcshareddata/xcschemes/iOSDFULibrary-Example.xcscheme

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1250"
3+
LastUpgradeVersion = "1300"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ if you need to resymbolicate crash logs. you may want to keep those files bundle
4848
**For Swift Package Manager:**
4949

5050
```swift
51-
// swift-tools-version:5.4
51+
// swift-tools-version:5.5
5252
import PackageDescription
5353

5454
let package = Package(
5555
name: "<Your Product Name>",
5656
dependencies: [
5757
.package(
5858
url: "https://github.com/NordicSemiconductor/IOS-DFU-Library",
59-
.upToNextMajor(from: "<Desired Version, e.g. 4.11.0>")
59+
.upToNextMajor(from: "<Desired Version, e.g. 4.11.1>")
6060
)
6161
],
6262
targets: [.target(name: "<Your Target Name>", dependencies: ["NordicDFU"])]

README_OBJC.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ end
1818
pod install
1919

2020
- Open the newly created `.xcworkspace` and begin working on your project.
21-
- If Xcode asks to migrate code to Swift 5.2, choose **Later**. (The codebase is Swift 5.2 already)
21+
- If Xcode asks to migrate code to Swift 5.5, choose **Later**. (The codebase is Swift 5.5 already)
2222
- Click on the `Pods` project, then go to the `Build Settings`
2323
- Click on the `iOSDFULibrary` target, then set the `Use Legacy Swift version` setting to `No`
2424
- Repeat the same for the `ZIPFoundation` target.

changelog.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
### Changelog
2+
- **4.11.1**
3+
- Improvement: Xcode 13 issue fixed (#455).
4+
25
- **4.11.0**
36
- Feature: Support for Abort op code added in Secure DFU (#447).
47
- Improvement: More op codes added in Secure DFU in SDK 15 (#447).

iOSDFULibrary.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "iOSDFULibrary"
3-
s.version = "4.11.0"
3+
s.version = "4.11.1"
44
s.summary = "This repository contains a library to perform Device Firmware Update on the nRF5x devices."
55
s.description = <<-DESC
66
The nRF5x Series chips are flash-based SoCs, and as such they represent the most flexible solution available. A key feature of the nRF5x Series and their associated software architecture and S-Series SoftDevices is the possibility for Over-The-Air Device Firmware Upgrade (OTA-DFU). See Figure 1. OTA-DFU allows firmware upgrades to be issued and downloaded to products in the field via the cloud and so enables OEMs to fix bugs and introduce new features to products that are already out on the market. This brings added security and flexibility to product development when using the nRF5x Series SoCs.

iOSDFULibrary/Classes/Implementation/LegacyDFU/Characteristics/DFUControlPoint.swift

+6-15
Original file line numberDiff line numberDiff line change
@@ -224,14 +224,11 @@ internal struct PacketReceiptNotification {
224224
*/
225225
func enableNotifications(onSuccess success: Callback?, onError report: ErrorCallback?) {
226226
// Get the peripheral object.
227-
#if swift(>=5.5)
228-
guard let peripheral = characteristic.service?.peripheral else {
227+
let optService: CBService? = characteristic.service
228+
guard let peripheral = optService?.peripheral else {
229229
report?(.invalidInternalState, "Assert characteristic.service?.peripheral != nil failed")
230230
return
231231
}
232-
#else
233-
let peripheral = characteristic.service.peripheral
234-
#endif
235232

236233
// Save callbacks.
237234
self.success = success
@@ -255,14 +252,11 @@ internal struct PacketReceiptNotification {
255252
*/
256253
func send(_ request: Request, onSuccess success: Callback?, onError report: ErrorCallback?) {
257254
// Get the peripheral object.
258-
#if swift(>=5.5)
259-
guard let peripheral = characteristic.service?.peripheral else {
255+
let optService: CBService? = characteristic.service
256+
guard let peripheral = optService?.peripheral else {
260257
report?(.invalidInternalState, "Assert characteristic.service?.peripheral != nil failed")
261258
return
262259
}
263-
#else
264-
let peripheral = characteristic.service.peripheral
265-
#endif
266260

267261
// Save callbacks and parameter.
268262
self.success = success
@@ -309,14 +303,11 @@ internal struct PacketReceiptNotification {
309303
onPacketReceiptNofitication proceed: ProgressCallback?,
310304
onError report: ErrorCallback?) {
311305
// Get the peripheral object.
312-
#if swift(>=5.5)
313-
guard let peripheral = characteristic.service?.peripheral else {
306+
let optService: CBService? = characteristic.service
307+
guard let peripheral = optService?.peripheral else {
314308
report?(.invalidInternalState, "Assert characteristic.service?.peripheral != nil failed")
315309
return
316310
}
317-
#else
318-
let peripheral = characteristic.service.peripheral
319-
#endif
320311

321312
// Save callbacks. The proceed callback will be called periodically whenever
322313
// a packet receipt notification is received. It resumes uploading.

iOSDFULibrary/Classes/Implementation/LegacyDFU/Characteristics/DFUPacket.swift

+8-20
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,11 @@ internal class DFUPacket: DFUCharacteristic {
6868
*/
6969
func sendFirmwareSize(_ size: DFUFirmwareSize, onError report: ErrorCallback?) {
7070
// Get the peripheral object
71-
#if swift(>=5.5)
72-
guard let peripheral = characteristic.service?.peripheral else {
71+
let optService: CBService? = characteristic.service
72+
guard let peripheral = optService?.peripheral else {
7373
report?(.invalidInternalState, "Assert characteristic.service?.peripheral != nil failed")
7474
return
7575
}
76-
#else
77-
let peripheral = characteristic.service.peripheral
78-
#endif
7976

8077
let data = Data()
8178
+ size.softdevice.littleEndian
@@ -98,14 +95,11 @@ internal class DFUPacket: DFUCharacteristic {
9895
*/
9996
func sendFirmwareSize_v1(_ size: DFUFirmwareSize, onError report: ErrorCallback?) {
10097
// Get the peripheral object.
101-
#if swift(>=5.5)
102-
guard let peripheral = characteristic.service?.peripheral else {
98+
let optService: CBService? = characteristic.service
99+
guard let peripheral = optService?.peripheral else {
103100
report?(.invalidInternalState, "Assert characteristic.service?.peripheral != nil failed")
104101
return
105102
}
106-
#else
107-
let peripheral = characteristic.service.peripheral
108-
#endif
109103

110104
let data = Data() + size.application.littleEndian
111105

@@ -124,14 +118,11 @@ internal class DFUPacket: DFUCharacteristic {
124118
*/
125119
func sendInitPacket(_ data: Data, onError report: ErrorCallback?) {
126120
// Get the peripheral object.
127-
#if swift(>=5.5)
128-
guard let peripheral = characteristic.service?.peripheral else {
121+
let optService: CBService? = characteristic.service
122+
guard let peripheral = optService?.peripheral else {
129123
report?(.invalidInternalState, "Assert characteristic.service?.peripheral != nil failed")
130124
return
131125
}
132-
#else
133-
let peripheral = characteristic.service.peripheral
134-
#endif
135126

136127
// Data may be sent in up-to-20-bytes packets.
137128
var offset: UInt32 = 0
@@ -169,14 +160,11 @@ internal class DFUPacket: DFUCharacteristic {
169160
andReportProgressTo progress: DFUProgressDelegate?, on queue: DispatchQueue,
170161
onError report: ErrorCallback?) {
171162
// Get the peripheral object.
172-
#if swift(>=5.5)
173-
guard let peripheral = characteristic.service?.peripheral else {
163+
let optService: CBService? = characteristic.service
164+
guard let peripheral = optService?.peripheral else {
174165
report?(.invalidInternalState, "Assert characteristic.service?.peripheral != nil failed")
175166
return
176167
}
177-
#else
178-
let peripheral = characteristic.service.peripheral
179-
#endif
180168

181169
// Some super complicated computations...
182170
let bytesTotal = UInt32(firmware.data.count)

iOSDFULibrary/Classes/Implementation/LegacyDFU/Characteristics/DFUVersion.swift

+2-5
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,11 @@ internal typealias VersionCallback = (_ major: UInt8, _ minor: UInt8) -> Void
6262
*/
6363
func readVersion(onSuccess success: VersionCallback?, onError report: ErrorCallback?) {
6464
// Get the peripheral object.
65-
#if swift(>=5.5)
66-
guard let peripheral = characteristic.service?.peripheral else {
65+
let optService: CBService? = characteristic.service
66+
guard let peripheral = optService?.peripheral else {
6767
report?(.invalidInternalState, "Assert characteristic.service?.peripheral != nil failed")
6868
return
6969
}
70-
#else
71-
let peripheral = characteristic.service.peripheral
72-
#endif
7370

7471
// Save callbacks.
7572
self.success = success

iOSDFULibrary/Classes/Implementation/LegacyDFU/Services/LegacyDFUService.swift

+4-10
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,11 @@ import CoreBluetooth
154154
self.report = report
155155

156156
// Get the peripheral object
157-
#if swift(>=5.5)
158-
guard let peripheral = service.peripheral else {
157+
let optPeripheral: CBPeripheral? = service.peripheral
158+
guard let peripheral = optPeripheral else {
159159
report(.invalidInternalState, "Assert service.peripheral != nil failed")
160160
return
161161
}
162-
#else
163-
let peripheral = service.peripheral
164-
#endif
165162

166163
// Set the peripheral delegate to self
167164
peripheral.delegate = self
@@ -200,14 +197,11 @@ import CoreBluetooth
200197
// - we must be in the DFU mode already (otherwise the device would be useless...).
201198
// Note: On iOS the Generic Access and Generic Attribute services (nor HID Service)
202199
// are not returned during service discovery.
203-
#if swift(>=5.5)
204-
guard let peripheral = service.peripheral else {
200+
let optPeripheral: CBPeripheral? = service.peripheral
201+
guard let peripheral = optPeripheral else {
205202
logger.e("Assert service.peripheral != nil failed")
206203
return false // Return value doesn't really matter.
207204
}
208-
#else
209-
let peripheral = service.peripheral
210-
#endif
211205
let services = peripheral.services
212206
if services?.count == 1 {
213207
return false

iOSDFULibrary/Classes/Implementation/SecureDFU/Characteristics/ButtonlessDFU.swift

+4-10
Original file line numberDiff line numberDiff line change
@@ -189,14 +189,11 @@ internal class ButtonlessDFU : NSObject, CBPeripheralDelegate, DFUCharacteristic
189189
*/
190190
func enable(onSuccess success: Callback?, onError report: ErrorCallback?) {
191191
// Get the peripheral object.
192-
#if swift(>=5.5)
193-
guard let peripheral = characteristic.service?.peripheral else {
192+
let optService: CBService? = characteristic.service
193+
guard let peripheral = optService?.peripheral else {
194194
report?(.invalidInternalState, "Assert characteristic.service?.peripheral != nil failed")
195195
return
196196
}
197-
#else
198-
let peripheral = characteristic.service.peripheral
199-
#endif
200197

201198
// Save callbacks.
202199
self.success = success
@@ -225,14 +222,11 @@ internal class ButtonlessDFU : NSObject, CBPeripheralDelegate, DFUCharacteristic
225222
func send(_ request: ButtonlessDFURequest,
226223
onSuccess success: Callback?, onError report: ErrorCallback?) {
227224
// Get the peripheral object.
228-
#if swift(>=5.5)
229-
guard let peripheral = characteristic.service?.peripheral else {
225+
let optService: CBService? = characteristic.service
226+
guard let peripheral = optService?.peripheral else {
230227
report?(.invalidInternalState, "Assert characteristic.service?.peripheral != nil failed")
231228
return
232229
}
233-
#else
234-
let peripheral = characteristic.service.peripheral
235-
#endif
236230

237231
// Save callbacks and parameter.
238232
self.success = success

0 commit comments

Comments
 (0)