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

Commit 0f0d06a

Browse files
committed
changes for mms
1 parent 92b82a7 commit 0f0d06a

24 files changed

+1529
-294
lines changed

ExampleApp/MetaWearApp/AppDelegate.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import UIKit
1010
@main
1111
class AppDelegate: UIResponder, UIApplicationDelegate {
1212

13-
14-
1513
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
1614
// Override point for customization after application launch.
1715
return true

ExampleApp/MetaWearApp/DeviceDetailViewController.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -554,11 +554,11 @@ class DeviceDetailViewController: StaticDataTableViewController, UITextFieldDele
554554
hud.label.text = "Updating..."
555555
device.updateFirmware(delegate: self).continueWith { t in
556556
if let error = t.error {
557-
print("Firmware update error \(error.localizedDescription)")
558-
let alertController = UIAlertController(title: "Update Error", message: "Please re-connect and try again, if you can't connect, try MetaBoot Mode to recover.\nError: \(error.localizedDescription)", preferredStyle: .alert)
559-
alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
560-
self.present(alertController, animated: true, completion: nil)
561557
DispatchQueue.main.async {
558+
print("Firmware update error \(error.localizedDescription)")
559+
let alertController = UIAlertController(title: "Update Error", message: "Please re-connect and try again, if you can't connect, try MetaBoot Mode to recover.\nError: \(error.localizedDescription)", preferredStyle: .alert)
560+
alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
561+
self.present(alertController, animated: true, completion: nil)
562562
self.hud?.hide(animated: true)
563563
}
564564
} else {

ExampleApp/MetaWearApp/Info.plist

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5+
<key>NSAppTransportSecurity</key>
6+
<dict>
7+
<key>NSExceptionDomains</key>
8+
<dict>
9+
<key>mbientlab.com</key>
10+
<dict>
11+
<key>NSExceptionAllowsInsecureHTTPLoads</key>
12+
<true/>
13+
<key>NSIncludesSubdomains</key>
14+
<true/>
15+
</dict>
16+
</dict>
17+
</dict>
518
<key>CFBundleDevelopmentRegion</key>
619
<string>$(DEVELOPMENT_LANGUAGE)</string>
720
<key>CFBundleDisplayName</key>

MetaWear.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
1616
:tag => s.version.to_s, :submodules => true }
1717

1818
s.platform = :ios, :osx, :tvos, :watchos
19-
s.ios.deployment_target = '10.0'
19+
s.ios.deployment_target = '12.1'
2020
s.osx.deployment_target = '10.14'
2121
s.tvos.deployment_target = '10.0'
2222
s.watchos.deployment_target = '4.0'

MetaWear/AsyncUtils/MblMwDataSignal+Async.swift

Lines changed: 233 additions & 46 deletions
Large diffs are not rendered by default.

MetaWear/AsyncUtils/MetaWear+Async.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ extension OpaquePointer {
6161
mbl_mw_metawearboard_tear_down(self)
6262
mbl_mw_logging_clear_entries(self)
6363
mbl_mw_macro_erase_all(self)
64-
mbl_mw_debug_reset_after_gc(self)
65-
mbl_mw_debug_disconnect(self)
64+
mbl_mw_debug_reset_after_gc(self) //05
65+
mbl_mw_debug_disconnect(self) //06
6666
}
6767

6868
/// Tasky interface to mbl_mw_macro_end_record

MetaWear/Core/MetaWearData.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ extension MblMwData {
5757
typeId: type_id)
5858
}
5959
public var timestamp: Date {
60-
return Date(timeIntervalSince1970: Double(epoch) / 1000.0)
60+
let date = Date(timeIntervalSince1970: Double(epoch) / 1000.0)
61+
let milliseconds = epoch%1000
62+
return Calendar.current.date(byAdding: .nanosecond, value: Int(milliseconds), to: date)!
6163
}
6264
public func valueAs<T>() -> T {
6365
return doTheParse(length: length, type_id: type_id, value: value)
@@ -115,6 +117,8 @@ fileprivate func doTheParse<T>(length: UInt8, type_id: MblMwDataTypeId, value: U
115117
assert(T.self == MblMwBtleAddress.self)
116118
case MBL_MW_DT_ID_BOSCH_ANY_MOTION:
117119
assert(T.self == MblMwBoschAnyMotion.self)
120+
case MBL_MW_DT_ID_BOSCH_GESTURE:
121+
assert(T.self == MblMwBoschGestureType.self)
118122
case MBL_MW_DT_ID_CALIBRATION_STATE:
119123
assert(T.self == MblMwCalibrationState.self)
120124
case MBL_MW_DT_ID_BOSCH_TAP:

MetaWear/MetaWear-SDK-Cpp

Submodule MetaWear-SDK-Cpp updated 227 files

MetaWear/MetaWear.xcodeproj/project.pbxproj

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@
5757
6F8D972C1AF668270B9DA1C1 /* Pods_MetaWear_MetaWear_tvOS_MetaWearIntegrationTestHost_tvOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FE2A1E686EA067BA1F21C94C /* Pods_MetaWear_MetaWear_tvOS_MetaWearIntegrationTestHost_tvOS.framework */; };
5858
7DFB8E3E757AA59FB6B87556 /* Pods_MetaWear_MetaWear_tvOS_MetaWearUnitTests_tvOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D098693F507F95523CEC2456 /* Pods_MetaWear_MetaWear_tvOS_MetaWearUnitTests_tvOS.framework */; };
5959
8AEA9C538942199830BE7B6B /* Pods_MetaWearIntegrationTests_macOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AFEB932F09D8B4BB720E75C2 /* Pods_MetaWearIntegrationTests_macOS.framework */; };
60+
ABB5532025F8316500F36FEC /* LoggingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABB5531F25F8316500F36FEC /* LoggingTests.swift */; };
61+
ABB5532125F8316500F36FEC /* LoggingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABB5531F25F8316500F36FEC /* LoggingTests.swift */; };
62+
ABB5532225F8316500F36FEC /* LoggingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABB5531F25F8316500F36FEC /* LoggingTests.swift */; };
63+
ABEEADC325D7580300AD1F88 /* AccelerometerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABEEADC225D7580300AD1F88 /* AccelerometerTests.swift */; };
64+
ABEEADC425D7580300AD1F88 /* AccelerometerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABEEADC225D7580300AD1F88 /* AccelerometerTests.swift */; };
65+
ABEEADC525D7580300AD1F88 /* AccelerometerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABEEADC225D7580300AD1F88 /* AccelerometerTests.swift */; };
66+
ABEEADC725D758FF00AD1F88 /* GyroscopeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABEEADC625D758FF00AD1F88 /* GyroscopeTests.swift */; };
67+
ABEEADC825D758FF00AD1F88 /* GyroscopeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABEEADC625D758FF00AD1F88 /* GyroscopeTests.swift */; };
68+
ABEEADC925D758FF00AD1F88 /* GyroscopeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABEEADC625D758FF00AD1F88 /* GyroscopeTests.swift */; };
6069
C0BE9E70E4089C6F08FE590F /* Pods_MetaWear_MetaWear_iOS_MetaWearUnitTests_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E017EC1F72EA22D0ACD7A0B1 /* Pods_MetaWear_MetaWear_iOS_MetaWearUnitTests_iOS.framework */; };
6170
F341671D79CCAF86AEAA9A5A /* Pods_MetaWear_MetaWear_macOS_MetaWearUnitTests_macOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 36EF3C0A2070835EA6973292 /* Pods_MetaWear_MetaWear_macOS_MetaWearUnitTests_macOS.framework */; };
6271
/* End PBXBuildFile section */
@@ -201,6 +210,9 @@
201210
9A48D104D1B7CCF64BA84E3D /* Pods_MetaWear_MetaWear_watchOS_MetaWearIntegrationTestHost_watchOS_Extension.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MetaWear_MetaWear_watchOS_MetaWearIntegrationTestHost_watchOS_Extension.framework; sourceTree = BUILT_PRODUCTS_DIR; };
202211
9D2CC86004B9E8F7F816C2E3 /* Pods-MetaWear-MetaWear-iOS-MetaWearUnitTests-iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MetaWear-MetaWear-iOS-MetaWearUnitTests-iOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-MetaWear-MetaWear-iOS-MetaWearUnitTests-iOS/Pods-MetaWear-MetaWear-iOS-MetaWearUnitTests-iOS.debug.xcconfig"; sourceTree = "<group>"; };
203212
AB6940A7253774BF00DA83FC /* LICENSE.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = LICENSE.md; path = ../LICENSE.md; sourceTree = "<group>"; };
213+
ABB5531F25F8316500F36FEC /* LoggingTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoggingTests.swift; sourceTree = "<group>"; };
214+
ABEEADC225D7580300AD1F88 /* AccelerometerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccelerometerTests.swift; sourceTree = "<group>"; };
215+
ABEEADC625D758FF00AD1F88 /* GyroscopeTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GyroscopeTests.swift; sourceTree = "<group>"; };
204216
AD660D07C46FF62D5D8493F0 /* Pods-MetaWear-MetaWear-tvOS-MetaWearIntegrationTestHost-tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MetaWear-MetaWear-tvOS-MetaWearIntegrationTestHost-tvOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-MetaWear-MetaWear-tvOS-MetaWearIntegrationTestHost-tvOS/Pods-MetaWear-MetaWear-tvOS-MetaWearIntegrationTestHost-tvOS.debug.xcconfig"; sourceTree = "<group>"; };
205217
AE0F4B5B1D12FF6A9AD72AE2 /* Pods_MetaWearIntegrationTests_tvOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MetaWearIntegrationTests_tvOS.framework; sourceTree = BUILT_PRODUCTS_DIR; };
206218
AF8C92E37F4F0E39DD4A3179 /* Pods-MetaWear-MetaWear-tvOS-MetaWearUnitTests-tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MetaWear-MetaWear-tvOS-MetaWearUnitTests-tvOS.release.xcconfig"; path = "Pods/Target Support Files/Pods-MetaWear-MetaWear-tvOS-MetaWearUnitTests-tvOS/Pods-MetaWear-MetaWear-tvOS-MetaWearUnitTests-tvOS.release.xcconfig"; sourceTree = "<group>"; };
@@ -406,6 +418,9 @@
406418
children = (
407419
404057B0209A7CB700591D6B /* ManualTests.swift */,
408420
404057B1209A7CB700591D6B /* Tests.swift */,
421+
ABEEADC225D7580300AD1F88 /* AccelerometerTests.swift */,
422+
ABEEADC625D758FF00AD1F88 /* GyroscopeTests.swift */,
423+
ABB5531F25F8316500F36FEC /* LoggingTests.swift */,
409424
);
410425
path = Integration;
411426
sourceTree = "<group>";
@@ -778,7 +793,7 @@
778793
attributes = {
779794
CLASSPREFIX = MBL;
780795
LastSwiftUpdateCheck = 0930;
781-
LastUpgradeCheck = 1130;
796+
LastUpgradeCheck = 1240;
782797
ORGANIZATIONNAME = "Stephen Schiffli";
783798
TargetAttributes = {
784799
40405831209A83CA00591D6B = {
@@ -1366,6 +1381,9 @@
13661381
isa = PBXSourcesBuildPhase;
13671382
buildActionMask = 2147483647;
13681383
files = (
1384+
ABB5532025F8316500F36FEC /* LoggingTests.swift in Sources */,
1385+
ABEEADC325D7580300AD1F88 /* AccelerometerTests.swift in Sources */,
1386+
ABEEADC725D758FF00AD1F88 /* GyroscopeTests.swift in Sources */,
13691387
4058ABC5211D10A600A50323 /* Tests.swift in Sources */,
13701388
4058ABC6211D10AA00A50323 /* ManualTests.swift in Sources */,
13711389
);
@@ -1393,6 +1411,9 @@
13931411
isa = PBXSourcesBuildPhase;
13941412
buildActionMask = 2147483647;
13951413
files = (
1414+
ABB5532225F8316500F36FEC /* LoggingTests.swift in Sources */,
1415+
ABEEADC525D7580300AD1F88 /* AccelerometerTests.swift in Sources */,
1416+
ABEEADC925D758FF00AD1F88 /* GyroscopeTests.swift in Sources */,
13961417
404057B4209A7CB700591D6B /* ManualTests.swift in Sources */,
13971418
404057B7209A7CB700591D6B /* Tests.swift in Sources */,
13981419
);
@@ -1411,6 +1432,9 @@
14111432
isa = PBXSourcesBuildPhase;
14121433
buildActionMask = 2147483647;
14131434
files = (
1435+
ABB5532125F8316500F36FEC /* LoggingTests.swift in Sources */,
1436+
ABEEADC425D7580300AD1F88 /* AccelerometerTests.swift in Sources */,
1437+
ABEEADC825D758FF00AD1F88 /* GyroscopeTests.swift in Sources */,
14141438
404057B3209A7CB700591D6B /* ManualTests.swift in Sources */,
14151439
404057B6209A7CB700591D6B /* Tests.swift in Sources */,
14161440
);
@@ -2033,6 +2057,7 @@
20332057
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
20342058
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
20352059
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
2060+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
20362061
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
20372062
CLANG_WARN_STRICT_PROTOTYPES = YES;
20382063
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -2057,13 +2082,13 @@
20572082
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
20582083
GCC_WARN_UNUSED_FUNCTION = YES;
20592084
GCC_WARN_UNUSED_VARIABLE = YES;
2060-
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
2085+
IPHONEOS_DEPLOYMENT_TARGET = 12.1;
20612086
MACOSX_DEPLOYMENT_TARGET = 10.14;
20622087
ONLY_ACTIVE_ARCH = YES;
20632088
SDKROOT = iphoneos;
20642089
SWIFT_VERSION = 5.0;
20652090
TARGETED_DEVICE_FAMILY = "1,2";
2066-
TVOS_DEPLOYMENT_TARGET = 10.0;
2091+
TVOS_DEPLOYMENT_TARGET = 12.0;
20672092
WATCHOS_DEPLOYMENT_TARGET = 4.0;
20682093
};
20692094
name = Debug;
@@ -2091,6 +2116,7 @@
20912116
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
20922117
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
20932118
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
2119+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
20942120
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
20952121
CLANG_WARN_STRICT_PROTOTYPES = YES;
20962122
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -2108,13 +2134,13 @@
21082134
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
21092135
GCC_WARN_UNUSED_FUNCTION = YES;
21102136
GCC_WARN_UNUSED_VARIABLE = YES;
2111-
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
2137+
IPHONEOS_DEPLOYMENT_TARGET = 12.1;
21122138
MACOSX_DEPLOYMENT_TARGET = 10.14;
21132139
SDKROOT = iphoneos;
21142140
SWIFT_COMPILATION_MODE = wholemodule;
21152141
SWIFT_VERSION = 5.0;
21162142
TARGETED_DEVICE_FAMILY = "1,2";
2117-
TVOS_DEPLOYMENT_TARGET = 10.0;
2143+
TVOS_DEPLOYMENT_TARGET = 12.0;
21182144
VALIDATE_PRODUCT = YES;
21192145
WATCHOS_DEPLOYMENT_TARGET = 4.0;
21202146
};

MetaWear/MetaWear.xcodeproj/xcshareddata/xcschemes/MetaWearDFU.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1130"
3+
LastUpgradeVersion = "1240"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

0 commit comments

Comments
 (0)