diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2017-12-12 11:13:28 -0500 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2017-12-12 11:13:28 -0500 |
commit | 22a45dd698989e35cc230f25139aa7f4e0c9d49d (patch) | |
tree | 1d1e8d45d266ffe3437196d333bc9bc39b42fb97 | |
parent | 1e1244e4e126e6b00038b3754bf6a010e2c013d6 (diff) | |
parent | c29d33f8e740caea8948de83f5916cbbcdc441db (diff) | |
download | sdl_ios-22a45dd698989e35cc230f25139aa7f4e0c9d49d.tar.gz |
Merge branch 'develop' into feature/issue_794_CarWindow
-rw-r--r-- | CHANGELOG.md | 3 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | SmartDeviceLink-iOS.podspec | 2 | ||||
-rw-r--r-- | SmartDeviceLink.podspec | 2 | ||||
-rw-r--r-- | SmartDeviceLink/Info.plist | 2 | ||||
-rw-r--r-- | SmartDeviceLink/SDLManager.h | 2 | ||||
-rw-r--r-- | SmartDeviceLink/SDLManager.m | 2 | ||||
-rw-r--r-- | SmartDeviceLink/SDLProxy.m | 2 | ||||
-rw-r--r-- | SmartDeviceLink/SDLResponseDispatcher.m | 4 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSlider.h | 31 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSlider.m | 10 | ||||
-rw-r--r-- | SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSliderSpec.m | 99 | ||||
-rw-r--r-- | SmartDeviceLink_Example/Info.plist | 2 |
13 files changed, 120 insertions, 43 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a9dd2286..79685770d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 5.0.0 +No changes since RC3 + # 5.0.0 Release Candidate 3 (changes since RC 2) ### Bug Fixes * Fix a possible crash if the List Files request from the FileManager fails due to disconnection or unregistration. @@ -44,7 +44,7 @@ You can install this library using [Cocoapods](https://cocoapods.org/pods/SmartD In your podfile, you want to add `pod 'SmartDeviceLink', '~> 5.0'`. Then run `pod install` inside your terminal. With Cocoapods, we support iOS 8.0+. ###### Swift -If you are building a Swift app, then add this instead `pod 'SmartDeviceLink-iOS/Swift', '~> 5.0'`. Then run `pod install` in your terminal. +If you are building a Swift app, then add this instead `pod 'SmartDeviceLink/Swift', '~> 5.0'`. Then run `pod install` in your terminal. ##### Carthage diff --git a/SmartDeviceLink-iOS.podspec b/SmartDeviceLink-iOS.podspec index 21ec70ac2..724b14c3d 100644 --- a/SmartDeviceLink-iOS.podspec +++ b/SmartDeviceLink-iOS.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "SmartDeviceLink-iOS" -s.version = "5.0.0-rc.3" +s.version = "5.0.0" s.summary = "Connect your app with cars!" s.homepage = "https://github.com/smartdevicelink/SmartDeviceLink-iOS" s.license = { :type => "New BSD", :file => "LICENSE" } diff --git a/SmartDeviceLink.podspec b/SmartDeviceLink.podspec index 34d7eb0e7..e77069eb8 100644 --- a/SmartDeviceLink.podspec +++ b/SmartDeviceLink.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "SmartDeviceLink" -s.version = "5.0.0-rc.3" +s.version = "5.0.0" s.summary = "Connect your app with cars!" s.homepage = "https://github.com/smartdevicelink/SmartDeviceLink-iOS" s.license = { :type => "New BSD", :file => "LICENSE" } diff --git a/SmartDeviceLink/Info.plist b/SmartDeviceLink/Info.plist index cb0690f2e..e790eb616 100644 --- a/SmartDeviceLink/Info.plist +++ b/SmartDeviceLink/Info.plist @@ -15,7 +15,7 @@ <key>CFBundlePackageType</key> <string>FMWK</string> <key>CFBundleShortVersionString</key> - <string>5.0.0-rc.3</string> + <string>5.0.0</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> diff --git a/SmartDeviceLink/SDLManager.h b/SmartDeviceLink/SDLManager.h index 1e3438b16..615189675 100644 --- a/SmartDeviceLink/SDLManager.h +++ b/SmartDeviceLink/SDLManager.h @@ -38,7 +38,7 @@ typedef void (^SDLManagerReadyBlock)(BOOL success, NSError *_Nullable error); /** * The current HMI level of the running app. */ -@property (copy, nonatomic, readonly) SDLHMILevel hmiLevel; +@property (copy, nonatomic, readonly, nullable) SDLHMILevel hmiLevel; /** * The current audio streaming state of the running app. diff --git a/SmartDeviceLink/SDLManager.m b/SmartDeviceLink/SDLManager.m index 41c5612ac..9e36f7951 100644 --- a/SmartDeviceLink/SDLManager.m +++ b/SmartDeviceLink/SDLManager.m @@ -64,7 +64,7 @@ NS_ASSUME_NONNULL_BEGIN return self.lifecycleManager.configuration; } -- (SDLHMILevel)hmiLevel { +- (nullable SDLHMILevel)hmiLevel { return self.lifecycleManager.hmiLevel; } diff --git a/SmartDeviceLink/SDLProxy.m b/SmartDeviceLink/SDLProxy.m index 9bd0745c0..6f19a7686 100644 --- a/SmartDeviceLink/SDLProxy.m +++ b/SmartDeviceLink/SDLProxy.m @@ -41,7 +41,7 @@ typedef NSString SDLVehicleMake; typedef void (^URLSessionTaskCompletionHandler)(NSData *data, NSURLResponse *response, NSError *error); typedef void (^URLSessionDownloadTaskCompletionHandler)(NSURL *location, NSURLResponse *response, NSError *error); -NSString *const SDLProxyVersion = @"5.0.0-rc.3"; +NSString *const SDLProxyVersion = @"5.0.0"; const float StartSessionTime = 10.0; const float NotifyProxyClosedDelay = 0.1; const int PoliciesCorrelationId = 65535; diff --git a/SmartDeviceLink/SDLResponseDispatcher.m b/SmartDeviceLink/SDLResponseDispatcher.m index ede7e51fb..e95c3be6c 100644 --- a/SmartDeviceLink/SDLResponseDispatcher.m +++ b/SmartDeviceLink/SDLResponseDispatcher.m @@ -15,6 +15,7 @@ #import "SDLDeleteCommand.h" #import "SDLDeleteCommandResponse.h" #import "SDLError.h" +#import "SDLLogMacros.h" #import "SDLOnAudioPassThru.h" #import "SDLOnButtonEvent.h" #import "SDLOnButtonPress.h" @@ -174,6 +175,9 @@ NS_ASSUME_NONNULL_BEGIN // Run the response handler if (handler) { + if (!response.success.boolValue) { + SDLLogW(@"Request failed: %@, response: %@, error: %@", request, response, error); + } handler(request, response, error); } diff --git a/SmartDeviceLink/SDLSlider.h b/SmartDeviceLink/SDLSlider.h index fa1dc7acc..c23606350 100644 --- a/SmartDeviceLink/SDLSlider.h +++ b/SmartDeviceLink/SDLSlider.h @@ -16,10 +16,37 @@ NS_ASSUME_NONNULL_BEGIN @interface SDLSlider : SDLRPCRequest +/** + Create an SDLSlider with only the number of ticks and position. Note that this is not enough to get a SUCCESS response. You must supply additional data. See below for required parameters. + + @param numTicks The number of ticks present on the slider. + @param position The default starting position of the slider. + @return An SDLSlider RPC Request. + */ - (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position; +/** + Create an SDLSlider with all required data and a static footer (or no footer). + + @param numTicks The number of ticks present on the slider. + @param position The default starting position of the slider. + @param sliderHeader The header describing the slider. + @param sliderFooter A static footer with text, or nil for no footer. + @param timeout The length of time in milliseconds the popup should be displayed before automatically disappearing. + @return An SDLSlider RPC Request. + */ - (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader sliderFooter:(nullable NSString *)sliderFooter timeout:(UInt16)timeout; +/** + Create an SDLSlider with all required data and a dynamic footer (or no footer). + + @param numTicks The number of ticks present on the slider. + @param position The default starting position of the slider. + @param sliderHeader The header describing the slider. + @param sliderFooters An array of footers. This should be the same length as `numTicks` as each footer should correspond to a tick, or no footer if nil. + @param timeout The length of time in milliseconds the popup should be displayed before automatically disappearing. + @return An SDLSlider RPC Request. + */ - (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader sliderFooters:(nullable NSArray<NSString *> *)sliderFooters timeout:(UInt16)timeout; /** @@ -39,7 +66,7 @@ NS_ASSUME_NONNULL_BEGIN /** * @abstract A text header to display * - * Rquired, Max length 500 chars + * Required, Max length 500 chars */ @property (strong, nonatomic) NSString *sliderHeader; @@ -59,7 +86,7 @@ NS_ASSUME_NONNULL_BEGIN @property (strong, nonatomic, nullable) NSArray<NSString *> *sliderFooter; /** - * @abstract An App defined timeout + * @abstract An App defined timeout in milliseconds * * @discussion Indicates how long of a timeout from the last action (i.e. sliding control resets timeout). * diff --git a/SmartDeviceLink/SDLSlider.m b/SmartDeviceLink/SDLSlider.m index cf2f9519c..800d65741 100644 --- a/SmartDeviceLink/SDLSlider.m +++ b/SmartDeviceLink/SDLSlider.m @@ -18,14 +18,12 @@ NS_ASSUME_NONNULL_BEGIN } - (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader sliderFooter:(nullable NSString *)sliderFooter timeout:(UInt16)timeout { - NSMutableArray *sliderFooters = [NSMutableArray arrayWithCapacity:numTicks]; - - // Populates array with the same footer value for each position - for (int i = 0; i < sliderFooters.count; i++) { - sliderFooters[0] = sliderFooter; + NSArray<NSString *> *footer = nil; + if (sliderFooter != nil) { + footer = @[sliderFooter]; } - return [self initWithNumTicks:numTicks position:position sliderHeader:sliderHeader sliderFooter:[sliderFooters copy] timeout:timeout]; + return [self initWithNumTicks:numTicks position:position sliderHeader:sliderHeader sliderFooters:footer timeout:timeout]; } - (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader sliderFooters:(nullable NSArray<NSString *> *)sliderFooters timeout:(UInt16)timeout { diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSliderSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSliderSpec.m index 294e0ce50..e1fb58dc1 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSliderSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSliderSpec.m @@ -14,42 +14,87 @@ QuickSpecBegin(SDLSliderSpec) describe(@"Getter/Setter Tests", ^ { + __block SDLSlider *testRequest = nil; + __block UInt8 testNumTicks = 4; + __block UInt8 testPosition = 1; + __block NSUInteger testTimeout = 2000; + __block NSString *testHeader = @"Head"; + __block NSString *testFooter = @"Foot"; + __block NSArray<NSString *> *testFooters = @[@"Foot1", @"Foot2"]; + + beforeEach(^{ + testRequest = nil; + testNumTicks = 4; + testPosition = 1; + testTimeout = 2000; + testHeader = @"Head"; + testFooter = @"Foot"; + testFooters = @[@"Foot1", @"Foot2"]; + }); + it(@"Should set and get correctly", ^ { - SDLSlider* testRequest = [[SDLSlider alloc] init]; + testRequest = [[SDLSlider alloc] init]; - testRequest.numTicks = @2; - testRequest.position = @1; - testRequest.sliderHeader = @"Head"; - testRequest.sliderFooter = [@[@"LeftFoot", @"RightFoot"] mutableCopy]; - testRequest.timeout = @2000; + testRequest.numTicks = @(testNumTicks); + testRequest.position = @(testPosition); + testRequest.sliderHeader = testHeader; + testRequest.sliderFooter = testFooters; + testRequest.timeout = @(testTimeout); - expect(testRequest.numTicks).to(equal(@2)); - expect(testRequest.position).to(equal(@1)); - expect(testRequest.sliderHeader).to(equal(@"Head")); - expect(testRequest.sliderFooter).to(equal([@[@"LeftFoot", @"RightFoot"] mutableCopy])); - expect(testRequest.timeout).to(equal(@2000)); + expect(testRequest.numTicks).to(equal(testNumTicks)); + expect(testRequest.position).to(equal(testPosition)); + expect(testRequest.sliderHeader).to(equal(testHeader)); + expect(testRequest.sliderFooter).to(equal(testFooters)); + expect(testRequest.timeout).to(equal(testTimeout)); }); - it(@"Should get correctly when initialized", ^ { - NSMutableDictionary<NSString *, id> *dict = [@{SDLNameRequest: - @{SDLNameParameters: - @{SDLNameNumberTicks:@2, - SDLNamePosition:@1, - SDLNameSliderHeader:@"Head", - SDLNameSliderFooter:[@[@"LeftFoot", @"RightFoot"] mutableCopy], - SDLNameTimeout:@2000}, - SDLNameOperationName:SDLNameSlider}} mutableCopy]; - SDLSlider* testRequest = [[SDLSlider alloc] initWithDictionary:dict]; + it(@"Should get correctly when initialized with a dictionary", ^ { + NSDictionary<NSString *, id> *dict = @{SDLNameRequest: + @{SDLNameParameters: + @{SDLNameNumberTicks:@(testNumTicks), + SDLNamePosition:@(testPosition), + SDLNameSliderHeader:testHeader, + SDLNameSliderFooter:testFooters, + SDLNameTimeout:@(testTimeout)}, + SDLNameOperationName:SDLNameSlider}}; + testRequest = [[SDLSlider alloc] initWithDictionary:dict]; - expect(testRequest.numTicks).to(equal(@2)); - expect(testRequest.position).to(equal(@1)); - expect(testRequest.sliderHeader).to(equal(@"Head")); - expect(testRequest.sliderFooter).to(equal([@[@"LeftFoot", @"RightFoot"] mutableCopy])); - expect(testRequest.timeout).to(equal(@2000)); + expect(testRequest.numTicks).to(equal(testNumTicks)); + expect(testRequest.position).to(equal(testPosition)); + expect(testRequest.sliderHeader).to(equal(testHeader)); + expect(testRequest.sliderFooter).to(equal(testFooters)); + expect(testRequest.timeout).to(equal(testTimeout)); + }); + + it(@"should correctly initialize with initWithNumTicks:position:", ^{ + testRequest = [[SDLSlider alloc] initWithNumTicks:testNumTicks position:testPosition]; + + expect(testRequest.numTicks).to(equal(testNumTicks)); + expect(testRequest.position).to(equal(testPosition)); + }); + + it(@"should correctly initialize with initWithNumTicks:position:sliderHeader:sliderFooters:timeout:", ^{ + testRequest = [[SDLSlider alloc] initWithNumTicks:testNumTicks position:testPosition sliderHeader:testHeader sliderFooters:testFooters timeout:testTimeout]; + + expect(testRequest.numTicks).to(equal(testNumTicks)); + expect(testRequest.position).to(equal(testPosition)); + expect(testRequest.sliderHeader).to(equal(testHeader)); + expect(testRequest.sliderFooter).to(equal(testFooters)); + expect(testRequest.timeout).to(equal(testTimeout)); + }); + + it(@"should correctly initialize with initWithNumTicks:position:sliderHeader:sliderFooter:timeout:", ^{ + testRequest = [[SDLSlider alloc] initWithNumTicks:testNumTicks position:testPosition sliderHeader:testHeader sliderFooter:testFooter timeout:testTimeout]; + + expect(testRequest.numTicks).to(equal(testNumTicks)); + expect(testRequest.position).to(equal(testPosition)); + expect(testRequest.sliderHeader).to(equal(testHeader)); + expect(testRequest.sliderFooter).to(equal(@[testFooter])); + expect(testRequest.timeout).to(equal(testTimeout)); }); it(@"Should return nil if not set", ^ { - SDLSlider* testRequest = [[SDLSlider alloc] init]; + testRequest = [[SDLSlider alloc] init]; expect(testRequest.numTicks).to(beNil()); expect(testRequest.position).to(beNil()); diff --git a/SmartDeviceLink_Example/Info.plist b/SmartDeviceLink_Example/Info.plist index fc085b8a3..46063b5e1 100644 --- a/SmartDeviceLink_Example/Info.plist +++ b/SmartDeviceLink_Example/Info.plist @@ -15,7 +15,7 @@ <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> - <string>5.0.0-rc.3</string> + <string>5.0.0</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> |