Skip to content

Commit

Permalink
Extended coverage of unit testing
Browse files Browse the repository at this point in the history
- Also added compatibility with BLEBee 2.0.0
  • Loading branch information
mcrollin committed Nov 18, 2015
1 parent 33ce989 commit 3380a2b
Show file tree
Hide file tree
Showing 20 changed files with 294 additions and 72 deletions.
61 changes: 57 additions & 4 deletions Drivecast.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
49B0FA2F1BD0105A0078490C /* SDCAboutViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49B0FA2E1BD0105A0078490C /* SDCAboutViewModel.swift */; };
49B0FA311BD01CF10078490C /* SDCSignInViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49B0FA301BD01CF10078490C /* SDCSignInViewController.swift */; };
49B0FA331BD051AF0078490C /* SDCMeasurementColorLUT.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49B0FA321BD051AF0078490C /* SDCMeasurementColorLUT.swift */; };
49B473AF1BFB338700A3AC51 /* SDCMeasurementColorLUTTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49B473AE1BFB338700A3AC51 /* SDCMeasurementColorLUTTests.swift */; };
49B473B01BFB33A800A3AC51 /* SDCMeasurementColorLUT.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49B0FA321BD051AF0078490C /* SDCMeasurementColorLUT.swift */; };
49B473B21BFB51CE00A3AC51 /* SDCSafecastAPIRouterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49B473B11BFB51CE00A3AC51 /* SDCSafecastAPIRouterTests.swift */; };
49B473B31BFB51E200A3AC51 /* SDCSafecastAPIRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49FC9A801BCFB852006FA40E /* SDCSafecastAPIRouter.swift */; };
49B473B41BFB542900A3AC51 /* SDCConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49FC9A891BCFB852006FA40E /* SDCConfiguration.swift */; };
49B948051BE4CD380019507C /* SDCDashboardImportLogOpenMapCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49B948041BE4CD380019507C /* SDCDashboardImportLogOpenMapCell.swift */; };
49C04EB91BE11268002B7703 /* SDCDashboardImportLogDetailsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49C04EB81BE11268002B7703 /* SDCDashboardImportLogDetailsCell.swift */; };
49C04EBB1BE11285002B7703 /* SDCDashboardImportLogHeaderCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49C04EBA1BE11285002B7703 /* SDCDashboardImportLogHeaderCell.swift */; };
Expand All @@ -49,8 +54,10 @@
49DAC9D01BD5B48400CD300F /* CLLocationDistance.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49DAC9CF1BD5B48400CD300F /* CLLocationDistance.swift */; };
49DAC9D21BD5B58E00CD300F /* NSTimeInterval.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49DAC9D11BD5B58E00CD300F /* NSTimeInterval.swift */; };
49DAC9D41BD5B75E00CD300F /* NSTimer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49DAC9D31BD5B75E00CD300F /* NSTimer.swift */; };
49F03F221BFA269600B54CE5 /* SDCLogParserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49F03F211BFA269600B54CE5 /* SDCLogParserTests.swift */; };
49F03F231BFA273800B54CE5 /* SDCLogParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4920F8BA1BD461A4001D3C16 /* SDCLogParser.swift */; };
49F03F241BFA285C00B54CE5 /* DCTLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49FC9A751BCFB852006FA40E /* DCTLog.swift */; };
49FC9A221BCFB5D4006FA40E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49FC9A211BCFB5D4006FA40E /* AppDelegate.swift */; };
49FC9A371BCFB5D4006FA40E /* DrivecastTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49FC9A361BCFB5D4006FA40E /* DrivecastTests.swift */; };
49FC9A421BCFB5D4006FA40E /* DrivecastUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49FC9A411BCFB5D4006FA40E /* DrivecastUITests.swift */; };
49FC9A581BCFB79D006FA40E /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 49FC9A571BCFB79D006FA40E /* MapKit.framework */; };
49FC9A901BCFB852006FA40E /* JSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49FC9A6F1BCFB852006FA40E /* JSON.swift */; };
Expand Down Expand Up @@ -127,6 +134,8 @@
49B0FA2E1BD0105A0078490C /* SDCAboutViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SDCAboutViewModel.swift; sourceTree = "<group>"; };
49B0FA301BD01CF10078490C /* SDCSignInViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SDCSignInViewController.swift; sourceTree = "<group>"; };
49B0FA321BD051AF0078490C /* SDCMeasurementColorLUT.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SDCMeasurementColorLUT.swift; sourceTree = "<group>"; };
49B473AE1BFB338700A3AC51 /* SDCMeasurementColorLUTTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SDCMeasurementColorLUTTests.swift; sourceTree = "<group>"; };
49B473B11BFB51CE00A3AC51 /* SDCSafecastAPIRouterTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SDCSafecastAPIRouterTests.swift; sourceTree = "<group>"; };
49B948041BE4CD380019507C /* SDCDashboardImportLogOpenMapCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SDCDashboardImportLogOpenMapCell.swift; sourceTree = "<group>"; };
49C04EB81BE11268002B7703 /* SDCDashboardImportLogDetailsCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SDCDashboardImportLogDetailsCell.swift; sourceTree = "<group>"; };
49C04EBA1BE11285002B7703 /* SDCDashboardImportLogHeaderCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SDCDashboardImportLogHeaderCell.swift; sourceTree = "<group>"; };
Expand All @@ -140,11 +149,12 @@
49DAC9CF1BD5B48400CD300F /* CLLocationDistance.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CLLocationDistance.swift; sourceTree = "<group>"; };
49DAC9D11BD5B58E00CD300F /* NSTimeInterval.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSTimeInterval.swift; sourceTree = "<group>"; };
49DAC9D31BD5B75E00CD300F /* NSTimer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSTimer.swift; sourceTree = "<group>"; };
49F03F201BFA269600B54CE5 /* DrivecastTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "DrivecastTests-Bridging-Header.h"; sourceTree = "<group>"; };
49F03F211BFA269600B54CE5 /* SDCLogParserTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SDCLogParserTests.swift; sourceTree = "<group>"; };
49FC9A1E1BCFB5D4006FA40E /* Drivecast.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Drivecast.app; sourceTree = BUILT_PRODUCTS_DIR; };
49FC9A211BCFB5D4006FA40E /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
49FC9A2D1BCFB5D4006FA40E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
49FC9A321BCFB5D4006FA40E /* DrivecastTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DrivecastTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
49FC9A361BCFB5D4006FA40E /* DrivecastTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DrivecastTests.swift; sourceTree = "<group>"; };
49FC9A381BCFB5D4006FA40E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
49FC9A3D1BCFB5D4006FA40E /* DrivecastUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DrivecastUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
49FC9A411BCFB5D4006FA40E /* DrivecastUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DrivecastUITests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -204,6 +214,23 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
49F03F1E1BFA264800B54CE5 /* Libraries */ = {
isa = PBXGroup;
children = (
49F03F211BFA269600B54CE5 /* SDCLogParserTests.swift */,
49B473AE1BFB338700A3AC51 /* SDCMeasurementColorLUTTests.swift */,
49B473B11BFB51CE00A3AC51 /* SDCSafecastAPIRouterTests.swift */,
);
path = Libraries;
sourceTree = "<group>";
};
49F03F1F1BFA264B00B54CE5 /* Models */ = {
isa = PBXGroup;
children = (
);
path = Models;
sourceTree = "<group>";
};
49FC9A151BCFB5D4006FA40E = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -248,7 +275,9 @@
49FC9A351BCFB5D4006FA40E /* DrivecastTests */ = {
isa = PBXGroup;
children = (
49FC9A361BCFB5D4006FA40E /* DrivecastTests.swift */,
49F03F1F1BFA264B00B54CE5 /* Models */,
49F03F1E1BFA264800B54CE5 /* Libraries */,
49F03F201BFA269600B54CE5 /* DrivecastTests-Bridging-Header.h */,
49FC9A381BCFB5D4006FA40E /* Info.plist */,
);
path = DrivecastTests;
Expand Down Expand Up @@ -484,6 +513,7 @@
49FC9A161BCFB5D4006FA40E /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0710;
LastUpgradeCheck = 0700;
ORGANIZATIONNAME = Safecast;
TargetAttributes = {
Expand Down Expand Up @@ -691,7 +721,14 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
49FC9A371BCFB5D4006FA40E /* DrivecastTests.swift in Sources */,
49B473B21BFB51CE00A3AC51 /* SDCSafecastAPIRouterTests.swift in Sources */,
49F03F231BFA273800B54CE5 /* SDCLogParser.swift in Sources */,
49B473B31BFB51E200A3AC51 /* SDCSafecastAPIRouter.swift in Sources */,
49B473B41BFB542900A3AC51 /* SDCConfiguration.swift in Sources */,
49B473AF1BFB338700A3AC51 /* SDCMeasurementColorLUTTests.swift in Sources */,
49F03F221BFA269600B54CE5 /* SDCLogParserTests.swift in Sources */,
49F03F241BFA285C00B54CE5 /* DCTLog.swift in Sources */,
49B473B01BFB33A800A3AC51 /* SDCMeasurementColorLUT.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -827,6 +864,7 @@
baseConfigurationReference = 56B8D662FA9703DECFEE8609 /* Pods.production debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -837,6 +875,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.momokoito.drivecast;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = "Production Debug";
};
Expand All @@ -845,6 +884,7 @@
baseConfigurationReference = E5331C90BAAD6850DDEB09A6 /* Pods.production release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Distribution";
COPY_PHASE_STRIP = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -862,10 +902,13 @@
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ENABLE_MODULES = YES;
INFOPLIST_FILE = DrivecastTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.momokoito.DrivecastTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "DrivecastTests/DrivecastTests-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Drivecast.app/Drivecast";
};
name = "Production Debug";
Expand All @@ -874,10 +917,12 @@
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ENABLE_MODULES = YES;
INFOPLIST_FILE = DrivecastTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.momokoito.DrivecastTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "DrivecastTests/DrivecastTests-Bridging-Header.h";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Drivecast.app/Drivecast";
};
name = "Production Release";
Expand Down Expand Up @@ -956,6 +1001,7 @@
baseConfigurationReference = 8D72FD4BB90C87934F44102E /* Pods.staging debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -966,17 +1012,21 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.momokoito.drivecast;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = "Staging Debug";
};
49FC9A511BCFB5E0006FA40E /* Staging Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ENABLE_MODULES = YES;
INFOPLIST_FILE = DrivecastTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.momokoito.DrivecastTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "DrivecastTests/DrivecastTests-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Drivecast.app/Drivecast";
};
name = "Staging Debug";
Expand Down Expand Up @@ -1038,6 +1088,7 @@
baseConfigurationReference = BBFF8E9ECA56CCE4BEFC6195 /* Pods.staging release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Distribution";
COPY_PHASE_STRIP = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -1055,10 +1106,12 @@
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ENABLE_MODULES = YES;
INFOPLIST_FILE = DrivecastTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.momokoito.DrivecastTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "DrivecastTests/DrivecastTests-Bridging-Header.h";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Drivecast.app/Drivecast";
};
name = "Staging Release";
Expand Down
2 changes: 1 addition & 1 deletion Drivecast/Extensions/String.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ extension String {
return (self as NSString).substringWithRange(matched.rangeAtIndex(1))
}
} catch {
log(error)
dlog(error)
}

return nil
Expand Down
10 changes: 6 additions & 4 deletions Drivecast/Helpers/DCTLog.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
import Foundation

// Log function displaying details about the dumped object
func log<T>(object: T, filename: NSString = __FILE__, line: Int = __LINE__, funcname: String = __FUNCTION__) {
print(">>> \(filename.lastPathComponent)(\(line)) \(funcname):")
dump(object)
print("")
func dlog<T>(object: T, filename: NSString = __FILE__, line: Int = __LINE__, funcname: String = __FUNCTION__) {
#if DEBUG
print(">>> \(filename.lastPathComponent)(\(line)) \(funcname):")
dump(object)
print("")
#endif
}
2 changes: 1 addition & 1 deletion Drivecast/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>14</string>
<string>15</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
Expand Down
2 changes: 1 addition & 1 deletion Drivecast/Libraries/SDCBluetoothManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ extension SDCBluetoothManager: CBCentralManagerDelegate {

try remotePeripheral?.discover()
} catch {
log(error)
dlog(error)
}
}

Expand Down
3 changes: 2 additions & 1 deletion Drivecast/Libraries/SDCBluetoothRemotePeripheral.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ extension SDCBluetoothRemotePeripheral {

// Sending data by chunk based on the endOfDataMark
for dataString in dataArray {
self.delegate?.remotePeripheralDidSendNewData(self, data: dataString)
let trimmedDataString = dataString.stringByTrimmingCharactersInSet(NSCharacterSet.newlineCharacterSet())
self.delegate?.remotePeripheralDidSendNewData(self, data: trimmedDataString)
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions Drivecast/Libraries/SDCLogParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

import Foundation

/* The format is as follow: $BNRDD,0210,2013-04-11T05:40:51Z,35,0,736,A,3516.1459,N,13614.9700,E,73.50,A,125,0*64
/* The format is as follow: BNRDD,0210,2013-04-11T05:40:51Z,35,0,736,A,3516.1459,N,13614.9700,E,73.50,A,125,0*64

0 - Header : $BNRDD
0 - Header : BNRDD
1 - Device ID : Device serial number. 0210
2 - Date : Date formatted according to iso-8601 standard. Usually uses GMT. 2013-04-11T05:40:51Z
3 - Radiation 1 minute : number of pulses given by the Geiger tube in the last minute. 35 (cpm)
Expand All @@ -30,7 +30,7 @@ import Foundation

extension String {
func parseMeasurementData() -> Dictionary<String, AnyObject>? {
guard self.hasPrefix("$BNRDD") else {
guard self.hasPrefix("BNRDD") else {
return nil
}

Expand Down Expand Up @@ -83,10 +83,10 @@ extension String {
dateStringFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss'Z'"
dateStringFormatter.timeZone = NSTimeZone(name: "UTC")

if let date = dateStringFormatter.dateFromString(self) {
return date
guard let date = dateStringFormatter.dateFromString(self) else {
return NSDate()
}

return NSDate()
return date
}
}
4 changes: 2 additions & 2 deletions Drivecast/Libraries/SDCMeasurementColorLUT.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ struct SDCMeasurementColorLUT {
}

// Retrieves the color based on the index in the table
func colorForIndex(index:Int) -> UIColor {
func colorForIndex(index: Int) -> UIColor {
return UIColor(red: CGFloat(self.r[index]) / 255,
green: CGFloat(self.g[index]) / 255,
blue: CGFloat(self.b[index]) / 255,
alpha: 1.0)
}

// Compute the index for a specific CPM value
func indexForValue(cpm:Int) -> Int {
func indexForValue(cpm: Int) -> Int {
var value = (Double(cpm) - min) * rdiff

if value > 1 {
Expand Down
2 changes: 1 addition & 1 deletion Drivecast/Libraries/SDCSafecastAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ extension SDCSafecastAPI {
guard let _ = string.regexpFind("(Retrieve your API key)") else {
// Retrieve the error message
guard let message = string.regexpFind("\"alert\">&times;</button>([^<]*)") else {
log(string)
dlog(string)

return completion(.Failure(SDCSafecastAPI.UserError.APIKeyCouldNotBeFound("Something wrong happened, please try again later.")))
}
Expand Down
2 changes: 1 addition & 1 deletion Drivecast/Ressources/SDCConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct SDCConfiguration {

struct BGeigie {
// End mark used to parse received data from the device
static let endOfDataMark = "\r\n"
static let endOfDataMark = "$"

// UUID of compatible services for BLE devices
static let dataServiceIdentifiers = [
Expand Down
Loading

0 comments on commit 3380a2b

Please sign in to comment.