diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2016-03-30 12:43:51 -0400 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2016-03-30 12:43:51 -0400 |
commit | f04beeeead696bb9784a7777d3be5aca133f4059 (patch) | |
tree | 6e78b3c59c52b1decea3264e29f8e91ba1196cc9 | |
parent | a2c82266c485a1901da50a6817d10eed984054d6 (diff) | |
parent | 487e07e02c37e24b8d50b1ea41ab9d036878c7ec (diff) | |
download | sdl_ios-4.1.0.tar.gz |
-rw-r--r-- | CHANGELOG.md | 21 | ||||
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | SmartDeviceLink-iOS.podspec | 4 | ||||
-rw-r--r-- | SmartDeviceLink-iOS/SmartDeviceLink/Info.plist | 2 | ||||
-rw-r--r-- | SmartDeviceLink-iOS/SmartDeviceLink/SDLAbstractProtocol.h | 2 | ||||
-rw-r--r-- | SmartDeviceLink-iOS/SmartDeviceLink/SDLProtocol.m | 32 | ||||
-rw-r--r-- | SmartDeviceLink-iOS/SmartDeviceLink/SDLProxy.m | 2 | ||||
-rw-r--r-- | SmartDeviceLink-iOS/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m | 33 |
8 files changed, 59 insertions, 41 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ff63007f..0b69c166a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,28 @@ +# 4.1.0 Release Notes +### Enhancements +* The `LAUNCH_APP` system request was implemented. +* The proxy now tracks application state and relays that information to the Head Unit on v4 and above. + +### Bug Fixes +* `[SDLProxyListener onProxyOpened]` will only be called when the RPC service starts, instead of any service. +* Sending heartbeat has been deprecated. The iOS proxy will now only respond to heartbeats. +* `SYSTEM_REQUEST` RPC now properly uploads and returns data. +* `SDLStreamingMediaManager`'s version check now correctly compares versions + +### Other +* Updates to the README with "Getting Started" code, and updated information on testing. +* License copyright updated to 2016. +* All testing frameworks are removed from the repository and must be bootstrapped when wanted. + +### Deprecations +* Methods relating to sending heartbeat have been deprecated. This should not affect your app in any way. These lower-level classes will be removed in future versions. + # 4.0.3 Release Notes ### Enhancements * Implement HTTP System Requests for policy updates -### Bug Fix +### Bug Fixes * Revert the reachability code in TCP. If you were having trouble with connecting to SDL Core, this should fix that particular bug. ### Other @@ -34,7 +34,7 @@ See the [changelog](https://github.com/smartdevicelink/sdl_ios/blob/master/CHANG You can install this library using [Cocoapods](https://cocoapods.org/pods/SmartDeviceLink-iOS). You can get started with Cocoapods by [following their install guide](https://guides.cocoapods.org/using/getting-started.html#getting-started), and learn how to use Cocoapods to install dependencies [by following this guide](https://guides.cocoapods.org/using/using-cocoapods.html). -In your podfile, you want to add `pod 'SmartDeviceLink-iOS', '4.0.3'`. Then run `pod install` inside your terminal. With Cocoapods, we support iOS 6+. +In your podfile, you want to add `pod 'SmartDeviceLink-iOS', '4.1.0'`. Then run `pod install` inside your terminal. With Cocoapods, we support iOS 6+. ##### Carthage @@ -188,7 +188,7 @@ if (self.proxy != nil) { ``` #### onOnHMIStatus -When your app receives `onOnHMIStatus` it has changed HMI states on the head unit. For example, your application can be put into `HMI_FULL` meaning that it has full access to the vehicle screen. For more info on HMI Levels, [see the Cocoadoc documentation on the enum](http://cocoadocs.org/docsets/SmartDeviceLink-iOS/4.0.0-alpha.2/Classes/SDLHMILevel.html). +When your app receives `onOnHMIStatus` it has changed HMI states on the head unit. For example, your application can be put into `HMI_FULL` meaning that it has full access to the vehicle screen. For more info on HMI Levels, [see the Cocoadoc documentation on the enum](http://cocoadocs.org/docsets/SmartDeviceLink-iOS/4.0.3/Classes/SDLHMILevel.html). You will want to track your first HMI FULL, for instance with a boolean value. The example application has extremely basic tracking of this type in the `onOnHMIStatus` callback. diff --git a/SmartDeviceLink-iOS.podspec b/SmartDeviceLink-iOS.podspec index 8cc037321..ea303f4b6 100644 --- a/SmartDeviceLink-iOS.podspec +++ b/SmartDeviceLink-iOS.podspec @@ -1,13 +1,13 @@ Pod::Spec.new do |s| s.name = "SmartDeviceLink-iOS" - s.version = "4.0.3" + s.version = "4.1.0" s.summary = "Connect your app with cars!" s.homepage = "https://github.com/smartdevicelink/SmartDeviceLink-iOS" s.license = { :type => "New BSD", :file => "LICENSE" } s.author = { "SmartDeviceLink Team" => "joel@livio.io" } s.platform = :ios, "6.0" - s.source = { :git => "https://github.com/smartdevicelink/sdl_ios.git", :tag => "4.0.3" } + s.source = { :git => "https://github.com/smartdevicelink/sdl_ios.git", :tag => "4.1.0" } s.source_files = "SmartDeviceLink-iOS/SmartDeviceLink/*.{h,m}" s.requires_arc = true diff --git a/SmartDeviceLink-iOS/SmartDeviceLink/Info.plist b/SmartDeviceLink-iOS/SmartDeviceLink/Info.plist index 161178394..5284837db 100644 --- a/SmartDeviceLink-iOS/SmartDeviceLink/Info.plist +++ b/SmartDeviceLink-iOS/SmartDeviceLink/Info.plist @@ -15,7 +15,7 @@ <key>CFBundlePackageType</key> <string>FMWK</string> <key>CFBundleShortVersionString</key> - <string>4.0.3</string> + <string>4.1.0</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> diff --git a/SmartDeviceLink-iOS/SmartDeviceLink/SDLAbstractProtocol.h b/SmartDeviceLink-iOS/SmartDeviceLink/SDLAbstractProtocol.h index 22608f3d6..01a4c7e9d 100644 --- a/SmartDeviceLink-iOS/SmartDeviceLink/SDLAbstractProtocol.h +++ b/SmartDeviceLink-iOS/SmartDeviceLink/SDLAbstractProtocol.h @@ -20,7 +20,7 @@ - (void)sendEndSessionWithType:(SDLServiceType)serviceType; - (void)sendRPC:(SDLRPCMessage *)message; - (void)sendRPCRequest:(SDLRPCRequest *)rpcRequest __deprecated_msg(("Use sendRPC: instead")); -- (void)sendHeartbeat; +- (void)sendHeartbeat __deprecated_msg("Heartbeat is no longer used."); - (void)sendRawDataStream:(NSInputStream *)inputStream withServiceType:(SDLServiceType)serviceType; - (void)sendRawData:(NSData *)data withServiceType:(SDLServiceType)serviceType; diff --git a/SmartDeviceLink-iOS/SmartDeviceLink/SDLProtocol.m b/SmartDeviceLink-iOS/SmartDeviceLink/SDLProtocol.m index d1b5e15ef..cee0d7791 100644 --- a/SmartDeviceLink-iOS/SmartDeviceLink/SDLProtocol.m +++ b/SmartDeviceLink-iOS/SmartDeviceLink/SDLProtocol.m @@ -34,8 +34,6 @@ @property (assign) UInt8 sessionID; @property (strong) NSMutableData *receiveBuffer; @property (strong) SDLProtocolReceivedMessageRouter *messageRouter; -@property (nonatomic) BOOL heartbeatACKed; -@property (nonatomic, strong) SDLTimer *heartbeatTimer; @end @@ -45,7 +43,6 @@ if (self = [super init]) { _messageID = 0; _sessionID = 0; - _heartbeatACKed = NO; _receiveQueue = dispatch_queue_create("com.sdl.protocol.receive", DISPATCH_QUEUE_SERIAL); _sendQueue = dispatch_queue_create("com.sdl.protocol.transmit", DISPATCH_QUEUE_SERIAL); _prioritizedCollection = [[SDLPrioritizedObjectCollection alloc] init]; @@ -273,23 +270,6 @@ [self sendDataToTransport:message.data withPriority:header.serviceType]; } -- (void)startHeartbeatTimerWithDuration:(float)duration { - self.heartbeatTimer = [[SDLTimer alloc] initWithDuration:duration repeat:YES]; - __weak typeof(self) weakSelf = self; - self.heartbeatTimer.elapsedBlock = ^void() { - __strong typeof(weakSelf) strongSelf = weakSelf; - if (strongSelf.heartbeatACKed) { - strongSelf.heartbeatACKed = NO; - [strongSelf sendHeartbeat]; - } else { - NSString *logMessage = [NSString stringWithFormat:@"Heartbeat ack not received. Goodbye."]; - [SDLDebugTool logInfo:logMessage withType:SDLDebugType_RPC toOutput:SDLDebugOutput_All toGroup:strongSelf.debugConsoleGroupName]; - [strongSelf onProtocolClosed]; - } - }; - [self.heartbeatTimer start]; -} - - (void)sendRawData:(NSData *)data withServiceType:(SDLServiceType)serviceType { SDLV2ProtocolHeader *header = [[SDLV2ProtocolHeader alloc] initWithVersion:[SDLGlobals globals].protocolVersion]; header.frameType = SDLFrameType_Single; @@ -319,10 +299,6 @@ case SDLServiceType_RPC: { self.sessionID = sessionID; [SDLGlobals globals].maxHeadUnitVersion = version; - if ([SDLGlobals globals].protocolVersion >= 3) { - self.heartbeatACKed = YES; // Ensures a first heartbeat is sent - [self startHeartbeatTimerWithDuration:5.0]; - } } break; default: break; @@ -382,8 +358,6 @@ } - (void)handleHeartbeatACK { - self.heartbeatACKed = YES; - for (id<SDLProtocolListener> listener in self.protocolDelegateTable.allObjects) { if ([listener respondsToSelector:@selector(handleHeartbeatACK)]) { [listener handleHeartbeatACK]; @@ -392,11 +366,6 @@ } - (void)onProtocolMessageReceived:(SDLProtocolMessage *)msg { - if ([SDLGlobals globals].protocolVersion >= 3 && self.heartbeatTimer != nil) { - self.heartbeatACKed = YES; // All messages count as heartbeats - [self.heartbeatTimer start]; - } - for (id<SDLProtocolListener> listener in self.protocolDelegateTable.allObjects) { if ([listener respondsToSelector:@selector(onProtocolMessageReceived:)]) { [listener onProtocolMessageReceived:msg]; @@ -438,7 +407,6 @@ self.messageRouter = nil; self.transport = nil; self.protocolDelegateTable = nil; - self.heartbeatTimer = nil; } } diff --git a/SmartDeviceLink-iOS/SmartDeviceLink/SDLProxy.m b/SmartDeviceLink-iOS/SmartDeviceLink/SDLProxy.m index 4c14ca415..48e1fe275 100644 --- a/SmartDeviceLink-iOS/SmartDeviceLink/SDLProxy.m +++ b/SmartDeviceLink-iOS/SmartDeviceLink/SDLProxy.m @@ -45,7 +45,7 @@ typedef void (^URLSessionTaskCompletionHandler)(NSData *data, NSURLResponse *response, NSError *error); typedef void (^URLSessionDownloadTaskCompletionHandler)(NSURL *location, NSURLResponse *response, NSError *error); -NSString *const SDLProxyVersion = @"4.0.3"; +NSString *const SDLProxyVersion = @"4.1.0"; const float startSessionTime = 10.0; const float notifyProxyClosedDelay = 0.1; const int POLICIES_CORRELATION_ID = 65535; diff --git a/SmartDeviceLink-iOS/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m b/SmartDeviceLink-iOS/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m index 7c6f8dfaa..373575a4d 100644 --- a/SmartDeviceLink-iOS/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m +++ b/SmartDeviceLink-iOS/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m @@ -317,8 +317,11 @@ describe(@"SendHeartbeat Tests", ^ { expect(dataSent).to(equal([NSData dataWithBytes:testHeader length:8])); }] sendData:[OCMArg any]]; testProtocol.transport = transportMock; - + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" [testProtocol sendHeartbeat]; +#pragma clang diagnostic pop expect(@(verified)).toEventually(beTruthy()); }); @@ -344,7 +347,10 @@ describe(@"SendHeartbeat Tests", ^ { }] sendData:[OCMArg any]]; testProtocol.transport = transportMock; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" [testProtocol sendHeartbeat]; +#pragma clang diagnostic pop expect(@(verified)).toEventually(beTruthy()); }); @@ -381,6 +387,31 @@ describe(@"HandleProtocolSessionStarted Tests", ^ { }); }); +describe(@"HandleHeartbeatForSession Tests", ^{ + // TODO: Test automatically sending data to head unit (dependency injection?) + it(@"Should pass information along to delegate", ^ { + SDLProtocol* testProtocol = [[SDLProtocol alloc] init]; + + id delegateMock = OCMProtocolMock(@protocol(SDLProtocolListener)); + + __block BOOL verified = NO; + [[[[delegateMock stub] andDo:^(NSInvocation* invocation) { + verified = YES; + Byte sessionID; + + [invocation getArgument:&sessionID atIndex:2]; + + expect(@(sessionID)).to(equal(@0x44)); + }] ignoringNonObjectArgs] handleHeartbeatForSession:0]; + + [testProtocol.protocolDelegateTable addObject:delegateMock]; + + [testProtocol handleHeartbeatForSession:0x44]; + + expect(@(verified)).to(beTruthy()); + }); +}); + describe(@"OnProtocolMessageReceived Tests", ^ { it(@"Should pass information along to delegate", ^ { SDLProtocol* testProtocol = [[SDLProtocol alloc] init]; |