Skip to content

Commit

Permalink
Merge pull request #48 from LoopKit/dev
Browse files Browse the repository at this point in the history
Version 0.8.0
  • Loading branch information
loudnate authored Sep 30, 2016
2 parents 5cdf2d3 + b9ca1d3 commit f95286d
Show file tree
Hide file tree
Showing 18 changed files with 230 additions and 55 deletions.
6 changes: 3 additions & 3 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- xDripG5 (0.7.0)
- xDripG5 (0.8.0)

DEPENDENCIES:
- xDripG5 (from `../`)
Expand All @@ -9,8 +9,8 @@ EXTERNAL SOURCES:
:path: ../

SPEC CHECKSUMS:
xDripG5: b0bfa28e1dc510799d919ab6a67badb56a024247
xDripG5: 8779a4f495fd8eb81a3d75457afe9b95fb52f61d

PODFILE CHECKSUM: 6b30cba971694d5258509315fb52eb645c9bc5e3

COCOAPODS: 1.1.0.beta.2
COCOAPODS: 1.1.0.rc.2
6 changes: 4 additions & 2 deletions Example/xDripG5.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/* Begin PBXBuildFile section */
06C991A3D94948120AD2A278 /* Pods_xDripG5_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 42011659993839B43D24C553 /* Pods_xDripG5_Example.framework */; };
43846AC21D8F812A00799272 /* Data.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43846AC11D8F812A00799272 /* Data.swift */; };
439FCA211C332AA4007DE84C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 439FCA1F1C332AA4007DE84C /* LaunchScreen.storyboard */; };
439FCA231C332AE5007DE84C /* NSUserDefaults.swift in Sources */ = {isa = PBXBuildFile; fileRef = 439FCA221C332AE5007DE84C /* NSUserDefaults.swift */; };
43E3979F1D569B340028E321 /* HKUnit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43E3979E1D569B340028E321 /* HKUnit.swift */; };
Expand All @@ -19,6 +20,7 @@

