summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Switzer <dswitzer@xevo.com>2017-05-18 16:58:55 -0700
committerDavid Switzer <dswitzer@xevo.com>2017-05-18 16:58:55 -0700
commit4a58a55e0b2a02ee19a902432dcc56b68f8bf19c (patch)
tree7517db6efb2451bd90e291c52680395fa4674f7b
parented0e9e6263b81736adabb4a5138b9e0d6906082e (diff)
parent0168838cb13d8c90e8cbb3446eaf56681108283e (diff)
downloadsdl_ios-4a58a55e0b2a02ee19a902432dcc56b68f8bf19c.tar.gz
Merge branch 'master' into feature/issue_591
-rw-r--r--.github/ISSUE_TEMPLATE.md4
-rw-r--r--.github/PULL_REQUEST_TEMPLATE.md4
-rw-r--r--.swift-version1
-rw-r--r--.travis.yml8
-rw-r--r--CHANGELOG.md8
-rw-r--r--Cartfile.private10
-rw-r--r--Cartfile.resolved8
-rw-r--r--LICENSE4
-rw-r--r--README.md9
-rw-r--r--SmartDeviceLink-iOS.podspec2
-rw-r--r--SmartDeviceLink-iOS.xcodeproj/project.pbxproj44
-rw-r--r--SmartDeviceLink/Info.plist2
-rw-r--r--SmartDeviceLink/NSBundle+SDLBundle.m10
-rw-r--r--SmartDeviceLink/SDLAlert.m8
-rw-r--r--SmartDeviceLink/SDLAlertManeuver.m8
-rw-r--r--SmartDeviceLink/SDLArtwork.h4
-rw-r--r--SmartDeviceLink/SDLCreateInteractionChoiceSet.m4
-rw-r--r--SmartDeviceLink/SDLDisplayCapabilities.m12
-rw-r--r--SmartDeviceLink/SDLFileManager.m2
-rw-r--r--SmartDeviceLink/SDLGetWaypointsResponse.m4
-rw-r--r--SmartDeviceLink/SDLHMIPermissions.m8
-rw-r--r--SmartDeviceLink/SDLIAPSession.h3
-rw-r--r--SmartDeviceLink/SDLIAPSession.m175
-rw-r--r--SmartDeviceLink/SDLIAPTransport.m110
-rw-r--r--SmartDeviceLink/SDLImageField.m4
-rw-r--r--SmartDeviceLink/SDLLifecycleConfiguration.h4
-rw-r--r--SmartDeviceLink/SDLLifecycleConfiguration.m1
-rw-r--r--SmartDeviceLink/SDLLifecycleManager.h3
-rw-r--r--SmartDeviceLink/SDLLifecycleManager.m32
-rw-r--r--SmartDeviceLink/SDLLockScreenConfiguration.h4
-rw-r--r--SmartDeviceLink/SDLMenuParams.m2
-rwxr-xr-xSmartDeviceLink/SDLMutableDataQueue.h60
-rwxr-xr-xSmartDeviceLink/SDLMutableDataQueue.m75
-rw-r--r--SmartDeviceLink/SDLOnPermissionsChange.m4
-rw-r--r--SmartDeviceLink/SDLOnTouchEvent.m4
-rw-r--r--SmartDeviceLink/SDLOnWaypointChange.m4
-rw-r--r--SmartDeviceLink/SDLPerformAudioPassThru.m4
-rw-r--r--SmartDeviceLink/SDLPerformInteraction.m16
-rw-r--r--SmartDeviceLink/SDLProxy.m4
-rw-r--r--SmartDeviceLink/SDLProxyFactory.m2
-rw-r--r--SmartDeviceLink/SDLProxyListener.h2
-rw-r--r--SmartDeviceLink/SDLReadDIDResponse.m4
-rw-r--r--SmartDeviceLink/SDLRegisterAppInterface.m8
-rw-r--r--SmartDeviceLink/SDLRegisterAppInterfaceResponse.m28
-rw-r--r--SmartDeviceLink/SDLResetGlobalProperties.m4
-rw-r--r--SmartDeviceLink/SDLResponseDispatcher.m5
-rw-r--r--SmartDeviceLink/SDLScrollableMessage.m4
-rw-r--r--SmartDeviceLink/SDLSetDisplayLayoutResponse.m8
-rw-r--r--SmartDeviceLink/SDLSetGlobalProperties.m12
-rw-r--r--SmartDeviceLink/SDLShow.m4
-rw-r--r--SmartDeviceLink/SDLShowConstantTBT.m4
-rw-r--r--SmartDeviceLink/SDLSpeak.m4
-rw-r--r--SmartDeviceLink/SDLStreamingMediaManager.h2
-rw-r--r--SmartDeviceLink/SDLStreamingMediaManager.m10
-rw-r--r--SmartDeviceLink/SDLTouchEvent.m4
-rw-r--r--SmartDeviceLink/SDLTouchManagerDelegate.h4
-rw-r--r--SmartDeviceLink/SDLUpdateTurnList.m8
-rw-r--r--SmartDeviceLink/SmartDeviceLink.h4
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m39
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenViewControllerSnapshotTests.m2
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLPermissionFilterSpec.m4
-rw-r--r--SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m16
-rw-r--r--SmartDeviceLinkTests/ProtocolSpecs/SDLAbstractProtocolSpec.m4
-rw-r--r--SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolReceivedMessageRouterSpec.m6
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAlertSpec.m19
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMenuParamsSpec.m64
-rw-r--r--SmartDeviceLinkTests/UtilitiesSpecs/Touches/SDLTouchManagerSpec.m2
-rw-r--r--SmartDeviceLink_Example/Classes/ConnectionTCPTableViewController.m5
-rw-r--r--SmartDeviceLink_Example/Classes/ProxyManager.m4
-rw-r--r--SmartDeviceLink_Example/Info.plist2
70 files changed, 730 insertions, 231 deletions
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
index 9d11929f5..84c2de694 100644
--- a/.github/ISSUE_TEMPLATE.md
+++ b/.github/ISSUE_TEMPLATE.md
@@ -5,8 +5,8 @@
##### Reproduction Steps
1. [Step 1]
-1. [Step 2]
-1. [Step 3]
+2. [Step 2]
+3. [Step 3]
##### Expected Behavior
[Some expected behavior]
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 2b3f22d93..9a41515c7 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -19,8 +19,8 @@ This PR makes **[no / minor / major]** API changes.
##### Breaking Changes
* [Breaking change info]
-##### Enchancements
-* [Enchancement info]
+##### Enhancements
+* [Enhancement info]
##### Bug Fixes
* [Bug Fix Info]
diff --git a/.swift-version b/.swift-version
deleted file mode 100644
index bb576dbde..000000000
--- a/.swift-version
+++ /dev/null
@@ -1 +0,0 @@
-2.3
diff --git a/.travis.yml b/.travis.yml
index 95fafda82..cc31cf516 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,8 +1,8 @@
language: objective-c
-osx_image: xcode8
+osx_image: xcode8.3
xcode_project: SmartDeviceLink-iOS.xcodeproj
xcode_scheme: SmartDeviceLink
-xcode_sdk: iphonesimulator10.0
+xcode_sdk: iphonesimulator10.3
env:
global:
- FRAMEWORK_NAME=SmartDeviceLink
@@ -18,8 +18,8 @@ before_script:
- carthage bootstrap --platform ios
script:
-- xcodebuild -project "SmartDeviceLink-iOS.xcodeproj" -scheme "SmartDeviceLink" -sdk "iphonesimulator10.0" -destination "OS=10.0,name=iPhone 7" -configuration Debug ONLY_ACTIVE_ARCH=NO RUN_CLANG_STATIC_ANALYZER=NO GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES ENABLE_TESTABILITY=YES test | xcpretty -c;
-- xcodebuild -project "SmartDeviceLink-iOS.xcodeproj" -scheme "SmartDeviceLink-Example" -sdk "iphonesimulator10.0" -destination "OS=10.0,name=iPhone 7" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty -c;
+- xcodebuild -project "SmartDeviceLink-iOS.xcodeproj" -scheme "SmartDeviceLink" -sdk "iphonesimulator10.3" -destination "OS=10.3,name=iPhone 7" -configuration Debug ONLY_ACTIVE_ARCH=NO RUN_CLANG_STATIC_ANALYZER=NO GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES ENABLE_TESTABILITY=YES test | xcpretty -c;
+- xcodebuild -project "SmartDeviceLink-iOS.xcodeproj" -scheme "SmartDeviceLink-Example" -sdk "iphonesimulator10.3" -destination "OS=10.3,name=iPhone 7" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty -c;
after_script:
- bash <(curl -s https://codecov.io/bash)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 27a7b1eb9..1331800f4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,11 @@
+# 4.5.5 Release Notes
+### Bug Fixes
+* Added a check for if `SDLManager` is already started and prevent starting it again.
+* Prevent infinite loops in IAP transport.
+
+### Example App
+* Fixed incorrectly setting button state on disconnect.
+
# 4.5.4 Release Notes
### Bug Fixes
* Streaming video will not crash if data is unexpectedly NULL.
diff --git a/Cartfile.private b/Cartfile.private
index f661526be..c7c2797f3 100644
--- a/Cartfile.private
+++ b/Cartfile.private
@@ -1,5 +1,5 @@
-github "Quick/Quick" ~> 0.9
-github "Quick/Nimble" ~> 4.0
-github "AliSoftware/OHHTTPStubs" ~> 5.0
-github "erikdoe/ocmock" ~> 3.3
-github "facebook/ios-snapshot-test-case" == 2.1.3
+github "Quick/Quick" ~> 1.1
+github "Quick/Nimble" ~> 6.1
+github "AliSoftware/OHHTTPStubs" "5.2.3-swift3"
+github "erikdoe/ocmock" ~> 3.4
+github "facebook/ios-snapshot-test-case" ~> 2.1
diff --git a/Cartfile.resolved b/Cartfile.resolved
index e2b082f08..2de645370 100644
--- a/Cartfile.resolved
+++ b/Cartfile.resolved
@@ -1,5 +1,5 @@
-github "Quick/Nimble" "v4.1.0"
-github "AliSoftware/OHHTTPStubs" "5.2.3"
-github "Quick/Quick" "v0.9.3"
-github "facebook/ios-snapshot-test-case" "2.1.3"
+github "Quick/Nimble" "v6.1.0"
+github "AliSoftware/OHHTTPStubs" "5.2.3-swift3"
+github "Quick/Quick" "v1.1.0"
+github "facebook/ios-snapshot-test-case" "2.1.4"
github "erikdoe/ocmock" "v3.4"
diff --git a/LICENSE b/LICENSE
index 7f7887c5d..255251f17 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2016 Ford Motor Company,
+Copyright (c) 2017 SmartDeviceLink Consortium, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -11,7 +11,7 @@ modification, are permitted provided that the following conditions are met:
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
-* Neither the name of Ford Motor Company nor the names of its
+* Neither the name of SmartDeviceLink Consortium, Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
diff --git a/README.md b/README.md
index a7f71363a..7ba78f97f 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,8 @@
* The [Core](https://github.com/smartdevicelink/sdl_core) component is the software which Vehicle Manufacturers (OEMs) implement in their vehicle head units. Integrating this component into their head unit and HMI based on a set of guidelines and templates enables access to various smartphone applications.
* The optional [SDL Server](https://github.com/smartdevicelink/sdl_server) can be used by Vehicle OEMs to update application policies and gather usage information for connected applications.
* The [iOS](https://github.com/smartdevicelink/sdl_ios) and [Android](https://github.com/smartdevicelink/sdl_android) libraries are implemented by app developers into their applications to enable command and control via the connected head unit.
-* To suggest new features to SDL, including the iOS library, go to the [SDL Evolution](https://github.com/smartdevicelink/sdl_evolution) github project
+* To suggest new features to SDL, including the iOS library, go to the [SDL Evolution](https://github.com/smartdevicelink/sdl_evolution) github project.
+* To understand if a contribution should be entered as an iOS Pull Request or Issue, or an SDL Evolution Proposal, please reference [this document](https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals_versus_issues.md).
<a href="http://www.youtube.com/watch?feature=player_embedded&v=AzdQdSCS24M" target="_blank"><img src="http://i.imgur.com/nm8UujD.png?1" alt="SmartDeviceLink" border="10" /></a>
@@ -52,11 +53,13 @@ Tagged to our releases is a dynamic framework file that can be drag-and-dropped
### Reference Documentation
-You can find the latest reference documentation on [Cocoadocs](http://cocoadocs.org/docsets/SmartDeviceLink-iOS). Install this documentation to [Dash](http://kapeli.com/dash) or Xcode using [Docs for Xcode](https://documancer.com/xcode/). On the [docs page](http://cocoadocs.org/docsets/SmartDeviceLink-iOS), click the 'share' button in the upper right.
+You can find the latest reference documentation on [SmartDeviceLink.com Documentation](https://smartdevicelink.com/en/docs/iOS/master/), and view guides on [SmartDeviceLink.com Guides](https://smartdevicelink.com/en/guides/iOS/getting-started/installation/).
### Getting Help
-If you see a bug, feel free to post an issue on the appropriate repository. Please see the [contribution guidelines](https://github.com/smartdevicelink/sdl_ios/blob/master/CONTRIBUTING.md) before proceeding. If you need general assistance, or have other questions, you can [sign up](http://slack.smartdevicelink.org) for the [SDL Slack](https://smartdevicelink.slack.com) and chat with other developers and the maintainers of the project.
+First, view our guides on [SmartDeviceLink.com](https://smartdevicelink.com/en/guides/iOS/getting-started/installation/).
+
+If you see a bug, please post an issue on the appropriate repository. Please see the [contribution guidelines](https://github.com/smartdevicelink/sdl_ios/blob/master/CONTRIBUTING.md) before proceeding. If you need general assistance, or have other questions, you can [sign up](http://slack.smartdevicelink.org) for the [SDL Slack](https://smartdevicelink.slack.com) and chat with other developers and the maintainers of the project.
### SDL iOS Getting Started
diff --git a/SmartDeviceLink-iOS.podspec b/SmartDeviceLink-iOS.podspec
index 3d9e0d0d4..9ede8a5a5 100644
--- a/SmartDeviceLink-iOS.podspec
+++ b/SmartDeviceLink-iOS.podspec
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "SmartDeviceLink-iOS"
-s.version = "4.5.4"
+s.version = "4.5.5"
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-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj
index d131e4d29..e9422ea73 100644
--- a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj
+++ b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj
@@ -770,10 +770,10 @@
5D61FE0A1A84238C00846EE7 /* SDLVehicleDataType.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D61FC1D1A84238C00846EE7 /* SDLVehicleDataType.m */; };
5D61FE0B1A84238C00846EE7 /* SDLVehicleType.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D61FC1E1A84238C00846EE7 /* SDLVehicleType.h */; settings = {ATTRIBUTES = (Public, ); }; };
5D61FE0C1A84238C00846EE7 /* SDLVehicleType.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D61FC1F1A84238C00846EE7 /* SDLVehicleType.m */; };
- 5D61FE0D1A84238C00846EE7 /* SDLVRCapabilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D61FC201A84238C00846EE7 /* SDLVRCapabilities.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 5D61FE0E1A84238C00846EE7 /* SDLVRCapabilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D61FC211A84238C00846EE7 /* SDLVRCapabilities.m */; };
- 5D61FE0F1A84238C00846EE7 /* SDLVRHelpItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D61FC221A84238C00846EE7 /* SDLVRHelpItem.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 5D61FE101A84238C00846EE7 /* SDLVRHelpItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D61FC231A84238C00846EE7 /* SDLVRHelpItem.m */; };
+ 5D61FE0D1A84238C00846EE7 /* SDLVrCapabilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D61FC201A84238C00846EE7 /* SDLVrCapabilities.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 5D61FE0E1A84238C00846EE7 /* SDLVrCapabilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D61FC211A84238C00846EE7 /* SDLVrCapabilities.m */; };
+ 5D61FE0F1A84238C00846EE7 /* SDLVrHelpItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D61FC221A84238C00846EE7 /* SDLVrHelpItem.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 5D61FE101A84238C00846EE7 /* SDLVrHelpItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D61FC231A84238C00846EE7 /* SDLVrHelpItem.m */; };
5D61FE111A84238C00846EE7 /* SDLWarningLightStatus.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D61FC241A84238C00846EE7 /* SDLWarningLightStatus.h */; settings = {ATTRIBUTES = (Public, ); }; };
5D61FE121A84238C00846EE7 /* SDLWarningLightStatus.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D61FC251A84238C00846EE7 /* SDLWarningLightStatus.m */; };
5D61FE131A84238C00846EE7 /* SDLWiperStatus.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D61FC261A84238C00846EE7 /* SDLWiperStatus.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -885,6 +885,8 @@
5DEE55C01B8509CB004F0D0F /* SDLURLRequestTaskSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DEE55BF1B8509CB004F0D0F /* SDLURLRequestTaskSpec.m */; };
5DF2BB9D1B94E38A00CE5994 /* SDLURLSessionSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DF2BB9C1B94E38A00CE5994 /* SDLURLSessionSpec.m */; };
5DFFB9151BD7C89700DB3F04 /* SDLConnectionManagerType.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DFFB9141BD7C89700DB3F04 /* SDLConnectionManagerType.h */; };
+ 97E26DEC1E807AD70074A3C7 /* SDLMutableDataQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 97E26DEA1E807AD70074A3C7 /* SDLMutableDataQueue.h */; };
+ 97E26DED1E807AD70074A3C7 /* SDLMutableDataQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 97E26DEB1E807AD70074A3C7 /* SDLMutableDataQueue.m */; };
DA4353DF1D271FD10099B8C4 /* CGPointUtilSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = DA4353DE1D271FD10099B8C4 /* CGPointUtilSpec.m */; };
DA4353E31D2720A30099B8C4 /* SDLPinchGestureSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = DA4353E21D2720A30099B8C4 /* SDLPinchGestureSpec.m */; };
DA4353E91D2721680099B8C4 /* DispatchTimerSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = DA4353E61D2721680099B8C4 /* DispatchTimerSpec.m */; };
@@ -1814,10 +1816,10 @@
5D61FC1D1A84238C00846EE7 /* SDLVehicleDataType.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLVehicleDataType.m; sourceTree = "<group>"; };
5D61FC1E1A84238C00846EE7 /* SDLVehicleType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLVehicleType.h; sourceTree = "<group>"; };
5D61FC1F1A84238C00846EE7 /* SDLVehicleType.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLVehicleType.m; sourceTree = "<group>"; };
- 5D61FC201A84238C00846EE7 /* SDLVRCapabilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLVRCapabilities.h; sourceTree = "<group>"; };
- 5D61FC211A84238C00846EE7 /* SDLVRCapabilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLVRCapabilities.m; sourceTree = "<group>"; };
- 5D61FC221A84238C00846EE7 /* SDLVRHelpItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLVRHelpItem.h; sourceTree = "<group>"; };
- 5D61FC231A84238C00846EE7 /* SDLVRHelpItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLVRHelpItem.m; sourceTree = "<group>"; };
+ 5D61FC201A84238C00846EE7 /* SDLVrCapabilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLVrCapabilities.h; sourceTree = "<group>"; };
+ 5D61FC211A84238C00846EE7 /* SDLVrCapabilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLVrCapabilities.m; sourceTree = "<group>"; };
+ 5D61FC221A84238C00846EE7 /* SDLVrHelpItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLVrHelpItem.h; sourceTree = "<group>"; };
+ 5D61FC231A84238C00846EE7 /* SDLVrHelpItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLVrHelpItem.m; sourceTree = "<group>"; };
5D61FC241A84238C00846EE7 /* SDLWarningLightStatus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLWarningLightStatus.h; sourceTree = "<group>"; };
5D61FC251A84238C00846EE7 /* SDLWarningLightStatus.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLWarningLightStatus.m; sourceTree = "<group>"; };
5D61FC261A84238C00846EE7 /* SDLWiperStatus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLWiperStatus.h; sourceTree = "<group>"; };
@@ -1924,6 +1926,8 @@
5DEE55BF1B8509CB004F0D0F /* SDLURLRequestTaskSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLURLRequestTaskSpec.m; path = "UtilitiesSpecs/HTTP Connection/SDLURLRequestTaskSpec.m"; sourceTree = "<group>"; };
5DF2BB9C1B94E38A00CE5994 /* SDLURLSessionSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLURLSessionSpec.m; path = "UtilitiesSpecs/HTTP Connection/SDLURLSessionSpec.m"; sourceTree = "<group>"; };
5DFFB9141BD7C89700DB3F04 /* SDLConnectionManagerType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLConnectionManagerType.h; sourceTree = "<group>"; };
+ 97E26DEA1E807AD70074A3C7 /* SDLMutableDataQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLMutableDataQueue.h; sourceTree = "<group>"; };
+ 97E26DEB1E807AD70074A3C7 /* SDLMutableDataQueue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLMutableDataQueue.m; sourceTree = "<group>"; };
DA4353DE1D271FD10099B8C4 /* CGPointUtilSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CGPointUtilSpec.m; path = UtilitiesSpecs/Touches/CGPointUtilSpec.m; sourceTree = "<group>"; };
DA4353E21D2720A30099B8C4 /* SDLPinchGestureSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLPinchGestureSpec.m; path = UtilitiesSpecs/Touches/SDLPinchGestureSpec.m; sourceTree = "<group>"; };
DA4353E61D2721680099B8C4 /* DispatchTimerSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DispatchTimerSpec.m; path = UtilitiesSpecs/Touches/DispatchTimerSpec.m; sourceTree = "<group>"; };
@@ -2922,8 +2926,8 @@
5D61FC171A84238C00846EE7 /* SDLVehicleDataResult.m */,
5D61FC1E1A84238C00846EE7 /* SDLVehicleType.h */,
5D61FC1F1A84238C00846EE7 /* SDLVehicleType.m */,
- 5D61FC221A84238C00846EE7 /* SDLVRHelpItem.h */,
- 5D61FC231A84238C00846EE7 /* SDLVRHelpItem.m */,
+ 5D61FC221A84238C00846EE7 /* SDLVrHelpItem.h */,
+ 5D61FC231A84238C00846EE7 /* SDLVrHelpItem.m */,
);
name = Structs;
sourceTree = "<group>";
@@ -3062,8 +3066,8 @@
5D61FC1B1A84238C00846EE7 /* SDLVehicleDataStatus.m */,
5D61FC1C1A84238C00846EE7 /* SDLVehicleDataType.h */,
5D61FC1D1A84238C00846EE7 /* SDLVehicleDataType.m */,
- 5D61FC201A84238C00846EE7 /* SDLVRCapabilities.h */,
- 5D61FC211A84238C00846EE7 /* SDLVRCapabilities.m */,
+ 5D61FC201A84238C00846EE7 /* SDLVrCapabilities.h */,
+ 5D61FC211A84238C00846EE7 /* SDLVrCapabilities.m */,
5D61FC241A84238C00846EE7 /* SDLWarningLightStatus.h */,
5D61FC251A84238C00846EE7 /* SDLWarningLightStatus.m */,
DA9F7E811DCC047200ACAE48 /* SDLWaypointType.h */,
@@ -3091,6 +3095,8 @@
5D5934F61A85189500687FB9 /* Utilities */ = {
isa = PBXGroup;
children = (
+ 97E26DEA1E807AD70074A3C7 /* SDLMutableDataQueue.h */,
+ 97E26DEB1E807AD70074A3C7 /* SDLMutableDataQueue.m */,
DAC5724C1D0FE3B60004288B /* Touches */,
5DCC199D1B8221D2004FFAD9 /* HTTP Connection */,
E9C32B831AB20B2900F283AF /* @categories */,
@@ -3912,7 +3918,7 @@
DAC572571D1067270004288B /* SDLTouchManager.h in Headers */,
5D61FD521A84238C00846EE7 /* SDLProxyFactory.h in Headers */,
5D61FCDA1A84238C00846EE7 /* SDLJingle.h in Headers */,
- 5D61FE0D1A84238C00846EE7 /* SDLVRCapabilities.h in Headers */,
+ 5D61FE0D1A84238C00846EE7 /* SDLVrCapabilities.h in Headers */,
5D61FC531A84238C00846EE7 /* SDLButtonEventMode.h in Headers */,
5D61FC781A84238C00846EE7 /* SDLDeleteFileResponse.h in Headers */,
5D61FC5F1A84238C00846EE7 /* SDLCharacterSet.h in Headers */,
@@ -4105,7 +4111,7 @@
5DCF76F91ACDD7CD00BB647B /* SDLSendLocationResponse.h in Headers */,
5D61FD391A84238C00846EE7 /* SDLPrerecordedSpeech.h in Headers */,
5D61FC671A84238C00846EE7 /* SDLComponentVolumeStatus.h in Headers */,
- 5D61FE0F1A84238C00846EE7 /* SDLVRHelpItem.h in Headers */,
+ 5D61FE0F1A84238C00846EE7 /* SDLVrHelpItem.h in Headers */,
5D60088A1BE3ED540094A505 /* SDLStateMachine.h in Headers */,
5D61FC721A84238C00846EE7 /* SDLDeleteCommand.h in Headers */,
5D61FC821A84238C00846EE7 /* SDLDeviceInfo.h in Headers */,
@@ -4201,6 +4207,7 @@
5D61FD4A1A84238C00846EE7 /* SDLProtocolMessageAssembler.h in Headers */,
5D61FD4C1A84238C00846EE7 /* SDLProtocolMessageDisassembler.h in Headers */,
5D61FD4E1A84238C00846EE7 /* SDLProtocolReceivedMessageRouter.h in Headers */,
+ 97E26DEC1E807AD70074A3C7 /* SDLMutableDataQueue.h in Headers */,
5D61FDF71A84238C00846EE7 /* SDLV1ProtocolMessage.h in Headers */,
5D61FDFB1A84238C00846EE7 /* SDLV2ProtocolMessage.h in Headers */,
5D7F87EB1CE3C1A1002DD7C4 /* SDLDeleteFileOperation.h in Headers */,
@@ -4461,7 +4468,7 @@
5D61FDE61A84238C00846EE7 /* SDLUnregisterAppInterfaceResponse.m in Sources */,
5D61FC481A84238C00846EE7 /* SDLAudioStreamingState.m in Sources */,
5D61FCC81A84238C00846EE7 /* SDLIAPTransport.m in Sources */,
- 5D61FE101A84238C00846EE7 /* SDLVRHelpItem.m in Sources */,
+ 5D61FE101A84238C00846EE7 /* SDLVrHelpItem.m in Sources */,
5D61FCC01A84238C00846EE7 /* SDLHexUtility.m in Sources */,
5D61FD821A84238C00846EE7 /* SDLSetAppIconResponse.m in Sources */,
5D61FDF81A84238C00846EE7 /* SDLV1ProtocolMessage.m in Sources */,
@@ -4668,6 +4675,7 @@
5D61FD7A1A84238C00846EE7 /* SDLScreenParams.m in Sources */,
5D61FC831A84238C00846EE7 /* SDLDeviceInfo.m in Sources */,
5D7F87EC1CE3C1A1002DD7C4 /* SDLDeleteFileOperation.m in Sources */,
+ 97E26DED1E807AD70074A3C7 /* SDLMutableDataQueue.m in Sources */,
5D61FD641A84238C00846EE7 /* SDLResetGlobalProperties.m in Sources */,
5D60088B1BE3ED540094A505 /* SDLStateMachine.m in Sources */,
5D61FD181A84238C00846EE7 /* SDLOnPermissionsChange.m in Sources */,
@@ -4686,7 +4694,7 @@
5D61FD401A84238C00846EE7 /* SDLPrioritizedObjectCollection.m in Sources */,
5D61FD741A84238C00846EE7 /* SDLRPCRequestFactory.m in Sources */,
5D61FDC61A84238C00846EE7 /* SDLTCPTransport.m in Sources */,
- 5D61FE0E1A84238C00846EE7 /* SDLVRCapabilities.m in Sources */,
+ 5D61FE0E1A84238C00846EE7 /* SDLVrCapabilities.m in Sources */,
5D61FDC21A84238C00846EE7 /* SDLSystemRequestResponse.m in Sources */,
5D61FD001A84238C00846EE7 /* SDLOnAppInterfaceUnregistered.m in Sources */,
DAC5726A1D10D5FC0004288B /* dispatch_timer.m in Sources */,
@@ -5290,7 +5298,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.smartdevicelink.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
- SWIFT_VERSION = 2.3;
+ SWIFT_VERSION = 3.0;
};
name = Debug;
};
@@ -5320,7 +5328,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = "com.smartdevicelink.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
- SWIFT_VERSION = 2.3;
+ SWIFT_VERSION = 3.0;
};
name = Release;
};
diff --git a/SmartDeviceLink/Info.plist b/SmartDeviceLink/Info.plist
index 4d3548d19..b5f4052c5 100644
--- a/SmartDeviceLink/Info.plist
+++ b/SmartDeviceLink/Info.plist
@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
- <string>4.5.4</string>
+ <string>4.5.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
diff --git a/SmartDeviceLink/NSBundle+SDLBundle.m b/SmartDeviceLink/NSBundle+SDLBundle.m
index 032994883..5880a5927 100644
--- a/SmartDeviceLink/NSBundle+SDLBundle.m
+++ b/SmartDeviceLink/NSBundle+SDLBundle.m
@@ -22,7 +22,15 @@ NS_ASSUME_NONNULL_BEGIN
sdlBundle = [NSBundle bundleWithURL:sdlBundleURL];
}
if (sdlBundle == nil) {
- sdlBundle = [NSBundle bundleForClass:[SDLManager class]];
+ NSBundle *frameworkBundle = [NSBundle bundleForClass:[SDLManager class]];
+
+ // HAX: Cocoapods will have the bundle as an inner bundle that we need to unpack...because reasons. Otherwise it's just the bundle we need
+ NSURL *innerBundleURL = [frameworkBundle URLForResource:@"SmartDeviceLink" withExtension:@"bundle"];
+ if (innerBundleURL) {
+ sdlBundle = [NSBundle bundleWithURL:innerBundleURL];
+ } else {
+ sdlBundle = frameworkBundle;
+ }
}
if (sdlBundle == nil) {
@throw [NSException exceptionWithName:NSInternalInconsistencyException reason:@"SDL WARNING: The 'SmartDeviceLink.bundle' resources bundle was not found. If you are using cocoapods, try dragging the bundle from the SmartDeviceLink-iOS pod 'products' directory into your resources build phase. If this does not work, please go to the SDL slack at slack.smartdevicelink.com and explain your issue. You may disable the lockscreen in configuration to prevent this failure, for now." userInfo:nil];
diff --git a/SmartDeviceLink/SDLAlert.m b/SmartDeviceLink/SDLAlert.m
index d5e11a12b..89f2cb02e 100644
--- a/SmartDeviceLink/SDLAlert.m
+++ b/SmartDeviceLink/SDLAlert.m
@@ -123,7 +123,9 @@ static UInt16 const SDLDefaultDuration = 5000;
- (NSMutableArray *)ttsChunks {
NSMutableArray *array = [parameters objectForKey:NAMES_ttsChunks];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLTTSChunk.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLTTSChunk.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
@@ -180,7 +182,9 @@ static UInt16 const SDLDefaultDuration = 5000;
- (NSMutableArray *)softButtons {
NSMutableArray *array = [parameters objectForKey:NAMES_softButtons];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLSoftButton.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLSoftButton.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
diff --git a/SmartDeviceLink/SDLAlertManeuver.m b/SmartDeviceLink/SDLAlertManeuver.m
index a3e6899b9..8582ee697 100644
--- a/SmartDeviceLink/SDLAlertManeuver.m
+++ b/SmartDeviceLink/SDLAlertManeuver.m
@@ -50,7 +50,9 @@
- (NSMutableArray *)ttsChunks {
NSMutableArray *array = [parameters objectForKey:NAMES_ttsChunks];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLTTSChunk.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLTTSChunk.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
@@ -71,7 +73,9 @@
- (NSMutableArray *)softButtons {
NSMutableArray *array = [parameters objectForKey:NAMES_softButtons];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLSoftButton.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLSoftButton.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
diff --git a/SmartDeviceLink/SDLArtwork.h b/SmartDeviceLink/SDLArtwork.h
index 9bbd81cb9..d9e82dff2 100644
--- a/SmartDeviceLink/SDLArtwork.h
+++ b/SmartDeviceLink/SDLArtwork.h
@@ -6,7 +6,7 @@
// Copyright © 2015 smartdevicelink. All rights reserved.
//
-@import UIKit;
+#import <UIKit/UIKit.h>
#import "SDLFile.h"
@@ -67,4 +67,4 @@ NS_ASSUME_NONNULL_BEGIN
@end
-NS_ASSUME_NONNULL_END \ No newline at end of file
+NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLCreateInteractionChoiceSet.m b/SmartDeviceLink/SDLCreateInteractionChoiceSet.m
index 25539d8ea..b81d27f8a 100644
--- a/SmartDeviceLink/SDLCreateInteractionChoiceSet.m
+++ b/SmartDeviceLink/SDLCreateInteractionChoiceSet.m
@@ -54,7 +54,9 @@
- (NSMutableArray *)choiceSet {
NSMutableArray *array = [parameters objectForKey:NAMES_choiceSet];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLChoice.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLChoice.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
diff --git a/SmartDeviceLink/SDLDisplayCapabilities.m b/SmartDeviceLink/SDLDisplayCapabilities.m
index 07ae53d62..a9ddd21f2 100644
--- a/SmartDeviceLink/SDLDisplayCapabilities.m
+++ b/SmartDeviceLink/SDLDisplayCapabilities.m
@@ -52,7 +52,9 @@
- (NSMutableArray *)textFields {
NSMutableArray *array = [store objectForKey:NAMES_textFields];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLTextField.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLTextField.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
@@ -73,7 +75,9 @@
- (NSMutableArray *)imageFields {
NSMutableArray *array = [store objectForKey:NAMES_imageFields];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLImageField.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLImageField.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
@@ -94,7 +98,9 @@
- (NSMutableArray *)mediaClockFormats {
NSMutableArray *array = [store objectForKey:NAMES_mediaClockFormats];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLMediaClockFormat.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLMediaClockFormat.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
diff --git a/SmartDeviceLink/SDLFileManager.m b/SmartDeviceLink/SDLFileManager.m
index 0321691ac..7f20080f4 100644
--- a/SmartDeviceLink/SDLFileManager.m
+++ b/SmartDeviceLink/SDLFileManager.m
@@ -136,7 +136,7 @@ SDLFileManagerState *const SDLFileManagerStateStartupError = @"StartupError";
}
}
-- (void)willEnterStateShutdown {
+- (void)didEnterStateShutdown {
[self.transactionQueue cancelAllOperations];
[self.mutableRemoteFileNames removeAllObjects];
[self.class sdl_clearTemporaryFileDirectory];
diff --git a/SmartDeviceLink/SDLGetWaypointsResponse.m b/SmartDeviceLink/SDLGetWaypointsResponse.m
index 3f3f474a4..2e5b6f984 100644
--- a/SmartDeviceLink/SDLGetWaypointsResponse.m
+++ b/SmartDeviceLink/SDLGetWaypointsResponse.m
@@ -24,7 +24,9 @@
- (NSArray<SDLLocationDetails *> *)waypoints {
NSMutableArray *array = [parameters objectForKey:NAMES_waypoints];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLLocationDetails.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLLocationDetails.class]) {
return [array copy];
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
diff --git a/SmartDeviceLink/SDLHMIPermissions.m b/SmartDeviceLink/SDLHMIPermissions.m
index 29555bf59..5ba496efa 100644
--- a/SmartDeviceLink/SDLHMIPermissions.m
+++ b/SmartDeviceLink/SDLHMIPermissions.m
@@ -31,7 +31,9 @@
- (NSMutableArray *)allowed {
NSMutableArray *array = [store objectForKey:NAMES_allowed];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLHMILevel.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLHMILevel.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
@@ -52,7 +54,9 @@
- (NSMutableArray *)userDisallowed {
NSMutableArray *array = [store objectForKey:NAMES_userDisallowed];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLHMILevel.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLHMILevel.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
diff --git a/SmartDeviceLink/SDLIAPSession.h b/SmartDeviceLink/SDLIAPSession.h
index d21343894..751d10086 100644
--- a/SmartDeviceLink/SDLIAPSession.h
+++ b/SmartDeviceLink/SDLIAPSession.h
@@ -17,11 +17,12 @@ typedef void (^SessionCompletionHandler)(BOOL success);
@property (strong, atomic) EASession *easession;
@property (weak) id<SDLIAPSessionDelegate> delegate;
@property (strong, atomic) SDLStreamDelegate *streamDelegate;
+@property (assign, readonly, getter=isStopped) BOOL stopped;
- (instancetype)initWithAccessory:(EAAccessory *)accessory
forProtocol:(NSString *)protocol;
- (BOOL)start;
- (void)stop;
-
+- (void)sendData:(NSData *)data;
@end
diff --git a/SmartDeviceLink/SDLIAPSession.m b/SmartDeviceLink/SDLIAPSession.m
index 5020b2081..2048f88de 100644
--- a/SmartDeviceLink/SDLIAPSession.m
+++ b/SmartDeviceLink/SDLIAPSession.m
@@ -4,14 +4,21 @@
#import "SDLIAPSession.h"
#import "SDLDebugTool.h"
+#import "SDLMutableDataQueue.h"
#import "SDLStreamDelegate.h"
#import "SDLTimer.h"
+NSString *const IOStreamThreadName = @"com.smartdevicelink.iostream";
+NSTimeInterval const streamThreadWaitSecs = 1.0;
@interface SDLIAPSession ()
@property (assign) BOOL isInputStreamOpen;
@property (assign) BOOL isOutputStreamOpen;
+@property (assign, nonatomic) BOOL isDataSession;
+@property (nonatomic, strong) NSThread *ioStreamThread;
+@property (nonatomic, strong) SDLMutableDataQueue *sendDataQueue;
+@property (nonatomic, strong) dispatch_semaphore_t canceledSemaphore;
@end
@@ -27,8 +34,11 @@
self = [super init];
if (self) {
_delegate = nil;
+ _isDataSession = [protocol isEqualToString:@"com.smartdevicelink.prot0"] ? NO : YES;
_accessory = accessory;
_protocol = protocol;
+ _canceledSemaphore = dispatch_semaphore_create(0);
+ _sendDataQueue = [[SDLMutableDataQueue alloc] init];
_streamDelegate = nil;
_easession = nil;
_isInputStreamOpen = NO;
@@ -43,20 +53,28 @@
- (BOOL)start {
__weak typeof(self) weakSelf = self;
- NSString *logMessage = [NSString stringWithFormat:@"Opening EASession withAccessory:%@ forProtocol:%@", _accessory.name, _protocol];
+ NSString *logMessage = [NSString stringWithFormat:@"Opening EASession withAccessory:%@ forProtocol:%@", self.accessory.name, self.protocol];
[SDLDebugTool logInfo:logMessage];
- if ((self.easession = [[EASession alloc] initWithAccessory:_accessory forProtocol:_protocol])) {
+ // TODO: This assignment should be broken out of the if and the if / else should be flipped.
+ if ((self.easession = [[EASession alloc] initWithAccessory:self.accessory forProtocol:self.protocol])) {
__strong typeof(self) strongSelf = weakSelf;
[SDLDebugTool logInfo:@"Created Session Object"];
strongSelf.streamDelegate.streamErrorHandler = [self streamErroredHandler];
strongSelf.streamDelegate.streamOpenHandler = [self streamOpenedHandler];
-
- [strongSelf startStream:weakSelf.easession.outputStream];
- [strongSelf startStream:weakSelf.easession.inputStream];
-
+ if (self.isDataSession) {
+ self.streamDelegate.streamHasSpaceHandler = [self sdl_streamHasSpaceHandler];
+ // Start I/O event loop processing events in iAP channel
+ self.ioStreamThread = [[NSThread alloc] initWithTarget:self selector:@selector(sdl_accessoryEventLoop) object:nil];
+ [self.ioStreamThread setName:IOStreamThreadName];
+ [self.ioStreamThread start];
+ } else {
+ // Set up control session -- no need for its own thread
+ [self startStream:self.easession.outputStream];
+ [self startStream:self.easession.inputStream];
+ }
return YES;
} else {
@@ -66,17 +84,124 @@
}
- (void)stop {
- [self stopStream:self.easession.outputStream];
- [self stopStream:self.easession.inputStream];
+ if (self.isDataSession) {
+ [self.ioStreamThread cancel];
+
+ long lWait = dispatch_semaphore_wait(self.canceledSemaphore, dispatch_time(DISPATCH_TIME_NOW, streamThreadWaitSecs * NSEC_PER_SEC));
+ if (lWait == 0) {
+ [SDLDebugTool logInfo:@"Stream thread canceled"];
+ } else {
+ [SDLDebugTool logInfo:@"Error: failed to cancel stream thread"];
+ }
+ self.ioStreamThread = nil;
+ self.isDataSession = NO;
+ } else {
+ // Stop control session
+ [self stopStream:self.easession.outputStream];
+ [self stopStream:self.easession.inputStream];
+ }
self.easession = nil;
}
+- (BOOL)isStopped {
+ return !self.isOutputStreamOpen && !self.isInputStreamOpen;
+}
+
+# pragma mark - data send methods
+
+- (void)sendData:(NSData *)data {
+ // Enqueue the data for transmission on the IO thread
+ [self.sendDataQueue enqueueBuffer:data.mutableCopy];
+}
+
+- (BOOL)sdl_dequeueAndWriteToOutputStream:(NSError **)error {
+ NSOutputStream *ostream = self.easession.outputStream;
+ NSMutableData *remainder = [self.sendDataQueue frontBuffer];
+ BOOL allDataWritten = NO;
+
+ if (error != nil && remainder != nil && ostream.streamStatus == NSStreamStatusOpen) {
+ NSInteger bytesRemaining = remainder.length;
+ NSInteger bytesWritten = [ostream write:remainder.bytes maxLength:bytesRemaining];
+ if (bytesWritten < 0) {
+ *error = ostream.streamError;
+ } else if (bytesWritten == bytesRemaining) {
+ // Remove the data from the queue
+ [self.sendDataQueue popBuffer];
+ allDataWritten = YES;
+ } else {
+ // Cleave the sent bytes from the data, the remainder will sit at the head of the queue
+ [remainder replaceBytesInRange:NSMakeRange(0, bytesWritten) withBytes:NULL length:0];
+ }
+ }
+
+ return allDataWritten;
+}
+
+- (void)sdl_handleOutputStreamWriteError:(NSError *)error {
+ NSString *errString = [NSString stringWithFormat:@"Output stream error: %@", error];
+ [SDLDebugTool logInfo:errString];
+ // TODO: We should look at the domain and the code as a tuple and decide how to handle the error based on both values. For now, if the stream is closed, we will flush the send queue and leave it as-is otherwise so that temporary error conditions can be dealt with by retrying
+ if (self.easession == nil ||
+ self.easession.outputStream == nil ||
+ self.easession.outputStream.streamStatus != NSStreamStatusOpen) {
+ [self.sendDataQueue removeAllObjects];
+ }
+}
+
+# pragma mark - background I/O for data session
+
+// Data session I/O thread
+- (void)sdl_accessoryEventLoop {
+ @autoreleasepool {
+ NSAssert(self.easession, @"_session must be assigned before calling");
+
+ if (!self.easession) {
+ return;
+ }
+
+ [self startStream:self.easession.inputStream];
+ [self startStream:self.easession.outputStream];
+
+ [SDLDebugTool logInfo:@"starting the event loop for accessory"];
+ do {
+ if (self.sendDataQueue.count > 0 && !self.sendDataQueue.frontDequeued) {
+ NSError *sendErr = nil;
+ if (![self sdl_dequeueAndWriteToOutputStream:&sendErr] && sendErr != nil) {
+ [self sdl_handleOutputStreamWriteError:sendErr];
+ }
+ }
+ // The principle here is to give the event loop enough time to process stream events while also allowing it to handle new enqueued data buffers in a timely manner. We're capping the run loop CPU time at 0.25s maximum before it will return control to the rest of the loop.
+ [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.25f]];
+ } while (![NSThread currentThread].cancelled);
+
+ [SDLDebugTool logInfo:@"closing accessory session"];
+
+ // Close I/O streams of the iAP session
+ [self sdl_closeSession];
+ dispatch_semaphore_signal(self.canceledSemaphore);
+ }
+}
+
+// Must be called on accessoryEventLoop.
+- (void)sdl_closeSession {
+ if (!self.easession) {
+ return;
+ }
+
+ NSString *closeSessionString = [NSString stringWithFormat:@"Close EASession: %tu", self.easession.accessory.connectionID];
+ [SDLDebugTool logInfo:closeSessionString];
+
+ [self stopStream:[self.easession inputStream]];
+ [self stopStream:[self.easession outputStream]];
+}
+
#pragma mark - Private Stream Lifecycle Helpers
- (void)startStream:(NSStream *)stream {
stream.delegate = self.streamDelegate;
- [stream scheduleInRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode];
+ NSAssert((self.isDataSession && [[NSThread currentThread] isEqual:self.ioStreamThread]) || [NSThread isMainThread], @"startStream is being called on the wrong thread!!!");
+ [stream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
[stream open];
}
@@ -86,6 +211,8 @@
// When you disconect the cable you get a stream end event and come here but stream is already in closed state.
// Still need to remove from run loop.
+
+ NSAssert((self.isDataSession && [[NSThread currentThread] isEqual:self.ioStreamThread]) || [NSThread isMainThread], @"stopStream is being called on the wrong thread!!!");
NSUInteger status1 = stream.streamStatus;
if (status1 != NSStreamStatusNotOpen &&
@@ -93,15 +220,17 @@
[stream close];
}
- [stream removeFromRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode];
+ [stream removeFromRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
[stream setDelegate:nil];
NSUInteger status2 = stream.streamStatus;
if (status2 == NSStreamStatusClosed) {
if (stream == [self.easession inputStream]) {
[SDLDebugTool logInfo:@"Input Stream Closed"];
+ self.isInputStreamOpen = NO;
} else if (stream == [self.easession outputStream]) {
[SDLDebugTool logInfo:@"Output Stream Closed"];
+ self.isOutputStreamOpen = NO;
}
}
}
@@ -141,16 +270,22 @@
};
}
-
-#pragma mark - Lifecycle Destruction
-
-- (void)dealloc {
- self.delegate = nil;
- self.accessory = nil;
- self.protocol = nil;
- self.streamDelegate = nil;
- self.easession = nil;
- [SDLDebugTool logInfo:@"SDLIAPSession Dealloc"];
+- (SDLStreamHasSpaceHandler)sdl_streamHasSpaceHandler {
+ __weak typeof(self) weakSelf = self;
+
+ return ^(NSStream *stream) {
+ __strong typeof(weakSelf) strongSelf = weakSelf;
+
+ if (!strongSelf.isDataSession){
+ return;
+ }
+
+ NSError *sendErr = nil;
+
+ if (![strongSelf sdl_dequeueAndWriteToOutputStream:&sendErr] && sendErr != nil) {
+ [strongSelf sdl_handleOutputStreamWriteError:sendErr];
+ }
+ };
}
@end
diff --git a/SmartDeviceLink/SDLIAPTransport.m b/SmartDeviceLink/SDLIAPTransport.m
index b3dabaa9f..bccac5d3b 100644
--- a/SmartDeviceLink/SDLIAPTransport.m
+++ b/SmartDeviceLink/SDLIAPTransport.m
@@ -6,6 +6,7 @@
#import <UIKit/UIKit.h>
#import "EAAccessoryManager+SDLProtocols.h"
+#import "EAAccessory+SDLProtocols.h"
#import "SDLDebugTool.h"
#import "SDLGlobals.h"
#import "SDLIAPSession.h"
@@ -28,7 +29,6 @@ int const streamOpenTimeoutSeconds = 2;
@interface SDLIAPTransport () {
- dispatch_queue_t _transmit_queue;
BOOL _alreadyDestructed;
}
@@ -50,8 +50,7 @@ int const streamOpenTimeoutSeconds = 2;
_controlSession = nil;
_retryCounter = 0;
_protocolIndexTimer = nil;
- _transmit_queue = dispatch_queue_create("com.sdl.transport.iap.transmit", DISPATCH_QUEUE_SERIAL);
- _backgroundTaskId = UIBackgroundTaskInvalid;
+
[self sdl_startEventListening];
[SDLSiphonServer init];
}
@@ -80,6 +79,8 @@ int const streamOpenTimeoutSeconds = 2;
selector:@selector(sdl_applicationWillEnterForeground:)
name:UIApplicationWillEnterForegroundNotification
object:nil];
+
+ [[EAAccessoryManager sharedAccessoryManager] registerForLocalNotifications];
}
- (void)sdl_stopEventListening {
@@ -117,11 +118,13 @@ int const streamOpenTimeoutSeconds = 2;
#pragma mark - EAAccessory Notifications
- (void)sdl_accessoryConnected:(NSNotification *)notification {
+ EAAccessory *accessory = notification.userInfo[EAAccessoryKey];
NSMutableString *logMessage = [NSMutableString stringWithFormat:@"Accessory Connected, Opening in %0.03fs", self.retryDelay];
[self sdl_backgroundTaskStart];
[SDLDebugTool logInfo:logMessage withType:SDLDebugType_Transport_iAP toOutput:SDLDebugOutput_All toGroup:self.debugConsoleGroupName];
self.retryCounter = 0;
- [self performSelector:@selector(connect) withObject:nil afterDelay:self.retryDelay];
+
+ [self performSelector:@selector(sdl_connect:) withObject:accessory afterDelay:self.retryDelay];
}
- (void)sdl_accessoryDisconnected:(NSNotification *)notification {
@@ -129,7 +132,10 @@ int const streamOpenTimeoutSeconds = 2;
// Only check for the data session, the control session is handled separately
EAAccessory *accessory = [notification.userInfo objectForKey:EAAccessoryKey];
- if (accessory.connectionID == self.session.accessory.connectionID) {
+ if (accessory.connectionID != self.session.accessory.connectionID) {
+ [SDLDebugTool logInfo:@"Accessory connection ID mismatch!!!" withType:SDLDebugType_Transport_iAP toOutput:SDLDebugOutput_All toGroup:self.debugConsoleGroupName];
+ }
+ if ([accessory.serialNumber isEqualToString:self.session.accessory.serialNumber]){
self.sessionSetupInProgress = NO;
[self disconnect];
[self.delegate onTransportDisconnected];
@@ -147,9 +153,13 @@ int const streamOpenTimeoutSeconds = 2;
#pragma mark - Stream Lifecycle
- (void)connect {
+ [self sdl_connect:nil];
+}
+
+- (void)sdl_connect:(EAAccessory *)accessory {
if (!self.session && !self.sessionSetupInProgress) {
self.sessionSetupInProgress = YES;
- [self sdl_establishSession];
+ [self sdl_establishSessionWithAccessory:accessory];
} else if (self.session) {
[SDLDebugTool logInfo:@"Session already established."];
} else {
@@ -159,7 +169,9 @@ int const streamOpenTimeoutSeconds = 2;
- (void)disconnect {
[SDLDebugTool logInfo:@"IAP Disconnecting" withType:SDLDebugType_Transport_iAP toOutput:SDLDebugOutput_All toGroup:self.debugConsoleGroupName];
-
+ // Stop event listening here so that even if the transport is disconnected by the proxy
+ // we unregister for accessory local notifications
+ [self sdl_stopEventListening];
// Only disconnect the data session, the control session does not stay open and is handled separately
if (self.session != nil) {
[self.session stop];
@@ -170,23 +182,43 @@ int const streamOpenTimeoutSeconds = 2;
#pragma mark - Creating Session Streams
-- (void)sdl_establishSession {
+- (BOOL)sdl_connectAccessory:(EAAccessory *)accessory {
+ BOOL connecting = NO;
+
+ if ([accessory supportsProtocol:controlProtocolString]) {
+ [self sdl_createIAPControlSessionWithAccessory:accessory];
+ connecting = YES;
+ } else if ([accessory supportsProtocol:legacyProtocolString]) {
+ [self sdl_createIAPDataSessionWithAccessory:accessory forProtocol:legacyProtocolString];
+ connecting = YES;
+ }
+
+ return connecting;
+}
+
+- (void)sdl_establishSessionWithAccessory:(EAAccessory *)accessory {
[SDLDebugTool logInfo:@"Attempting To Connect"];
if (self.retryCounter < createSessionRetries) {
// We should be attempting to connect
self.retryCounter++;
- EAAccessory *accessory = nil;
-
+ EAAccessory *sdlAccessory = accessory;
+ // If we are being called from sdl_connectAccessory, the EAAccessoryDidConnectNotification will contain the SDL accessory to connect to and we can connect without searching the accessory manager's connected accessory list. Otherwise, we fall through to a search.
+ if (sdlAccessory != nil && [self sdl_connectAccessory:sdlAccessory]){
+ // Connection underway, exit
+ return;
+ }
+
// Determine if we can start a multi-app session or a legacy (single-app) session
- if ((accessory = [EAAccessoryManager findAccessoryForProtocol:controlProtocolString])) {
- [self sdl_createIAPControlSessionWithAccessory:accessory];
- } else if ((accessory = [EAAccessoryManager findAccessoryForProtocol:legacyProtocolString])) {
- [self sdl_createIAPDataSessionWithAccessory:accessory forProtocol:legacyProtocolString];
+ if ((sdlAccessory = [EAAccessoryManager findAccessoryForProtocol:controlProtocolString])) {
+ [self sdl_createIAPControlSessionWithAccessory:sdlAccessory];
+ } else if ((sdlAccessory = [EAAccessoryManager findAccessoryForProtocol:legacyProtocolString])) {
+ [self sdl_createIAPDataSessionWithAccessory:sdlAccessory forProtocol:legacyProtocolString];
} else {
// No compatible accessory
[SDLDebugTool logInfo:@"No accessory supporting a required sync protocol was found."];
self.sessionSetupInProgress = NO;
}
+
} else {
// We are beyond the number of retries allowed
[SDLDebugTool logInfo:@"Create session retries exhausted."];
@@ -264,6 +296,13 @@ int const streamOpenTimeoutSeconds = 2;
- (void)sdl_retryEstablishSession {
// Current strategy disallows automatic retries.
self.sessionSetupInProgress = NO;
+ if (self.session != nil){
+ [self.session stop];
+ self.session.delegate = nil;
+ self.session = nil;
+ }
+ // No accessory to use this time, search connected accessories
+ [self sdl_connect:nil];
}
// This gets called after both I/O streams of the session have opened.
@@ -298,23 +337,11 @@ int const streamOpenTimeoutSeconds = 2;
#pragma mark - Data Transmission
- (void)sendData:(NSData *)data {
- dispatch_async(_transmit_queue, ^{
- NSOutputStream *ostream = self.session.easession.outputStream;
- NSMutableData *remainder = data.mutableCopy;
-
- while (remainder.length != 0) {
- if (ostream.streamStatus == NSStreamStatusOpen && ostream.hasSpaceAvailable) {
- NSInteger bytesWritten = [ostream write:remainder.bytes maxLength:remainder.length];
-
- if (bytesWritten == -1) {
- [SDLDebugTool logInfo:[NSString stringWithFormat:@"Error: %@", [ostream streamError]] withType:SDLDebugType_Transport_iAP toOutput:SDLDebugOutput_All];
- break;
- }
-
- [remainder replaceBytesInRange:NSMakeRange(0, bytesWritten) withBytes:NULL length:0];
- }
- }
- });
+ if (self.session == nil || !self.session.accessory.connected) {
+ return;
+ }
+
+ [self.session sendData:data];
}
@@ -357,15 +384,19 @@ int const streamOpenTimeoutSeconds = 2;
// Destroy the control session
[strongSelf.protocolIndexTimer cancel];
- [strongSelf.controlSession stop];
- strongSelf.controlSession.streamDelegate = nil;
- strongSelf.controlSession = nil;
+ dispatch_sync(dispatch_get_main_queue(), ^{
+ [strongSelf.controlSession stop];
+ strongSelf.controlSession.streamDelegate = nil;
+ strongSelf.controlSession = nil;
+ });
// Determine protocol string of the data session, then create that data session
NSString *indexedProtocolString = [NSString stringWithFormat:@"%@%@", indexedProtocolStringPrefix, @(buf[0])];
- dispatch_sync(dispatch_get_main_queue(), ^{
- [strongSelf sdl_createIAPDataSessionWithAccessory:accessory forProtocol:indexedProtocolString];
- });
+ if (accessory.isConnected){
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [strongSelf sdl_createIAPDataSessionWithAccessory:accessory forProtocol:indexedProtocolString];
+ });
+ }
}
};
}
@@ -413,7 +444,9 @@ int const streamOpenTimeoutSeconds = 2;
__strong typeof(weakSelf) strongSelf = weakSelf;
uint8_t buf[[SDLGlobals globals].maxMTUSize];
- while ([istream hasBytesAvailable]) {
+ while (istream.streamStatus == NSStreamStatusOpen && istream.hasBytesAvailable) {
+ // It is necessary to check the stream status and whether there are bytes available because the dataStreamHasBytesHandler is executed on the IO thread and the accessory disconnect notification arrives on the main thread, causing data to be passed to the delegate while the main thread is tearing down the transport.
+
NSInteger bytesRead = [istream read:buf maxLength:[SDLGlobals globals].maxMTUSize];
NSData *dataIn = [NSData dataWithBytes:buf length:bytesRead];
@@ -488,7 +521,6 @@ int const streamOpenTimeoutSeconds = 2;
- (void)sdl_destructObjects {
if (!_alreadyDestructed) {
_alreadyDestructed = YES;
- [self sdl_stopEventListening];
self.controlSession = nil;
self.session = nil;
self.delegate = nil;
diff --git a/SmartDeviceLink/SDLImageField.m b/SmartDeviceLink/SDLImageField.m
index af4f15517..18f90c113 100644
--- a/SmartDeviceLink/SDLImageField.m
+++ b/SmartDeviceLink/SDLImageField.m
@@ -50,7 +50,9 @@
- (NSMutableArray *)imageTypeSupported {
NSMutableArray *array = [store objectForKey:NAMES_imageTypeSupported];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLFileType.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLFileType.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
diff --git a/SmartDeviceLink/SDLLifecycleConfiguration.h b/SmartDeviceLink/SDLLifecycleConfiguration.h
index 638c1703a..84a6d9efb 100644
--- a/SmartDeviceLink/SDLLifecycleConfiguration.h
+++ b/SmartDeviceLink/SDLLifecycleConfiguration.h
@@ -6,9 +6,7 @@
// Copyright © 2015 smartdevicelink. All rights reserved.
//
-@import UIKit;
-
-#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
@class SDLAppHMIType;
@class SDLFile;
diff --git a/SmartDeviceLink/SDLLifecycleConfiguration.m b/SmartDeviceLink/SDLLifecycleConfiguration.m
index f1b8acf7e..efc9014b2 100644
--- a/SmartDeviceLink/SDLLifecycleConfiguration.m
+++ b/SmartDeviceLink/SDLLifecycleConfiguration.m
@@ -92,6 +92,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)setAppType:(nullable SDLAppHMIType *)appType {
if (appType == nil) {
_appType = [SDLAppHMIType DEFAULT];
+ return;
}
_appType = appType;
diff --git a/SmartDeviceLink/SDLLifecycleManager.h b/SmartDeviceLink/SDLLifecycleManager.h
index 9332d5d9d..f09d18aaf 100644
--- a/SmartDeviceLink/SDLLifecycleManager.h
+++ b/SmartDeviceLink/SDLLifecycleManager.h
@@ -42,7 +42,8 @@ extern SDLLifecycleState *const SDLLifecycleStateReconnecting;
extern SDLLifecycleState *const SDLLifecycleStateConnected;
extern SDLLifecycleState *const SDLLifecycleStateRegistered;
extern SDLLifecycleState *const SDLLifecycleStateSettingUpManagers;
-extern SDLLifecycleState *const SDLLifecycleStatePostManagerProcessing;
+extern SDLLifecycleState *const SDLLifecycleStateSettingUpAppIcon;
+extern SDLLifecycleState *const SDLLifecycleStateSettingUpHMI;
extern SDLLifecycleState *const SDLLifecycleStateUnregistering;
extern SDLLifecycleState *const SDLLifecycleStateReady;
diff --git a/SmartDeviceLink/SDLLifecycleManager.m b/SmartDeviceLink/SDLLifecycleManager.m
index 29a6f7a6d..185822148 100644
--- a/SmartDeviceLink/SDLLifecycleManager.m
+++ b/SmartDeviceLink/SDLLifecycleManager.m
@@ -49,7 +49,8 @@ SDLLifecycleState *const SDLLifecycleStateReconnecting = @"Reconnecting";
SDLLifecycleState *const SDLLifecycleStateConnected = @"Connected";
SDLLifecycleState *const SDLLifecycleStateRegistered = @"Registered";
SDLLifecycleState *const SDLLifecycleStateSettingUpManagers = @"SettingUpManagers";
-SDLLifecycleState *const SDLLifecycleStatePostManagerProcessing = @"PostManagerProcessing";
+SDLLifecycleState *const SDLLifecycleStateSettingUpAppIcon = @"SettingUpAppIcon";
+SDLLifecycleState *const SDLLifecycleStateSettingUpHMI = @"SettingUpHMI";
SDLLifecycleState *const SDLLifecycleStateUnregistering = @"Unregistering";
SDLLifecycleState *const SDLLifecycleStateReady = @"Ready";
@@ -148,11 +149,12 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready";
return @{
SDLLifecycleStateStopped: @[SDLLifecycleStateStarted],
SDLLifecycleStateStarted : @[SDLLifecycleStateConnected, SDLLifecycleStateStopped, SDLLifecycleStateReconnecting],
- SDLLifecycleStateReconnecting: @[SDLLifecycleStateStarted],
+ SDLLifecycleStateReconnecting: @[SDLLifecycleStateStarted, SDLLifecycleStateStopped],
SDLLifecycleStateConnected: @[SDLLifecycleStateStopped, SDLLifecycleStateReconnecting, SDLLifecycleStateRegistered],
SDLLifecycleStateRegistered: @[SDLLifecycleStateStopped, SDLLifecycleStateReconnecting, SDLLifecycleStateSettingUpManagers],
- SDLLifecycleStateSettingUpManagers: @[SDLLifecycleStateStopped, SDLLifecycleStateReconnecting, SDLLifecycleStatePostManagerProcessing],
- SDLLifecycleStatePostManagerProcessing: @[SDLLifecycleStateStopped, SDLLifecycleStateReconnecting, SDLLifecycleStateReady],
+ SDLLifecycleStateSettingUpManagers: @[SDLLifecycleStateStopped, SDLLifecycleStateReconnecting, SDLLifecycleStateSettingUpAppIcon],
+ SDLLifecycleStateSettingUpAppIcon: @[SDLLifecycleStateStopped, SDLLifecycleStateReconnecting, SDLLifecycleStateSettingUpHMI],
+ SDLLifecycleStateSettingUpHMI: @[SDLLifecycleStateStopped, SDLLifecycleStateReconnecting, SDLLifecycleStateReady],
SDLLifecycleStateUnregistering: @[SDLLifecycleStateStopped],
SDLLifecycleStateReady: @[SDLLifecycleStateUnregistering, SDLLifecycleStateStopped, SDLLifecycleStateReconnecting]
};
@@ -263,18 +265,28 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready";
// When done, we want to transition, even if there were errors. They may be expected, e.g. on head units that do not support files.
dispatch_group_notify(managerGroup, dispatch_get_main_queue(), ^{
- [self.lifecycleStateMachine transitionToState:SDLLifecycleStatePostManagerProcessing];
+ [self.lifecycleStateMachine transitionToState:SDLLifecycleStateSettingUpAppIcon];
});
}
-- (void)didEnterStatePostManagerProcessing {
- // We only want to send the app icon when the file manager is complete, and when that's done, set the state to ready
+- (void)didEnterStateSettingUpAppIcon {
+ // We only want to send the app icon when the file manager is complete, and when that's done, wait for hmi status to be ready
[self sdl_sendAppIcon:self.configuration.lifecycleConfig.appIcon
withCompletion:^{
- [self.lifecycleStateMachine transitionToState:SDLLifecycleStateReady];
+ [self.lifecycleStateMachine transitionToState:SDLLifecycleStateSettingUpHMI];
}];
}
+- (void)didEnterStateSettingUpHMI{
+ // We want to make sure we've gotten a SDLOnHMIStatus notification
+ if (self.hmiLevel == nil) {
+ // If nil, return and wait until we get a notification
+ return;
+ }
+ // We are sure to have a HMIStatus, set state to ready
+ [self.lifecycleStateMachine transitionToState:SDLLifecycleStateReady];
+}
+
- (void)didEnterStateReady {
SDLResult *registerResult = self.registerResponse.resultCode;
NSString *registerInfo = self.registerResponse.info;
@@ -466,6 +478,10 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready";
SDLOnHMIStatus *hmiStatusNotification = notification.notification;
SDLHMILevel *oldHMILevel = self.hmiLevel;
self.hmiLevel = hmiStatusNotification.hmiLevel;
+
+ if ([self.lifecycleStateMachine isCurrentState:SDLLifecycleStateSettingUpHMI]) {
+ [self.lifecycleStateMachine transitionToState:SDLLifecycleStateReady];
+ }
if (![self.lifecycleStateMachine isCurrentState:SDLLifecycleStateReady]) {
return;
diff --git a/SmartDeviceLink/SDLLockScreenConfiguration.h b/SmartDeviceLink/SDLLockScreenConfiguration.h
index 4bf55e9a0..cf1287cc3 100644
--- a/SmartDeviceLink/SDLLockScreenConfiguration.h
+++ b/SmartDeviceLink/SDLLockScreenConfiguration.h
@@ -6,9 +6,7 @@
// Copyright © 2015 smartdevicelink. All rights reserved.
//
-@import UIKit;
-
-#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
diff --git a/SmartDeviceLink/SDLMenuParams.m b/SmartDeviceLink/SDLMenuParams.m
index aa41f4b4a..8292f52d0 100644
--- a/SmartDeviceLink/SDLMenuParams.m
+++ b/SmartDeviceLink/SDLMenuParams.m
@@ -27,7 +27,7 @@
}
self.parentID = @(parentId);
- self.position = @(parentId);
+ self.position = @(position);
return self;
}
diff --git a/SmartDeviceLink/SDLMutableDataQueue.h b/SmartDeviceLink/SDLMutableDataQueue.h
new file mode 100755
index 000000000..1632acf5a
--- /dev/null
+++ b/SmartDeviceLink/SDLMutableDataQueue.h
@@ -0,0 +1,60 @@
+//
+// SDLMutableDataQueue.h
+//
+//
+// Created by David Switzer on 3/2/17.
+//
+//
+
+#import <Foundation/Foundation.h>
+
+/**
+ This queue class is used by the IAP data session to provide safe, async writing of RPC messages to the connected SDL compliant accessory. It uses NSMutableData objects because the NSOutputStream has a variable amount of space available based on iOS and accessory buffering. We want to be able to pop the buffer at the head multiiple times and consume as many bytes as there are available in the stream.
+ */
+
+@interface SDLMutableDataQueue : NSObject
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ frontBuffer returns the NSMutableData * buffer at the front of the queue, but does not remove it - modeled after the STL C++ queue front method
+
+ @return NSMutableData containing the buffer at the head of the queue or nil if
+ the queue is empty
+ */
+- (NSMutableData * _Nullable)frontBuffer;
+
+
+/**
+ popBuffer removes the buffer at the head of the queue -- modeled after the
+ STL C++ queue pop method. Use to remove the buffer once all of the data has
+ been consumed or the data is no longer valid/needed.
+ */
+- (void)popBuffer;
+
+/**
+ Enqueues a new buffer at the back of the queue
+
+ @param data NSMutableData containing the buffer to enqueue
+ */
+- (void)enqueueBuffer:(NSMutableData *)data;
+
+/**
+ Empty the queue
+ */
+- (void)removeAllObjects;
+
+/**
+ Gets the number of buffers currently enqueued
+ */
+@property(nonatomic, assign, readonly) NSUInteger count;
+
+/**
+ A flag indicating whether the buffer at the head of the queue has been dequeued at least once.
+ */
+@property(nonatomic, assign, readonly, getter=isFrontBufferDequeued) BOOL frontDequeued;
+
+NS_ASSUME_NONNULL_END
+
+
+@end
diff --git a/SmartDeviceLink/SDLMutableDataQueue.m b/SmartDeviceLink/SDLMutableDataQueue.m
new file mode 100755
index 000000000..c91b25d85
--- /dev/null
+++ b/SmartDeviceLink/SDLMutableDataQueue.m
@@ -0,0 +1,75 @@
+//
+// SDLMutableDataQueue.m
+//
+//
+// Created by David Switzer on 3/2/17.
+//
+//
+
+#import "SDLMutableDataQueue.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface SDLMutableDataQueue()
+
+@property(nonatomic, strong) NSMutableArray *elements;
+@property(nonatomic, assign, readwrite) BOOL frontDequeued;
+
+@end
+
+@implementation SDLMutableDataQueue
+
+- (instancetype)init {
+ self = [super init];
+ if (!self) {
+ return nil;
+ }
+
+ _elements = [NSMutableArray array];
+
+ return self;
+}
+
+- (void)enqueueBuffer:(NSMutableData *)data {
+ // Since this method is being called from the main thread and the dequeue methods are being called from the data session stream thread, we need to put critical sections around the queue members. Use the @synchronized object level lock to do this.
+ @synchronized (self) {
+ [self.elements addObject:data];
+ self.frontDequeued = NO;
+ }
+}
+
+- (NSMutableData * _Nullable )frontBuffer {
+ NSMutableData *dataAtFront = nil;
+
+ @synchronized (self) {
+ if (self.elements.count) {
+ // The front of the queue is always at index 0
+ dataAtFront = self.elements[0];
+ self.frontDequeued = YES;
+ }
+ }
+
+ return dataAtFront;
+}
+
+- (void)popBuffer {
+ @synchronized (self) {
+ [self.elements removeObjectAtIndex:0];
+ }
+}
+
+- (void)removeAllObjects {
+ @synchronized (self) {
+ [self.elements removeAllObjects];
+ }
+}
+
+- (NSUInteger)count {
+ @synchronized (self) {
+ return self.elements.count;
+ }
+}
+
+NS_ASSUME_NONNULL_END
+
+@end
diff --git a/SmartDeviceLink/SDLOnPermissionsChange.m b/SmartDeviceLink/SDLOnPermissionsChange.m
index e80df88c4..bc5a64f35 100644
--- a/SmartDeviceLink/SDLOnPermissionsChange.m
+++ b/SmartDeviceLink/SDLOnPermissionsChange.m
@@ -31,7 +31,9 @@
- (NSMutableArray *)permissionItem {
NSMutableArray *array = [parameters objectForKey:NAMES_permissionItem];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLPermissionItem.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLPermissionItem.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
diff --git a/SmartDeviceLink/SDLOnTouchEvent.m b/SmartDeviceLink/SDLOnTouchEvent.m
index e73c79603..f98a22af6 100644
--- a/SmartDeviceLink/SDLOnTouchEvent.m
+++ b/SmartDeviceLink/SDLOnTouchEvent.m
@@ -49,7 +49,9 @@
- (NSMutableArray *)event {
NSMutableArray *array = [parameters objectForKey:NAMES_event];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLTouchEvent.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLTouchEvent.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
diff --git a/SmartDeviceLink/SDLOnWaypointChange.m b/SmartDeviceLink/SDLOnWaypointChange.m
index 60b6fa4a6..79afcde6e 100644
--- a/SmartDeviceLink/SDLOnWaypointChange.m
+++ b/SmartDeviceLink/SDLOnWaypointChange.m
@@ -24,7 +24,9 @@
- (NSArray<SDLLocationDetails *> *)waypoints {
NSMutableArray *array = [parameters objectForKey:NAMES_waypoints];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLLocationDetails.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLLocationDetails.class]) {
return [array copy];
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
diff --git a/SmartDeviceLink/SDLPerformAudioPassThru.m b/SmartDeviceLink/SDLPerformAudioPassThru.m
index da14cf9d8..6d42daf20 100644
--- a/SmartDeviceLink/SDLPerformAudioPassThru.m
+++ b/SmartDeviceLink/SDLPerformAudioPassThru.m
@@ -64,7 +64,9 @@
- (NSMutableArray *)initialPrompt {
NSMutableArray *array = [parameters objectForKey:NAMES_initialPrompt];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLTTSChunk.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLTTSChunk.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
diff --git a/SmartDeviceLink/SDLPerformInteraction.m b/SmartDeviceLink/SDLPerformInteraction.m
index f769e835e..687b13cc4 100644
--- a/SmartDeviceLink/SDLPerformInteraction.m
+++ b/SmartDeviceLink/SDLPerformInteraction.m
@@ -105,7 +105,9 @@ static UInt16 const SDLDefaultTimeout = 10000;
- (NSMutableArray *)initialPrompt {
NSMutableArray *array = [parameters objectForKey:NAMES_initialPrompt];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLTTSChunk.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLTTSChunk.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
@@ -155,7 +157,9 @@ static UInt16 const SDLDefaultTimeout = 10000;
- (NSMutableArray *)helpPrompt {
NSMutableArray *array = [parameters objectForKey:NAMES_helpPrompt];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLTTSChunk.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLTTSChunk.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
@@ -176,7 +180,9 @@ static UInt16 const SDLDefaultTimeout = 10000;
- (NSMutableArray *)timeoutPrompt {
NSMutableArray *array = [parameters objectForKey:NAMES_timeoutPrompt];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLTTSChunk.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLTTSChunk.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
@@ -209,7 +215,9 @@ static UInt16 const SDLDefaultTimeout = 10000;
- (NSMutableArray *)vrHelp {
NSMutableArray *array = [parameters objectForKey:NAMES_vrHelp];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLVRHelpItem.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLVRHelpItem.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
diff --git a/SmartDeviceLink/SDLProxy.m b/SmartDeviceLink/SDLProxy.m
index e35df95ec..68eb8f6fc 100644
--- a/SmartDeviceLink/SDLProxy.m
+++ b/SmartDeviceLink/SDLProxy.m
@@ -49,7 +49,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 = @"4.5.4";
+NSString *const SDLProxyVersion = @"4.5.5";
const float startSessionTime = 10.0;
const float notifyProxyClosedDelay = 0.1;
const int POLICIES_CORRELATION_ID = 65535;
@@ -88,7 +88,6 @@ const int POLICIES_CORRELATION_ID = 65535;
[self.transport connect];
[SDLDebugTool logInfo:@"SDLProxy initWithTransport"];
- [[EAAccessoryManager sharedAccessoryManager] registerForLocalNotifications];
}
return self;
@@ -99,7 +98,6 @@ const int POLICIES_CORRELATION_ID = 65535;
_alreadyDestructed = YES;
[[NSNotificationCenter defaultCenter] removeObserver:self];
- [[EAAccessoryManager sharedAccessoryManager] unregisterForLocalNotifications];
[[SDLURLSession defaultSession] cancelAllTasks];
diff --git a/SmartDeviceLink/SDLProxyFactory.m b/SmartDeviceLink/SDLProxyFactory.m
index b2320c641..9f9f7b1da 100644
--- a/SmartDeviceLink/SDLProxyFactory.m
+++ b/SmartDeviceLink/SDLProxyFactory.m
@@ -34,4 +34,4 @@
return ret;
}
-@end \ No newline at end of file
+@end
diff --git a/SmartDeviceLink/SDLProxyListener.h b/SmartDeviceLink/SDLProxyListener.h
index 9b6f460f4..0de048633 100644
--- a/SmartDeviceLink/SDLProxyListener.h
+++ b/SmartDeviceLink/SDLProxyListener.h
@@ -1,7 +1,7 @@
// SDLProxyListener.h
//
-@import UIKit;
+#import <UIKit/UIKit.h>
@class SDLAddCommandResponse;
@class SDLAddSubMenuResponse;
diff --git a/SmartDeviceLink/SDLReadDIDResponse.m b/SmartDeviceLink/SDLReadDIDResponse.m
index 08c5477f6..9ac45b146 100644
--- a/SmartDeviceLink/SDLReadDIDResponse.m
+++ b/SmartDeviceLink/SDLReadDIDResponse.m
@@ -31,7 +31,9 @@
- (NSMutableArray *)didResult {
NSMutableArray *array = [parameters objectForKey:NAMES_didResult];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLDIDResult.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLDIDResult.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
diff --git a/SmartDeviceLink/SDLRegisterAppInterface.m b/SmartDeviceLink/SDLRegisterAppInterface.m
index 97657563e..d454f4355 100644
--- a/SmartDeviceLink/SDLRegisterAppInterface.m
+++ b/SmartDeviceLink/SDLRegisterAppInterface.m
@@ -107,7 +107,9 @@
- (NSMutableArray *)ttsName {
NSMutableArray *array = [parameters objectForKey:NAMES_ttsName];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLTTSChunk.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLTTSChunk.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
@@ -198,7 +200,9 @@
- (NSMutableArray *)appHMIType {
NSMutableArray *array = [parameters objectForKey:NAMES_appHMIType];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLAppHMIType.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLAppHMIType.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
diff --git a/SmartDeviceLink/SDLRegisterAppInterfaceResponse.m b/SmartDeviceLink/SDLRegisterAppInterfaceResponse.m
index 0dcab3498..1247ad495 100644
--- a/SmartDeviceLink/SDLRegisterAppInterfaceResponse.m
+++ b/SmartDeviceLink/SDLRegisterAppInterfaceResponse.m
@@ -112,7 +112,9 @@
- (NSMutableArray *)buttonCapabilities {
NSMutableArray *array = [parameters objectForKey:NAMES_buttonCapabilities];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLButtonCapabilities.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLButtonCapabilities.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
@@ -133,7 +135,9 @@
- (NSMutableArray *)softButtonCapabilities {
NSMutableArray *array = [parameters objectForKey:NAMES_softButtonCapabilities];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLSoftButtonCapabilities.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLSoftButtonCapabilities.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
@@ -171,7 +175,9 @@
- (NSMutableArray *)hmiZoneCapabilities {
NSMutableArray *array = [parameters objectForKey:NAMES_hmiZoneCapabilities];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLHMIZoneCapabilities.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLHMIZoneCapabilities.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
@@ -192,7 +198,9 @@
- (NSMutableArray *)speechCapabilities {
NSMutableArray *array = [parameters objectForKey:NAMES_speechCapabilities];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLSpeechCapabilities.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLSpeechCapabilities.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
@@ -213,7 +221,9 @@
- (NSMutableArray *)prerecordedSpeech {
NSMutableArray *array = [parameters objectForKey:NAMES_prerecordedSpeech];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLPrerecordedSpeech.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLPrerecordedSpeech.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
@@ -234,7 +244,9 @@
- (NSMutableArray *)vrCapabilities {
NSMutableArray *array = [parameters objectForKey:NAMES_vrCapabilities];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLVRCapabilities.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLVRCapabilities.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
@@ -255,7 +267,9 @@
- (NSMutableArray *)audioPassThruCapabilities {
NSMutableArray *array = [parameters objectForKey:NAMES_audioPassThruCapabilities];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLAudioPassThruCapabilities.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLAudioPassThruCapabilities.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
diff --git a/SmartDeviceLink/SDLResetGlobalProperties.m b/SmartDeviceLink/SDLResetGlobalProperties.m
index 737de4b3a..93af24f97 100644
--- a/SmartDeviceLink/SDLResetGlobalProperties.m
+++ b/SmartDeviceLink/SDLResetGlobalProperties.m
@@ -42,7 +42,9 @@
- (NSMutableArray *)properties {
NSMutableArray *array = [parameters objectForKey:NAMES_properties];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLGlobalProperty.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLGlobalProperty.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
diff --git a/SmartDeviceLink/SDLResponseDispatcher.m b/SmartDeviceLink/SDLResponseDispatcher.m
index b4ac0b7cb..b9fcf4095 100644
--- a/SmartDeviceLink/SDLResponseDispatcher.m
+++ b/SmartDeviceLink/SDLResponseDispatcher.m
@@ -108,6 +108,11 @@ NS_ASSUME_NONNULL_BEGIN
}
- (void)clear {
+ // When we get disconnected we have to delete all existing responseHandlers as they are not valid anymore
+ for (SDLRPCCorrelationId *correlationID in self.rpcResponseHandlerMap) {
+ SDLResponseHandler responseHandler = self.rpcResponseHandlerMap[correlationID];
+ responseHandler(self.rpcRequestDictionary[correlationID], nil, [NSError sdl_lifecycle_notConnectedError]);
+ }
[self.rpcRequestDictionary removeAllObjects];
[self.rpcResponseHandlerMap removeAllObjects];
[self.commandHandlerMap removeAllObjects];
diff --git a/SmartDeviceLink/SDLScrollableMessage.m b/SmartDeviceLink/SDLScrollableMessage.m
index ecc771c18..1110cd087 100644
--- a/SmartDeviceLink/SDLScrollableMessage.m
+++ b/SmartDeviceLink/SDLScrollableMessage.m
@@ -78,7 +78,9 @@
- (NSMutableArray *)softButtons {
NSMutableArray *array = [parameters objectForKey:NAMES_softButtons];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLSoftButton.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLSoftButton.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
diff --git a/SmartDeviceLink/SDLSetDisplayLayoutResponse.m b/SmartDeviceLink/SDLSetDisplayLayoutResponse.m
index fde37062e..2cdad4734 100644
--- a/SmartDeviceLink/SDLSetDisplayLayoutResponse.m
+++ b/SmartDeviceLink/SDLSetDisplayLayoutResponse.m
@@ -52,7 +52,9 @@
- (NSMutableArray *)buttonCapabilities {
NSMutableArray *array = [parameters objectForKey:NAMES_buttonCapabilities];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLButtonCapabilities.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLButtonCapabilities.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
@@ -73,7 +75,9 @@
- (NSMutableArray *)softButtonCapabilities {
NSMutableArray *array = [parameters objectForKey:NAMES_softButtonCapabilities];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLSoftButtonCapabilities.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLSoftButtonCapabilities.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
diff --git a/SmartDeviceLink/SDLSetGlobalProperties.m b/SmartDeviceLink/SDLSetGlobalProperties.m
index 9c7a500e5..21d5fbc67 100644
--- a/SmartDeviceLink/SDLSetGlobalProperties.m
+++ b/SmartDeviceLink/SDLSetGlobalProperties.m
@@ -62,7 +62,9 @@
- (NSMutableArray *)helpPrompt {
NSMutableArray *array = [parameters objectForKey:NAMES_helpPrompt];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLTTSChunk.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLTTSChunk.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
@@ -83,7 +85,9 @@
- (NSMutableArray *)timeoutPrompt {
NSMutableArray *array = [parameters objectForKey:NAMES_timeoutPrompt];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLTTSChunk.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLTTSChunk.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
@@ -116,7 +120,9 @@
- (NSMutableArray *)vrHelp {
NSMutableArray *array = [parameters objectForKey:NAMES_vrHelp];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLVRHelpItem.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLVRHelpItem.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
diff --git a/SmartDeviceLink/SDLShow.m b/SmartDeviceLink/SDLShow.m
index 36251d3bc..ed6ab93ce 100644
--- a/SmartDeviceLink/SDLShow.m
+++ b/SmartDeviceLink/SDLShow.m
@@ -202,7 +202,9 @@
- (NSMutableArray *)softButtons {
NSMutableArray *array = [parameters objectForKey:NAMES_softButtons];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLSoftButton.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLSoftButton.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
diff --git a/SmartDeviceLink/SDLShowConstantTBT.m b/SmartDeviceLink/SDLShowConstantTBT.m
index f95d8c621..c890c707b 100644
--- a/SmartDeviceLink/SDLShowConstantTBT.m
+++ b/SmartDeviceLink/SDLShowConstantTBT.m
@@ -184,7 +184,9 @@
- (NSMutableArray *)softButtons {
NSMutableArray *array = [parameters objectForKey:NAMES_softButtons];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLSoftButton.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLSoftButton.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
diff --git a/SmartDeviceLink/SDLSpeak.m b/SmartDeviceLink/SDLSpeak.m
index 875e4e513..d2ce48eca 100644
--- a/SmartDeviceLink/SDLSpeak.m
+++ b/SmartDeviceLink/SDLSpeak.m
@@ -48,7 +48,9 @@
- (NSMutableArray *)ttsChunks {
NSMutableArray *array = [parameters objectForKey:NAMES_ttsChunks];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLTTSChunk.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLTTSChunk.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
diff --git a/SmartDeviceLink/SDLStreamingMediaManager.h b/SmartDeviceLink/SDLStreamingMediaManager.h
index 401622b7b..027b39304 100644
--- a/SmartDeviceLink/SDLStreamingMediaManager.h
+++ b/SmartDeviceLink/SDLStreamingMediaManager.h
@@ -7,7 +7,7 @@
//
#import <Foundation/Foundation.h>
-@import VideoToolbox;
+#import <VideoToolbox/VideoToolbox.h>
#import "SDLProtocolListener.h"
diff --git a/SmartDeviceLink/SDLStreamingMediaManager.m b/SmartDeviceLink/SDLStreamingMediaManager.m
index ab7cde8c5..3bf380522 100644
--- a/SmartDeviceLink/SDLStreamingMediaManager.m
+++ b/SmartDeviceLink/SDLStreamingMediaManager.m
@@ -8,7 +8,7 @@
#import "SDLStreamingMediaManager.h"
-@import UIKit;
+#import <UIKit/UIKit.h>
#import "SDLAbstractProtocol.h"
#import "SDLDebugTool.h"
@@ -416,7 +416,7 @@ void sdl_videoEncoderOutputCallback(void * CM_NULLABLE outputCallbackRefCon, voi
if (status != noErr) {
// TODO: Log the error
- if (*error != nil) {
+ if (error != NULL) {
*error = [NSError errorWithDomain:SDLErrorDomainStreamingMediaVideo code:SDLStreamingVideoErrorConfigurationCompressionSessionCreationFailure userInfo:@{ @"OSStatus": @(status) }];
}
@@ -430,7 +430,7 @@ void sdl_videoEncoderOutputCallback(void * CM_NULLABLE outputCallbackRefCon, voi
CFDictionaryRef supportedProperties;
status = VTSessionCopySupportedPropertyDictionary(self.compressionSession, &supportedProperties);
if (status != noErr) {
- if (*error != nil) {
+ if (error != NULL) {
*error = [NSError errorWithDomain:SDLErrorDomainStreamingMediaVideo code:SDLStreamingVideoErrorConfigurationCompressionSessionSetPropertyFailure userInfo:@{ @"OSStatus": @(status) }];
}
@@ -439,7 +439,7 @@ void sdl_videoEncoderOutputCallback(void * CM_NULLABLE outputCallbackRefCon, voi
for (NSString *key in self.videoEncoderSettings.allKeys) {
if (CFDictionaryContainsKey(supportedProperties, (__bridge CFStringRef)key) == false) {
- if (*error != nil) {
+ if (error != NULL) {
NSString *description = [NSString stringWithFormat:@"\"%@\" is not a supported key.", key];
*error = [NSError errorWithDomain:SDLErrorDomainStreamingMediaVideo code:SDLStreamingVideoErrorConfigurationCompressionSessionSetPropertyFailure userInfo:@{NSLocalizedDescriptionKey: description}];
}
@@ -455,7 +455,7 @@ void sdl_videoEncoderOutputCallback(void * CM_NULLABLE outputCallbackRefCon, voi
status = VTSessionSetProperty(self.compressionSession, (__bridge CFStringRef)key, (__bridge CFTypeRef)value);
if (status != noErr) {
- if (*error != nil) {
+ if (error != NULL) {
*error = [NSError errorWithDomain:SDLErrorDomainStreamingMediaVideo code:SDLStreamingVideoErrorConfigurationCompressionSessionSetPropertyFailure userInfo:@{ @"OSStatus": @(status) }];
}
diff --git a/SmartDeviceLink/SDLTouchEvent.m b/SmartDeviceLink/SDLTouchEvent.m
index e54e8b79e..0a5e6f01c 100644
--- a/SmartDeviceLink/SDLTouchEvent.m
+++ b/SmartDeviceLink/SDLTouchEvent.m
@@ -55,7 +55,9 @@
- (NSMutableArray *)coord {
NSMutableArray *array = [store objectForKey:NAMES_c];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLTouchCoord.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLTouchCoord.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
diff --git a/SmartDeviceLink/SDLTouchManagerDelegate.h b/SmartDeviceLink/SDLTouchManagerDelegate.h
index 9bbcb433d..924780612 100644
--- a/SmartDeviceLink/SDLTouchManagerDelegate.h
+++ b/SmartDeviceLink/SDLTouchManagerDelegate.h
@@ -6,7 +6,7 @@
// Copyright © 2016 smartdevicelink. All rights reserved.
//
-@import UIKit;
+#import <UIKit/UIKit.h>
@class SDLTouchManager;
@@ -103,4 +103,4 @@ NS_ASSUME_NONNULL_BEGIN
@end
-NS_ASSUME_NONNULL_END \ No newline at end of file
+NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLUpdateTurnList.m b/SmartDeviceLink/SDLUpdateTurnList.m
index da2067382..4baa3a829 100644
--- a/SmartDeviceLink/SDLUpdateTurnList.m
+++ b/SmartDeviceLink/SDLUpdateTurnList.m
@@ -44,7 +44,9 @@
- (NSMutableArray *)turnList {
NSMutableArray *array = [parameters objectForKey:NAMES_turnList];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLTurn.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLTurn.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
@@ -65,7 +67,9 @@
- (NSMutableArray *)softButtons {
NSMutableArray *array = [parameters objectForKey:NAMES_softButtons];
- if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLSoftButton.class]) {
+ if ([array isEqual:[NSNull null]]) {
+ return [NSMutableArray array];
+ } else if (array.count < 1 || [array.firstObject isKindOfClass:SDLSoftButton.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
diff --git a/SmartDeviceLink/SmartDeviceLink.h b/SmartDeviceLink/SmartDeviceLink.h
index 24a3188b5..394a7894c 100644
--- a/SmartDeviceLink/SmartDeviceLink.h
+++ b/SmartDeviceLink/SmartDeviceLink.h
@@ -214,7 +214,7 @@ FOUNDATION_EXPORT const unsigned char SmartDeviceLinkVersionString[];
#import "SDLTouchEvent.h"
#import "SDLTouchEventCapabilities.h"
#import "SDLTurn.h"
-#import "SDLVRHelpItem.h"
+#import "SDLVrHelpItem.h"
#import "SDLVehicleDataResult.h"
#import "SDLVehicleType.h"
@@ -279,7 +279,7 @@ FOUNDATION_EXPORT const unsigned char SmartDeviceLinkVersionString[];
#import "SDLTouchType.h"
#import "SDLTriggerSource.h"
#import "SDLUpdateMode.h"
-#import "SDLVRCapabilities.h"
+#import "SDLVrCapabilities.h"
#import "SDLVehicleDataActiveStatus.h"
#import "SDLVehicleDataEventStatus.h"
#import "SDLVehicleDataNotificationStatus.h"
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m
index eb685441e..593e99941 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m
@@ -56,7 +56,7 @@ QuickConfigurationEnd
QuickSpecBegin(SDLLifecycleManagerSpec)
-describe(@"a lifecycle manager", ^{
+xdescribe(@"a lifecycle manager", ^{
__block SDLLifecycleManager *testManager = nil;
__block SDLConfiguration *testConfig = nil;
@@ -263,6 +263,43 @@ describe(@"a lifecycle manager", ^{
});
});
});
+
+ describe(@"transitioning to the Setting Up HMI state", ^{
+ context(@"before register response is a success", ^{
+ it(@"ready handler should not be called yet", ^{
+ SDLRegisterAppInterfaceResponse *response = [[SDLRegisterAppInterfaceResponse alloc] init];
+ response.resultCode = [SDLResult SUCCESS];
+ testManager.registerResponse = response;
+
+ [testManager.lifecycleStateMachine setToState:SDLLifecycleStateSettingUpHMI fromOldState:nil callEnterTransition:YES];
+
+ expect(@(readyHandlerSuccess)).to(equal(@NO));
+ expect(readyHandlerError).to(beNil());
+ });
+ });
+
+ context(@"assume hmi status is nil", ^{
+ it(@"mock notification and ensure state changes to ready", ^{
+ __block SDLOnHMIStatus *testHMIStatus = nil;
+ __block SDLHMILevel *testHMILevel = nil;
+ testHMIStatus = [[SDLOnHMIStatus alloc] init];
+
+ SDLRegisterAppInterfaceResponse *response = [[SDLRegisterAppInterfaceResponse alloc] init];
+ response.resultCode = [SDLResult SUCCESS];
+ testManager.registerResponse = response;
+
+ [testManager.lifecycleStateMachine setToState:SDLLifecycleStateSettingUpHMI fromOldState:nil callEnterTransition:YES];
+
+ testHMILevel = [SDLHMILevel FULL];
+ testHMIStatus.hmiLevel = testHMILevel;
+
+ [testManager.notificationDispatcher postRPCNotificationNotification:SDLDidChangeHMIStatusNotification notification:testHMIStatus];
+
+ expect(@(readyHandlerSuccess)).to(equal(@YES));
+ expect(readyHandlerError).toNot(beNil());
+ });
+ });
+ });
describe(@"transitioning to the ready state", ^{
context(@"when the register response is a success", ^{
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenViewControllerSnapshotTests.m b/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenViewControllerSnapshotTests.m
index 7eedccfe2..341e10105 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenViewControllerSnapshotTests.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenViewControllerSnapshotTests.m
@@ -6,7 +6,7 @@
// Copyright © 2016 smartdevicelink. All rights reserved.
//
-@import UIKit;
+#import <UIKit/UIKit.h>
#import <FBSnapshotTestCase/FBSnapshotTestCase.h>
#import "SDLLockScreenConfiguration.h"
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLPermissionFilterSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLPermissionFilterSpec.m
index ccbf6bb34..be190c40d 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLPermissionFilterSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLPermissionFilterSpec.m
@@ -126,10 +126,6 @@ describe(@"A filter", ^{
it(@"should copy the change type correctly", ^{
expect(@(testCopiedFilter.groupType)).to(equal(@(testFilter.groupType)));
});
-
- it(@"should copy the observer correctly", ^{
- expect(testCopiedFilter.handler).to(equal(testFilter.handler));
- });
});
describe(@"testing equality", ^{
diff --git a/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m
index 52dd249bf..e7224cc67 100644
--- a/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m
+++ b/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m
@@ -325,11 +325,7 @@ describe(@"HandleBytesFromTransport Tests", ^ {
});
});
-describe(@"SendHeartbeat Tests", ^ {
- // TODO: These need to be rewritten
-});
-
-describe(@"HandleProtocolSessionStarted Tests", ^ {
+xdescribe(@"HandleProtocolSessionStarted Tests", ^ {
it(@"Should pass information along to delegate", ^ {
SDLProtocol* testProtocol = [[SDLProtocol alloc] init];
@@ -349,7 +345,7 @@ describe(@"HandleProtocolSessionStarted Tests", ^ {
});
});
-describe(@"HandleHeartbeatForSession Tests", ^{
+xdescribe(@"HandleHeartbeatForSession Tests", ^{
// TODO: Test automatically sending data to head unit (dependency injection?)
it(@"Should pass information along to delegate", ^ {
SDLProtocol* testProtocol = [[SDLProtocol alloc] init];
@@ -363,7 +359,7 @@ describe(@"HandleHeartbeatForSession Tests", ^{
});
});
-describe(@"OnProtocolMessageReceived Tests", ^ {
+xdescribe(@"OnProtocolMessageReceived Tests", ^ {
it(@"Should pass information along to delegate", ^ {
SDLProtocol *testProtocol = [[SDLProtocol alloc] init];
@@ -381,7 +377,7 @@ describe(@"OnProtocolMessageReceived Tests", ^ {
});
});
-describe(@"OnProtocolOpened Tests", ^ {
+xdescribe(@"OnProtocolOpened Tests", ^ {
it(@"Should pass information along to delegate", ^ {
SDLProtocol* testProtocol = [[SDLProtocol alloc] init];
@@ -394,7 +390,7 @@ describe(@"OnProtocolOpened Tests", ^ {
});
});
-describe(@"OnProtocolClosed Tests", ^ {
+xdescribe(@"OnProtocolClosed Tests", ^ {
it(@"Should pass information along to delegate", ^ {
SDLProtocol* testProtocol = [[SDLProtocol alloc] init];
@@ -407,7 +403,7 @@ describe(@"OnProtocolClosed Tests", ^ {
});
});
-describe(@"OnError Tests", ^ {
+xdescribe(@"OnError Tests", ^ {
it(@"Should pass information along to delegate", ^ {
SDLProtocol* testProtocol = [[SDLProtocol alloc] init];
diff --git a/SmartDeviceLinkTests/ProtocolSpecs/SDLAbstractProtocolSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/SDLAbstractProtocolSpec.m
index c393e2f7e..38d6f3c03 100644
--- a/SmartDeviceLinkTests/ProtocolSpecs/SDLAbstractProtocolSpec.m
+++ b/SmartDeviceLinkTests/ProtocolSpecs/SDLAbstractProtocolSpec.m
@@ -14,7 +14,7 @@
QuickSpecBegin(SDLAbstractProtocolSpec)
-describe(@"OnTransportConnected Tests", ^ {
+xdescribe(@"OnTransportConnected Tests", ^ {
it(@"Should invoke the correct method", ^ {
id delegateMock = OCMProtocolMock(@protocol(SDLProtocolListener));
@@ -34,7 +34,7 @@ describe(@"OnTransportConnected Tests", ^ {
});
});
-describe(@"OnTransportDisconnected Tests", ^ {
+xdescribe(@"OnTransportDisconnected Tests", ^ {
it(@"Should invoke the correct method", ^ {
id delegateMock = OCMProtocolMock(@protocol(SDLProtocolListener));
diff --git a/SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolReceivedMessageRouterSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolReceivedMessageRouterSpec.m
index f88f0a192..f045ae721 100644
--- a/SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolReceivedMessageRouterSpec.m
+++ b/SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolReceivedMessageRouterSpec.m
@@ -18,7 +18,7 @@ QuickSpecBegin(SDLProtocolReceivedMessageRouterSpec)
// TODO: This should be rewritten using an actual mock (i.e. SDLProtocolListenerDelegateMock class to avoid OCMock)
describe(@"HandleReceivedMessage Tests", ^ {
- context(@"When handling control message", ^ {
+ xcontext(@"When handling control message", ^ {
it(@"Should route message correctly", ^ {
id delegateMock = OCMProtocolMock(@protocol(SDLProtocolListener));
@@ -42,7 +42,7 @@ describe(@"HandleReceivedMessage Tests", ^ {
});
});
- context(@"When handling single frame message", ^ {
+ xcontext(@"When handling single frame message", ^ {
it(@"Should route message correctly", ^ {
id delegateMock = OCMProtocolMock(@protocol(SDLProtocolListener));
@@ -81,7 +81,7 @@ describe(@"HandleReceivedMessage Tests", ^ {
});
});
- context(@"When handling multi-frame message", ^ {
+ xcontext(@"When handling multi-frame message", ^ {
it(@"Should route message correctly", ^ {
//Allocate 2000 bytes and use it as test data
const NSUInteger dataLength = 2000;
diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAlertSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAlertSpec.m
index b5725e168..bef3c8df0 100644
--- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAlertSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLAlertSpec.m
@@ -64,6 +64,23 @@ describe(@"Getter/Setter Tests", ^ {
expect(testRequest.progressIndicator).to(equal(@NO));
expect(testRequest.softButtons).to(equal([@[button] mutableCopy]));
});
+
+ it(@"Should handle NSNull", ^{
+ NSMutableDictionary* dict = [@{NAMES_request:
+ @{NAMES_parameters:
+ @{NAMES_alertText1:@"alert#1",
+ NAMES_alertText2:@"alert#2",
+ NAMES_alertText3:@"alert#3",
+ NAMES_ttsChunks:[@[tts] mutableCopy],
+ NAMES_duration:@4357,
+ NAMES_playTone:@YES,
+ NAMES_progressIndicator:@NO,
+ NAMES_softButtons:[NSNull null]},
+ NAMES_operation_name:NAMES_Alert}} mutableCopy];
+ SDLAlert* testRequest = [[SDLAlert alloc] initWithDictionary:dict];
+
+ expect(testRequest.softButtons).to(beEmpty());
+ });
it(@"Should return nil if not set", ^ {
SDLAlert* testRequest = [[SDLAlert alloc] init];
@@ -79,4 +96,4 @@ describe(@"Getter/Setter Tests", ^ {
});
});
-QuickSpecEnd \ No newline at end of file
+QuickSpecEnd
diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMenuParamsSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMenuParamsSpec.m
index 3d6bc6462..ec9cc2457 100644
--- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMenuParamsSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLMenuParamsSpec.m
@@ -13,8 +13,49 @@
QuickSpecBegin(SDLMenuParamsSpec)
+describe(@"Initialization tests", ^{
+ __block UInt32 testParentId = 504320489;
+ __block UInt16 testPosition = testPosition;
+ __block NSString *testMenuName = @"Test Menu";
+
+ it(@"should properly initialize init", ^{
+ SDLMenuParams* testStruct = [[SDLMenuParams alloc] init];
+
+ expect(testStruct.parentID).to(beNil());
+ expect(testStruct.position).to(beNil());
+ expect(testStruct.menuName).to(beNil());
+ });
+
+ it(@"should properly initialize initWithDictionary", ^{
+ NSMutableDictionary* dict = [@{NAMES_parentID:@(testParentId),
+ NAMES_position:@(testPosition),
+ NAMES_menuName:testMenuName} mutableCopy];
+ SDLMenuParams* testStruct = [[SDLMenuParams alloc] initWithDictionary:dict];
+
+ expect(testStruct.parentID).to(equal(@(testParentId)));
+ expect(testStruct.position).to(equal(@(testPosition)));
+ expect(testStruct.menuName).to(equal(testMenuName));
+ });
+
+ it(@"should properly initialize initWithMenuName", ^{
+ SDLMenuParams* testStruct = [[SDLMenuParams alloc] initWithMenuName:testMenuName];
+
+ expect(testStruct.parentID).to(beNil());
+ expect(testStruct.position).to(beNil());
+ expect(testStruct.menuName).to(equal(testMenuName));
+ });
+
+ it(@"should properly initialize initWithMenuName:parentId:position:", ^{
+ SDLMenuParams* testStruct = [[SDLMenuParams alloc] initWithMenuName:testMenuName parentId:testParentId position:testPosition];
+
+ expect(testStruct.parentID).to(equal(@(testParentId)));
+ expect(testStruct.position).to(equal(@(testPosition)));
+ expect(testStruct.menuName).to(equal(testMenuName));
+ });
+});
+
describe(@"Getter/Setter Tests", ^ {
- it(@"Should set and get correctly", ^ {
+ it(@"Should set and get correctly", ^{
SDLMenuParams* testStruct = [[SDLMenuParams alloc] init];
testStruct.parentID = @504320489;
@@ -25,25 +66,6 @@ describe(@"Getter/Setter Tests", ^ {
expect(testStruct.position).to(equal(@256));
expect(testStruct.menuName).to(equal(@"Menu"));
});
-
- it(@"Should get correctly when initialized", ^ {
- NSMutableDictionary* dict = [@{NAMES_parentID:@504320489,
- NAMES_position:@256,
- NAMES_menuName:@"Menu"} mutableCopy];
- SDLMenuParams* testStruct = [[SDLMenuParams alloc] initWithDictionary:dict];
-
- expect(testStruct.parentID).to(equal(@504320489));
- expect(testStruct.position).to(equal(@256));
- expect(testStruct.menuName).to(equal(@"Menu"));
- });
-
- it(@"Should return nil if not set", ^ {
- SDLMenuParams* testStruct = [[SDLMenuParams alloc] init];
-
- expect(testStruct.parentID).to(beNil());
- expect(testStruct.position).to(beNil());
- expect(testStruct.menuName).to(beNil());
- });
});
-QuickSpecEnd \ No newline at end of file
+QuickSpecEnd
diff --git a/SmartDeviceLinkTests/UtilitiesSpecs/Touches/SDLTouchManagerSpec.m b/SmartDeviceLinkTests/UtilitiesSpecs/Touches/SDLTouchManagerSpec.m
index 50303e2a0..21d78c071 100644
--- a/SmartDeviceLinkTests/UtilitiesSpecs/Touches/SDLTouchManagerSpec.m
+++ b/SmartDeviceLinkTests/UtilitiesSpecs/Touches/SDLTouchManagerSpec.m
@@ -36,7 +36,7 @@ describe(@"SDLTouchManager Tests", ^{
});
- describe(@"touch events", ^{
+ xdescribe(@"touch events", ^{
typedef void (^DelegateCallbackBlock)(NSInvocation* invocation);
__block id delegateMock;
diff --git a/SmartDeviceLink_Example/Classes/ConnectionTCPTableViewController.m b/SmartDeviceLink_Example/Classes/ConnectionTCPTableViewController.m
index 7861bb321..b32b2c215 100644
--- a/SmartDeviceLink_Example/Classes/ConnectionTCPTableViewController.m
+++ b/SmartDeviceLink_Example/Classes/ConnectionTCPTableViewController.m
@@ -2,7 +2,8 @@
// ConnectionTCPTableViewController.m
// SmartDeviceLink-iOS
-@import AVFoundation;
+#import <AVFoundation/AVFoundation.h>
+#import <MobileCoreServices/MobileCoreServices.h>
#import "ConnectionTCPTableViewController.h"
@@ -10,8 +11,6 @@
#import "ProxyManager.h"
#import "SDLStreamingMediaManager.h"
-#import <MobileCoreServices/MobileCoreServices.h>
-
@interface ConnectionTCPTableViewController ()
@property (weak, nonatomic) IBOutlet UITextField *ipAddressTextField;
diff --git a/SmartDeviceLink_Example/Classes/ProxyManager.m b/SmartDeviceLink_Example/Classes/ProxyManager.m
index 7096f4bd9..891783100 100644
--- a/SmartDeviceLink_Example/Classes/ProxyManager.m
+++ b/SmartDeviceLink_Example/Classes/ProxyManager.m
@@ -2,7 +2,7 @@
// ProxyManager.m
// SmartDeviceLink-iOS
-@import SmartDeviceLink;
+#import "SmartDeviceLink.h"
#import "ProxyManager.h"
@@ -357,7 +357,7 @@ NS_ASSUME_NONNULL_BEGIN
// Reset our state
self.firstTimeState = SDLHMIFirstStateNone;
self.initialShowState = SDLHMIInitialShowStateNone;
- _state = ProxyStateStopped;
+ [self sdlex_updateProxyState:ProxyStateStopped];
if (ShouldRestartOnDisconnect) {
[self startManager];
}
diff --git a/SmartDeviceLink_Example/Info.plist b/SmartDeviceLink_Example/Info.plist
index ff523f6b7..753c2b42c 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>4.5.4</string>
+ <string>4.5.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>