Skip to content
This repository was archived by the owner on Jul 20, 2025. It is now read-only.

Commit af953e0

Browse files
author
Stephen Schiffli
committed
Merge branch 'release-3.1.5'
2 parents 9f1088d + bea4ca8 commit af953e0

File tree

26 files changed

+62
-130
lines changed

26 files changed

+62
-130
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 3.1.4
2+
current_version = 3.1.5
33

44
[bumpversion:file:Docs/source/conf.py]
55

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "MetaWear/MetaWear-SDK-Cpp"]
22
path = MetaWear/MetaWear-SDK-Cpp
3-
url = git@github.com:mbientlab/MetaWear-SDK-Cpp.git
3+
url = https://github.com/mbientlab/MetaWear-SDK-Cpp.git

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Added
9+
- Bluetooth State Restoration on MetaWearScanner.shared
10+
11+
### Changed
12+
- CPP submodule accessed with https instead of git protocol
813

914
## [3.1.4] - 2018-07-23
1015

Docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@
5555
# built documents.
5656
#
5757
# The short X.Y version.
58-
version = '3.1.4'
58+
version = '3.1.5'
5959
# The full version, including alpha/beta/rc tags.
60-
release = '3.1.4'
60+
release = '3.1.5'
6161

6262
# The language for content autogenerated by Sphinx. Refer to documentation
6363
# for a list of supported languages.

Docs/source/project_setup.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ Compile Dependency
99

1010
To add the MetaWear SDK as a dependency to your project you should setup `CocoaPods <https://guides.cocoapods.org/using/getting-started.html>`_, and add the following line to your Podfile: ::
1111

12-
pod "MetaWear"
13-
# Bolts-Swift hasn't pushed the latest Xcode 9 + Swift 4 compatiable version, so require it directly
14-
pod 'Bolts-Swift', :git => 'https://github.com/BoltsFramework/Bolts-Swift.git', :commit => 'e9baa72'
12+
# The subspecs are all optional, but might be useful
13+
pod "MetaWear", :subspecs => ['UI', 'AsyncUtils', 'Mocks', 'DFU']
1514

1615
.. highlight:: console
1716

MetaWear.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'MetaWear'
3-
s.version = '3.1.4'
3+
s.version = '3.1.5'
44
s.license = { :type => 'Commercial', :text => 'See https://www.mbientlab.com/terms/', :file => 'LICENSE' }
55
s.homepage = 'https://mbientlab.com'
66
s.summary = 'iOS/macOS/tvOS/watchOS API and documentation for the MetaWear platform'

MetaWear/AsyncUtils/MblMwDataSignal+Async.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import BoltsSwift
3737
import MetaWearCpp
3838

39+
/// Task wrappers around various CPP functions with callbacks
3940
extension OpaquePointer {
4041
/// Tasky interface to reading a MetaWear data signal
4142
public func read() -> Task<MetaWearData> {

MetaWear/Core/CBUUID.swift

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

3636
import CoreBluetooth
3737

38-
38+
/// Bluetooth ID's used by MetaWear
3939
extension CBUUID {
4040
public static let metaWearService = CBUUID(string: "326A9000-85CB-9195-D9DD-464CFBBAE75A")
4141
public static let metaWearCommand = CBUUID(string: "326A9001-85CB-9195-D9DD-464CFBBAE75A")

MetaWear/Core/MetaWearScanner.swift

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fileprivate var scannerCount = 0
4343
/// Scanner utility, make is simple to start scanning for MetaWear devices without
4444
/// having to understand all of CoreBluetooth
4545
public class MetaWearScanner: NSObject {
46-
public static let shared = MetaWearScanner()
46+
public static let shared = MetaWearScanner(restoreIdentifier: "MetaWearScanner.shared")
4747
public var central: CBCentralManager! = nil
4848
public var deviceMap: [CBPeripheral: MetaWear] = [:]
4949
public var didUpdateState: ((CBCentralManager) -> Void)? {
@@ -52,10 +52,9 @@ public class MetaWearScanner: NSObject {
5252
}
5353
}
5454

55-
public override init() {
55+
public init(restoreIdentifier: String? = nil) {
5656
super.init()
57-
let options: [String : Any] = [:]
58-
//options[CBCentralManagerOptionRestoreIdentifierKey] = restoreIdentifier
57+
let options: [String : Any] = restoreIdentifier == nil ? [:] : [CBCentralManagerOptionRestoreIdentifierKey: restoreIdentifier!]
5958
self.central = CBCentralManager(delegate: self,
6059
queue: bleQueue,
6160
options: options)
@@ -231,22 +230,9 @@ extension MetaWearScanner: CBCentralManagerDelegate {
231230
public func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: Error?) {
232231
deviceMap[peripheral]?.didDisconnectPeripheral(error: error)
233232
}
234-
// public func centralManager(_ central: CBCentralManager, willRestoreState dict: [String : Any]) {
235-
// MetaWearScanner.willRestoreState?(dict)
236-
237-
// An array (an instance of NSArray) of CBPeripheral objects that contains
238-
// all of the peripherals that were connected to the central manager
239-
// (or had a connection pending) at the time the app was terminated by the system.
240-
// let a = dict[CBCentralManagerRestoredStatePeripheralsKey]
241-
242-
// An array (an instance of NSArray) of service UUIDs (represented by CBUUID objects)
243-
// that contains all the services the central manager was scanning for at the
244-
// time the app was terminated by the system.
245-
// let b = dict[CBCentralManagerRestoredStateScanServicesKey]
246-
247-
// A dictionary (an instance of NSDictionary) that contains all of the
248-
// peripheral scan options that were being used by the central manager
249-
// at the time the app was terminated by the system.
250-
// let c = dict[CBCentralManagerRestoredStateScanOptionsKey]
251-
// }
233+
public func centralManager(_ central: CBCentralManager, willRestoreState dict: [String : Any]) {
234+
// As an SDK, we arn't sure what operations the user is acutally doing.
235+
// You should place code in didFinishLaunchingWithOptions to kick off any tasks
236+
// you expect to take place
237+
}
252238
}

MetaWear/Core/String+VersionCompare.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
*/
3535

3636

37+
/// String helper functions
3738
extension String {
3839
/// Inner comparison utility to handle same versions with different length. (Ex: "1.0.0" & "1.0")
3940
private func compare(toVersion targetVersion: String) -> ComparisonResult {

0 commit comments

Comments
 (0)