/* Begin PBXFileReference section */
42011659993839B43D24C553 /* Pods_xDripG5_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_xDripG5_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
43846AC11D8F812A00799272 /* Data.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Data.swift; sourceTree = "<group>"; };
439FCA201C332AA4007DE84C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
439FCA221C332AE5007DE84C /* NSUserDefaults.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSUserDefaults.swift; sourceTree = "<group>"; };
43E3979E1D569B340028E321 /* HKUnit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HKUnit.swift; path = ../../xDripG5/HKUnit.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -78,6 +80,7 @@
isa = PBXGroup;
children = (
607FACD51AFB9204008FA782 /* AppDelegate.swift */,
43846AC11D8F812A00799272 /* Data.swift */,
43E3979E1D569B340028E321 /* HKUnit.swift */,
439FCA221C332AE5007DE84C /* NSUserDefaults.swift */,
607FACD71AFB9204008FA782 /* ViewController.swift */,
Expand Down Expand Up @@ -246,6 +249,7 @@
buildActionMask = 2147483647;
files = (
607FACD81AFB9204008FA782 /* ViewController.swift in Sources */,
43846AC21D8F812A00799272 /* Data.swift in Sources */,
607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */,
43E3979F1D569B340028E321 /* HKUnit.swift in Sources */,
439FCA231C332AE5007DE84C /* NSUserDefaults.swift in Sources */,
Expand Down Expand Up @@ -365,7 +369,6 @@
isa = XCBuildConfiguration;
baseConfigurationReference = F3147B948B4F90A741304461 /* Pods-xDripG5_Example.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = xDripG5/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand All @@ -381,7 +384,6 @@
isa = XCBuildConfiguration;
baseConfigurationReference = CFBD776BFE02F42998A8820B /* Pods-xDripG5_Example.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = xDripG5/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand Down
8 changes: 8 additions & 0 deletions Example/xDripG5/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate, TransmitterDelegate {
}
}
}

func transmitter(_ transmitter: Transmitter, didReadUnknownData data: Data) {
if let vc = window?.rootViewController as? TransmitterDelegate {
DispatchQueue.main.async {
vc.transmitter(transmitter, didReadUnknownData: data)
}
}
}
}
22 changes: 22 additions & 0 deletions Example/xDripG5/Data.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// Data.swift
// xDripG5
//
// Created by Nate Racklyeft on 9/18/16.
// Copyright © 2016 Nathan Racklyeft. All rights reserved.
//

import Foundation


extension Data {
var hexadecimalString: String {
let string = NSMutableString(capacity: count * 2)

for byte in self {
string.appendFormat("%02x", byte)
}

return string as String
}
}
5 changes: 5 additions & 0 deletions Example/xDripG5/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ class ViewController: UIViewController, TransmitterDelegate, UITextFieldDelegate
let date = glucose.readDate
subtitleLabel.text = DateFormatter.localizedString(from: date, dateStyle: .none, timeStyle: .long)
}

func transmitter(_ transmitter: Transmitter, didReadUnknownData data: Data) {
titleLabel.text = NSLocalizedString("Unknown Data", comment: "Title displayed during unknown data response")
subtitleLabel.text = data.hexadecimalString
}
}


Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# xDripG5

[![CI Status](http://img.shields.io/travis/loudnate/xDripG5.svg?style=flat)](https://travis-ci.org/loudnate/xDripG5)
[![CI Status](http://img.shields.io/travis/LoopKit/xDripG5.svg?style=flat)](https://travis-ci.org/LoopKit/xDripG5)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Version](https://img.shields.io/cocoapods/v/xDripG5.svg?style=flat)](http://cocoapods.org/pods/xDripG5)
[![License](https://img.shields.io/cocoapods/l/xDripG5.svg?style=flat)](http://cocoapods.org/pods/xDripG5)
Expand All @@ -21,7 +21,7 @@ This framework connects to a G5 Mobile Transmitter via Bluetooth LE. It does not
xDripG5 is available through [Carthage](https://github.com/Carthage/Carthage). To install it, add the following line to your Cartfile:

```ruby
github "loudnate/xDripG5"
github "LoopKit/xDripG5"
```

Note that you'll need to confgure your target to link against `CommonCrypto.framework` in addition to `xDripG5.framework`
Expand All @@ -48,7 +48,7 @@ If you plan to run your app alongside the G5 Mobile application, make sure to se

## Code of Conduct

Please note that this project is released with a [Contributor Code of Conduct](https://github.com/loudnate/LoopKit/blob/master/CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
Please note that this project is released with a [Contributor Code of Conduct](https://github.com/LoopKit/LoopKit/blob/master/CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.

## License

Expand Down
7 changes: 3 additions & 4 deletions xDripG5.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "xDripG5"
s.version = "0.7.0"
s.version = "0.8.0"
s.summary = "An interface for communicating with the G5 glucose transmitter over Bluetooth."

s.description = <<-DESC
Expand All @@ -11,11 +11,10 @@ By using this framework in your own app, you can get access to your glucose read
Please note this project is neither created nor backed by Dexcom, Inc. Use of this software is not intended for therapy.
DESC

s.homepage = "https://github.com/loudnate/xDripG5"
s.homepage = "https://github.com/LoopKit/xDripG5"
s.license = 'MIT'
s.author = { "Nathan Racklyeft" => "[email protected]" }
s.source = { :git => "https://github.com/loudnate/xDripG5.git", :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/loudnate'
s.source = { :git => "https://github.com/LoopKit/xDripG5.git", :tag => s.version.to_s }

s.platform = :ios, '9.3'
s.requires_arc = true
Expand Down
32 changes: 24 additions & 8 deletions xDripG5.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
/* Begin PBXBuildFile section */
430D64C51CB7846A00FCA750 /* NSData+CRC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 430D64C41CB7846A00FCA750 /* NSData+CRC.swift */; };
43538C111D81220F0071CA5E /* NSData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43CABE101C350B2800005705 /* NSData.swift */; };
43846AC61D8F896C00799272 /* CalibrationDataRxMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43846AC51D8F896C00799272 /* CalibrationDataRxMessage.swift */; };
43846AC81D8F89BE00799272 /* CalibrationDataRxMessageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43846AC71D8F89BE00799272 /* CalibrationDataRxMessageTests.swift */; };
43880F981D9E19FC009061A8 /* TransmitterVersionRxMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43880F971D9E19FC009061A8 /* TransmitterVersionRxMessage.swift */; };
43880F9A1D9E1BD7009061A8 /* TransmitterVersionRxMessageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43880F991D9E1BD7009061A8 /* TransmitterVersionRxMessageTests.swift */; };
43CABDF71C3506F100005705 /* xDripG5.h in Headers */ = {isa = PBXBuildFile; fileRef = 43CABDF61C3506F100005705 /* xDripG5.h */; settings = {ATTRIBUTES = (Public, ); }; };
43CABDFE1C3506F100005705 /* xDripG5.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 43CABDF31C3506F100005705 /* xDripG5.framework */; };
43CABE121C350B2800005705 /* BluetoothManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43CABE0E1C350B2800005705 /* BluetoothManager.swift */; };
Expand Down Expand Up @@ -74,6 +78,10 @@

