Skip to content

Commit 3b2c99e

Browse files
author
Mostafa Berg
committed
Release 4.0.1
2 parents 4a5518a + 7e092b0 commit 3b2c99e

File tree

10 files changed

+41
-38
lines changed

10 files changed

+41
-38
lines changed

Example/iOSDFULibrary/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
1919
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
2020
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21-
*/
21+
*/
2222

2323
import UIKit
2424

Example/iOSDFULibrary/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
<key>CFBundlePackageType</key>
1616
<string>APPL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>4.0</string>
18+
<string>4.0.1</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>38</string>
22+
<string>39</string>
2323
<key>LSRequiresIPhoneOS</key>
2424
<true/>
2525
<key>UILaunchStoryboardName</key>

changelog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
### Changelog
22

3+
- **4.0.1**
4+
- Bugfix/Improvement: Added @objc tags for Xcode projects that are built with no Objc inference.
5+
36
- **4.0**:
47
- Feature: Migration to Swift 4
58

iOSDFULibrary.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = "iOSDFULibrary"
11-
s.version = "4.0.0"
11+
s.version = "4.0.1"
1212
s.summary = "This repository contains a tested library for iOS 8+ devices to perform Device Firmware Update on the nRF5x devices"
1313
s.description = <<-DESC
1414
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/DFUPeripheralSelectorDelegate.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ import CoreBluetooth
5757

5858
- returns: true (YES) if given peripheral is what service is looking for
5959
*/
60-
func select(_ peripheral: CBPeripheral, advertisementData: [String : AnyObject], RSSI: NSNumber, hint name: String?) -> Bool
60+
@objc func select(_ peripheral: CBPeripheral, advertisementData: [String : AnyObject], RSSI: NSNumber, hint name: String?) -> Bool
6161

6262
/**
6363
Returns an optional list of services that the scanner will use to filter advertising packets
@@ -72,5 +72,5 @@ import CoreBluetooth
7272

7373
- returns: an optional list of services or nil
7474
*/
75-
func filterBy(hint dfuServiceUUID: CBUUID) -> [CBUUID]?
75+
@objc func filterBy(hint dfuServiceUUID: CBUUID) -> [CBUUID]?
7676
}