/* Begin PBXFileReference section */
430D64C41CB7846A00FCA750 /* NSData+CRC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSData+CRC.swift"; sourceTree = "<group>"; };
43846AC51D8F896C00799272 /* CalibrationDataRxMessage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CalibrationDataRxMessage.swift; sourceTree = "<group>"; };
43846AC71D8F89BE00799272 /* CalibrationDataRxMessageTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CalibrationDataRxMessageTests.swift; sourceTree = "<group>"; };
43880F971D9E19FC009061A8 /* TransmitterVersionRxMessage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransmitterVersionRxMessage.swift; sourceTree = "<group>"; };
43880F991D9E1BD7009061A8 /* TransmitterVersionRxMessageTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransmitterVersionRxMessageTests.swift; sourceTree = "<group>"; };
43CABDF31C3506F100005705 /* xDripG5.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = xDripG5.framework; sourceTree = BUILT_PRODUCTS_DIR; };
43CABDF61C3506F100005705 /* xDripG5.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = xDripG5.h; sourceTree = "<group>"; };
43CABDF81C3506F100005705 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand Down Expand Up @@ -182,13 +190,15 @@
43CABE011C3506F100005705 /* xDripG5Tests */ = {
isa = PBXGroup;
children = (
43E397901D5692080028E321 /* GlucoseTests.swift */,
43846AC71D8F89BE00799272 /* CalibrationDataRxMessageTests.swift */,
43DC87C11C8B520F005BC30D /* GlucoseRxMessageTests.swift */,
43E397901D5692080028E321 /* GlucoseTests.swift */,
43CABE041C3506F100005705 /* Info.plist */,
43DC87BF1C8B509B005BC30D /* NSData.swift */,
43F82BCB1D035AA4006F5DD7 /* TransmitterTimeRxMessageTests.swift */,
43F82BD11D037040006F5DD7 /* SessionStopRxMessageTests.swift */,
43F82BD31D037227006F5DD7 /* SessionStartRxMessageTests.swift */,
43F82BD11D037040006F5DD7 /* SessionStopRxMessageTests.swift */,
43F82BCB1D035AA4006F5DD7 /* TransmitterTimeRxMessageTests.swift */,
43880F991D9E1BD7009061A8 /* TransmitterVersionRxMessageTests.swift */,
);
path = xDripG5Tests;
sourceTree = "<group>";
Expand All @@ -203,6 +213,7 @@
43CE7CCB1CA73BCC003CC1B0 /* BatteryStatusTxMessage.swift */,
43CABE1B1C350B3D00005705 /* BondRequestTxMessage.swift */,
43CE7CD11CA73CBC003CC1B0 /* CalibrateGlucoseTxMessage.swift */,
43846AC51D8F896C00799272 /* CalibrationDataRxMessage.swift */,
43CABE1C1C350B3D00005705 /* DisconnectTxMessage.swift */,
43CE7CC71CA73AEB003CC1B0 /* FirmwareVersionTxMessage.swift */,
43CE7CD31CA73CE8003CC1B0 /* GlucoseHistoryTxMessage.swift */,
Expand All @@ -217,6 +228,7 @@
43CABE211C350B3D00005705 /* TransmitterTimeRxMessage.swift */,
43CABE221C350B3D00005705 /* TransmitterTimeTxMessage.swift */,
43CE7CC91CA73B94003CC1B0 /* TransmitterVersionTxMessage.swift */,
43880F971D9E19FC009061A8 /* TransmitterVersionRxMessage.swift */,
);
path = Messages;
sourceTree = "<group>";
Expand Down Expand Up @@ -281,7 +293,7 @@
attributes = {
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0800;
ORGANIZATIONNAME = "Nathan Racklyeft";
ORGANIZATIONNAME = "LoopKit Authors";
TargetAttributes = {
43CABDF21C3506F100005705 = {
CreatedOnToolsVersion = 7.2;
Expand Down Expand Up @@ -343,13 +355,15 @@
43CABE261C350B3D00005705 /* AuthStatusRxMessage.swift in Sources */,
43CE7CD41CA73CE8003CC1B0 /* GlucoseHistoryTxMessage.swift in Sources */,
43E397931D56950C0028E321 /* HKUnit.swift in Sources */,
43846AC61D8F896C00799272 /* CalibrationDataRxMessage.swift in Sources */,
43CE7CD01CA73C57003CC1B0 /* SessionStopTxMessage.swift in Sources */,
43CABE2A1C350B3D00005705 /* GlucoseTxMessage.swift in Sources */,
43CE7CC81CA73AEB003CC1B0 /* FirmwareVersionTxMessage.swift in Sources */,
43CE7CCC1CA73BCC003CC1B0 /* BatteryStatusTxMessage.swift in Sources */,
43EEA7121D14DC0800CBBDA0 /* AESCrypt.m in Sources */,
43CE7CCE1CA73C22003CC1B0 /* SessionStartTxMessage.swift in Sources */,
43CABE2E1C350B3D00005705 /* TransmitterTimeTxMessage.swift in Sources */,
43880F981D9E19FC009061A8 /* TransmitterVersionRxMessage.swift in Sources */,
43538C111D81220F0071CA5E /* NSData.swift in Sources */,
43CABE2C1C350B3D00005705 /* TransmitterMessage.swift in Sources */,
43CABE131C350B2800005705 /* BluetoothServices.swift in Sources */,
Expand All @@ -373,9 +387,11 @@
files = (
43F82BCC1D035AA4006F5DD7 /* TransmitterTimeRxMessageTests.swift in Sources */,
43F82BD41D037227006F5DD7 /* SessionStartRxMessageTests.swift in Sources */,
43846AC81D8F89BE00799272 /* CalibrationDataRxMessageTests.swift in Sources */,
43DC87C01C8B509B005BC30D /* NSData.swift in Sources */,
43F82BD21D037040006F5DD7 /* SessionStopRxMessageTests.swift in Sources */,
43E397911D5692080028E321 /* GlucoseTests.swift in Sources */,
43880F9A1D9E1BD7009061A8 /* TransmitterVersionRxMessageTests.swift in Sources */,
43DC87C21C8B520F005BC30D /* GlucoseRxMessageTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -412,7 +428,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 13;
CURRENT_PROJECT_VERSION = 14;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down Expand Up @@ -462,7 +478,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 13;
CURRENT_PROJECT_VERSION = 14;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down Expand Up @@ -492,7 +508,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 13;
DYLIB_CURRENT_VERSION = 14;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = xDripG5/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand All @@ -512,7 +528,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 13;
DYLIB_CURRENT_VERSION = 14;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = xDripG5/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand Down
15 changes: 12 additions & 3 deletions xDripG5/BluetoothManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ protocol BluetoothManagerDelegate: class {
- returns: True if the peripheral should connect
*/
func bluetoothManager(_ manager: BluetoothManager, shouldConnectPeripheral peripheral: CBPeripheral) -> Bool

/// Tells the delegate that the bluetooth manager received new data in the control characteristic.
///
/// - parameter manager: The bluetooth manager
/// - parameter didReceiveControlResponse: The data received on the control characteristic
func bluetoothManager(_ manager: BluetoothManager, didReceiveControlResponse response: Data)
}


Expand Down Expand Up @@ -422,7 +428,6 @@ class BluetoothManager: NSObject, CBCentralManagerDelegate, CBPeripheralDelegate
}

func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) {

operationLock.lock()

if operationConditions.remove(.valueUpdate(characteristic: characteristic, firstByte: characteristic.value?[0])) != nil ||
Expand All @@ -436,11 +441,15 @@ class BluetoothManager: NSObject, CBCentralManagerDelegate, CBPeripheralDelegate
}

operationLock.unlock()

if let data = characteristic.value {
delegate?.bluetoothManager(self, didReceiveControlResponse: data)
}
}

func peripheral(_ peripheral: CBPeripheral, didWriteValueFor characteristic: CBCharacteristic, error: Error?) {

self.operationLock.lock()
operationLock.lock()

if operationConditions.remove(.writeUpdate(characteristic: characteristic)) != nil {
operationError = error
Expand All @@ -450,7 +459,7 @@ class BluetoothManager: NSObject, CBCentralManagerDelegate, CBPeripheralDelegate
}
}

self.operationLock.unlock()
operationLock.unlock()
}
}

Expand Down
2 changes: 1 addition & 1 deletion xDripG5/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.7.0</string>
<string>0.8.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 2 additions & 0 deletions xDripG5/Messages/BatteryStatusTxMessage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ import Foundation

struct BatteryStatusTxMessage {
let opcode: UInt8 = 0x22

// Response: 23003c012f01cd021f247bae
}
24 changes: 24 additions & 0 deletions xDripG5/Messages/CalibrationDataRxMessage.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// CalibrationDataRxMessage.swift
// Pods
//
// Created by Nate Racklyeft on 9/18/16.
//
//

import Foundation


struct CalibrationDataRxMessage: TransmitterRxMessage {
static let opcode: UInt8 = 0x33

init?(data: Data) {
guard data.count == 19 && data.crcValid() else {
return nil
}

guard data[0] == type(of: self).opcode else {
return nil
}
}
}
Loading

0 comments on commit f95286d

Please sign in to comment.