iOSDFULibrary/Classes/Implementation/DFUServiceController.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import CoreBluetooth
3939
next Packet Receipt Notification. Otherwise it will continue to send Op Codes and pause before sending the first bytes
4040
of the firmware. With Packet Receipt Notifications disabled it is the only moment when upload may be paused.
4141
*/
42-
public func pause() {
42+
@objc public func pause() {
4343
guard let executor = executor, !servicePaused, !serviceAborted else { return }
4444
if executor.pause() {
4545
servicePaused = true
@@ -49,7 +49,7 @@ import CoreBluetooth
4949
/**
5050
Call this method to resume the paused transffer, otherwise does nothing.
5151
*/
52-
public func resume() {
52+
@objc public func resume() {
5353
guard let executor = executor, servicePaused, !serviceAborted else { return }
5454
if executor.resume() {
5555
servicePaused = false
@@ -67,7 +67,7 @@ import CoreBluetooth
6767

6868
- returns: true if DFU has been aborted.
6969
*/
70-
public func abort() -> Bool {
70+
@objc public func abort() -> Bool {
7171
guard let executor = executor, !serviceAborted else { return serviceAborted }
7272
serviceAborted = true
7373
servicePaused = false
@@ -77,7 +77,7 @@ import CoreBluetooth
7777
/**
7878
Starts again aborted DFU operation.
7979
*/
80-
public func restart() {
80+
@objc public func restart() {
8181
guard let executor = executor, serviceAborted else { return }
8282
serviceAborted = false
8383
servicePaused = false
@@ -87,14 +87,14 @@ import CoreBluetooth
8787
/**
8888
Returns true if DFU operation has been paused.
8989
*/
90-
public var paused: Bool {
90+
@objc public var paused: Bool {
9191
return servicePaused
9292
}
9393

9494
/**
9595
Returns true if DFU operation has been aborted.
9696
*/
97-
public var aborted: Bool {
97+
@objc public var aborted: Bool {
9898
return serviceAborted
9999
}
100100
}

iOSDFULibrary/Classes/Implementation/DFUServiceDelegate.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
- parameter currentSpeedBytesPerSecond: the current speed in bytes per second
144144
- parameter avgSpeedBytesPerSecond: the average speed in bytes per second
145145
*/
146-
func dfuProgressDidChange(for part: Int, outOf totalParts: Int, to progress: Int,
146+
@objc func dfuProgressDidChange(for part: Int, outOf totalParts: Int, to progress: Int,
147147
currentSpeedBytesPerSecond: Double, avgSpeedBytesPerSecond: Double)
148148
}
149149

@@ -158,7 +158,7 @@
158158

159159
- parameter state: the new state fo the service
160160
*/
161-
func dfuStateDidChange(to state: DFUState)
161+
@objc func dfuStateDidChange(to state: DFUState)
162162

163163
/**
164164
Called after an error occurred.
@@ -169,6 +169,6 @@
169169
- parameter error: the error code
170170
- parameter message: error description
171171
*/
172-
func dfuError(_ error: DFUError, didOccurWithMessage message: String)
172+
@objc func dfuError(_ error: DFUError, didOccurWithMessage message: String)
173173

174174
}

iOSDFULibrary/Classes/Implementation/DFUServiceInitiator.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,18 @@ import CoreBluetooth
4141
The service delegate is an object that will be notified about state changes of the DFU Service.
4242
Setting it is optional but recommended.
4343
*/
44-
public weak var delegate: DFUServiceDelegate?
44+
@objc public weak var delegate: DFUServiceDelegate?
4545

4646
/**
4747
An optional progress delegate will be called only during upload. It notifies about current upload
4848
percentage and speed.
4949
*/
50-
public weak var progressDelegate: DFUProgressDelegate?
50+
@objc public weak var progressDelegate: DFUProgressDelegate?
5151

5252
/**
5353
The logger is an object that should print given messages to the user. It is optional.
5454
*/
55-
public weak var logger: LoggerDelegate?
55+
@objc public weak var logger: LoggerDelegate?
5656

5757
/**
5858
The selector object is used when the device needs to disconnect and start advertising with a different address
@@ -68,7 +68,7 @@ import CoreBluetooth
6868

6969
Ignore this property if not updating Softdevice and Application from one ZIP file or your
7070
*/
71-
public var peripheralSelector: DFUPeripheralSelectorDelegate
71+
@objc public var peripheralSelector: DFUPeripheralSelectorDelegate
7272

7373
/**
7474
The number of packets of firmware data to be received by the DFU target before sending
@@ -78,7 +78,7 @@ import CoreBluetooth
7878
but also cause a buffer overflow and hang the Bluetooth adapter.
7979
Maximum verified values were 29 for iPhone 6 Plus or 22 for iPhone 7, both iOS 10.1.
8080
*/
81-
public var packetReceiptNotificationParameter: UInt16 = 12
81+
@objc public var packetReceiptNotificationParameter: UInt16 = 12
8282

8383
/**
8484
**Legacy DFU only.**
@@ -127,7 +127,7 @@ import CoreBluetooth
127127
if the only service found is the DFU Service. Setting the forceDfu to true (YES) will prevent from
128128
jumping in these both cases.
129129
*/
130-
public var forceDfu = false
130+
@objc public var forceDfu = false
131131

132132
/**
133133
Set this flag to true to enable experimental buttonless feature in Secure DFU. When the
@@ -164,7 +164,7 @@ import CoreBluetooth
164164
passing bond information to the bootloader, encryption, well tested). It is recommended to use this
165165
new service when SDK 13 (or later) is out. TODO: fix the docs when SDK 13 is out.
166166
*/
167-
public var enableUnsafeExperimentalButtonlessServiceInSecureDfu = false
167+
@objc public var enableUnsafeExperimentalButtonlessServiceInSecureDfu = false
168168

169169
//MARK: - Public API
170170

@@ -183,7 +183,7 @@ import CoreBluetooth
183183
- seeAlso: peripheralSelector property - a selector used when scanning for a device in DFU Bootloader mode
184184
in case you want to update a Softdevice and Application from a single ZIP Distribution Packet.
185185
*/
186-
public init(centralManager: CBCentralManager, target: CBPeripheral) {
186+
@objc public init(centralManager: CBCentralManager, target: CBPeripheral) {
187187
self.centralManager = centralManager
188188
// Just to be sure that manager is not scanning
189189
self.centralManager.stopScan()
@@ -201,7 +201,7 @@ import CoreBluetooth
201201

202202
- returns: the initiator instance to allow chain use
203203
*/
204-
public func with(firmware file: DFUFirmware) -> DFUServiceInitiator {
204+
@objc public func with(firmware file: DFUFirmware) -> DFUServiceInitiator {
205205
self.file = file
206206
return self
207207
}
@@ -219,7 +219,7 @@ import CoreBluetooth
219219

220220
- returns: A DFUServiceController object that can be used to control the DFU operation.
221221
*/
222-
public func start() -> DFUServiceController? {
222+
@objc public func start() -> DFUServiceController? {
223223
// The firmware file must be specified before calling `start()`
224224
if file == nil {
225225
delegate?.dfuError(.fileNotSpecified, didOccurWithMessage: "Firmare not specified")

iOSDFULibrary/Classes/Implementation/Firmware/DFUFirmware.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,22 @@
4646
internal let stream: DFUStream?
4747

4848
/// The name of the firmware file.
49-
public let fileName: String?
49+
@objc public let fileName: String?
5050
/// The URL to the firmware file.
51-
public let fileUrl: URL?
51+
@objc public let fileUrl: URL?
5252

5353
/// Information whether the firmware was successfully initialized.
54-
public var valid: Bool {
54+
@objc public var valid: Bool {
5555
return stream != nil
5656
}
5757

5858
/// The size of each component of the firmware.
59-
public var size: DFUFirmwareSize {
59+
@objc public var size: DFUFirmwareSize {
6060
return stream!.size
6161
}
6262

6363
/// Number of connectinos required to transfer the firmware. This does not include the connection needed to switch to the DFU mode.
64-
public var parts: Int {
64+
@objc public var parts: Int {
6565
if stream == nil {
6666
return 0
6767
}
@@ -89,7 +89,7 @@
8989

9090
- returns: the DFU firmware object or null in case of an error
9191
*/
92-
convenience public init?(urlToZipFile: URL) {
92+
@objc convenience public init?(urlToZipFile: URL) {
9393
self.init(urlToZipFile: urlToZipFile, type: DFUFirmwareType.softdeviceBootloaderApplication)
9494
}
9595

@@ -103,7 +103,7 @@
103103

104104
- returns: the DFU firmware object or null in case of an error
105105
*/
106-
public init?(urlToZipFile: URL, type: DFUFirmwareType) {
106+
@objc public init?(urlToZipFile: URL, type: DFUFirmwareType) {
107107
fileUrl = urlToZipFile
108108
fileName = urlToZipFile.lastPathComponent
109109

@@ -136,7 +136,7 @@
136136

137137
- returns: the DFU firmware object or null in case of an error
138138
*/
139-
convenience public init?(zipFile: Data) {
139+
@objc convenience public init?(zipFile: Data) {
140140
self.init(zipFile: zipFile, type: DFUFirmwareType.softdeviceBootloaderApplication)
141141
}
142142

@@ -150,7 +150,7 @@
150150

151151
- returns: the DFU firmware object or null in case of an error
152152
*/
153-
public init?(zipFile: Data, type: DFUFirmwareType) {
153+
@objc public init?(zipFile: Data, type: DFUFirmwareType) {
154154
fileUrl = nil
155155
fileName = nil
156156

@@ -175,7 +175,7 @@
175175

176176
- returns: the DFU firmware object or null in case of an error
177177
*/
178-
public init?(urlToBinOrHexFile: URL, urlToDatFile: URL?, type: DFUFirmwareType) {
178+
@objc public init?(urlToBinOrHexFile: URL, urlToDatFile: URL?, type: DFUFirmwareType) {
179179
fileUrl = urlToBinOrHexFile
180180
fileName = urlToBinOrHexFile.lastPathComponent
181181

@@ -218,7 +218,7 @@
218218

219219
- returns: the DFU firmware object or null in case of an error
220220
*/
221-
public init?(binFile: Data, datFile: Data?, type: DFUFirmwareType) {
221+
@objc public init?(binFile: Data, datFile: Data?, type: DFUFirmwareType) {
222222
fileUrl = nil
223223
fileName = nil
224224

@@ -236,7 +236,7 @@
236236

237237
- returns: the DFU firmware object or null in case of an error
238238
*/
239-
public init?(hexFile: Data, datFile: Data?, type: DFUFirmwareType) {
239+
@objc public init?(hexFile: Data, datFile: Data?, type: DFUFirmwareType) {
240240
fileUrl = nil
241241
fileName = nil
242242

iOSDFULibrary/Classes/Utilities/Logging/LoggerDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,5 @@ Log level. Logger application may filter log entries based on their level. Level
7171
- parameter level: the log level
7272
- parameter message: the message
7373
*/
74-
func logWith(_ level: LogLevel, message: String)
74+
@objc func logWith(_ level: LogLevel, message: String)
7575
}

0 commit comments

Comments
 (0)