summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2017-08-15 13:54:04 -0400
committerGitHub <noreply@github.com>2017-08-15 13:54:04 -0400
commit79f43406172df5abb87524745a8c67f5ece862ed (patch)
tree3d5bd91e50c400565130ff3e84162646c8cdf1f6
parent1100710e66c3acc73a6311a86a479f8830a881f5 (diff)
parent671277a6b34b74cc4ccc981cf4f04c9714f51020 (diff)
downloadsdl_ios-79f43406172df5abb87524745a8c67f5ece862ed.tar.gz
Merge pull request #669 from smartdevicelink/feature/616_constructed_payloads
Implement SDL 0078 and SDL 0052 Control Frame Payloads
-rw-r--r--.gitmodules3
-rw-r--r--SmartDeviceLink-iOS.xcodeproj/project.pbxproj236
-rw-r--r--SmartDeviceLink-iOS.xcodeproj/project.xcworkspace/xcshareddata/SmartDeviceLink-iOS.xcscmblueprint30
-rw-r--r--SmartDeviceLink/SDLAbstractProtocol.h14
-rw-r--r--SmartDeviceLink/SDLAbstractProtocol.m10
-rw-r--r--SmartDeviceLink/SDLControlFramePayloadAudioStartServiceAck.h24
-rw-r--r--SmartDeviceLink/SDLControlFramePayloadAudioStartServiceAck.m81
-rw-r--r--SmartDeviceLink/SDLControlFramePayloadConstants.h21
-rw-r--r--SmartDeviceLink/SDLControlFramePayloadConstants.m21
-rw-r--r--SmartDeviceLink/SDLControlFramePayloadEndService.h24
-rw-r--r--SmartDeviceLink/SDLControlFramePayloadEndService.m81
-rw-r--r--SmartDeviceLink/SDLControlFramePayloadNak.h25
-rw-r--r--SmartDeviceLink/SDLControlFramePayloadNak.m100
-rw-r--r--SmartDeviceLink/SDLControlFramePayloadRPCStartService.h24
-rw-r--r--SmartDeviceLink/SDLControlFramePayloadRPCStartService.m83
-rw-r--r--SmartDeviceLink/SDLControlFramePayloadRPCStartServiceAck.h30
-rw-r--r--SmartDeviceLink/SDLControlFramePayloadRPCStartServiceAck.m103
-rw-r--r--SmartDeviceLink/SDLControlFramePayloadType.h20
-rw-r--r--SmartDeviceLink/SDLControlFramePayloadVideoStartService.h36
-rw-r--r--SmartDeviceLink/SDLControlFramePayloadVideoStartService.m116
-rw-r--r--SmartDeviceLink/SDLControlFramePayloadVideoStartServiceAck.h39
-rw-r--r--SmartDeviceLink/SDLControlFramePayloadVideoStartServiceAck.m121
-rw-r--r--SmartDeviceLink/SDLDebugTool.m2
-rw-r--r--SmartDeviceLink/SDLGlobals.h17
-rw-r--r--SmartDeviceLink/SDLGlobals.m66
-rw-r--r--SmartDeviceLink/SDLIAPTransport.m4
-rw-r--r--SmartDeviceLink/SDLProtocol.h8
-rw-r--r--SmartDeviceLink/SDLProtocol.m163
-rw-r--r--SmartDeviceLink/SDLProtocolHeader.h1
-rw-r--r--SmartDeviceLink/SDLProtocolHeader.m16
-rw-r--r--SmartDeviceLink/SDLProtocolListener.h17
-rw-r--r--SmartDeviceLink/SDLProtocolMessage.h5
-rw-r--r--SmartDeviceLink/SDLProtocolMessage.m43
-rw-r--r--SmartDeviceLink/SDLProtocolReceivedMessageRouter.m27
-rw-r--r--SmartDeviceLink/SDLProxy.m4
-rw-r--r--SmartDeviceLink/SDLStreamingMediaManager.h27
-rw-r--r--SmartDeviceLink/SDLStreamingMediaManager.m155
-rw-r--r--SmartDeviceLink/SDLUploadFileOperation.m2
-rw-r--r--SmartDeviceLink/SDLV2ProtocolHeader.m2
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLUploadFileOperationSpec.m12
-rw-r--r--SmartDeviceLinkTests/ProtocolSpecs/ControlFramePayloadSpecs/SDLControlFramePayloadNakSpec.m57
-rw-r--r--SmartDeviceLinkTests/ProtocolSpecs/ControlFramePayloadSpecs/SDLControlFramePayloadVideoStartServiceSpec.m80
-rw-r--r--SmartDeviceLinkTests/ProtocolSpecs/ControlFramePayloadSpecs/SDLControlFrameVideoStartServiceAckSpec.m86
-rw-r--r--SmartDeviceLinkTests/ProtocolSpecs/HeaderSpecs/SDLProtocolHeaderSpec.m18
-rw-r--r--SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolMessageSpec.m14
-rw-r--r--SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m14
-rw-r--r--SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadAudioStartServiceAckSpec.m60
-rw-r--r--SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadEndServiceSpec.m58
-rw-r--r--SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadRPCStartServiceAckSpec.m71
-rw-r--r--SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadRPCStartServiceSpec.m60
-rw-r--r--SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolMessageDisassemblerSpec.m6
-rw-r--r--SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolReceivedMessageRouterSpec.m2
-rw-r--r--SmartDeviceLinkTests/UtilitiesSpecs/SDLGlobalsSpec.m107
m---------bson_c_lib0
54 files changed, 2198 insertions, 248 deletions
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 000000000..684da2889
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "bson_c_lib"]
+ path = bson_c_lib
+ url = https://github.com/smartdevicelink/bson_c_lib.git
diff --git a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj
index 813d8687b..a8d219315 100644
--- a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj
+++ b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj
@@ -281,6 +281,13 @@
5D4029D41A76F0340006B0C2 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5D4029D31A76F0340006B0C2 /* Images.xcassets */; };
5D4029E31A76F0760006B0C2 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5D4029DF1A76F0760006B0C2 /* LaunchScreen.xib */; };
5D4029E41A76F0760006B0C2 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5D4029E11A76F0760006B0C2 /* Main.storyboard */; };
+ 5D4631041F2120A30092EFDC /* SDLControlFramePayloadType.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D4631031F2120A30092EFDC /* SDLControlFramePayloadType.h */; };
+ 5D4631081F21261A0092EFDC /* SDLControlFramePayloadRPCStartServiceAck.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D4631061F21261A0092EFDC /* SDLControlFramePayloadRPCStartServiceAck.h */; };
+ 5D4631091F21261B0092EFDC /* SDLControlFramePayloadRPCStartServiceAck.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D4631071F21261A0092EFDC /* SDLControlFramePayloadRPCStartServiceAck.m */; };
+ 5D4631101F2135850092EFDC /* SDLControlFramePayloadConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D46310E1F2135850092EFDC /* SDLControlFramePayloadConstants.h */; };
+ 5D4631111F2135850092EFDC /* SDLControlFramePayloadConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D46310F1F2135850092EFDC /* SDLControlFramePayloadConstants.m */; };
+ 5D4631141F2136B60092EFDC /* SDLControlFramePayloadNak.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D4631121F2136B60092EFDC /* SDLControlFramePayloadNak.h */; };
+ 5D4631151F2136B60092EFDC /* SDLControlFramePayloadNak.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D4631131F2136B60092EFDC /* SDLControlFramePayloadNak.m */; };
5D48329D1A8EA33D00252386 /* Preferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D48329C1A8EA33D00252386 /* Preferences.m */; };
5D4832A11A92868E00252386 /* ProxyManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D4832A01A92868E00252386 /* ProxyManager.m */; };
5D4832A51A94F90D00252386 /* ConnectionTransitionContext.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D4832A41A94F90D00252386 /* ConnectionTransitionContext.m */; };
@@ -844,6 +851,15 @@
5D9F50811BE7E6E300FEF399 /* SDLPermissionsManagerSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D9F50801BE7E6E300FEF399 /* SDLPermissionsManagerSpec.m */; };
5D9F50831BEA5C6100FEF399 /* SDLFileManagerSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D9F50821BEA5C6100FEF399 /* SDLFileManagerSpec.m */; };
5D9F50871BED412E00FEF399 /* TestConnectionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D9F50861BED412E00FEF399 /* TestConnectionManager.m */; };
+ 5D9FDA8F1F2A7D3400A495C8 /* bson_array.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D9FDA891F2A7D3400A495C8 /* bson_array.c */; };
+ 5D9FDA901F2A7D3400A495C8 /* bson_array.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D9FDA8A1F2A7D3400A495C8 /* bson_array.h */; };
+ 5D9FDA911F2A7D3400A495C8 /* bson_object.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D9FDA8B1F2A7D3400A495C8 /* bson_object.c */; };
+ 5D9FDA921F2A7D3400A495C8 /* bson_object.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D9FDA8C1F2A7D3400A495C8 /* bson_object.h */; };
+ 5D9FDA931F2A7D3400A495C8 /* bson_util.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D9FDA8D1F2A7D3400A495C8 /* bson_util.c */; };
+ 5D9FDA941F2A7D3400A495C8 /* bson_util.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D9FDA8E1F2A7D3400A495C8 /* bson_util.h */; };
+ 5D9FDA981F2A7D3F00A495C8 /* emhashmap.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D9FDA951F2A7D3F00A495C8 /* emhashmap.c */; };
+ 5D9FDA991F2A7D3F00A495C8 /* emhashmap.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D9FDA961F2A7D3F00A495C8 /* emhashmap.h */; };
+ 5D9FDA9A1F2A7D3F00A495C8 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 5D9FDA971F2A7D3F00A495C8 /* LICENSE */; };
5DA026901AD44EE700019F86 /* SDLDialNumberResponseSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DA0268F1AD44EE700019F86 /* SDLDialNumberResponseSpec.m */; };
5DA102A41D4122C700C15826 /* NSMutableDictionary+SafeRemove.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DA102A21D4122C700C15826 /* NSMutableDictionary+SafeRemove.h */; };
5DA102A51D4122C700C15826 /* NSMutableDictionary+SafeRemove.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DA102A31D4122C700C15826 /* NSMutableDictionary+SafeRemove.m */; };
@@ -856,6 +872,10 @@
5DA22CBD1D075DE800245F5F /* OHHTTPStubs.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5DA22CB51D075CF200245F5F /* OHHTTPStubs.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
5DA22CBE1D075DE800245F5F /* Quick.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5DA22CB61D075CF200245F5F /* Quick.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
5DA22CBF1D075DEC00245F5F /* SmartDeviceLink.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5D61FA1C1A84237100846EE7 /* SmartDeviceLink.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
+ 5DA23FF01F2FA0FF009C0313 /* SDLControlFramePayloadEndServiceSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DA23FEF1F2FA0FF009C0313 /* SDLControlFramePayloadEndServiceSpec.m */; };
+ 5DA23FF31F2FA35C009C0313 /* SDLControlFramePayloadAudioStartServiceAckSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DA23FF21F2FA35C009C0313 /* SDLControlFramePayloadAudioStartServiceAckSpec.m */; };
+ 5DA23FF61F2FAA31009C0313 /* SDLControlFramePayloadRPCStartServiceSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DA23FF51F2FAA31009C0313 /* SDLControlFramePayloadRPCStartServiceSpec.m */; };
+ 5DA23FF81F2FAF2D009C0313 /* SDLControlFramePayloadRPCStartServiceAckSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DA23FF71F2FAF2D009C0313 /* SDLControlFramePayloadRPCStartServiceAckSpec.m */; };
5DA3F3541BC448060026F2D0 /* NSMapTable+Subscripting.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DA3F3521BC448060026F2D0 /* NSMapTable+Subscripting.h */; };
5DA3F3551BC448060026F2D0 /* NSMapTable+Subscripting.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DA3F3531BC448060026F2D0 /* NSMapTable+Subscripting.m */; };
5DA3F35A1BC448480026F2D0 /* SDLError.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DA3F3581BC448480026F2D0 /* SDLError.h */; };
@@ -864,6 +884,8 @@
5DA3F3601BC448590026F2D0 /* SDLNotificationConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DA3F35E1BC448590026F2D0 /* SDLNotificationConstants.m */; };
5DA3F3701BC4489A0026F2D0 /* SDLManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DA3F36E1BC4489A0026F2D0 /* SDLManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
5DA3F3711BC4489A0026F2D0 /* SDLManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DA3F36F1BC4489A0026F2D0 /* SDLManager.m */; };
+ 5DA49CE51F1EA83300E65FC5 /* SDLControlFramePayloadRPCStartService.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DA49CE31F1EA83300E65FC5 /* SDLControlFramePayloadRPCStartService.h */; };
+ 5DA49CE61F1EA83300E65FC5 /* SDLControlFramePayloadRPCStartService.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DA49CE41F1EA83300E65FC5 /* SDLControlFramePayloadRPCStartService.m */; };
5DAE06731BDEC6C000F9B498 /* SDLFileSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DAE06721BDEC6C000F9B498 /* SDLFileSpec.m */; };
5DAE06751BDEC6D600F9B498 /* SDLArtworkSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DAE06741BDEC6D600F9B498 /* SDLArtworkSpec.m */; };
5DB1BCD31D243A8E002FFC37 /* SDLDeleteFileOperationSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DB1BCD01D243A8E002FFC37 /* SDLDeleteFileOperationSpec.m */; };
@@ -881,8 +903,19 @@
5DB92D2F1AC59F0000C15BB0 /* SDLObjectWithPrioritySpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DB92D2E1AC59F0000C15BB0 /* SDLObjectWithPrioritySpec.m */; };
5DB92D321AC9C8BA00C15BB0 /* SDLRPCStruct.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DB92D301AC9C8BA00C15BB0 /* SDLRPCStruct.h */; settings = {ATTRIBUTES = (Public, ); }; };
5DB92D331AC9C8BA00C15BB0 /* SDLRPCStruct.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DB92D311AC9C8BA00C15BB0 /* SDLRPCStruct.m */; };
+ 5DB9964E1F26886C002D8795 /* SDLControlFramePayloadEndService.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DB9964C1F26886C002D8795 /* SDLControlFramePayloadEndService.h */; };
+ 5DB9964F1F26886C002D8795 /* SDLControlFramePayloadEndService.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DB9964D1F26886C002D8795 /* SDLControlFramePayloadEndService.m */; };
+ 5DB996571F268ECB002D8795 /* SDLControlFramePayloadAudioStartServiceAck.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DB996551F268ECB002D8795 /* SDLControlFramePayloadAudioStartServiceAck.h */; };
+ 5DB996581F268ECB002D8795 /* SDLControlFramePayloadAudioStartServiceAck.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DB996561F268ECB002D8795 /* SDLControlFramePayloadAudioStartServiceAck.m */; };
+ 5DB9965C1F268F97002D8795 /* SDLControlFramePayloadVideoStartService.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DB9965A1F268F97002D8795 /* SDLControlFramePayloadVideoStartService.h */; };
+ 5DB9965D1F268F97002D8795 /* SDLControlFramePayloadVideoStartService.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DB9965B1F268F97002D8795 /* SDLControlFramePayloadVideoStartService.m */; };
+ 5DB996601F28C6ED002D8795 /* SDLControlFramePayloadVideoStartServiceAck.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DB9965E1F28C6ED002D8795 /* SDLControlFramePayloadVideoStartServiceAck.h */; };
+ 5DB996611F28C6ED002D8795 /* SDLControlFramePayloadVideoStartServiceAck.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DB9965F1F28C6ED002D8795 /* SDLControlFramePayloadVideoStartServiceAck.m */; };
5DBAE0AB1D3588AC00CE00BF /* SDLNotificationDispatcherSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DBAE0AA1D3588AC00CE00BF /* SDLNotificationDispatcherSpec.m */; };
5DBAE0AD1D368D1A00CE00BF /* SDLResponseDispatcherSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DBAE0AC1D368D1A00CE00BF /* SDLResponseDispatcherSpec.m */; };
+ 5DBF0D5E1F3A68C0008AF2C9 /* SDLControlFramePayloadVideoStartServiceSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DBF0D5D1F3A68C0008AF2C9 /* SDLControlFramePayloadVideoStartServiceSpec.m */; };
+ 5DBF0D601F3B3DB4008AF2C9 /* SDLControlFrameVideoStartServiceAckSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DBF0D5F1F3B3DB4008AF2C9 /* SDLControlFrameVideoStartServiceAckSpec.m */; };
+ 5DC09EDA1F2F7FEC00F4AB1D /* SDLControlFramePayloadNakSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DC09ED91F2F7FEC00F4AB1D /* SDLControlFramePayloadNakSpec.m */; };
5DC978261B7A38640012C2F1 /* SDLGlobalsSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DC978251B7A38640012C2F1 /* SDLGlobalsSpec.m */; };
5DCC19A01B8221F3004FFAD9 /* SDLURLSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DCC199E1B8221F3004FFAD9 /* SDLURLSession.h */; };
5DCC19A11B8221F3004FFAD9 /* SDLURLSession.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DCC199F1B8221F3004FFAD9 /* SDLURLSession.m */; };
@@ -1344,6 +1377,13 @@
5D4029D51A76F0410006B0C2 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = SmartDeviceLink_Example/Info.plist; sourceTree = SOURCE_ROOT; };
5D4029E01A76F0760006B0C2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = SmartDeviceLink_Example/Base.lproj/LaunchScreen.xib; sourceTree = SOURCE_ROOT; };
5D4029E21A76F0760006B0C2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = SmartDeviceLink_Example/Base.lproj/Main.storyboard; sourceTree = SOURCE_ROOT; };
+ 5D4631031F2120A30092EFDC /* SDLControlFramePayloadType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLControlFramePayloadType.h; sourceTree = "<group>"; };
+ 5D4631061F21261A0092EFDC /* SDLControlFramePayloadRPCStartServiceAck.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLControlFramePayloadRPCStartServiceAck.h; sourceTree = "<group>"; };
+ 5D4631071F21261A0092EFDC /* SDLControlFramePayloadRPCStartServiceAck.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLControlFramePayloadRPCStartServiceAck.m; sourceTree = "<group>"; };
+ 5D46310E1F2135850092EFDC /* SDLControlFramePayloadConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLControlFramePayloadConstants.h; sourceTree = "<group>"; };
+ 5D46310F1F2135850092EFDC /* SDLControlFramePayloadConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLControlFramePayloadConstants.m; sourceTree = "<group>"; };
+ 5D4631121F2136B60092EFDC /* SDLControlFramePayloadNak.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLControlFramePayloadNak.h; sourceTree = "<group>"; };
+ 5D4631131F2136B60092EFDC /* SDLControlFramePayloadNak.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLControlFramePayloadNak.m; sourceTree = "<group>"; };
5D48329B1A8EA33D00252386 /* Preferences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Preferences.h; path = SmartDeviceLink_Example/Classes/Preferences.h; sourceTree = SOURCE_ROOT; };
5D48329C1A8EA33D00252386 /* Preferences.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Preferences.m; path = SmartDeviceLink_Example/Classes/Preferences.m; sourceTree = SOURCE_ROOT; };
5D48329F1A92868E00252386 /* ProxyManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProxyManager.h; path = SmartDeviceLink_Example/Classes/ProxyManager.h; sourceTree = SOURCE_ROOT; };
@@ -1921,6 +1961,15 @@
5D9F50821BEA5C6100FEF399 /* SDLFileManagerSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLFileManagerSpec.m; path = DevAPISpecs/SDLFileManagerSpec.m; sourceTree = "<group>"; };
5D9F50851BED412E00FEF399 /* TestConnectionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TestConnectionManager.h; path = TestUtilities/TestConnectionManager.h; sourceTree = "<group>"; };
5D9F50861BED412E00FEF399 /* TestConnectionManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TestConnectionManager.m; path = TestUtilities/TestConnectionManager.m; sourceTree = "<group>"; };
+ 5D9FDA891F2A7D3400A495C8 /* bson_array.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = bson_array.c; path = bson_c_lib/src/bson_array.c; sourceTree = SOURCE_ROOT; };
+ 5D9FDA8A1F2A7D3400A495C8 /* bson_array.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = bson_array.h; path = bson_c_lib/src/bson_array.h; sourceTree = SOURCE_ROOT; };
+ 5D9FDA8B1F2A7D3400A495C8 /* bson_object.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = bson_object.c; path = bson_c_lib/src/bson_object.c; sourceTree = SOURCE_ROOT; };
+ 5D9FDA8C1F2A7D3400A495C8 /* bson_object.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = bson_object.h; path = bson_c_lib/src/bson_object.h; sourceTree = SOURCE_ROOT; };
+ 5D9FDA8D1F2A7D3400A495C8 /* bson_util.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = bson_util.c; path = bson_c_lib/src/bson_util.c; sourceTree = SOURCE_ROOT; };
+ 5D9FDA8E1F2A7D3400A495C8 /* bson_util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = bson_util.h; path = bson_c_lib/src/bson_util.h; sourceTree = SOURCE_ROOT; };
+ 5D9FDA951F2A7D3F00A495C8 /* emhashmap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = emhashmap.c; path = bson_c_lib/src/emhashmap/emhashmap.c; sourceTree = SOURCE_ROOT; };
+ 5D9FDA961F2A7D3F00A495C8 /* emhashmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = emhashmap.h; path = bson_c_lib/src/emhashmap/emhashmap.h; sourceTree = SOURCE_ROOT; };
+ 5D9FDA971F2A7D3F00A495C8 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = LICENSE; path = bson_c_lib/src/emhashmap/LICENSE; sourceTree = SOURCE_ROOT; };
5DA0268F1AD44EE700019F86 /* SDLDialNumberResponseSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLDialNumberResponseSpec.m; sourceTree = "<group>"; };
5DA102A21D4122C700C15826 /* NSMutableDictionary+SafeRemove.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableDictionary+SafeRemove.h"; sourceTree = "<group>"; };
5DA102A31D4122C700C15826 /* NSMutableDictionary+SafeRemove.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMutableDictionary+SafeRemove.m"; sourceTree = "<group>"; };
@@ -1928,6 +1977,10 @@
5DA22CB41D075CF200245F5F /* OCMock.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OCMock.framework; path = sdl_ios/Carthage/Build/iOS/OCMock.framework; sourceTree = "<group>"; };
5DA22CB51D075CF200245F5F /* OHHTTPStubs.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OHHTTPStubs.framework; path = sdl_ios/Carthage/Build/iOS/OHHTTPStubs.framework; sourceTree = "<group>"; };
5DA22CB61D075CF200245F5F /* Quick.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quick.framework; path = sdl_ios/Carthage/Build/iOS/Quick.framework; sourceTree = "<group>"; };
+ 5DA23FEF1F2FA0FF009C0313 /* SDLControlFramePayloadEndServiceSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLControlFramePayloadEndServiceSpec.m; sourceTree = "<group>"; };
+ 5DA23FF21F2FA35C009C0313 /* SDLControlFramePayloadAudioStartServiceAckSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLControlFramePayloadAudioStartServiceAckSpec.m; sourceTree = "<group>"; };
+ 5DA23FF51F2FAA31009C0313 /* SDLControlFramePayloadRPCStartServiceSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLControlFramePayloadRPCStartServiceSpec.m; sourceTree = "<group>"; };
+ 5DA23FF71F2FAF2D009C0313 /* SDLControlFramePayloadRPCStartServiceAckSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLControlFramePayloadRPCStartServiceAckSpec.m; sourceTree = "<group>"; };
5DA3F3521BC448060026F2D0 /* NSMapTable+Subscripting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMapTable+Subscripting.h"; sourceTree = "<group>"; };
5DA3F3531BC448060026F2D0 /* NSMapTable+Subscripting.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMapTable+Subscripting.m"; sourceTree = "<group>"; };
5DA3F3581BC448480026F2D0 /* SDLError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLError.h; sourceTree = "<group>"; };
@@ -1936,6 +1989,8 @@
5DA3F35E1BC448590026F2D0 /* SDLNotificationConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLNotificationConstants.m; sourceTree = "<group>"; };
5DA3F36E1BC4489A0026F2D0 /* SDLManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLManager.h; sourceTree = "<group>"; };
5DA3F36F1BC4489A0026F2D0 /* SDLManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLManager.m; sourceTree = "<group>"; };
+ 5DA49CE31F1EA83300E65FC5 /* SDLControlFramePayloadRPCStartService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLControlFramePayloadRPCStartService.h; sourceTree = "<group>"; };
+ 5DA49CE41F1EA83300E65FC5 /* SDLControlFramePayloadRPCStartService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLControlFramePayloadRPCStartService.m; sourceTree = "<group>"; };
5DAE06721BDEC6C000F9B498 /* SDLFileSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLFileSpec.m; path = DevAPISpecs/SDLFileSpec.m; sourceTree = "<group>"; };
5DAE06741BDEC6D600F9B498 /* SDLArtworkSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLArtworkSpec.m; path = DevAPISpecs/SDLArtworkSpec.m; sourceTree = "<group>"; };
5DB1BCD01D243A8E002FFC37 /* SDLDeleteFileOperationSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLDeleteFileOperationSpec.m; path = DevAPISpecs/SDLDeleteFileOperationSpec.m; sourceTree = "<group>"; };
@@ -1954,8 +2009,19 @@
5DB92D2E1AC59F0000C15BB0 /* SDLObjectWithPrioritySpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLObjectWithPrioritySpec.m; path = "UtilitiesSpecs/Prioritized Objects/SDLObjectWithPrioritySpec.m"; sourceTree = "<group>"; };
5DB92D301AC9C8BA00C15BB0 /* SDLRPCStruct.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLRPCStruct.h; sourceTree = "<group>"; };
5DB92D311AC9C8BA00C15BB0 /* SDLRPCStruct.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLRPCStruct.m; sourceTree = "<group>"; };
+ 5DB9964C1F26886C002D8795 /* SDLControlFramePayloadEndService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLControlFramePayloadEndService.h; sourceTree = "<group>"; };
+ 5DB9964D1F26886C002D8795 /* SDLControlFramePayloadEndService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLControlFramePayloadEndService.m; sourceTree = "<group>"; };
+ 5DB996551F268ECB002D8795 /* SDLControlFramePayloadAudioStartServiceAck.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLControlFramePayloadAudioStartServiceAck.h; sourceTree = "<group>"; };
+ 5DB996561F268ECB002D8795 /* SDLControlFramePayloadAudioStartServiceAck.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLControlFramePayloadAudioStartServiceAck.m; sourceTree = "<group>"; };
+ 5DB9965A1F268F97002D8795 /* SDLControlFramePayloadVideoStartService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLControlFramePayloadVideoStartService.h; sourceTree = "<group>"; };
+ 5DB9965B1F268F97002D8795 /* SDLControlFramePayloadVideoStartService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLControlFramePayloadVideoStartService.m; sourceTree = "<group>"; };
+ 5DB9965E1F28C6ED002D8795 /* SDLControlFramePayloadVideoStartServiceAck.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLControlFramePayloadVideoStartServiceAck.h; sourceTree = "<group>"; };
+ 5DB9965F1F28C6ED002D8795 /* SDLControlFramePayloadVideoStartServiceAck.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLControlFramePayloadVideoStartServiceAck.m; sourceTree = "<group>"; };
5DBAE0AA1D3588AC00CE00BF /* SDLNotificationDispatcherSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLNotificationDispatcherSpec.m; path = DevAPISpecs/SDLNotificationDispatcherSpec.m; sourceTree = "<group>"; };
5DBAE0AC1D368D1A00CE00BF /* SDLResponseDispatcherSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLResponseDispatcherSpec.m; path = DevAPISpecs/SDLResponseDispatcherSpec.m; sourceTree = "<group>"; };
+ 5DBF0D5D1F3A68C0008AF2C9 /* SDLControlFramePayloadVideoStartServiceSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLControlFramePayloadVideoStartServiceSpec.m; path = ControlFramePayloadSpecs/SDLControlFramePayloadVideoStartServiceSpec.m; sourceTree = "<group>"; };
+ 5DBF0D5F1F3B3DB4008AF2C9 /* SDLControlFrameVideoStartServiceAckSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLControlFrameVideoStartServiceAckSpec.m; path = ControlFramePayloadSpecs/SDLControlFrameVideoStartServiceAckSpec.m; sourceTree = "<group>"; };
+ 5DC09ED91F2F7FEC00F4AB1D /* SDLControlFramePayloadNakSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLControlFramePayloadNakSpec.m; path = ControlFramePayloadSpecs/SDLControlFramePayloadNakSpec.m; sourceTree = "<group>"; };
5DC978251B7A38640012C2F1 /* SDLGlobalsSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLGlobalsSpec.m; path = UtilitiesSpecs/SDLGlobalsSpec.m; sourceTree = "<group>"; };
5DCA93821EE0844D0015768E /* SmartDeviceLink.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; path = SmartDeviceLink.podspec; sourceTree = SOURCE_ROOT; };
5DCC199E1B8221F3004FFAD9 /* SDLURLSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLURLSession.h; sourceTree = "<group>"; };
@@ -2438,6 +2504,7 @@
1680B1041A9CD7AD00DBD79E /* ProtocolSpecs */ = {
isa = PBXGroup;
children = (
+ 5DC09ED71F2F7F1A00F4AB1D /* Control Frame Payloads */,
1680B1051A9CD7AD00DBD79E /* HeaderSpecs */,
1680B1091A9CD7AD00DBD79E /* MessageSpecs */,
1680B10E1A9CD7AD00DBD79E /* SDLAbstractProtocolSpec.m */,
@@ -2595,6 +2662,36 @@
name = "Supporting Files";
sourceTree = "<group>";
};
+ 5D4631051F2125F70092EFDC /* @protocols */ = {
+ isa = PBXGroup;
+ children = (
+ 5D4631031F2120A30092EFDC /* SDLControlFramePayloadType.h */,
+ );
+ name = "@protocols";
+ sourceTree = "<group>";
+ };
+ 5D46310D1F2133940092EFDC /* RPC Service */ = {
+ isa = PBXGroup;
+ children = (
+ 5DA49CE31F1EA83300E65FC5 /* SDLControlFramePayloadRPCStartService.h */,
+ 5DA49CE41F1EA83300E65FC5 /* SDLControlFramePayloadRPCStartService.m */,
+ 5D4631061F21261A0092EFDC /* SDLControlFramePayloadRPCStartServiceAck.h */,
+ 5D4631071F21261A0092EFDC /* SDLControlFramePayloadRPCStartServiceAck.m */,
+ );
+ name = "RPC Service";
+ sourceTree = "<group>";
+ };
+ 5D4631161F223DEE0092EFDC /* General */ = {
+ isa = PBXGroup;
+ children = (
+ 5D4631121F2136B60092EFDC /* SDLControlFramePayloadNak.h */,
+ 5D4631131F2136B60092EFDC /* SDLControlFramePayloadNak.m */,
+ 5DB9964C1F26886C002D8795 /* SDLControlFramePayloadEndService.h */,
+ 5DB9964D1F26886C002D8795 /* SDLControlFramePayloadEndService.m */,
+ );
+ name = General;
+ sourceTree = "<group>";
+ };
5D4832991A8EA27200252386 /* Storyboards */ = {
isa = PBXGroup;
children = (
@@ -2657,6 +2754,7 @@
5D5934EE1A85160900687FB9 /* Protocol */ = {
isa = PBXGroup;
children = (
+ 5DA49C8C1F1E549000E65FC5 /* BSON */,
5D5934FA1A851AC900687FB9 /* @protocols */,
5D5935011A851D7E00687FB9 /* Header */,
5D5935021A851D8700687FB9 /* Message */,
@@ -3342,6 +3440,7 @@
5D5935021A851D8700687FB9 /* Message */ = {
isa = PBXGroup;
children = (
+ 5DA49CE21F1EA77900E65FC5 /* Control Frame Payloads */,
5D61FB5B1A84238B00846EE7 /* SDLProtocolMessage.h */,
5D61FB5C1A84238B00846EE7 /* SDLProtocolMessage.m */,
5D61FC0A1A84238C00846EE7 /* SDLV1ProtocolMessage.h */,
@@ -3626,6 +3725,32 @@
name = Permissions;
sourceTree = "<group>";
};
+ 5DA23FF11F2FA32A009C0313 /* Audio Service */ = {
+ isa = PBXGroup;
+ children = (
+ 5DA23FF21F2FA35C009C0313 /* SDLControlFramePayloadAudioStartServiceAckSpec.m */,
+ );
+ name = "Audio Service";
+ sourceTree = "<group>";
+ };
+ 5DA23FF41F2FAA06009C0313 /* RPC Service */ = {
+ isa = PBXGroup;
+ children = (
+ 5DA23FF51F2FAA31009C0313 /* SDLControlFramePayloadRPCStartServiceSpec.m */,
+ 5DA23FF71F2FAF2D009C0313 /* SDLControlFramePayloadRPCStartServiceAckSpec.m */,
+ );
+ name = "RPC Service";
+ sourceTree = "<group>";
+ };
+ 5DA23FF91F2FB485009C0313 /* Video Service */ = {
+ isa = PBXGroup;
+ children = (
+ 5DBF0D5D1F3A68C0008AF2C9 /* SDLControlFramePayloadVideoStartServiceSpec.m */,
+ 5DBF0D5F1F3B3DB4008AF2C9 /* SDLControlFrameVideoStartServiceAckSpec.m */,
+ );
+ name = "Video Service";
+ sourceTree = "<group>";
+ };
5DA3F3511BC4477B0026F2D0 /* Developer API */ = {
isa = PBXGroup;
children = (
@@ -3682,6 +3807,44 @@
name = "Handler Additions";
sourceTree = "<group>";
};
+ 5DA49C8C1F1E549000E65FC5 /* BSON */ = {
+ isa = PBXGroup;
+ children = (
+ 5D9FDA891F2A7D3400A495C8 /* bson_array.c */,
+ 5D9FDA8A1F2A7D3400A495C8 /* bson_array.h */,
+ 5D9FDA8B1F2A7D3400A495C8 /* bson_object.c */,
+ 5D9FDA8C1F2A7D3400A495C8 /* bson_object.h */,
+ 5D9FDA8D1F2A7D3400A495C8 /* bson_util.c */,
+ 5D9FDA8E1F2A7D3400A495C8 /* bson_util.h */,
+ 5DA49CB51F1E64BB00E65FC5 /* emhashmap */,
+ );
+ name = BSON;
+ sourceTree = "<group>";
+ };
+ 5DA49CB51F1E64BB00E65FC5 /* emhashmap */ = {
+ isa = PBXGroup;
+ children = (
+ 5D9FDA951F2A7D3F00A495C8 /* emhashmap.c */,
+ 5D9FDA961F2A7D3F00A495C8 /* emhashmap.h */,
+ 5D9FDA971F2A7D3F00A495C8 /* LICENSE */,
+ );
+ name = emhashmap;
+ sourceTree = "<group>";
+ };
+ 5DA49CE21F1EA77900E65FC5 /* Control Frame Payloads */ = {
+ isa = PBXGroup;
+ children = (
+ 5D46310E1F2135850092EFDC /* SDLControlFramePayloadConstants.h */,
+ 5D46310F1F2135850092EFDC /* SDLControlFramePayloadConstants.m */,
+ 5DB996541F268E9D002D8795 /* Audio Service */,
+ 5D4631161F223DEE0092EFDC /* General */,
+ 5D46310D1F2133940092EFDC /* RPC Service */,
+ 5DB996591F268F78002D8795 /* Video Service */,
+ 5D4631051F2125F70092EFDC /* @protocols */,
+ );
+ name = "Control Frame Payloads";
+ sourceTree = "<group>";
+ };
5DAE06711BDEC68700F9B498 /* Developer API Tests */ = {
isa = PBXGroup;
children = (
@@ -3762,6 +3925,26 @@
name = "Prioritized Objects";
sourceTree = "<group>";
};
+ 5DB996541F268E9D002D8795 /* Audio Service */ = {
+ isa = PBXGroup;
+ children = (
+ 5DB996551F268ECB002D8795 /* SDLControlFramePayloadAudioStartServiceAck.h */,
+ 5DB996561F268ECB002D8795 /* SDLControlFramePayloadAudioStartServiceAck.m */,
+ );
+ name = "Audio Service";
+ sourceTree = "<group>";
+ };
+ 5DB996591F268F78002D8795 /* Video Service */ = {
+ isa = PBXGroup;
+ children = (
+ 5DB9965A1F268F97002D8795 /* SDLControlFramePayloadVideoStartService.h */,
+ 5DB9965B1F268F97002D8795 /* SDLControlFramePayloadVideoStartService.m */,
+ 5DB9965E1F28C6ED002D8795 /* SDLControlFramePayloadVideoStartServiceAck.h */,
+ 5DB9965F1F28C6ED002D8795 /* SDLControlFramePayloadVideoStartServiceAck.m */,
+ );
+ name = "Video Service";
+ sourceTree = "<group>";
+ };
5DBAE0A51D355EE700CE00BF /* Lock Screen */ = {
isa = PBXGroup;
children = (
@@ -3816,6 +3999,26 @@
name = Dispatchers;
sourceTree = "<group>";
};
+ 5DC09ED71F2F7F1A00F4AB1D /* Control Frame Payloads */ = {
+ isa = PBXGroup;
+ children = (
+ 5DA23FF11F2FA32A009C0313 /* Audio Service */,
+ 5DC09ED81F2F7FC000F4AB1D /* General */,
+ 5DA23FF41F2FAA06009C0313 /* RPC Service */,
+ 5DA23FF91F2FB485009C0313 /* Video Service */,
+ );
+ name = "Control Frame Payloads";
+ sourceTree = "<group>";
+ };
+ 5DC09ED81F2F7FC000F4AB1D /* General */ = {
+ isa = PBXGroup;
+ children = (
+ 5DC09ED91F2F7FEC00F4AB1D /* SDLControlFramePayloadNakSpec.m */,
+ 5DA23FEF1F2FA0FF009C0313 /* SDLControlFramePayloadEndServiceSpec.m */,
+ );
+ name = General;
+ sourceTree = "<group>";
+ };
5DCC199D1B8221D2004FFAD9 /* HTTP Connection */ = {
isa = PBXGroup;
children = (
@@ -4029,6 +4232,7 @@
5D61FDE71A84238C00846EE7 /* SDLUnsubscribeButton.h in Headers */,
5D61FC691A84238C00846EE7 /* SDLConsoleController.h in Headers */,
5D61FCAB1A84238C00846EE7 /* SDLFuelCutoffStatus.h in Headers */,
+ 5DB9965C1F268F97002D8795 /* SDLControlFramePayloadVideoStartService.h in Headers */,
5D1665C81CF8CA3D00CC4CA1 /* SDLPermissionFilter.h in Headers */,
E9C32B911AB20BA200F283AF /* SDLIAPSession.h in Headers */,
5D61FCD71A84238C00846EE7 /* SDLInteractionMode.h in Headers */,
@@ -4042,9 +4246,12 @@
5D61FE111A84238C00846EE7 /* SDLWarningLightStatus.h in Headers */,
5D61FC7A1A84238C00846EE7 /* SDLDeleteInteractionChoiceSet.h in Headers */,
5D61FC3B1A84238C00846EE7 /* SDLAlertManeuverResponse.h in Headers */,
+ 5DB9964E1F26886C002D8795 /* SDLControlFramePayloadEndService.h in Headers */,
+ 5D9FDA991F2A7D3F00A495C8 /* emhashmap.h in Headers */,
5D61FC6F1A84238C00846EE7 /* SDLDebugTool.h in Headers */,
5D61FDB71A84238C00846EE7 /* SDLSyncPData.h in Headers */,
5D61FD011A84238C00846EE7 /* SDLOnAudioPassThru.h in Headers */,
+ 5D9FDA901F2A7D3400A495C8 /* bson_array.h in Headers */,
5D61FDCB1A84238C00846EE7 /* SDLTextFieldName.h in Headers */,
5D61FD8B1A84238C00846EE7 /* SDLSetMediaClockTimer.h in Headers */,
5D61FD031A84238C00846EE7 /* SDLOnButtonEvent.h in Headers */,
@@ -4115,6 +4322,7 @@
E9C32B861AB20B4300F283AF /* NSThread+ThreadIndex.h in Headers */,
5D61FC741A84238C00846EE7 /* SDLDeleteCommandResponse.h in Headers */,
5D61FDF11A84238C00846EE7 /* SDLUpdateTurnList.h in Headers */,
+ 5DB996571F268ECB002D8795 /* SDLControlFramePayloadAudioStartServiceAck.h in Headers */,
5D61FD671A84238C00846EE7 /* SDLResult.h in Headers */,
5D61FD351A84238C00846EE7 /* SDLPowerModeStatus.h in Headers */,
5D61FD971A84238C00846EE7 /* SDLSingleTireStatus.h in Headers */,
@@ -4132,6 +4340,7 @@
5D61FE091A84238C00846EE7 /* SDLVehicleDataType.h in Headers */,
5DCC19A01B8221F3004FFAD9 /* SDLURLSession.h in Headers */,
5D61FDB11A84238C00846EE7 /* SDLSubscribeVehicleData.h in Headers */,
+ 5DB996601F28C6ED002D8795 /* SDLControlFramePayloadVideoStartServiceAck.h in Headers */,
5DCF76F51ACDBAD300BB647B /* SDLSendLocation.h in Headers */,
5D61FC9E1A84238C00846EE7 /* SDLEncodedSyncPData.h in Headers */,
5D61FC291A84238C00846EE7 /* SDLAbstractProtocol.h in Headers */,
@@ -4149,6 +4358,7 @@
5D61FD451A84238C00846EE7 /* SDLProtocolHeader.h in Headers */,
5D61FCFA1A84238C00846EE7 /* SDLMyKey.h in Headers */,
5D61FC981A84238C00846EE7 /* SDLECallInfo.h in Headers */,
+ 5D9FDA921F2A7D3400A495C8 /* bson_object.h in Headers */,
5D61FD7B1A84238C00846EE7 /* SDLScrollableMessage.h in Headers */,
DA9F7E931DCC04E400ACAE48 /* SDLUnsubscribeWaypoints.h in Headers */,
5D61FD3D1A84238C00846EE7 /* SDLPrimaryAudioSource.h in Headers */,
@@ -4223,6 +4433,7 @@
DAC572631D10C5020004288B /* SDLPinchGesture.h in Headers */,
5D61FC311A84238C00846EE7 /* SDLAddSubMenu.h in Headers */,
5D61FD171A84238C00846EE7 /* SDLOnPermissionsChange.h in Headers */,
+ 5D4631081F21261A0092EFDC /* SDLControlFramePayloadRPCStartServiceAck.h in Headers */,
5D61FDD51A84238C00846EE7 /* SDLTouchEventCapabilities.h in Headers */,
5D61FD0B1A84238C00846EE7 /* SDLOnEncodedSyncPData.h in Headers */,
5D61FC631A84238C00846EE7 /* SDLClusterModeStatus.h in Headers */,
@@ -4235,6 +4446,7 @@
DA9F7E7F1DCC028B00ACAE48 /* SDLOnWaypointChange.h in Headers */,
5D61FCE41A84238C00846EE7 /* SDLKeyboardProperties.h in Headers */,
5D61FDED1A84238C00846EE7 /* SDLUnsubscribeVehicleDataResponse.h in Headers */,
+ 5D4631041F2120A30092EFDC /* SDLControlFramePayloadType.h in Headers */,
5DCC19A41B822804004FFAD9 /* SDLURLRequestTask.h in Headers */,
5D61FCCF1A84238C00846EE7 /* SDLImageField.h in Headers */,
5D535DC51B72473800CF7760 /* SDLGlobals.h in Headers */,
@@ -4248,6 +4460,7 @@
5D6F7A2B1BC45BF70070BF37 /* SDLRequestHandler.h in Headers */,
5D61FDB51A84238C00846EE7 /* SDLSyncMsgVersion.h in Headers */,
5DA102A41D4122C700C15826 /* NSMutableDictionary+SafeRemove.h in Headers */,
+ 5DA49CE51F1EA83300E65FC5 /* SDLControlFramePayloadRPCStartService.h in Headers */,
5D61FE031A84238C00846EE7 /* SDLVehicleDataResult.h in Headers */,
5D61FD911A84238C00846EE7 /* SDLShowConstantTBT.h in Headers */,
5D61FC331A84238C00846EE7 /* SDLAddSubMenuResponse.h in Headers */,
@@ -4287,6 +4500,7 @@
332A91501CED9CF10043824C /* SDLAppInfo.h in Headers */,
5D61FDA71A84238C00846EE7 /* SDLSpeakResponse.h in Headers */,
5D1665CB1CF8CA6700CC4CA1 /* NSNumber+NumberType.h in Headers */,
+ 5D9FDA941F2A7D3400A495C8 /* bson_util.h in Headers */,
5D61FD771A84238C00846EE7 /* SDLSamplingRate.h in Headers */,
5D61FCBB1A84238C00846EE7 /* SDLGPSData.h in Headers */,
5D61FDA31A84238C00846EE7 /* SDLSoftButtonType.h in Headers */,
@@ -4297,6 +4511,7 @@
5D61FD691A84238C00846EE7 /* SDLRPCMessage.h in Headers */,
5D61FCA71A84238C00846EE7 /* SDLEnum.h in Headers */,
5D8B174F1AC9D266006A6E1C /* SDLDialNumber.h in Headers */,
+ 5D4631101F2135850092EFDC /* SDLControlFramePayloadConstants.h in Headers */,
5D7F87EF1CE3C294002DD7C4 /* SDLFileManagerConstants.h in Headers */,
5D61FCAD1A84238C00846EE7 /* SDLFunctionID.h in Headers */,
DA9F7E831DCC047200ACAE48 /* SDLWaypointType.h in Headers */,
@@ -4306,6 +4521,7 @@
5D82041E1BCD8E6100D0A41B /* SDLConfiguration.h in Headers */,
5D61FD4A1A84238C00846EE7 /* SDLProtocolMessageAssembler.h in Headers */,
5D61FD4C1A84238C00846EE7 /* SDLProtocolMessageDisassembler.h in Headers */,
+ 5D4631141F2136B60092EFDC /* SDLControlFramePayloadNak.h in Headers */,
5D61FD4E1A84238C00846EE7 /* SDLProtocolReceivedMessageRouter.h in Headers */,
97E26DEC1E807AD70074A3C7 /* SDLMutableDataQueue.h in Headers */,
5D61FDF71A84238C00846EE7 /* SDLV1ProtocolMessage.h in Headers */,
@@ -4460,6 +4676,7 @@
DA7515B51D95FAA000F29323 /* lock_arrow_down_white@2x.png in Resources */,
DA7515BE1D95FAA000F29323 /* sdl_logo_black@2x.png in Resources */,
DA7515B91D95FAA000F29323 /* lock_arrow_up_black@3x.png in Resources */,
+ 5D9FDA9A1F2A7D3F00A495C8 /* LICENSE in Resources */,
DA7515B71D95FAA000F29323 /* lock_arrow_up_black.png in Resources */,
DA7515BC1D95FAA000F29323 /* lock_arrow_up_white@3x.png in Resources */,
DA7515B81D95FAA000F29323 /* lock_arrow_up_black@2x.png in Resources */,
@@ -4574,9 +4791,11 @@
5D61FCC81A84238C00846EE7 /* SDLIAPTransport.m in Sources */,
5D61FE101A84238C00846EE7 /* SDLVrHelpItem.m in Sources */,
5D61FCC01A84238C00846EE7 /* SDLHexUtility.m in Sources */,
+ 5DB9964F1F26886C002D8795 /* SDLControlFramePayloadEndService.m in Sources */,
5D61FD821A84238C00846EE7 /* SDLSetAppIconResponse.m in Sources */,
5D61FDF81A84238C00846EE7 /* SDLV1ProtocolMessage.m in Sources */,
5D61FDC81A84238C00846EE7 /* SDLTextAlignment.m in Sources */,
+ 5D4631091F21261B0092EFDC /* SDLControlFramePayloadRPCStartServiceAck.m in Sources */,
5D82042E1BCEC32F00D0A41B /* SDLFile.m in Sources */,
5DA3F3601BC448590026F2D0 /* SDLNotificationConstants.m in Sources */,
5D61FD5A1A84238C00846EE7 /* SDLReadDID.m in Sources */,
@@ -4607,6 +4826,7 @@
5D61FDB21A84238C00846EE7 /* SDLSubscribeVehicleData.m in Sources */,
5D61FC991A84238C00846EE7 /* SDLECallInfo.m in Sources */,
5D61FD601A84238C00846EE7 /* SDLRegisterAppInterfaceResponse.m in Sources */,
+ 5DB996581F268ECB002D8795 /* SDLControlFramePayloadAudioStartServiceAck.m in Sources */,
DAC572621D10C5020004288B /* SDLPinchGesture.m in Sources */,
5D61FCF51A84238C00846EE7 /* SDLMaintenanceModeStatus.m in Sources */,
5D61FCD81A84238C00846EE7 /* SDLInteractionMode.m in Sources */,
@@ -4635,11 +4855,13 @@
5D3E48801D6F88A30000BFEF /* SDLRPCNotificationNotification.m in Sources */,
DAC572581D1067270004288B /* SDLTouchManager.m in Sources */,
5D61FC641A84238C00846EE7 /* SDLClusterModeStatus.m in Sources */,
+ 5DB9965D1F268F97002D8795 /* SDLControlFramePayloadVideoStartService.m in Sources */,
5D61FCF91A84238C00846EE7 /* SDLMenuParams.m in Sources */,
5D61FD7C1A84238C00846EE7 /* SDLScrollableMessage.m in Sources */,
5D4D67B11D2FE2F900468B4A /* SDLResponseDispatcher.m in Sources */,
5D61FD801A84238C00846EE7 /* SDLSetAppIcon.m in Sources */,
5D61FD3C1A84238C00846EE7 /* SDLPresetBankCapabilities.m in Sources */,
+ 5D4631151F2136B60092EFDC /* SDLControlFramePayloadNak.m in Sources */,
5D61FDB81A84238C00846EE7 /* SDLSyncPData.m in Sources */,
5D61FD221A84238C00846EE7 /* SDLOnVehicleData.m in Sources */,
5D61FCD41A84238C00846EE7 /* SDLImageResolution.m in Sources */,
@@ -4662,12 +4884,15 @@
5D61FD701A84238C00846EE7 /* SDLRPCPayload.m in Sources */,
5D61FD9C1A84238C00846EE7 /* SDLSlider.m in Sources */,
5DCF76FA1ACDD7CD00BB647B /* SDLSendLocationResponse.m in Sources */,
+ 5D9FDA8F1F2A7D3400A495C8 /* bson_array.c in Sources */,
5D61FD661A84238C00846EE7 /* SDLResetGlobalPropertiesResponse.m in Sources */,
5D61FCFE1A84238C00846EE7 /* SDLObjectWithPriority.m in Sources */,
5D61FC401A84238C00846EE7 /* SDLAmbientLightStatus.m in Sources */,
5D61FC951A84238C00846EE7 /* SDLDriverDistractionState.m in Sources */,
+ 5DB996611F28C6ED002D8795 /* SDLControlFramePayloadVideoStartServiceAck.m in Sources */,
5D61FD961A84238C00846EE7 /* SDLShowResponse.m in Sources */,
5D61FD981A84238C00846EE7 /* SDLSingleTireStatus.m in Sources */,
+ 5D9FDA931F2A7D3400A495C8 /* bson_util.c in Sources */,
5D61FD511A84238C00846EE7 /* SDLProxy.m in Sources */,
5D61FD461A84238C00846EE7 /* SDLProtocolHeader.m in Sources */,
5D61FDBC1A84238C00846EE7 /* SDLSystemAction.m in Sources */,
@@ -4734,6 +4959,7 @@
5D61FE001A84238C00846EE7 /* SDLVehicleDataEventStatus.m in Sources */,
5D61FDC41A84238C00846EE7 /* SDLTBTState.m in Sources */,
5D61FDA61A84238C00846EE7 /* SDLSpeak.m in Sources */,
+ 5D4631111F2135850092EFDC /* SDLControlFramePayloadConstants.m in Sources */,
DA9F7E881DCC049900ACAE48 /* SDLSubscribeWaypoints.m in Sources */,
5D61FDDE1A84238C00846EE7 /* SDLTTSChunk.m in Sources */,
5D61FD9E1A84238C00846EE7 /* SDLSliderResponse.m in Sources */,
@@ -4750,6 +4976,7 @@
5D8B17541AC9E11B006A6E1C /* SDLDialNumberResponse.m in Sources */,
5D61FC851A84238C00846EE7 /* SDLDeviceLevelStatus.m in Sources */,
5D1665AB1CF5F7D000CC4CA1 /* (null) in Sources */,
+ 5D9FDA981F2A7D3F00A495C8 /* emhashmap.c in Sources */,
5D61FD1E1A84238C00846EE7 /* SDLOnTBTClientState.m in Sources */,
DA9F7E641DCBFAC800ACAE48 /* SDLDateTime.m in Sources */,
5D61FD581A84238C00846EE7 /* SDLPutFileResponse.m in Sources */,
@@ -4769,6 +4996,7 @@
5D61FE021A84238C00846EE7 /* SDLVehicleDataNotificationStatus.m in Sources */,
5D61FDD81A84238C00846EE7 /* SDLTouchType.m in Sources */,
5D61FDD61A84238C00846EE7 /* SDLTouchEventCapabilities.m in Sources */,
+ 5DA49CE61F1EA83300E65FC5 /* SDLControlFramePayloadRPCStartService.m in Sources */,
5DA102A51D4122C700C15826 /* NSMutableDictionary+SafeRemove.m in Sources */,
5D61FCF11A84238C00846EE7 /* SDLLockScreenStatusManager.m in Sources */,
5D61FDAC1A84238C00846EE7 /* SDLStartTime.m in Sources */,
@@ -4809,6 +5037,7 @@
5D61FDC61A84238C00846EE7 /* SDLTCPTransport.m in Sources */,
5D61FE0E1A84238C00846EE7 /* SDLVrCapabilities.m in Sources */,
5D61FDC21A84238C00846EE7 /* SDLSystemRequestResponse.m in Sources */,
+ 5D9FDA911F2A7D3400A495C8 /* bson_object.c in Sources */,
5D61FD001A84238C00846EE7 /* SDLOnAppInterfaceUnregistered.m in Sources */,
DAC5726A1D10D5FC0004288B /* dispatch_timer.m in Sources */,
5D61FC6C1A84238C00846EE7 /* SDLCreateInteractionChoiceSet.m in Sources */,
@@ -4853,6 +5082,7 @@
5DA026901AD44EE700019F86 /* SDLDialNumberResponseSpec.m in Sources */,
162E83901A9BDE8B00906325 /* SDLTireStatusSpec.m in Sources */,
162E82E01A9BDE8B00906325 /* SDLHMILevelSpec.m in Sources */,
+ 5DC09EDA1F2F7FEC00F4AB1D /* SDLControlFramePayloadNakSpec.m in Sources */,
162E83041A9BDE8B00906325 /* SDLUpdateModeSpec.m in Sources */,
162E83801A9BDE8B00906325 /* SDLHMIPermissionsSpec.m in Sources */,
5D1654561D3E754F00554D93 /* SDLLifecycleManagerSpec.m in Sources */,
@@ -4884,6 +5114,7 @@
162E83991A9BDE8B00906325 /* SDLEnumSpec.m in Sources */,
162E82ED1A9BDE8B00906325 /* SDLMaintenanceModeStatusSpec.m in Sources */,
5DB92D2D1AC4A34F00C15BB0 /* SDLPrioritizedObjectCollectionSpec.m in Sources */,
+ 5DA23FF31F2FA35C009C0313 /* SDLControlFramePayloadAudioStartServiceAckSpec.m in Sources */,
1680B11C1A9CD7AD00DBD79E /* SDLProtocolMessageAssemblerSpec.m in Sources */,
162E83181A9BDE8B00906325 /* SDLOnKeyboardInputSpec.m in Sources */,
162E83701A9BDE8B00906325 /* SDLUpdateTurnListResponseSpec.m in Sources */,
@@ -4920,6 +5151,7 @@
162E82F31A9BDE8B00906325 /* SDLPrerecordedSpeechSpec.m in Sources */,
162E83691A9BDE8B00906325 /* SDLSubscribeButtonResponseSpec.m in Sources */,
5DAE06751BDEC6D600F9B498 /* SDLArtworkSpec.m in Sources */,
+ 5DA23FF01F2FA0FF009C0313 /* SDLControlFramePayloadEndServiceSpec.m in Sources */,
162E83591A9BDE8B00906325 /* SDLListFilesResponseSpec.m in Sources */,
162E832A1A9BDE8B00906325 /* SDLDeleteInteractionChoiceSetSpec.m in Sources */,
162E839D1A9BDE8B00906325 /* SDLRPCResponseSpec.m in Sources */,
@@ -4980,9 +5212,11 @@
5D9F50811BE7E6E300FEF399 /* SDLPermissionsManagerSpec.m in Sources */,
162E83361A9BDE8B00906325 /* SDLRegisterAppInterfaceSpec.m in Sources */,
162E82DD1A9BDE8B00906325 /* SDLFileTypeSpec.m in Sources */,
+ 5DBF0D5E1F3A68C0008AF2C9 /* SDLControlFramePayloadVideoStartServiceSpec.m in Sources */,
162E836A1A9BDE8B00906325 /* SDLSubscribeVehicleDataResponseSpec.m in Sources */,
162E83761A9BDE8B00906325 /* SDLChoiceSpec.m in Sources */,
162E83571A9BDE8B00906325 /* SDLGetDTCsResponseSpec.m in Sources */,
+ 5DA23FF61F2FAA31009C0313 /* SDLControlFramePayloadRPCStartServiceSpec.m in Sources */,
162E83201A9BDE8B00906325 /* SDLOnVehicleDataSpec.m in Sources */,
162E83141A9BDE8B00906325 /* SDLOnDriverDistractionSpec.m in Sources */,
162E83371A9BDE8B00906325 /* SDLResetGlobalPropertiesSpec.m in Sources */,
@@ -5052,12 +5286,14 @@
162E83301A9BDE8B00906325 /* SDLGetVehicleDataSpec.m in Sources */,
162E833F1A9BDE8B00906325 /* SDLSliderSpec.m in Sources */,
162E838C1A9BDE8B00906325 /* SDLSoftButtonSpec.m in Sources */,
+ 5DA23FF81F2FAF2D009C0313 /* SDLControlFramePayloadRPCStartServiceAckSpec.m in Sources */,
162E83191A9BDE8B00906325 /* SDLOnLanguageChangeSpec.m in Sources */,
5DB1BCDD1D243DC3002FFC37 /* SDLLifecycleConfigurationSpec.m in Sources */,
162E83611A9BDE8B00906325 /* SDLSetAppIconResponseSpec.m in Sources */,
162E83471A9BDE8B00906325 /* SDLUnsubscribeVehicleDataSpec.m in Sources */,
162E839A1A9BDE8B00906325 /* SDLRPCMessageSpec.m in Sources */,
5D0A9F911F15550400CC80DD /* SDLSystemCapabilityTypeSpec.m in Sources */,
+ 5DBF0D601F3B3DB4008AF2C9 /* SDLControlFrameVideoStartServiceAckSpec.m in Sources */,
162E83311A9BDE8B00906325 /* SDLListFilesSpec.m in Sources */,
DA9F7EB01DCC063400ACAE48 /* SDLLocationDetailsSpec.m in Sources */,
5DC978261B7A38640012C2F1 /* SDLGlobalsSpec.m in Sources */,
diff --git a/SmartDeviceLink-iOS.xcodeproj/project.xcworkspace/xcshareddata/SmartDeviceLink-iOS.xcscmblueprint b/SmartDeviceLink-iOS.xcodeproj/project.xcworkspace/xcshareddata/SmartDeviceLink-iOS.xcscmblueprint
new file mode 100644
index 000000000..fe46776ac
--- /dev/null
+++ b/SmartDeviceLink-iOS.xcodeproj/project.xcworkspace/xcshareddata/SmartDeviceLink-iOS.xcscmblueprint
@@ -0,0 +1,30 @@
+{
+ "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "66020812E25F835F7E461E1F36EFF9E212E74787",
+ "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : {
+
+ },
+ "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : {
+ "66020812E25F835F7E461E1F36EFF9E212E74787" : 9223372036854775807,
+ "56518C5F548896A9F8039D14FD50ECBB0A40BE1B" : 9223372036854775807
+ },
+ "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "C6E6E3FF-2162-4DF5-AA1E-650AF27E7D3F",
+ "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
+ "66020812E25F835F7E461E1F36EFF9E212E74787" : "sdl_ios\/",
+ "56518C5F548896A9F8039D14FD50ECBB0A40BE1B" : "sdl_ios\/bson_c_lib\/"
+ },
+ "DVTSourceControlWorkspaceBlueprintNameKey" : "SmartDeviceLink-iOS",
+ "DVTSourceControlWorkspaceBlueprintVersion" : 204,
+ "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "SmartDeviceLink-iOS.xcodeproj",
+ "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [
+ {
+ "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/smartdevicelink\/bson_c_lib.git",
+ "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
+ "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "56518C5F548896A9F8039D14FD50ECBB0A40BE1B"
+ },
+ {
+ "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/smartdevicelink\/sdl_ios.git",
+ "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
+ "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "66020812E25F835F7E461E1F36EFF9E212E74787"
+ }
+ ]
+} \ No newline at end of file
diff --git a/SmartDeviceLink/SDLAbstractProtocol.h b/SmartDeviceLink/SDLAbstractProtocol.h
index a8277dac3..664ace5f6 100644
--- a/SmartDeviceLink/SDLAbstractProtocol.h
+++ b/SmartDeviceLink/SDLAbstractProtocol.h
@@ -19,14 +19,20 @@
@property (nonatomic, copy) NSString *appId;
// Sending
-- (void)sendStartSessionWithType:(SDLServiceType)serviceType __deprecated_msg(("Use startServiceWithType: instead"));
-- (void)startServiceWithType:(SDLServiceType)serviceType;
-- (void)startSecureServiceWithType:(SDLServiceType)serviceType completionHandler:(void (^)(BOOL success, NSError *error))completionHandler;
+- (void)sendStartSessionWithType:(SDLServiceType)serviceType __deprecated_msg(("Use startServiceWithType:payload: instead"));
+- (void)startServiceWithType:(SDLServiceType)serviceType __deprecated_msg(("Use startServiceWithType:payload: instead"));
+- (void)startServiceWithType:(SDLServiceType)serviceType payload:(NSData *)payload;
+
+- (void)startSecureServiceWithType:(SDLServiceType)serviceType completionHandler:(void (^)(BOOL success, NSError *error))completionHandler __deprecated_msg(("Use startSecureServiceWithType:payload:completionHandler instead"));;
+- (void)startSecureServiceWithType:(SDLServiceType)serviceType payload:(NSData *)payload completionHandler:(void (^)(BOOL success, NSError *error))completionHandler;
+
- (void)sendEndSessionWithType:(SDLServiceType)serviceType __deprecated_msg(("Use endServiceWithType: instead"));
- (void)endServiceWithType:(SDLServiceType)serviceType;
+
+- (void)sendRPCRequest:(SDLRPCRequest *)rpcRequest __deprecated_msg(("Use sendRPC: instead"));
- (void)sendRPC:(SDLRPCMessage *)message;
- (BOOL)sendRPC:(SDLRPCMessage *)message encrypted:(BOOL)encryption error:(NSError **)error;
-- (void)sendRPCRequest:(SDLRPCRequest *)rpcRequest __deprecated_msg(("Use sendRPC: instead"));
+
- (void)sendRawData:(NSData *)data withServiceType:(SDLServiceType)serviceType;
- (void)sendEncryptedRawData:(NSData *)data onService:(SDLServiceType)serviceType;
diff --git a/SmartDeviceLink/SDLAbstractProtocol.m b/SmartDeviceLink/SDLAbstractProtocol.m
index 37d18bfef..69301de44 100644
--- a/SmartDeviceLink/SDLAbstractProtocol.m
+++ b/SmartDeviceLink/SDLAbstractProtocol.m
@@ -24,7 +24,15 @@
[self doesNotRecognizeSelector:_cmd];
}
-- (void)startSecureServiceWithType:(SDLServiceType)serviceType completionHandler:(void (^)(BOOL success, NSError *error))completionHandler {
+- (void)startServiceWithType:(SDLServiceType)serviceType payload:(NSData *)payload {
+ [self doesNotRecognizeSelector:_cmd];
+}
+
+- (void)startSecureServiceWithType:(SDLServiceType)serviceType completionHandler:(void (^)(BOOL, NSError *))completionHandler {
+ [self doesNotRecognizeSelector:_cmd];
+}
+
+- (void)startSecureServiceWithType:(SDLServiceType)serviceType payload:(NSData *)payload completionHandler:(void (^)(BOOL, NSError *))completionHandler {
[self doesNotRecognizeSelector:_cmd];
}
diff --git a/SmartDeviceLink/SDLControlFramePayloadAudioStartServiceAck.h b/SmartDeviceLink/SDLControlFramePayloadAudioStartServiceAck.h
new file mode 100644
index 000000000..9a9dc95f4
--- /dev/null
+++ b/SmartDeviceLink/SDLControlFramePayloadAudioStartServiceAck.h
@@ -0,0 +1,24 @@
+//
+// SDLControlFramePayloadAudioStartServiceAck.h
+// SmartDeviceLink-iOS
+//
+// Created by Joel Fischer on 7/24/17.
+// Copyright © 2017 smartdevicelink. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+#import "SDLControlFramePayloadType.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface SDLControlFramePayloadAudioStartServiceAck : NSObject <SDLControlFramePayloadType>
+
+/// Max transport unit to be used for this service. If not included the client should use the one set via the RPC service or protocol version default.
+@property (assign, nonatomic, readonly) int64_t mtu;
+
+- (instancetype)initWithMTU:(int64_t)mtu;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLControlFramePayloadAudioStartServiceAck.m b/SmartDeviceLink/SDLControlFramePayloadAudioStartServiceAck.m
new file mode 100644
index 000000000..ac969d07b
--- /dev/null
+++ b/SmartDeviceLink/SDLControlFramePayloadAudioStartServiceAck.m
@@ -0,0 +1,81 @@
+//
+// SDLControlFramePayloadAudioStartServiceAck.m
+// SmartDeviceLink-iOS
+//
+// Created by Joel Fischer on 7/24/17.
+// Copyright © 2017 smartdevicelink. All rights reserved.
+//
+
+#import "SDLControlFramePayloadAudioStartServiceAck.h"
+
+#import "bson_object.h"
+#import "SDLControlFramePayloadConstants.h"
+
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface SDLControlFramePayloadAudioStartServiceAck ()
+
+@property (assign, nonatomic, readwrite) int64_t mtu;
+
+@end
+
+@implementation SDLControlFramePayloadAudioStartServiceAck
+
+- (instancetype)initWithMTU:(int64_t)mtu {
+ self = [super init];
+ if (!self) return nil;
+
+ _mtu = mtu;
+
+ return self;
+}
+
+- (instancetype)initWithData:(nullable NSData *)data {
+ self = [super init];
+ if (!self) return nil;
+
+ _mtu = SDLControlFrameInt64NotFound;
+
+ if (data != nil) {
+ [self sdl_parse:data];
+ }
+
+ return self;
+}
+
+- (nullable NSData *)data {
+ if (self.mtu == SDLControlFrameInt64NotFound) {
+ return nil;
+ }
+
+ BsonObject payloadObject;
+ bson_object_initialize_default(&payloadObject);
+
+ if (self.mtu != SDLControlFrameInt64NotFound) {
+ bson_object_put_int64(&payloadObject, SDLControlFrameMTUKey, self.mtu);
+ }
+
+ BytePtr bsonData = bson_object_to_bytes(&payloadObject);
+ NSUInteger length = bson_object_size(&payloadObject);
+
+ bson_object_deinitialize(&payloadObject);
+
+ return [[NSData alloc] initWithBytes:bsonData length:length];
+}
+
+- (void)sdl_parse:(NSData *)data {
+ BsonObject payloadObject = bson_object_from_bytes((BytePtr)data.bytes);
+
+ self.mtu = bson_object_get_int64(&payloadObject, SDLControlFrameMTUKey);
+
+ bson_object_deinitialize(&payloadObject);
+}
+
+- (NSString *)description {
+ return [NSString stringWithFormat:@"<%@>: MTU: %lld", NSStringFromClass(self.class), self.mtu];
+}
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLControlFramePayloadConstants.h b/SmartDeviceLink/SDLControlFramePayloadConstants.h
new file mode 100644
index 000000000..f95b90ef8
--- /dev/null
+++ b/SmartDeviceLink/SDLControlFramePayloadConstants.h
@@ -0,0 +1,21 @@
+//
+// SDLControlFramePayloadConstants.h
+// SmartDeviceLink-iOS
+//
+// Created by Joel Fischer on 7/20/17.
+// Copyright © 2017 smartdevicelink. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+extern int32_t const SDLControlFrameInt32NotFound;
+extern int64_t const SDLControlFrameInt64NotFound;
+
+extern char *const SDLControlFrameProtocolVersionKey;
+extern char *const SDLControlFrameHashIdKey;
+extern char *const SDLControlFrameMTUKey;
+extern char *const SDLControlFrameRejectedParams;
+extern char *const SDLControlFrameVideoProtocolKey;
+extern char *const SDLControlFrameVideoCodecKey;
+extern char *const SDLControlFrameHeightKey;
+extern char *const SDLControlFrameWidthKey;
diff --git a/SmartDeviceLink/SDLControlFramePayloadConstants.m b/SmartDeviceLink/SDLControlFramePayloadConstants.m
new file mode 100644
index 000000000..8d9965f37
--- /dev/null
+++ b/SmartDeviceLink/SDLControlFramePayloadConstants.m
@@ -0,0 +1,21 @@
+//
+// SDLControlFramePayloadConstants.m
+// SmartDeviceLink-iOS
+//
+// Created by Joel Fischer on 7/20/17.
+// Copyright © 2017 smartdevicelink. All rights reserved.
+//
+
+#import "SDLControlFramePayloadConstants.h"
+
+int32_t const SDLControlFrameInt32NotFound = -1;
+int64_t const SDLControlFrameInt64NotFound = -1;
+
+char *const SDLControlFrameProtocolVersionKey = "protocolVersion";
+char *const SDLControlFrameHashIdKey = "hashId";
+char *const SDLControlFrameMTUKey = "mtu";
+char *const SDLControlFrameRejectedParams = "rejectedParams";
+char *const SDLControlFrameVideoProtocolKey = "videoProtocol";
+char *const SDLControlFrameVideoCodecKey = "videoCodec";
+char *const SDLControlFrameHeightKey = "height";
+char *const SDLControlFrameWidthKey = "width";
diff --git a/SmartDeviceLink/SDLControlFramePayloadEndService.h b/SmartDeviceLink/SDLControlFramePayloadEndService.h
new file mode 100644
index 000000000..17790ab9e
--- /dev/null
+++ b/SmartDeviceLink/SDLControlFramePayloadEndService.h
@@ -0,0 +1,24 @@
+//
+// SDLControlFramePayloadEndService.h
+// SmartDeviceLink-iOS
+//
+// Created by Joel Fischer on 7/24/17.
+// Copyright © 2017 smartdevicelink. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+#import "SDLControlFramePayloadType.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface SDLControlFramePayloadEndService : NSObject <SDLControlFramePayloadType>
+
+/// Hash ID supplied in the StartServiceACK for this service type
+@property (assign, nonatomic, readonly) int32_t hashId;
+
+- (instancetype)initWithHashId:(int32_t)hashId;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLControlFramePayloadEndService.m b/SmartDeviceLink/SDLControlFramePayloadEndService.m
new file mode 100644
index 000000000..8399da517
--- /dev/null
+++ b/SmartDeviceLink/SDLControlFramePayloadEndService.m
@@ -0,0 +1,81 @@
+//
+// SDLControlFramePayloadEndService.m
+// SmartDeviceLink-iOS
+//
+// Created by Joel Fischer on 7/24/17.
+// Copyright © 2017 smartdevicelink. All rights reserved.
+//
+
+#import "SDLControlFramePayloadEndService.h"
+
+#import "bson_object.h"
+#import "SDLControlFramePayloadConstants.h"
+
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface SDLControlFramePayloadEndService ()
+
+@property (assign, nonatomic, readwrite) int32_t hashId;
+
+@end
+
+@implementation SDLControlFramePayloadEndService
+
+- (instancetype)initWithHashId:(int32_t)hashId {
+ self = [super init];
+ if (!self) return nil;
+
+ _hashId = hashId;
+
+ return self;
+}
+
+- (instancetype)initWithData:(nullable NSData *)data {
+ self = [super init];
+ if (!self) return nil;
+
+ _hashId = SDLControlFrameInt32NotFound;
+
+ if (data != nil) {
+ [self sdl_parse:data];
+ }
+
+ return self;
+}
+
+- (nullable NSData *)data {
+ if (self.hashId == SDLControlFrameInt32NotFound) {
+ return nil;
+ }
+
+ BsonObject payloadObject;
+ bson_object_initialize_default(&payloadObject);
+
+ if (self.hashId != SDLControlFrameInt32NotFound) {
+ bson_object_put_int32(&payloadObject, SDLControlFrameHashIdKey, self.hashId);
+ }
+
+ BytePtr bsonData = bson_object_to_bytes(&payloadObject);
+ NSUInteger length = bson_object_size(&payloadObject);
+
+ bson_object_deinitialize(&payloadObject);
+
+ return [[NSData alloc] initWithBytes:bsonData length:length];
+}
+
+- (void)sdl_parse:(NSData *)data {
+ BsonObject payloadObject = bson_object_from_bytes((BytePtr)data.bytes);
+
+ self.hashId = bson_object_get_int32(&payloadObject, SDLControlFrameHashIdKey);
+
+ bson_object_deinitialize(&payloadObject);
+}
+
+- (NSString *)description {
+ return [NSString stringWithFormat:@"<%@>: hash id: %d", NSStringFromClass(self.class), self.hashId];
+}
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLControlFramePayloadNak.h b/SmartDeviceLink/SDLControlFramePayloadNak.h
new file mode 100644
index 000000000..41781cb2e
--- /dev/null
+++ b/SmartDeviceLink/SDLControlFramePayloadNak.h
@@ -0,0 +1,25 @@
+//
+// SDLControlFramePayloadNak.h
+// SmartDeviceLink-iOS
+//
+// Created by Joel Fischer on 7/20/17.
+// Copyright © 2017 smartdevicelink. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+#import "SDLControlFramePayloadType.h"
+
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface SDLControlFramePayloadNak : NSObject <SDLControlFramePayloadType>
+
+/// An array of rejected parameters such as: [`hashId`]
+@property (copy, nonatomic, readonly, nullable) NSArray<NSString *> *rejectedParams;
+
+- (instancetype)initWithRejectedParams:(nullable NSArray<NSString *> *)rejectedParams;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLControlFramePayloadNak.m b/SmartDeviceLink/SDLControlFramePayloadNak.m
new file mode 100644
index 000000000..4402dea47
--- /dev/null
+++ b/SmartDeviceLink/SDLControlFramePayloadNak.m
@@ -0,0 +1,100 @@
+//
+// SDLControlFramePayloadNak.m
+// SmartDeviceLink-iOS
+//
+// Created by Joel Fischer on 7/20/17.
+// Copyright © 2017 smartdevicelink. All rights reserved.
+//
+
+#import "SDLControlFramePayloadNak.h"
+
+#import "bson_object.h"
+#import "SDLControlFramePayloadConstants.h"
+
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface SDLControlFramePayloadNak ()
+
+@property (copy, nonatomic, readwrite, nullable) NSArray<NSString *> *rejectedParams;
+
+@end
+
+@implementation SDLControlFramePayloadNak
+
+- (instancetype)initWithRejectedParams:(nullable NSArray<NSString *> *)rejectedParams {
+ self = [super init];
+ if (!self) return nil;
+
+ _rejectedParams = rejectedParams;
+
+ return self;
+}
+
+- (instancetype)initWithData:(nullable NSData *)data {
+ self = [super init];
+ if (!self) return nil;
+
+ if (data != nil) {
+ [self sdl_parse:data];
+ }
+
+ return self;
+}
+
+- (nullable NSData *)data {
+ if (self.rejectedParams == nil) {
+ return nil;
+ }
+
+ BsonObject payloadObject;
+ bson_object_initialize_default(&payloadObject);
+
+ if (self.rejectedParams != nil) {
+ BsonArray arrayObject;
+ bson_array_initialize(&arrayObject, 512);
+
+ for (NSString *param in self.rejectedParams) {
+ bson_array_add_string(&arrayObject, (char *)param.UTF8String);
+ }
+
+ bson_object_put_array(&payloadObject, SDLControlFrameRejectedParams, &arrayObject);
+ }
+
+ BytePtr bsonData = bson_object_to_bytes(&payloadObject);
+ NSUInteger length = bson_object_size(&payloadObject);
+
+ bson_object_deinitialize(&payloadObject);
+
+ return [[NSData alloc] initWithBytes:bsonData length:length];
+}
+
+- (void)sdl_parse:(NSData *)data {
+ BsonObject payloadObject = bson_object_from_bytes((BytePtr)data.bytes);
+ BsonArray *arrayObject = bson_object_get_array(&payloadObject, SDLControlFrameRejectedParams);
+ if (arrayObject == NULL) {
+ return;
+ }
+
+ NSMutableArray<NSString *> *rejectedParams = [NSMutableArray array];
+ char *paramString;
+ size_t index = 0;
+
+ paramString = bson_array_get_string(arrayObject, index);
+ while (paramString != NULL) {
+ [rejectedParams addObject:[NSString stringWithUTF8String:paramString]];
+ index++;
+ paramString = bson_array_get_string(arrayObject, index);
+ }
+
+ self.rejectedParams = [rejectedParams copy];
+ bson_object_deinitialize(&payloadObject);
+}
+
+- (NSString *)description {
+ return [NSString stringWithFormat:@"<%@>: Rejected params: %@", NSStringFromClass(self.class), self.rejectedParams];
+}
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLControlFramePayloadRPCStartService.h b/SmartDeviceLink/SDLControlFramePayloadRPCStartService.h
new file mode 100644
index 000000000..af3d97a12
--- /dev/null
+++ b/SmartDeviceLink/SDLControlFramePayloadRPCStartService.h
@@ -0,0 +1,24 @@
+//
+// SDLControlFrameStartService.h
+// SmartDeviceLink-iOS
+//
+// Created by Joel Fischer on 7/18/17.
+// Copyright © 2017 smartdevicelink. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+#import "SDLControlFramePayloadType.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface SDLControlFramePayloadRPCStartService : NSObject <SDLControlFramePayloadType>
+
+/// The max version of protocol version supported by client requesting service to start. Must be in the format "Major.Minor.Patch"
+@property (copy, nonatomic, readonly, nullable) NSString *protocolVersion;
+
+- (instancetype)initWithVersion:(NSString *)stringVersion;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLControlFramePayloadRPCStartService.m b/SmartDeviceLink/SDLControlFramePayloadRPCStartService.m
new file mode 100644
index 000000000..222370d24
--- /dev/null
+++ b/SmartDeviceLink/SDLControlFramePayloadRPCStartService.m
@@ -0,0 +1,83 @@
+//
+// SDLControlFrameStartService.m
+// SmartDeviceLink-iOS
+//
+// Created by Joel Fischer on 7/18/17.
+// Copyright © 2017 smartdevicelink. All rights reserved.
+//
+
+#import "SDLControlFramePayloadRPCStartService.h"
+
+#import "bson_object.h"
+#import "SDLControlFramePayloadConstants.h"
+
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface SDLControlFramePayloadRPCStartService ()
+
+@property (copy, nonatomic, readwrite, nullable) NSString *protocolVersion;
+
+@end
+
+
+@implementation SDLControlFramePayloadRPCStartService
+
+- (instancetype)initWithVersion:(NSString *)stringVersion {
+ self = [super init];
+ if (!self) return nil;
+
+ _protocolVersion = stringVersion;
+
+ return self;
+}
+
+- (instancetype)initWithData:(nullable NSData *)data {
+ self = [super init];
+ if (!self) return nil;
+
+ if (data != nil) {
+ [self sdl_parse:data];
+ }
+
+ return self;
+}
+
+- (nullable NSData *)data {
+ if (self.protocolVersion == nil) {
+ return nil;
+ }
+
+ BsonObject payloadObject;
+ bson_object_initialize_default(&payloadObject);
+
+ if (self.protocolVersion != nil) {
+ bson_object_put_string(&payloadObject, SDLControlFrameProtocolVersionKey, (char *)self.protocolVersion.UTF8String);
+ }
+
+ BytePtr bsonData = bson_object_to_bytes(&payloadObject);
+ NSUInteger length = bson_object_size(&payloadObject);
+
+ bson_object_deinitialize(&payloadObject);
+
+ return [[NSData alloc] initWithBytes:bsonData length:length];
+}
+
+- (void)sdl_parse:(NSData *)data {
+ BsonObject payloadObject = bson_object_from_bytes((BytePtr)data.bytes);
+
+ char *utf8String = bson_object_get_string(&payloadObject, SDLControlFrameProtocolVersionKey);
+ if (utf8String != NULL) {
+ self.protocolVersion = [NSString stringWithUTF8String:utf8String];
+ }
+
+ bson_object_deinitialize(&payloadObject);
+}
+
+- (NSString *)description {
+ return [NSString stringWithFormat:@"<%@>: Protocol Version: %@", NSStringFromClass(self.class), self.protocolVersion];
+}
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLControlFramePayloadRPCStartServiceAck.h b/SmartDeviceLink/SDLControlFramePayloadRPCStartServiceAck.h
new file mode 100644
index 000000000..078405e1e
--- /dev/null
+++ b/SmartDeviceLink/SDLControlFramePayloadRPCStartServiceAck.h
@@ -0,0 +1,30 @@
+//
+// SDLControlFramePayloadStartServiceAck.h
+// SmartDeviceLink-iOS
+//
+// Created by Joel Fischer on 7/20/17.
+// Copyright © 2017 smartdevicelink. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+#import "SDLControlFramePayloadType.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface SDLControlFramePayloadRPCStartServiceAck : NSObject <SDLControlFramePayloadType>
+
+/// Hash ID to identify this service and used when sending an EndService control frame
+@property (assign, nonatomic, readonly) int32_t hashId;
+
+/// Max transport unit to be used for this service
+@property (assign, nonatomic, readonly) int64_t mtu;
+
+/// The negotiated version of the protocol. Must be in the format "Major.Minor.Patch"
+@property (copy, nonatomic, readonly, nullable) NSString *protocolVersion;
+
+- (instancetype)initWithHashId:(int32_t)hashId mtu:(int64_t)mtu protocolVersion:(nullable NSString *)protocolVersion;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLControlFramePayloadRPCStartServiceAck.m b/SmartDeviceLink/SDLControlFramePayloadRPCStartServiceAck.m
new file mode 100644
index 000000000..e4b8347fa
--- /dev/null
+++ b/SmartDeviceLink/SDLControlFramePayloadRPCStartServiceAck.m
@@ -0,0 +1,103 @@
+//
+// SDLControlFramePayloadStartServiceAck.m
+// SmartDeviceLink-iOS
+//
+// Created by Joel Fischer on 7/20/17.
+// Copyright © 2017 smartdevicelink. All rights reserved.
+//
+
+#import "SDLControlFramePayloadRPCStartServiceAck.h"
+
+#import "bson_object.h"
+#import "SDLControlFramePayloadConstants.h"
+
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface SDLControlFramePayloadRPCStartServiceAck ()
+
+@property (assign, nonatomic, readwrite) int32_t hashId;
+@property (assign, nonatomic, readwrite) int64_t mtu;
+@property (copy, nonatomic, readwrite, nullable) NSString *protocolVersion;
+
+@end
+
+
+@implementation SDLControlFramePayloadRPCStartServiceAck
+
+- (instancetype)initWithHashId:(int32_t)hashId mtu:(int64_t)mtu protocolVersion:(nullable NSString *)protocolVersion {
+ self = [super init];
+ if (!self) return nil;
+
+ _hashId = hashId;
+ _mtu = mtu;
+ _protocolVersion = protocolVersion;
+
+ return self;
+}
+
+- (instancetype)initWithData:(nullable NSData *)data {
+ self = [super init];
+ if (!self) return nil;
+
+ _hashId = SDLControlFrameInt32NotFound;
+ _mtu = SDLControlFrameInt64NotFound;
+
+ if (data != nil) {
+ [self sdl_parse:data];
+ }
+
+ return self;
+}
+
+- (nullable NSData *)data {
+ if (self.hashId == SDLControlFrameInt32NotFound
+ && self.mtu == SDLControlFrameInt64NotFound
+ && self.protocolVersion == nil) {
+ return nil;
+ }
+
+ BsonObject payloadObject;
+ bson_object_initialize_default(&payloadObject);
+
+ if (self.hashId != SDLControlFrameInt32NotFound) {
+ bson_object_put_int32(&payloadObject, SDLControlFrameHashIdKey, self.hashId);
+ }
+
+ if (self.mtu != SDLControlFrameInt64NotFound) {
+ bson_object_put_int64(&payloadObject, SDLControlFrameMTUKey, self.mtu);
+ }
+
+ if (self.protocolVersion != nil) {
+ bson_object_put_string(&payloadObject, SDLControlFrameProtocolVersionKey, (char *)self.protocolVersion.UTF8String);
+ }
+
+ BytePtr bsonData = bson_object_to_bytes(&payloadObject);
+ NSUInteger length = bson_object_size(&payloadObject);
+
+ bson_object_deinitialize(&payloadObject);
+
+ return [[NSData alloc] initWithBytes:bsonData length:length];
+}
+
+- (void)sdl_parse:(NSData *)data {
+ BsonObject payloadObject = bson_object_from_bytes((BytePtr)data.bytes);
+
+ self.hashId = bson_object_get_int32(&payloadObject, SDLControlFrameHashIdKey);
+ self.mtu = bson_object_get_int64(&payloadObject, SDLControlFrameMTUKey);
+
+ char *utf8String = bson_object_get_string(&payloadObject, SDLControlFrameProtocolVersionKey);
+ if (utf8String != NULL) {
+ self.protocolVersion = [NSString stringWithUTF8String:utf8String];
+ }
+
+ bson_object_deinitialize(&payloadObject);
+}
+
+- (NSString *)description {
+ return [NSString stringWithFormat:@"<%@>: Protocol Version: %@, hash id: %d, MTU: %lld", NSStringFromClass(self.class), self.protocolVersion, self.hashId, self.mtu];
+}
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLControlFramePayloadType.h b/SmartDeviceLink/SDLControlFramePayloadType.h
new file mode 100644
index 000000000..2c9673ccc
--- /dev/null
+++ b/SmartDeviceLink/SDLControlFramePayloadType.h
@@ -0,0 +1,20 @@
+//
+// SDLControlFramePayload.h
+// SmartDeviceLink-iOS
+//
+// Created by Joel Fischer on 7/20/17.
+// Copyright © 2017 smartdevicelink. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@protocol SDLControlFramePayloadType <NSObject>
+
+- (nullable NSData *)data;
+- (instancetype)initWithData:(nullable NSData *)data;;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLControlFramePayloadVideoStartService.h b/SmartDeviceLink/SDLControlFramePayloadVideoStartService.h
new file mode 100644
index 000000000..30ea57e8f
--- /dev/null
+++ b/SmartDeviceLink/SDLControlFramePayloadVideoStartService.h
@@ -0,0 +1,36 @@
+//
+// SDLControlFramePayloadVideoStartService.h
+// SmartDeviceLink-iOS
+//
+// Created by Joel Fischer on 7/24/17.
+// Copyright © 2017 smartdevicelink. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+#import "SDLControlFramePayloadType.h"
+
+@class SDLVideoStreamingCodec;
+@class SDLVideoStreamingProtocol;
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface SDLControlFramePayloadVideoStartService : NSObject <SDLControlFramePayloadType>
+
+/// Desired height in pixels from the client requesting the video service to start
+@property (assign, nonatomic, readonly) int32_t height;
+
+/// Desired width in pixels from the client requesting the video service to start
+@property (assign, nonatomic, readonly) int32_t width;
+
+/// Desired video protocol to be used. See VideoStreamingProtocol RPC
+@property (copy, nonatomic, readonly, nullable) SDLVideoStreamingCodec *videoCodec;
+
+/// Desired video codec to be used. See VideoStreamingCodec RPC
+@property (copy, nonatomic, readonly, nullable) SDLVideoStreamingProtocol *videoProtocol;
+
+- (instancetype)initWithVideoHeight:(int32_t)height width:(int32_t)width protocol:(nullable SDLVideoStreamingProtocol *)protocol codec:(nullable SDLVideoStreamingCodec *)codec;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLControlFramePayloadVideoStartService.m b/SmartDeviceLink/SDLControlFramePayloadVideoStartService.m
new file mode 100644
index 000000000..caa6a24a2
--- /dev/null
+++ b/SmartDeviceLink/SDLControlFramePayloadVideoStartService.m
@@ -0,0 +1,116 @@
+//
+// SDLControlFramePayloadVideoStartService.m
+// SmartDeviceLink-iOS
+//
+// Created by Joel Fischer on 7/24/17.
+// Copyright © 2017 smartdevicelink. All rights reserved.
+//
+
+#import "SDLControlFramePayloadVideoStartService.h"
+
+#import "bson_object.h"
+#import "SDLControlFramePayloadConstants.h"
+#import "SDLVideoStreamingCodec.h"
+#import "SDLVideoStreamingProtocol.h"
+
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface SDLControlFramePayloadVideoStartService ()
+
+@property (assign, nonatomic, readwrite) int32_t height;
+@property (assign, nonatomic, readwrite) int32_t width;
+@property (copy, nonatomic, readwrite, nullable) SDLVideoStreamingCodec *videoCodec;
+@property (copy, nonatomic, readwrite, nullable) SDLVideoStreamingProtocol *videoProtocol;
+
+@end
+
+@implementation SDLControlFramePayloadVideoStartService
+
+- (instancetype)initWithVideoHeight:(int32_t)height width:(int32_t)width protocol:(nullable SDLVideoStreamingProtocol *)protocol codec:(nullable SDLVideoStreamingCodec *)codec {
+ self = [super init];
+ if (!self) return nil;
+
+ _height = height;
+ _width = width;
+ _videoProtocol = protocol;
+ _videoCodec = codec;
+
+ return self;
+}
+
+- (instancetype)initWithData:(nullable NSData *)data {
+ self = [super init];
+ if (!self) return nil;
+
+ _height = SDLControlFrameInt32NotFound;
+ _width = SDLControlFrameInt32NotFound;
+
+ if (data != nil) {
+ [self sdl_parse:data];
+ }
+
+ return self;
+}
+
+- (nullable NSData *)data {
+ if (self.height == SDLControlFrameInt32NotFound
+ && self.width == SDLControlFrameInt32NotFound
+ && self.videoProtocol == nil
+ && self.videoCodec == nil) {
+ return nil;
+ }
+
+ BsonObject payloadObject;
+ bson_object_initialize_default(&payloadObject);
+
+ if (self.height != SDLControlFrameInt32NotFound) {
+ bson_object_put_int32(&payloadObject, SDLControlFrameHeightKey, self.height);
+ }
+
+ if (self.width != SDLControlFrameInt32NotFound) {
+ bson_object_put_int32(&payloadObject, SDLControlFrameWidthKey, self.width);
+ }
+
+ if (self.videoProtocol != nil) {
+ bson_object_put_string(&payloadObject, SDLControlFrameVideoProtocolKey, (char *)self.videoProtocol.value.UTF8String);
+ }
+
+ if (self.videoCodec != nil) {
+ bson_object_put_string(&payloadObject, SDLControlFrameVideoCodecKey, (char *)self.videoCodec.value.UTF8String);
+ }
+
+ BytePtr bsonData = bson_object_to_bytes(&payloadObject);
+ NSUInteger length = bson_object_size(&payloadObject);
+
+ bson_object_deinitialize(&payloadObject);
+
+ return [[NSData alloc] initWithBytes:bsonData length:length];
+}
+
+- (void)sdl_parse:(NSData *)data {
+ BsonObject payloadObject = bson_object_from_bytes((BytePtr)data.bytes);
+
+ self.height = bson_object_get_int32(&payloadObject, SDLControlFrameHeightKey);
+ self.width = bson_object_get_int32(&payloadObject, SDLControlFrameWidthKey);
+
+ char *utf8String = bson_object_get_string(&payloadObject, SDLControlFrameVideoProtocolKey);
+ if (utf8String != NULL) {
+ self.videoProtocol = [SDLVideoStreamingProtocol valueOf:[NSString stringWithUTF8String:utf8String]];
+ }
+
+ utf8String = bson_object_get_string(&payloadObject, SDLControlFrameVideoCodecKey);
+ if (utf8String != NULL) {
+ self.videoCodec = [SDLVideoStreamingCodec valueOf:[NSString stringWithUTF8String:utf8String]];
+ }
+
+ bson_object_deinitialize(&payloadObject);
+}
+
+- (NSString *)description {
+ return [NSString stringWithFormat:@"<%@>: Width: %d, Height: %d, Protocol: %@, Codec: %@", NSStringFromClass(self.class), self.width, self.height, self.videoProtocol, self.videoCodec];
+}
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLControlFramePayloadVideoStartServiceAck.h b/SmartDeviceLink/SDLControlFramePayloadVideoStartServiceAck.h
new file mode 100644
index 000000000..ed6c17474
--- /dev/null
+++ b/SmartDeviceLink/SDLControlFramePayloadVideoStartServiceAck.h
@@ -0,0 +1,39 @@
+//
+// SDLControlFramePayloadVideoStartServiceAck.h
+// SmartDeviceLink-iOS
+//
+// Created by Joel Fischer on 7/26/17.
+// Copyright © 2017 smartdevicelink. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+#import "SDLControlFramePayloadType.h"
+
+@class SDLVideoStreamingCodec;
+@class SDLVideoStreamingProtocol;
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface SDLControlFramePayloadVideoStartServiceAck : NSObject <SDLControlFramePayloadType>
+
+/// Max transport unit to be used for this service
+@property (assign, nonatomic, readonly) int64_t mtu;
+
+/// Accepted height in pixels from the client requesting the video service to start
+@property (assign, nonatomic, readonly) int32_t height;
+
+/// Accepted width in pixels from the client requesting the video service to start
+@property (assign, nonatomic, readonly) int32_t width;
+
+/// Accepted video protocol to be used. See VideoStreamingProtocol RPC
+@property (copy, nonatomic, readonly, nullable) SDLVideoStreamingProtocol *videoProtocol;
+
+/// Accepted video codec to be used. See VideoStreamingCodec RPC
+@property (copy, nonatomic, readonly, nullable) SDLVideoStreamingCodec *videoCodec;
+
+- (instancetype)initWithMTU:(int64_t)mtu height:(int32_t)height width:(int32_t)width protocol:(SDLVideoStreamingProtocol *)protocol codec:(SDLVideoStreamingCodec *)codec;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLControlFramePayloadVideoStartServiceAck.m b/SmartDeviceLink/SDLControlFramePayloadVideoStartServiceAck.m
new file mode 100644
index 000000000..e30fe1af7
--- /dev/null
+++ b/SmartDeviceLink/SDLControlFramePayloadVideoStartServiceAck.m
@@ -0,0 +1,121 @@
+//
+// SDLControlFramePayloadVideoStartServiceAck.m
+// SmartDeviceLink-iOS
+//
+// Created by Joel Fischer on 7/26/17.
+// Copyright © 2017 smartdevicelink. All rights reserved.
+//
+
+#import "SDLControlFramePayloadVideoStartServiceAck.h"
+
+#import "bson_object.h"
+#import "SDLControlFramePayloadConstants.h"
+#import "SDLVideoStreamingCodec.h"
+#import "SDLVideoStreamingProtocol.h"
+
+
+@interface SDLControlFramePayloadVideoStartServiceAck ()
+
+@property (assign, nonatomic, readwrite) int64_t mtu;
+@property (assign, nonatomic, readwrite) int32_t height;
+@property (assign, nonatomic, readwrite) int32_t width;
+@property (copy, nonatomic, readwrite) SDLVideoStreamingProtocol *videoProtocol;
+@property (copy, nonatomic, readwrite) SDLVideoStreamingCodec *videoCodec;
+
+@end
+
+@implementation SDLControlFramePayloadVideoStartServiceAck
+
+- (instancetype)initWithMTU:(int64_t)mtu height:(int32_t)height width:(int32_t)width protocol:(SDLVideoStreamingProtocol *)protocol codec:(SDLVideoStreamingCodec *)codec {
+ self = [super init];
+ if (!self) return nil;
+
+ _mtu = mtu;
+ _height = height;
+ _width = width;
+ _videoProtocol = protocol;
+ _videoCodec = codec;
+
+ return self;
+}
+
+- (instancetype)initWithData:(nullable NSData *)data {
+ self = [super init];
+ if (!self) return nil;
+
+ _mtu = SDLControlFrameInt64NotFound;
+ _height = SDLControlFrameInt32NotFound;
+ _width = SDLControlFrameInt32NotFound;
+
+ if (data != nil) {
+ [self sdl_parse:data];
+ }
+
+ return self;
+}
+
+- (nullable NSData *)data {
+ if (self.mtu == SDLControlFrameInt64NotFound
+ && self.height == SDLControlFrameInt32NotFound
+ && self.width == SDLControlFrameInt32NotFound
+ && self.videoProtocol == nil
+ && self.videoCodec == nil) {
+ return nil;
+ }
+
+ BsonObject payloadObject;
+ bson_object_initialize_default(&payloadObject);
+
+ if (self.mtu != SDLControlFrameInt64NotFound) {
+ bson_object_put_int64(&payloadObject, SDLControlFrameMTUKey, self.mtu);
+ }
+
+ if (self.height != SDLControlFrameInt32NotFound) {
+ bson_object_put_int32(&payloadObject, SDLControlFrameHeightKey, self.height);
+ }
+
+ if (self.width != SDLControlFrameInt32NotFound) {
+ bson_object_put_int32(&payloadObject, SDLControlFrameWidthKey, self.width);
+ }
+
+ if (self.videoProtocol != nil) {
+ bson_object_put_string(&payloadObject, SDLControlFrameVideoProtocolKey, (char *)self.videoProtocol.value.UTF8String);
+ }
+
+ if (self.videoCodec != nil) {
+ bson_object_put_string(&payloadObject, SDLControlFrameVideoCodecKey, (char *)self.videoCodec.value.UTF8String);
+ }
+
+ BytePtr bsonData = bson_object_to_bytes(&payloadObject);
+ NSUInteger length = bson_object_size(&payloadObject);
+
+ bson_object_deinitialize(&payloadObject);
+
+ return [[NSData alloc] initWithBytes:bsonData length:length];
+}
+
+- (void)sdl_parse:(NSData *)data {
+ BsonObject payloadObject = bson_object_from_bytes((BytePtr)data.bytes);
+
+ self.mtu = bson_object_get_int64(&payloadObject, SDLControlFrameMTUKey);
+ self.height = bson_object_get_int32(&payloadObject, SDLControlFrameHeightKey);
+ self.width = bson_object_get_int32(&payloadObject, SDLControlFrameWidthKey);
+
+ char *utf8String = bson_object_get_string(&payloadObject, SDLControlFrameVideoProtocolKey);
+ if (utf8String != NULL) {
+ self.videoProtocol = [SDLVideoStreamingProtocol valueOf:[NSString stringWithUTF8String:utf8String]];
+ }
+
+ utf8String = bson_object_get_string(&payloadObject, SDLControlFrameVideoCodecKey);
+ if (utf8String != NULL) {
+ self.videoCodec = [SDLVideoStreamingCodec valueOf:[NSString stringWithUTF8String:utf8String]];
+ }
+
+ bson_object_deinitialize(&payloadObject);
+}
+
+- (NSString *)description {
+ return [NSString stringWithFormat:@"<%@>: MTU: %lld, Width: %d, Height: %d, Protocol: %@, Codec: %@", NSStringFromClass(self.class), self.mtu, self.width, self.height, self.videoProtocol, self.videoCodec];
+}
+
+@end
diff --git a/SmartDeviceLink/SDLDebugTool.m b/SmartDeviceLink/SDLDebugTool.m
index 1186dc340..d3327ef77 100644
--- a/SmartDeviceLink/SDLDebugTool.m
+++ b/SmartDeviceLink/SDLDebugTool.m
@@ -131,7 +131,7 @@
[outputString appendString:info];
}
- if (data) {
+ if (data != nil) {
@autoreleasepool {
NSString *dataString = [SDLHexUtility getHexString:data];
if (dataString) {
diff --git a/SmartDeviceLink/SDLGlobals.h b/SmartDeviceLink/SDLGlobals.h
index 1c503e619..f52f82574 100644
--- a/SmartDeviceLink/SDLGlobals.h
+++ b/SmartDeviceLink/SDLGlobals.h
@@ -8,16 +8,27 @@
#import <Foundation/Foundation.h>
+#import "SDLProtocolHeader.h"
+
#define SDL_SYSTEM_VERSION_LESS_THAN(version) ([[[UIDevice currentDevice] systemVersion] compare:version options:NSNumericSearch] == NSOrderedAscending)
#define SDL_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(version) ([[[UIDevice currentDevice] systemVersion] compare:version options:NSNumericSearch] != NSOrderedAscending)
#define BLOCK_RETURN return
+extern NSString *const SDLMaxProxyProtocolVersion;
+
+extern NSUInteger const SDLDefaultMTUSize;
+extern NSUInteger const SDLV1MTUSize;
+extern NSUInteger const SDLV3MTUSize;
+
@interface SDLGlobals : NSObject
-@property (assign, nonatomic, readonly) NSUInteger protocolVersion;
-@property (assign, nonatomic, readonly) NSUInteger maxMTUSize;
-@property (assign, nonatomic) NSUInteger maxHeadUnitVersion;
+@property (strong, nonatomic, readonly) NSString *protocolVersion;
+@property (assign, nonatomic, readonly) NSInteger majorProtocolVersion;
+@property (strong, nonatomic) NSString *maxHeadUnitVersion;
+ (instancetype)globals;
+- (void)setDynamicMTUSize:(NSUInteger)maxMTUSize forServiceType:(SDLServiceType)serviceType;
+- (NSUInteger)mtuSizeForServiceType:(SDLServiceType)serviceType;
+
@end
diff --git a/SmartDeviceLink/SDLGlobals.m b/SmartDeviceLink/SDLGlobals.m
index 7f122c01e..da2636a61 100644
--- a/SmartDeviceLink/SDLGlobals.m
+++ b/SmartDeviceLink/SDLGlobals.m
@@ -8,12 +8,22 @@
#import "SDLGlobals.h"
-static const NSUInteger maxProxyVersion = 4;
+// VERSION DEPENDENT CODE
+NSString *const SDLMaxProxyProtocolVersion = @"5.0.0";
+
+NSUInteger const SDLDefaultMTUSize = UINT32_MAX;
+NSUInteger const SDLV1MTUSize = 1024;
+NSUInteger const SDLV3MTUSize = 131024;
+
+
+typedef NSNumber* ServiceTypeBox;
+typedef NSNumber* MTUBox;
@interface SDLGlobals ()
-@property (assign, nonatomic) NSUInteger protocolVersion;
+@property (strong, nonatomic) NSMutableDictionary<ServiceTypeBox, MTUBox> *dynamicMTUDict;
+@property (strong, nonatomic, readwrite) NSString *protocolVersion;
@end
@@ -36,8 +46,9 @@ static const NSUInteger maxProxyVersion = 4;
return nil;
}
- _protocolVersion = 1;
- _maxHeadUnitVersion = 0;
+ _protocolVersion = @"1.0.0";
+ _maxHeadUnitVersion = @"0.0.0";
+ _dynamicMTUDict = [NSMutableDictionary dictionary];
return self;
}
@@ -45,30 +56,57 @@ static const NSUInteger maxProxyVersion = 4;
#pragma mark - Custom Getters / Setters
-- (void)setMaxHeadUnitVersion:(NSUInteger)maxHeadUnitVersion {
- self.protocolVersion = MIN(maxHeadUnitVersion, maxProxyVersion);
+- (void)setMaxHeadUnitVersion:(NSString *)maxHeadUnitVersion {
+ self.protocolVersion = [self sdl_isVersion:maxHeadUnitVersion greaterThanVersion:SDLMaxProxyProtocolVersion] ? SDLMaxProxyProtocolVersion : maxHeadUnitVersion;
_maxHeadUnitVersion = maxHeadUnitVersion;
}
-- (NSUInteger)maxMTUSize {
- switch (self.protocolVersion) {
+- (NSInteger)majorProtocolVersion {
+ return [self.protocolVersion substringWithRange:NSMakeRange(0, 1)].integerValue;
+}
+
+- (void)setDynamicMTUSize:(NSUInteger)maxMTUSize forServiceType:(SDLServiceType)serviceType {
+ self.dynamicMTUDict[@(serviceType)] = @(maxMTUSize);
+}
+
+- (NSUInteger)mtuSizeForServiceType:(SDLServiceType)serviceType {
+ if (self.dynamicMTUDict[@(serviceType)] != nil) {
+ return self.dynamicMTUDict[@(serviceType)].unsignedIntegerValue;
+ } else if (self.dynamicMTUDict[@(SDLServiceType_RPC)]) {
+ return self.dynamicMTUDict[@(SDLServiceType_RPC)].unsignedIntegerValue;
+ } else {
+ return [self sdl_defaultMaxMTUSize];
+ }
+}
+
+
+#pragma mark - Helpers
+
+- (BOOL)sdl_isVersion:(NSString *)version1 greaterThanVersion:(NSString *)version2 {
+ return ([version1 compare:version2 options:NSNumericSearch] == NSOrderedDescending);
+}
+
+- (NSUInteger)sdl_defaultMaxMTUSize {
+ // VERSION DEPENDENT CODE
+ switch (self.majorProtocolVersion) {
case 1: // fallthrough
case 2: {
// HAX: This was set to 1024 at some point, for an unknown reason. We can't change it because of backward compatibility & validation concerns. The actual MTU for v1/2 is 1500 bytes.
- return 1024;
+ return SDLV1MTUSize;
} break;
case 3: // fallthrough
- case 4: {
+ case 4: // fallthrough
+ case 5: {
// If the head unit isn't running v3/4, but that's the connection scheme we're using, then we have to know that they could be running an MTU that's not 128k, so we default back to the v1/2 MTU for safety.
- if (self.maxHeadUnitVersion > maxProxyVersion) {
- return 1024;
+ if ([self sdl_isVersion:self.maxHeadUnitVersion greaterThanVersion:SDLMaxProxyProtocolVersion]) {
+ return SDLV1MTUSize;
} else {
- return 131084;
+ return SDLV3MTUSize;
}
} break;
default: {
- NSAssert(NO, @"Unknown version number: %@", @(self.protocolVersion));
+ NSAssert(NO, @"Unknown version number for MTU Size: %@", @(self.majorProtocolVersion));
return 0;
}
}
diff --git a/SmartDeviceLink/SDLIAPTransport.m b/SmartDeviceLink/SDLIAPTransport.m
index eff233f9b..964f586ab 100644
--- a/SmartDeviceLink/SDLIAPTransport.m
+++ b/SmartDeviceLink/SDLIAPTransport.m
@@ -454,11 +454,11 @@ int const streamOpenTimeoutSeconds = 2;
return ^(NSInputStream *istream) {
__strong typeof(weakSelf) strongSelf = weakSelf;
- uint8_t buf[[SDLGlobals globals].maxMTUSize];
+ uint8_t buf[[[SDLGlobals globals] mtuSizeForServiceType:SDLServiceType_RPC]];
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];
+ NSInteger bytesRead = [istream read:buf maxLength:[[SDLGlobals globals] mtuSizeForServiceType:SDLServiceType_RPC]];
NSData *dataIn = [NSData dataWithBytes:buf length:bytesRead];
if (bytesRead > 0) {
diff --git a/SmartDeviceLink/SDLProtocol.h b/SmartDeviceLink/SDLProtocol.h
index 78b1c798e..0d7023ce9 100644
--- a/SmartDeviceLink/SDLProtocol.h
+++ b/SmartDeviceLink/SDLProtocol.h
@@ -15,8 +15,12 @@ extern NSString *const SDLProtocolSecurityErrorDomain;
// Sending
- (void)sendStartSessionWithType:(SDLServiceType)serviceType __deprecated_msg(("Use startServiceWithType: instead"));
-- (void)startServiceWithType:(SDLServiceType)serviceType;
-- (void)startSecureServiceWithType:(SDLServiceType)serviceType completionHandler:(void (^)(BOOL success, NSError *error))completionHandler;
+- (void)startServiceWithType:(SDLServiceType)serviceType __deprecated_msg(("Use startServiceWithType:payload: instead"));
+- (void)startServiceWithType:(SDLServiceType)serviceType payload:(NSData *)payload;
+
+- (void)startSecureServiceWithType:(SDLServiceType)serviceType completionHandler:(void (^)(BOOL success, NSError *error))completionHandler __deprecated_msg(("Use startSecureServiceWithType:payload:completionHandler instead"));
+- (void)startSecureServiceWithType:(SDLServiceType)serviceType payload:(NSData *)payload completionHandler:(void (^)(BOOL success, NSError *error))completionHandler;
+
- (void)sendEndSessionWithType:(SDLServiceType)serviceType __deprecated_msg(("Use endServiceWithType: instead"));
- (void)endServiceWithType:(SDLServiceType)serviceType;
- (void)sendRPC:(SDLRPCMessage *)message;
diff --git a/SmartDeviceLink/SDLProtocol.m b/SmartDeviceLink/SDLProtocol.m
index 6261e02ee..0596f24db 100644
--- a/SmartDeviceLink/SDLProtocol.m
+++ b/SmartDeviceLink/SDLProtocol.m
@@ -6,6 +6,10 @@
#import "SDLJsonEncoder.h"
#import "SDLAbstractTransport.h"
+#import "SDLControlFramePayloadConstants.h"
+#import "SDLControlFramePayloadNak.h"
+#import "SDLControlFramePayloadRPCStartService.h"
+#import "SDLControlFramePayloadRPCStartServiceAck.h"
#import "SDLDebugTool.h"
#import "SDLGlobals.h"
#import "SDLPrioritizedObjectCollection.h"
@@ -76,19 +80,27 @@ typedef NSNumber SDLServiceTypeBox;
}
- (void)sendStartSessionWithType:(SDLServiceType)serviceType {
- [self startServiceWithType:serviceType];
+ [self startServiceWithType:serviceType payload:nil];
}
#pragma mark - Start Service
- (void)startServiceWithType:(SDLServiceType)serviceType {
+ [self startServiceWithType:serviceType payload:nil];
+}
+
+- (void)startServiceWithType:(SDLServiceType)serviceType payload:(NSData *)payload {
// No encryption, just build and send the message synchronously
- SDLProtocolMessage *message = [self sdl_createStartServiceMessageWithType:serviceType encrypted:NO];
+ SDLProtocolMessage *message = [self sdl_createStartServiceMessageWithType:serviceType encrypted:NO payload:payload];
[self sdl_sendDataToTransport:message.data onService:serviceType];
}
- (void)startSecureServiceWithType:(SDLServiceType)serviceType completionHandler:(void (^)(BOOL success, NSError *error))completionHandler {
+ [self startSecureServiceWithType:serviceType payload:nil completionHandler:completionHandler];
+}
+
+- (void)startSecureServiceWithType:(SDLServiceType)serviceType payload:(NSData *)payload completionHandler:(void (^)(BOOL success, NSError *error))completionHandler {
[self sdl_initializeTLSEncryptionWithCompletionHandler:^(BOOL success, NSError *error) {
if (!success) {
// We can't start the service because we don't have encryption, return the error
@@ -97,13 +109,15 @@ typedef NSNumber SDLServiceTypeBox;
}
// TLS initialization succeeded. Build and send the message.
- SDLProtocolMessage *message = [self sdl_createStartServiceMessageWithType:serviceType encrypted:YES];
+ SDLProtocolMessage *message = [self sdl_createStartServiceMessageWithType:serviceType encrypted:YES payload:nil];
[self sdl_sendDataToTransport:message.data onService:serviceType];
}];
}
-- (SDLProtocolMessage *)sdl_createStartServiceMessageWithType:(SDLServiceType)serviceType encrypted:(BOOL)encryption {
- SDLProtocolHeader *header = [SDLProtocolHeader headerForVersion:[SDLGlobals globals].protocolVersion];
+- (SDLProtocolMessage *)sdl_createStartServiceMessageWithType:(SDLServiceType)serviceType encrypted:(BOOL)encryption payload:(NSData *)payload {
+ SDLProtocolHeader *header = [SDLProtocolHeader headerForVersion:[SDLGlobals globals].majorProtocolVersion];
+ NSData *servicePayload = payload;
+
switch (serviceType) {
case SDLServiceType_RPC: {
// Need a different header for starting the RPC service, we get the session Id from the HU, or its the same as the RPC service's
@@ -113,6 +127,9 @@ typedef NSNumber SDLServiceTypeBox;
} else {
header.sessionID = 0;
}
+
+ SDLControlFramePayloadRPCStartService *startServicePayload = [[SDLControlFramePayloadRPCStartService alloc] initWithVersion:SDLMaxProxyProtocolVersion];
+ servicePayload = startServicePayload.data;
} break;
default: {
header.sessionID = [self sdl_retrieveSessionIDforServiceType:SDLServiceType_RPC];
@@ -121,11 +138,12 @@ typedef NSNumber SDLServiceTypeBox;
header.frameType = SDLFrameType_Control;
header.serviceType = serviceType;
header.frameData = SDLFrameData_StartSession;
+ header.bytesInPayload = (UInt32)payload.length;
// Sending a StartSession with the encrypted bit set causes module to initiate SSL Handshake with a ClientHello message, which should be handled by the 'processControlService' method.
header.encrypted = encryption;
- return [SDLProtocolMessage messageWithHeader:header andPayload:nil];
+ return [SDLProtocolMessage messageWithHeader:header andPayload:servicePayload];
}
- (void)sdl_initializeTLSEncryptionWithCompletionHandler:(void (^)(BOOL success, NSError *error))completionHandler {
@@ -164,7 +182,7 @@ typedef NSNumber SDLServiceTypeBox;
}
- (void)endServiceWithType:(SDLServiceType)serviceType {
- SDLProtocolHeader *header = [SDLProtocolHeader headerForVersion:[SDLGlobals globals].protocolVersion];
+ SDLProtocolHeader *header = [SDLProtocolHeader headerForVersion:[SDLGlobals globals].majorProtocolVersion];
header.frameType = SDLFrameType_Control;
header.serviceType = serviceType;
header.frameData = SDLFrameData_EndSession;
@@ -184,7 +202,7 @@ typedef NSNumber SDLServiceTypeBox;
- (BOOL)sendRPC:(SDLRPCMessage *)message encrypted:(BOOL)encryption error:(NSError *__autoreleasing *)error {
NSParameterAssert(message != nil);
- NSData *jsonData = [[SDLJsonEncoder instance] encodeDictionary:[message serializeAsDictionary:[SDLGlobals globals].protocolVersion]];
+ NSData *jsonData = [[SDLJsonEncoder instance] encodeDictionary:[message serializeAsDictionary:[SDLGlobals globals].majorProtocolVersion]];
NSData *messagePayload = nil;
NSString *logMessage = [NSString stringWithFormat:@"%@", message];
@@ -192,14 +210,15 @@ typedef NSNumber SDLServiceTypeBox;
// Build the message payload. Include the binary header if necessary
// VERSION DEPENDENT CODE
- switch ([SDLGlobals globals].protocolVersion) {
+ switch ([SDLGlobals globals].majorProtocolVersion) {
case 1: {
// No binary header in version 1
messagePayload = jsonData;
} break;
case 2: // Fallthrough
case 3: // Fallthrough
- case 4: {
+ case 4: // Fallthrough
+ case 5: {
// Build a binary header
// Serialize the RPC data into an NSData
SDLRPCPayload *rpcPayload = [[SDLRPCPayload alloc] init];
@@ -229,12 +248,12 @@ typedef NSNumber SDLServiceTypeBox;
}
} break;
default: {
- NSAssert(NO, @"Attempting to send an RPC based on an unknown version number: %@, message: %@", @([SDLGlobals globals].protocolVersion), message);
+ NSAssert(NO, @"Attempting to send an RPC based on an unknown version number: %@, message: %@", @([SDLGlobals globals].majorProtocolVersion), message);
} break;
}
// Build the protocol level header & message
- SDLProtocolHeader *header = [SDLProtocolHeader headerForVersion:[SDLGlobals globals].protocolVersion];
+ SDLProtocolHeader *header = [SDLProtocolHeader headerForVersion:[SDLGlobals globals].majorProtocolVersion];
header.encrypted = encryption;
header.frameType = SDLFrameType_Single;
header.serviceType = (message.bulkData.length <= 0) ? SDLServiceType_RPC : SDLServiceType_BulkData;
@@ -243,7 +262,7 @@ typedef NSNumber SDLServiceTypeBox;
header.bytesInPayload = (UInt32)messagePayload.length;
// V2+ messages need to have message ID property set.
- if ([SDLGlobals globals].protocolVersion >= 2) {
+ if ([SDLGlobals globals].majorProtocolVersion >= 2) {
[((SDLV2ProtocolHeader *)header) setMessageID:++_messageID];
}
@@ -251,11 +270,11 @@ typedef NSNumber SDLServiceTypeBox;
SDLProtocolMessage *protocolMessage = [SDLProtocolMessage messageWithHeader:header andPayload:messagePayload];
// See if the message is small enough to send in one transmission. If not, break it up into smaller messages and send.
- if (protocolMessage.size < [SDLGlobals globals].maxMTUSize) {
+ if (protocolMessage.size < [[SDLGlobals globals] mtuSizeForServiceType:SDLServiceType_RPC]) {
[self sdl_logRPCSend:protocolMessage];
[self sdl_sendDataToTransport:protocolMessage.data onService:SDLServiceType_RPC];
} else {
- NSArray *messages = [SDLProtocolMessageDisassembler disassemble:protocolMessage withLimit:[SDLGlobals globals].maxMTUSize];
+ NSArray *messages = [SDLProtocolMessageDisassembler disassemble:protocolMessage withLimit:[[SDLGlobals globals] mtuSizeForServiceType:SDLServiceType_RPC]];
for (SDLProtocolMessage *smallerMessage in messages) {
[self sdl_logRPCSend:smallerMessage];
[self sdl_sendDataToTransport:smallerMessage.data onService:SDLServiceType_RPC];
@@ -297,7 +316,7 @@ typedef NSNumber SDLServiceTypeBox;
}
- (void)sdl_sendRawData:(NSData *)data onService:(SDLServiceType)service encryption:(BOOL)encryption {
- SDLV2ProtocolHeader *header = [[SDLV2ProtocolHeader alloc] initWithVersion:[SDLGlobals globals].protocolVersion];
+ SDLV2ProtocolHeader *header = [[SDLV2ProtocolHeader alloc] initWithVersion:[SDLGlobals globals].majorProtocolVersion];
header.encrypted = encryption;
header.frameType = SDLFrameType_Single;
header.serviceType = service;
@@ -318,11 +337,11 @@ typedef NSNumber SDLServiceTypeBox;
SDLProtocolMessage *message = [SDLProtocolMessage messageWithHeader:header andPayload:data];
- if (message.size < [SDLGlobals globals].maxMTUSize) {
+ if (message.size < [[SDLGlobals globals] mtuSizeForServiceType:service]) {
[self sdl_logRPCSend:message];
[self sdl_sendDataToTransport:message.data onService:header.serviceType];
} else {
- NSArray *messages = [SDLProtocolMessageDisassembler disassemble:message withLimit:[SDLGlobals globals].maxMTUSize];
+ NSArray *messages = [SDLProtocolMessageDisassembler disassemble:message withLimit:[[SDLGlobals globals] mtuSizeForServiceType:service]];
for (SDLProtocolMessage *smallerMessage in messages) {
[self sdl_logRPCSend:smallerMessage];
[self sdl_sendDataToTransport:smallerMessage.data onService:header.serviceType];
@@ -337,7 +356,7 @@ typedef NSNumber SDLServiceTypeBox;
- (void)handleBytesFromTransport:(NSData *)receivedData {
// Initialize the receive buffer which will contain bytes while messages are constructed.
if (self.receiveBuffer == nil) {
- self.receiveBuffer = [NSMutableData dataWithCapacity:(4 * [SDLGlobals globals].maxMTUSize)];
+ self.receiveBuffer = [NSMutableData dataWithCapacity:(4 * [[SDLGlobals globals] mtuSizeForServiceType:SDLServiceType_RPC])];
}
// Save the data
@@ -348,7 +367,7 @@ typedef NSNumber SDLServiceTypeBox;
- (void)processMessages {
NSMutableString *logMessage = [[NSMutableString alloc] init];
- UInt8 incomingVersion = [SDLProtocolMessage determineVersion:self.receiveBuffer];
+ UInt8 incomingVersion = [SDLProtocolHeader determineVersion:self.receiveBuffer];
// If we have enough bytes, create the header.
SDLProtocolHeader *header = [SDLProtocolHeader headerForVersion:incomingVersion];
@@ -404,65 +423,114 @@ typedef NSNumber SDLServiceTypeBox;
}
}
-- (void)handleProtocolStartSessionACK:(SDLProtocolHeader *)header {
- switch (header.serviceType) {
- case SDLServiceType_RPC: {
- [SDLGlobals globals].maxHeadUnitVersion = header.version;
- } break;
- default:
- break;
+// TODO: This is a v4 packet (create new delegate methods)
+- (void)handleProtocolStartServiceACKMessage:(SDLProtocolMessage *)startServiceACK {
+ // V5 Packet
+ if (startServiceACK.header.version >= 5) {
+ switch (startServiceACK.header.serviceType) {
+ case SDLServiceType_RPC: {
+ SDLControlFramePayloadRPCStartServiceAck *startServiceACKPayload = [[SDLControlFramePayloadRPCStartServiceAck alloc] initWithData:startServiceACK.payload];
+// NSLog(@"ServiceAckPayload: %@", startServiceACKPayload);
+
+ if (startServiceACKPayload.mtu != SDLControlFrameInt64NotFound) {
+ [[SDLGlobals globals] setDynamicMTUSize:startServiceACKPayload.mtu forServiceType:startServiceACK.header.serviceType];
+ }
+ [SDLGlobals globals].maxHeadUnitVersion = (startServiceACKPayload.protocolVersion != nil) ? startServiceACKPayload.protocolVersion : [NSString stringWithFormat:@"%u.0.0", startServiceACK.header.version];
+ // TODO: Hash id?
+ } break;
+ default:
+ break;
+ }
+ } else {
+ // V4 and below packet
+ switch (startServiceACK.header.serviceType) {
+ case SDLServiceType_RPC: {
+ [SDLGlobals globals].maxHeadUnitVersion = [NSString stringWithFormat:@"%u.0.0", startServiceACK.header.version];
+ } break;
+ default:
+ break;
+ }
}
// Store the header of this service away for future use
- self.serviceHeaders[@(header.serviceType)] = [header copy];
+ self.serviceHeaders[@(startServiceACK.header.serviceType)] = [startServiceACK.header copy];
// Pass along to all the listeners
for (id<SDLProtocolListener> listener in self.protocolDelegateTable.allObjects) {
- if ([listener respondsToSelector:@selector(handleProtocolStartSessionACK:)]) {
- [listener handleProtocolStartSessionACK:header];
+ if ([listener respondsToSelector:@selector(handleProtocolStartServiceACKMessage:)]) {
+ [listener handleProtocolStartServiceACKMessage:startServiceACK];
}
- if ([listener respondsToSelector:@selector(handleProtocolStartSessionACK:sessionID:version:)]) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- [listener handleProtocolStartSessionACK:header.serviceType
- sessionID:header.sessionID
- version:header.version];
+ if ([listener respondsToSelector:@selector(handleProtocolStartSessionACK:)]) {
+ [listener handleProtocolStartSessionACK:startServiceACK.header];
+ }
+
+ if ([listener respondsToSelector:@selector(handleProtocolStartSessionACK:sessionID:version:)]) {
+ [listener handleProtocolStartSessionACK:startServiceACK.header.serviceType
+ sessionID:startServiceACK.header.sessionID
+ version:startServiceACK.header.version];
#pragma clang diagnostic pop
}
}
}
-- (void)handleProtocolStartSessionNACK:(SDLServiceType)serviceType {
+- (void)handleProtocolStartServiceNAKMessage:(SDLProtocolMessage *)startServiceNAK {
+ [self sdl_logControlNAKPayload:startServiceNAK];
+
for (id<SDLProtocolListener> listener in self.protocolDelegateTable.allObjects) {
+ if ([listener respondsToSelector:@selector(handleProtocolStartServiceNAKMessage:)]) {
+ [listener handleProtocolStartServiceNAKMessage:startServiceNAK];
+ }
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
if ([listener respondsToSelector:@selector(handleProtocolStartSessionNACK:)]) {
- [listener handleProtocolStartSessionNACK:serviceType];
+ [listener handleProtocolStartSessionNACK:startServiceNAK.header.serviceType];
}
+#pragma clang diagnostic pop
}
}
-- (void)handleProtocolEndSessionACK:(SDLServiceType)serviceType {
+- (void)handleProtocolEndServiceACKMessage:(SDLProtocolMessage *)endServiceACK {
// Remove the session id
- [self.serviceHeaders removeObjectForKey:@(serviceType)];
+ [self.serviceHeaders removeObjectForKey:@(endServiceACK.header.serviceType)];
for (id<SDLProtocolListener> listener in self.protocolDelegateTable.allObjects) {
+ if ([listener respondsToSelector:@selector(handleProtocolEndServiceACKMessage:)]) {
+ [listener handleProtocolEndServiceACKMessage:endServiceACK];
+ }
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
if ([listener respondsToSelector:@selector(handleProtocolEndSessionACK:)]) {
- [listener handleProtocolEndSessionACK:serviceType];
+ [listener handleProtocolEndSessionACK:endServiceACK.header.serviceType];
}
}
+#pragma clang diagnostic pop
}
-- (void)handleProtocolEndSessionNACK:(SDLServiceType)serviceType {
+- (void)handleProtocolEndServiceNAKMessage:(SDLProtocolMessage *)endServiceNAK {
+ [self sdl_logControlNAKPayload:endServiceNAK];
+
for (id<SDLProtocolListener> listener in self.protocolDelegateTable.allObjects) {
+ if ([listener respondsToSelector:@selector(handleProtocolEndServiceNAKMessage:)]) {
+ [listener handleProtocolEndServiceNAKMessage:endServiceNAK];
+ }
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
if ([listener respondsToSelector:@selector(handleProtocolEndSessionNACK:)]) {
- [listener handleProtocolEndSessionNACK:serviceType];
+ [listener handleProtocolEndSessionNACK:endServiceNAK.header.serviceType];
}
}
+#pragma clang diagnostic pop
}
- (void)handleHeartbeatForSession:(Byte)session {
// Respond with a heartbeat ACK
- SDLProtocolHeader *header = [SDLProtocolHeader headerForVersion:[SDLGlobals globals].protocolVersion];
+ SDLProtocolHeader *header = [SDLProtocolHeader headerForVersion:[SDLGlobals globals].majorProtocolVersion];
header.frameType = SDLFrameType_Control;
header.serviceType = SDLServiceType_Control;
header.frameData = SDLFrameData_HeartbeatACK;
@@ -523,6 +591,17 @@ typedef NSNumber SDLServiceTypeBox;
}
}
+- (void)sdl_logControlNAKPayload:(SDLProtocolMessage *)nakMessage {
+ if (nakMessage.header.version >= 5) {
+ SDLControlFramePayloadNak *endServiceNakPayload = [[SDLControlFramePayloadNak alloc] initWithData:nakMessage.payload];
+ NSArray<NSString *> *rejectedParams = endServiceNakPayload.rejectedParams;
+ if (rejectedParams.count > 0) {
+ NSString *log = [NSString stringWithFormat:@"Start Service NAK'd, service type: %@, rejectedParams: %@", @(nakMessage.header.serviceType), rejectedParams];
+ [SDLDebugTool logInfo:log];
+ }
+ }
+}
+
#pragma mark - TLS Handshake
// TODO: These should be split out to a separate class to be tested properly
diff --git a/SmartDeviceLink/SDLProtocolHeader.h b/SmartDeviceLink/SDLProtocolHeader.h
index dc8cbb788..908a675c7 100644
--- a/SmartDeviceLink/SDLProtocolHeader.h
+++ b/SmartDeviceLink/SDLProtocolHeader.h
@@ -58,5 +58,6 @@ typedef NS_ENUM(UInt8, SDLFrameData) {
- (void)parse:(NSData *)data;
- (NSString *)description;
+ (__kindof SDLProtocolHeader *)headerForVersion:(UInt8)version;
++ (UInt8)determineVersion:(NSData *)data;
@end
diff --git a/SmartDeviceLink/SDLProtocolHeader.m b/SmartDeviceLink/SDLProtocolHeader.m
index 65e025c61..7a2c23161 100644
--- a/SmartDeviceLink/SDLProtocolHeader.m
+++ b/SmartDeviceLink/SDLProtocolHeader.m
@@ -55,14 +55,24 @@
} break;
case 2: // Fallthrough
case 3: // Fallthrough
- case 4: {
+ case 4: // Fallthrough
+ case 5: {
return [[SDLV2ProtocolHeader alloc] initWithVersion:version];
} break;
default: {
- NSString *reason = [NSString stringWithFormat:@"The version of header that is being created is unknown: %@", @(version)];
- @throw [NSException exceptionWithName:NSInvalidArgumentException reason:reason userInfo:@{ @"requestedVersion": @(version) }];
+ // Assume V2 header for unknown header versions and hope it doesn't break
+ return [[SDLV2ProtocolHeader alloc] initWithVersion:version];
} break;
}
}
+// For use in decoding a stream of bytes.
+// Pass in bytes representing message (or beginning of message)
+// Looks at and parses first byte to determine version.
++ (UInt8)determineVersion:(NSData *)data {
+ UInt8 firstByte = ((UInt8 *)data.bytes)[0];
+ UInt8 version = firstByte >> 4;
+ return version;
+}
+
@end
diff --git a/SmartDeviceLink/SDLProtocolListener.h b/SmartDeviceLink/SDLProtocolListener.h
index 3371dfde3..94a85177f 100644
--- a/SmartDeviceLink/SDLProtocolListener.h
+++ b/SmartDeviceLink/SDLProtocolListener.h
@@ -9,11 +9,18 @@
@protocol SDLProtocolListener <NSObject>
@optional
-- (void)handleProtocolStartSessionACK:(SDLServiceType)serviceType sessionID:(Byte)sessionID version:(Byte)version __deprecated_msg("use handleProtocolStartSessionACK: instead");
-- (void)handleProtocolStartSessionACK:(SDLProtocolHeader *)header;
-- (void)handleProtocolStartSessionNACK:(SDLServiceType)serviceType;
-- (void)handleProtocolEndSessionACK:(SDLServiceType)serviceType;
-- (void)handleProtocolEndSessionNACK:(SDLServiceType)serviceType;
+// v4.7.0 protocol handlers
+- (void)handleProtocolStartServiceACKMessage:(SDLProtocolMessage *)startServiceACK;
+- (void)handleProtocolStartServiceNAKMessage:(SDLProtocolMessage *)startServiceNAK;
+- (void)handleProtocolEndServiceACKMessage:(SDLProtocolMessage *)endServiceACK;
+- (void)handleProtocolEndServiceNAKMessage:(SDLProtocolMessage *)endServiceNAK;
+
+// Older protocol handlers
+- (void)handleProtocolStartSessionACK:(SDLServiceType)serviceType sessionID:(Byte)sessionID version:(Byte)version __deprecated_msg("use handleProtocolStartSessionACKMessage: instead");
+- (void)handleProtocolStartSessionACK:(SDLProtocolHeader *)header __deprecated_msg("use handleProtocolStartSessionACKMessage: instead");
+- (void)handleProtocolStartSessionNACK:(SDLServiceType)serviceType __deprecated_msg("use handleProtocolStartSessionNAKMessage: instead");
+- (void)handleProtocolEndSessionACK:(SDLServiceType)serviceType __deprecated_msg("use handleProtocolEndSessionACKMessage: instead");
+- (void)handleProtocolEndSessionNACK:(SDLServiceType)serviceType __deprecated_msg("use handleProtocolEndSessionNAKMessage: instead");
- (void)handleHeartbeatForSession:(Byte)session;
- (void)handleHeartbeatACK;
- (void)onProtocolMessageReceived:(SDLProtocolMessage *)msg;
diff --git a/SmartDeviceLink/SDLProtocolMessage.h b/SmartDeviceLink/SDLProtocolMessage.h
index 62abd6226..b7daeb055 100644
--- a/SmartDeviceLink/SDLProtocolMessage.h
+++ b/SmartDeviceLink/SDLProtocolMessage.h
@@ -11,13 +11,12 @@
@property (strong) NSData *payload;
@property (strong, readonly) NSData *data;
-+ (id)messageWithHeader:(SDLProtocolHeader *)header andPayload:(NSData *)payload; // Returns a V1 or V2 object
++ (instancetype)messageWithHeader:(SDLProtocolHeader *)header andPayload:(NSData *)payload; // Returns a V1 or V2 object
- (NSUInteger)size;
- (NSString *)description;
- (NSDictionary *)rpcDictionary; // Use for RPC type messages to obtain the data in a dictionary
-+ (UInt8)determineVersion:(NSData *)data;
-
++ (UInt8)determineVersion:(NSData *)data __deprecated_msg(("Use SDLProtocolHeader determineVersion: instead"));
@end
diff --git a/SmartDeviceLink/SDLProtocolMessage.m b/SmartDeviceLink/SDLProtocolMessage.m
index bfc33c4d7..8b6d079f6 100644
--- a/SmartDeviceLink/SDLProtocolMessage.m
+++ b/SmartDeviceLink/SDLProtocolMessage.m
@@ -17,19 +17,20 @@
@implementation SDLProtocolMessage
-// For use in decoding a stream of bytes.
-// Pass in bytes representing message (or beginning of message)
-// Looks at and parses first byte to determine version.
-+ (UInt8)determineVersion:(NSData *)data {
- UInt8 firstByte = ((UInt8 *)data.bytes)[0];
- UInt8 version = firstByte >> 4;
- return version;
-}
+// Returns a V1 or V2 object
++ (instancetype)messageWithHeader:(SDLProtocolHeader *)header andPayload:(NSData *)payload {
+ SDLProtocolMessage *newMessage = nil;
-- (instancetype)init {
- if (self = [super init]) {
+ UInt8 version = header.version;
+ if (version == 1) {
+ newMessage = [[SDLV1ProtocolMessage alloc] initWithHeader:(SDLProtocolHeader *)header andPayload:(NSData *)payload];
+ } else if (version >= 2) {
+ newMessage = [[SDLV2ProtocolMessage alloc] initWithHeader:(SDLProtocolHeader *)header andPayload:(NSData *)payload];
+ } else {
+ @throw [NSException exceptionWithName:NSInternalInconsistencyException reason:@"Attempted to create an SDLMessage, but the version of the header passed was 0" userInfo:nil];
}
- return self;
+
+ return newMessage;
}
- (NSDictionary *)rpcDictionary {
@@ -49,6 +50,10 @@
return dataOut;
}
++ (UInt8)determineVersion:(NSData *)data {
+ return [SDLProtocolHeader determineVersion:data];
+}
+
- (NSString *)description {
// Print the header data.
NSMutableString *description = [[NSMutableString alloc] init];
@@ -82,20 +87,4 @@
return description;
}
-// Returns a V1 or V2 object
-+ (id)messageWithHeader:(SDLProtocolHeader *)header andPayload:(NSData *)payload {
- SDLProtocolMessage *newMessage = nil;
-
- UInt8 version = header.version;
- if (version == 1) {
- newMessage = [[SDLV1ProtocolMessage alloc] initWithHeader:(SDLProtocolHeader *)header andPayload:(NSData *)payload];
- } else if (version >= 2) {
- newMessage = [[SDLV2ProtocolMessage alloc] initWithHeader:(SDLProtocolHeader *)header andPayload:(NSData *)payload];
- } else {
- @throw [NSException exceptionWithName:NSInternalInconsistencyException reason:@"Attempted to create an SDLMessage, but the version of the header passed was 0" userInfo:nil];
- }
-
- return newMessage;
-}
-
@end
diff --git a/SmartDeviceLink/SDLProtocolReceivedMessageRouter.m b/SmartDeviceLink/SDLProtocolReceivedMessageRouter.m
index 11c4ce0ea..1c00a9ce9 100644
--- a/SmartDeviceLink/SDLProtocolReceivedMessageRouter.m
+++ b/SmartDeviceLink/SDLProtocolReceivedMessageRouter.m
@@ -54,32 +54,23 @@
- (void)sdl_dispatchControlMessage:(SDLProtocolMessage *)message {
switch (message.header.frameData) {
case SDLFrameData_StartSessionACK: {
- if ([self.delegate respondsToSelector:@selector(handleProtocolStartSessionACK:sessionID:version:)]) {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- [self.delegate handleProtocolStartSessionACK:message.header.serviceType
- sessionID:message.header.sessionID
- version:message.header.version];
-#pragma clang diagnostic pop
- }
-
- if ([self.delegate respondsToSelector:@selector(handleProtocolStartSessionACK:)]) {
- [self.delegate handleProtocolStartSessionACK:message.header];
+ if ([self.delegate respondsToSelector:@selector(handleProtocolStartServiceACKMessage:)]) {
+ [self.delegate handleProtocolStartServiceACKMessage:message];
}
} break;
case SDLFrameData_StartSessionNACK: {
- if ([self.delegate respondsToSelector:@selector(handleProtocolStartSessionNACK:)]) {
- [self.delegate handleProtocolStartSessionNACK:message.header.serviceType];
+ if ([self.delegate respondsToSelector:@selector(handleProtocolStartServiceNAKMessage:)]) {
+ [self.delegate handleProtocolStartServiceNAKMessage:message];
}
} break;
case SDLFrameData_EndSessionACK: {
- if ([self.delegate respondsToSelector:@selector(handleProtocolEndSessionACK:)]) {
- [self.delegate handleProtocolEndSessionACK:message.header.serviceType];
+ if ([self.delegate respondsToSelector:@selector(handleProtocolEndServiceACKMessage:)]) {
+ [self.delegate handleProtocolEndServiceACKMessage:message];
}
} break;
case SDLFrameData_EndSessionNACK: {
- if ([self.delegate respondsToSelector:@selector(handleProtocolStartSessionNACK:)]) {
- [self.delegate handleProtocolEndSessionNACK:message.header.serviceType];
+ if ([self.delegate respondsToSelector:@selector(handleProtocolStartServiceNAKMessage:)]) {
+ [self.delegate handleProtocolEndServiceNAKMessage:message];
}
} break;
case SDLFrameData_Heartbeat: {
@@ -92,7 +83,7 @@
[self.delegate handleHeartbeatACK];
}
} break;
- default: break;
+ default: break; // Other frame data is possible, but we don't care about them
}
}
diff --git a/SmartDeviceLink/SDLProxy.m b/SmartDeviceLink/SDLProxy.m
index 637af1acd..6e5140a81 100644
--- a/SmartDeviceLink/SDLProxy.m
+++ b/SmartDeviceLink/SDLProxy.m
@@ -382,7 +382,7 @@ const int POLICIES_CORRELATION_ID = 65535;
self.protocol.securityManager.appId = self.appId;
}
- if ([SDLGlobals globals].protocolVersion >= 4) {
+ if ([SDLGlobals globals].majorProtocolVersion >= 4) {
[self sendMobileHMIState];
// Send SDL updates to application state
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sendMobileHMIState) name:UIApplicationDidBecomeActiveNotification object:nil];
@@ -779,7 +779,7 @@ const int POLICIES_CORRELATION_ID = 65535;
// Grab some bytes from the stream and send them in a SDLPutFile RPC Request
NSUInteger currentStreamOffset = [[stream propertyForKey:NSStreamFileCurrentOffsetKey] unsignedIntegerValue];
- NSMutableData *buffer = [NSMutableData dataWithLength:[SDLGlobals globals].maxMTUSize];
+ NSMutableData *buffer = [NSMutableData dataWithLength:[[SDLGlobals globals] mtuSizeForServiceType:SDLServiceType_RPC]];
NSUInteger nBytesRead = [(NSInputStream *)stream read:(uint8_t *)buffer.mutableBytes maxLength:buffer.length];
if (nBytesRead > 0) {
NSData *data = [buffer subdataWithRange:NSMakeRange(0, nBytesRead)];
diff --git a/SmartDeviceLink/SDLStreamingMediaManager.h b/SmartDeviceLink/SDLStreamingMediaManager.h
index 027b39304..f9689f828 100644
--- a/SmartDeviceLink/SDLStreamingMediaManager.h
+++ b/SmartDeviceLink/SDLStreamingMediaManager.h
@@ -14,6 +14,8 @@
@class SDLAbstractProtocol;
@class SDLDisplayCapabilities;
@class SDLTouchManager;
+@class SDLVideoStreamingCodec;
+@class SDLVideoStreamingProtocol;
NS_ASSUME_NONNULL_BEGIN
@@ -99,7 +101,7 @@ typedef void (^SDLStreamingEncryptionStartBlock)(BOOL success, BOOL encryption,
- (instancetype)initWithProtocol:(SDLAbstractProtocol *)protocol displayCapabilities:(SDLDisplayCapabilities *)displayCapabilities;
/**
- * This method will attempt to start a streaming video session. It will set up iOS's video encoder, and call out to the head unit asking if it will start a video session. This will not use encryption.
+ * This method will attempt to start a streaming video session. It will set up iOS's video encoder, and call out to the head unit asking if it will start a video session. This will not use encryption.
*
* @warning If this method is called on an 8.0 device, it will assert (in debug), or return a failure immediately to your block (in release).
*
@@ -108,6 +110,17 @@ typedef void (^SDLStreamingEncryptionStartBlock)(BOOL success, BOOL encryption,
- (void)startVideoSessionWithStartBlock:(SDLStreamingStartBlock)startBlock;
/**
+ This method will attempt to start a streaming video session. It will set up iOS's video encoder, and call out to the head unit asking if it will start a video session. This will not use encryption. To get proper values for height and width. If the remote system does not support GetSystemCapabilities, then call `startVideoSessionWithStartBlock:` instead.
+
+ @warning If this method is called on an 8.0 device, it will assert (in debug), or return a failure immediately to your block (in release).
+
+ @param height The height requested to be used
+ @param width The width requested to be used
+ @param startBlock A block that will be called with the result of attempting to start a video session
+ */
+- (void)startVideoSessionWithHeight:(int32_t)height width:(int32_t)width startBlock:(SDLStreamingStartBlock)startBlock;
+
+/**
* Start a video session either with with no encryption (the default), with authentication but no encryption (this will attempt a TLS authentication with the other side, but will not physically encrypt the data after that), or authentication and encryption, which will encrypt all video data being sent.
*
* @param encryptionFlag Whether and how much security to apply to the video session.
@@ -116,6 +129,18 @@ typedef void (^SDLStreamingEncryptionStartBlock)(BOOL success, BOOL encryption,
- (void)startVideoSessionWithTLS:(SDLEncryptionFlag)encryptionFlag startBlock:(SDLStreamingEncryptionStartBlock)startBlock;
/**
+ Start a video session either with with no encryption (the default), with authentication but no encryption (this will attempt a TLS authentication with the other side, but will not physically encrypt the data after that), or authentication and encryption, which will encrypt all video data being sent. To get proper values for height, width, protocol, and codec, call GetSystemCapabilities. If the remote system does not support GetSystemCapabilities, then call `startVideoSessionWithStartBlock:` instead.
+
+ @param encryptionFlag Whether and how much security to apply to the video session.
+ @param height The height requested to be used
+ @param width The width requested to be used
+ @param protocol The protocol requested to be used
+ @param codec The codec requested to be used
+ @param startBlock A block that will be called with the result of attempting to start a video session
+ */
+- (void)startVideoSessionWithTLS:(SDLEncryptionFlag)encryptionFlag height:(int32_t)height width:(int32_t)width startBlock:(SDLStreamingEncryptionStartBlock)startBlock;
+
+/**
* This method will stop a running video session if there is one running.
*/
- (void)stopVideoSession;
diff --git a/SmartDeviceLink/SDLStreamingMediaManager.m b/SmartDeviceLink/SDLStreamingMediaManager.m
index 11fa8048e..ff9d9d319 100644
--- a/SmartDeviceLink/SDLStreamingMediaManager.m
+++ b/SmartDeviceLink/SDLStreamingMediaManager.m
@@ -11,12 +11,19 @@
#import <UIKit/UIKit.h>
#import "SDLAbstractProtocol.h"
+#import "SDLControlFramePayloadConstants.h"
+#import "SDLControlFramePayloadAudioStartServiceAck.h"
+#import "SDLControlFramePayloadVideoStartService.h"
+#import "SDLControlFramePayloadVideoStartServiceAck.h"
#import "SDLDebugTool.h"
#import "SDLDisplayCapabilities.h"
#import "SDLGlobals.h"
#import "SDLImageResolution.h"
+#import "SDLProtocolMessage.h"
#import "SDLScreenParams.h"
#import "SDLTouchManager.h"
+#import "SDLVideoStreamingCodec.h"
+#import "SDLVideoStreamingProtocol.h"
NSString *const SDLErrorDomainStreamingMediaVideo = @"com.sdl.streamingmediamanager.video";
@@ -101,15 +108,8 @@ NS_ASSUME_NONNULL_BEGIN
_videoEncoderSettings = self.defaultVideoEncoderSettings;
_touchManager = [[SDLTouchManager alloc] init];
- [[NSNotificationCenter defaultCenter] addObserver:self
- selector:@selector(sdl_applicationDidEnterBackground:)
- name:UIApplicationDidEnterBackgroundNotification
- object:nil];
-
- [[NSNotificationCenter defaultCenter] addObserver:self
- selector:@selector(sdl_applicationDidResignActive:)
- name:UIApplicationWillResignActiveNotification
- object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sdl_applicationDidEnterBackground:) name:UIApplicationDidEnterBackgroundNotification object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sdl_applicationDidResignActive:) name:UIApplicationWillResignActiveNotification object:nil];
return self;
}
@@ -121,13 +121,20 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - Streaming media lifecycle
- (void)startVideoSessionWithStartBlock:(SDLStreamingStartBlock)startBlock {
- [self startVideoSessionWithTLS:SDLEncryptionFlagNone
- startBlock:^(BOOL success, BOOL encryption, NSError *_Nullable error) {
- startBlock(success, error);
- }];
+ [self startVideoSessionWithHeight:SDLControlFrameInt32NotFound width:SDLControlFrameInt32NotFound startBlock:startBlock];
+}
+
+- (void)startVideoSessionWithHeight:(int32_t)height width:(int32_t)width startBlock:(SDLStreamingStartBlock)startBlock {
+ [self startVideoSessionWithTLS:SDLEncryptionFlagNone height:height width:width startBlock:^(BOOL success, BOOL encryption, NSError *_Nullable error) {
+ startBlock(success, error);
+ }];
}
- (void)startVideoSessionWithTLS:(SDLEncryptionFlag)encryptionFlag startBlock:(SDLStreamingEncryptionStartBlock)startBlock {
+ [self startVideoSessionWithTLS:encryptionFlag height:SDLControlFrameInt32NotFound width:SDLControlFrameInt32NotFound startBlock:startBlock];
+}
+
+- (void)startVideoSessionWithTLS:(SDLEncryptionFlag)encryptionFlag height:(int32_t)height width:(int32_t)width startBlock:(SDLStreamingEncryptionStartBlock)startBlock {
if (SDL_SYSTEM_VERSION_LESS_THAN(@"8.0")) {
NSAssert(NO, @"SDL Video Sessions can only be run on iOS 8+ devices");
startBlock(NO, NO, [NSError errorWithDomain:SDLErrorDomainStreamingMediaVideo code:SDLStreamingVideoErrorInvalidOperatingSystemVersion userInfo:nil]);
@@ -138,23 +145,24 @@ NS_ASSUME_NONNULL_BEGIN
self.videoStartBlock = [startBlock copy];
self.videoSessionEncrypted = (encryptionFlag == SDLEncryptionFlagAuthenticateAndEncrypt ? YES : NO);
+ // H264 RAW is the only currently supported SMM format, so we will use hardcode that in to make sure that future Core's that may have different defaults still use our default.
+ SDLControlFramePayloadVideoStartService *payload = [[SDLControlFramePayloadVideoStartService alloc] initWithVideoHeight:height width:width protocol:[SDLVideoStreamingProtocol RAW] codec:[SDLVideoStreamingCodec H264]];
if (encryptionFlag != SDLEncryptionFlagNone) {
__weak typeof(self) weakSelf = self;
- [self.protocol startSecureServiceWithType:SDLServiceType_Video
- completionHandler:^(BOOL success, NSError *error) {
- typeof(weakSelf) strongSelf = weakSelf;
- // If success, we will get an ACK or NACK, so those methods will handle calling the video block
- if (!success) {
- if (strongSelf.videoStartBlock == nil) {
- return;
- }
+ [self.protocol startSecureServiceWithType:SDLServiceType_Video payload:payload.data completionHandler:^(BOOL success, NSError *error) {
+ typeof(weakSelf) strongSelf = weakSelf;
+ // If success, we will get an ACK or NACK, so those methods will handle calling the video block
+ if (!success) {
+ if (strongSelf.videoStartBlock == nil) {
+ return;
+ }
- strongSelf.videoStartBlock(NO, NO, error);
- strongSelf.videoStartBlock = nil;
- }
- }];
+ strongSelf.videoStartBlock(NO, NO, error);
+ strongSelf.videoStartBlock = nil;
+ }
+ }];
} else {
- [self.protocol startServiceWithType:SDLServiceType_Video];
+ [self.protocol startServiceWithType:SDLServiceType_Video payload:payload.data];
}
}
@@ -179,7 +187,7 @@ NS_ASSUME_NONNULL_BEGIN
if (encryptionFlag != SDLEncryptionFlagNone) {
__weak typeof(self) weakSelf = self;
- [self.protocol startSecureServiceWithType:SDLServiceType_Audio
+ [self.protocol startSecureServiceWithType:SDLServiceType_Audio payload:nil
completionHandler:^(BOOL success, NSError *error) {
typeof(weakSelf) strongSelf = weakSelf;
// If this passes, we will get an ACK or NACK, so those methods will handle calling the audio block
@@ -193,7 +201,7 @@ NS_ASSUME_NONNULL_BEGIN
}
}];
} else {
- [self.protocol startServiceWithType:SDLServiceType_Audio];
+ [self.protocol startServiceWithType:SDLServiceType_Audio payload:nil];
}
}
@@ -280,49 +288,75 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - SDLProtocolListener Methods
-- (void)handleProtocolStartSessionACK:(SDLProtocolHeader *)header {
- switch (header.serviceType) {
- case SDLServiceType_Audio: {
- self.audioSessionConnected = YES;
- self.audioSessionEncrypted = header.encrypted;
-
- if (self.audioStartBlock == nil) {
- return;
- }
+#pragma mark Protocol Ack
- self.audioStartBlock(YES, header.encrypted, nil);
- self.audioStartBlock = nil;
+- (void)handleProtocolStartServiceACKMessage:(SDLProtocolMessage *)startServiceACK {
+ switch (startServiceACK.header.serviceType) {
+ case SDLServiceType_Audio: {
+ [self sdl_handleAudioStartServiceAck:startServiceACK];
} break;
case SDLServiceType_Video: {
- NSError *error = nil;
- BOOL success = [self sdl_configureVideoEncoderWithError:&error];
+ [self sdl_handleVideoStartServiceAck:startServiceACK];
+ } break;
+ default: break;
+ }
+}
- if (!success) {
- [self sdl_teardownCompressionSession];
- [self.protocol endServiceWithType:SDLServiceType_Video];
+- (void)sdl_handleAudioStartServiceAck:(SDLProtocolMessage *)audioStartAck {
+ SDLControlFramePayloadAudioStartServiceAck *audioAckPayload = [[SDLControlFramePayloadAudioStartServiceAck alloc] initWithData:audioStartAck.payload];
- if (self.videoStartBlock == nil) {
- return;
- }
+ if (audioAckPayload.mtu != SDLControlFrameInt64NotFound) {
+ [[SDLGlobals globals] setDynamicMTUSize:audioAckPayload.mtu forServiceType:SDLServiceType_Audio];
+ }
- self.videoStartBlock(NO, header.encrypted, error);
- self.videoStartBlock = nil;
+ self.audioSessionConnected = YES;
+ self.audioSessionEncrypted = audioStartAck.header.encrypted;
- return;
- }
+ if (self.audioStartBlock == nil) {
+ return;
+ }
- self.videoSessionConnected = YES;
- self.videoSessionEncrypted = header.encrypted;
+ self.audioStartBlock(YES, audioStartAck.header.encrypted, nil);
+ self.audioStartBlock = nil;
+}
- if (self.videoStartBlock == nil) {
- return;
- }
+- (void)sdl_handleVideoStartServiceAck:(SDLProtocolMessage *)videoStartAck {
+ SDLControlFramePayloadVideoStartServiceAck *videoAckPayload = [[SDLControlFramePayloadVideoStartServiceAck alloc] initWithData:videoStartAck.payload];
- self.videoStartBlock(YES, header.encrypted, nil);
- self.videoStartBlock = nil;
- } break;
- default: break;
+ if (videoAckPayload.mtu != SDLControlFrameInt64NotFound) {
+ [[SDLGlobals globals] setDynamicMTUSize:videoAckPayload.mtu forServiceType:SDLServiceType_Video];
+ }
+
+ if (videoAckPayload.height != SDLControlFrameInt32NotFound && videoAckPayload.width != SDLControlFrameInt32NotFound) {
+ _screenSize = CGSizeMake(videoAckPayload.height, videoAckPayload.width);
}
+
+ NSError *error = nil;
+ BOOL success = [self sdl_configureVideoEncoderWithError:&error];
+
+ if (!success) {
+ [self sdl_teardownCompressionSession];
+ [self.protocol endServiceWithType:SDLServiceType_Video];
+
+ if (self.videoStartBlock == nil) {
+ return;
+ }
+
+ self.videoStartBlock(NO, videoStartAck.header.encrypted, error);
+ self.videoStartBlock = nil;
+
+ return;
+ }
+
+ self.videoSessionConnected = YES;
+ self.videoSessionEncrypted = videoStartAck.header.encrypted;
+
+ if (self.videoStartBlock == nil) {
+ return;
+ }
+
+ self.videoStartBlock(YES, videoStartAck.header.encrypted, nil);
+ self.videoStartBlock = nil;
}
- (void)handleProtocolStartSessionNACK:(SDLServiceType)serviceType {
@@ -582,6 +616,7 @@ void sdl_videoEncoderOutputCallback(void *CM_NULLABLE outputCallbackRefCon, void
}
#pragma mark - Private Functions
+
- (void)sdl_applicationDidEnterBackground:(NSNotification *)notification {
[self.touchManager cancelPendingTouches];
}
diff --git a/SmartDeviceLink/SDLUploadFileOperation.m b/SmartDeviceLink/SDLUploadFileOperation.m
index f373dc566..a10ecd069 100644
--- a/SmartDeviceLink/SDLUploadFileOperation.m
+++ b/SmartDeviceLink/SDLUploadFileOperation.m
@@ -52,7 +52,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)start {
[super start];
- [self sdl_sendPutFiles:[self.class sdl_splitFile:self.fileWrapper.file mtuSize:[SDLGlobals globals].maxMTUSize] withCompletion:self.fileWrapper.completionHandler];
+ [self sdl_sendPutFiles:[self.class sdl_splitFile:self.fileWrapper.file mtuSize:[[SDLGlobals globals] mtuSizeForServiceType:SDLServiceType_RPC]] withCompletion:self.fileWrapper.completionHandler];
}
- (void)sdl_sendPutFiles:(NSArray<SDLPutFile *> *)putFiles withCompletion:(SDLFileManagerUploadCompletionHandler)completion {
diff --git a/SmartDeviceLink/SDLV2ProtocolHeader.m b/SmartDeviceLink/SDLV2ProtocolHeader.m
index eb97f4102..b0e2050d7 100644
--- a/SmartDeviceLink/SDLV2ProtocolHeader.m
+++ b/SmartDeviceLink/SDLV2ProtocolHeader.m
@@ -107,7 +107,7 @@ const int V2PROTOCOL_HEADERSIZE = 12;
}
NSMutableString *description = [[NSMutableString alloc] init];
- [description appendFormat:@"Version:%i, compressed:%i, frameType:%@(%i), serviceType:%i, frameData:%@(%i), sessionID:%i, dataSize:%i, messageID:%i ",
+ [description appendFormat:@"Version:%i, encrypted:%i, frameType:%@(%i), serviceType:%i, frameData:%@(%i), sessionID:%i, dataSize:%i, messageID:%i ",
self.version,
self.encrypted,
frameTypeString,
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLUploadFileOperationSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLUploadFileOperationSpec.m
index 15371a53b..8d0506ad7 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLUploadFileOperationSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLUploadFileOperationSpec.m
@@ -28,7 +28,7 @@ describe(@"Upload File Operation", ^{
beforeEach(^{
// Set the head unit size small so we have a low MTU size
- [SDLGlobals globals].maxHeadUnitVersion = 2;
+ [SDLGlobals globals].maxHeadUnitVersion = @"2.0.0";
});
context(@"running a small file operation", ^{
@@ -143,25 +143,25 @@ describe(@"Upload File Operation", ^{
it(@"should send correct putfiles", ^{
NSArray<SDLPutFile *> *putFiles = testConnectionManager.receivedRequests;
- NSUInteger numberOfPutFiles = (((testFileData.length - 1) / [SDLGlobals globals].maxMTUSize) + 1);
+ NSUInteger numberOfPutFiles = (((testFileData.length - 1) / [[SDLGlobals globals] mtuSizeForServiceType:SDLServiceType_BulkData]) + 1);
expect(@(putFiles.count)).to(equal(@(numberOfPutFiles)));
// Test all PutFiles pieces for offset & length.
for (NSUInteger index = 0; index < numberOfPutFiles; index++) {
SDLPutFile *putFile = putFiles[index];
- expect(putFile.offset).to(equal(@(index * [SDLGlobals globals].maxMTUSize)));
+ expect(putFile.offset).to(equal(@(index * [[SDLGlobals globals] mtuSizeForServiceType:SDLServiceType_BulkData])));
expect(putFile.persistentFile).to(equal(@NO));
expect(putFile.syncFileName).to(equal(testFileName));
- expect(putFile.bulkData).to(equal([testFileData subdataWithRange:NSMakeRange((index * [SDLGlobals globals].maxMTUSize), MIN(putFile.length.unsignedIntegerValue, [SDLGlobals globals].maxMTUSize))]));
+ expect(putFile.bulkData).to(equal([testFileData subdataWithRange:NSMakeRange((index * [[SDLGlobals globals] mtuSizeForServiceType:SDLServiceType_BulkData]), MIN(putFile.length.unsignedIntegerValue, [[SDLGlobals globals] mtuSizeForServiceType:SDLServiceType_BulkData]))]));
// First Putfile has some differences due to informing core of the total incoming packet size.
if (index == 0) {
expect(putFile.length).to(equal(@(testFileData.length)));
} else if (index == numberOfPutFiles - 1) {
- expect(putFile.length).to(equal(@(testFileData.length - (index * [SDLGlobals globals].maxMTUSize))));
+ expect(putFile.length).to(equal(@(testFileData.length - (index * [[SDLGlobals globals] mtuSizeForServiceType:SDLServiceType_BulkData]))));
} else {
- expect(putFile.length).to(equal(@([SDLGlobals globals].maxMTUSize)));
+ expect(putFile.length).to(equal(@([[SDLGlobals globals] mtuSizeForServiceType:SDLServiceType_BulkData])));
}
}
diff --git a/SmartDeviceLinkTests/ProtocolSpecs/ControlFramePayloadSpecs/SDLControlFramePayloadNakSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/ControlFramePayloadSpecs/SDLControlFramePayloadNakSpec.m
new file mode 100644
index 000000000..ef0d8fae2
--- /dev/null
+++ b/SmartDeviceLinkTests/ProtocolSpecs/ControlFramePayloadSpecs/SDLControlFramePayloadNakSpec.m
@@ -0,0 +1,57 @@
+
+#import <Foundation/Foundation.h>
+
+#import <Quick/Quick.h>
+#import <Nimble/Nimble.h>
+
+#import "SDLControlFramePayloadNak.h"
+
+QuickSpecBegin(SDLControlFramePayloadNakSpec)
+
+describe(@"Test encoding data", ^{
+ __block SDLControlFramePayloadNak *testPayload = nil;
+ __block NSArray<NSString *> *testParams = nil;
+
+ context(@"with paramaters", ^{
+ beforeEach(^{
+ testParams = @[@"testParam1", @"testParam2"];
+ testPayload = [[SDLControlFramePayloadNak alloc] initWithRejectedParams:testParams];
+ });
+
+ it(@"should create the correct data", ^{
+ expect(testPayload.data.description).to(equal(@"<3e000000 0472656a 65637465 64506172 616d7300 29000000 0230000b 00000074 65737450 6172616d 31000231 000b0000 00746573 74506172 616d3200 0000>"));
+ });
+ });
+
+ context(@"without parameters", ^{
+ beforeEach(^{
+ testParams = nil;
+ testPayload = [[SDLControlFramePayloadNak alloc] initWithRejectedParams:testParams];
+ });
+
+ it(@"should create no data", ^{
+ expect(testPayload.data.length).to(equal(0));
+ });
+ });
+});
+
+describe(@"Test decoding data", ^{
+ __block SDLControlFramePayloadNak *testPayload = nil;
+ __block NSData *testData = nil;
+ __block NSArray<NSString *> *testParams = nil;
+
+ beforeEach(^{
+ testParams = @[@"testParam1", @"testParam2"];
+
+ SDLControlFramePayloadNak *firstPayload = [[SDLControlFramePayloadNak alloc] initWithRejectedParams:testParams];
+ testData = firstPayload.data;
+
+ testPayload = [[SDLControlFramePayloadNak alloc] initWithData:testData];
+ });
+
+ it(@"should output the correct params", ^{
+ expect(testPayload.rejectedParams).to(equal(testParams));
+ });
+});
+
+QuickSpecEnd
diff --git a/SmartDeviceLinkTests/ProtocolSpecs/ControlFramePayloadSpecs/SDLControlFramePayloadVideoStartServiceSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/ControlFramePayloadSpecs/SDLControlFramePayloadVideoStartServiceSpec.m
new file mode 100644
index 000000000..1a5e9cc9d
--- /dev/null
+++ b/SmartDeviceLinkTests/ProtocolSpecs/ControlFramePayloadSpecs/SDLControlFramePayloadVideoStartServiceSpec.m
@@ -0,0 +1,80 @@
+
+#import <Foundation/Foundation.h>
+
+#import <Quick/Quick.h>
+#import <Nimble/Nimble.h>
+
+#import "SDLControlFramePayloadConstants.h"
+#import "SDLControlFramePayloadVideoStartService.h"
+#import "SDLVideoStreamingCodec.h"
+#import "SDLVideoStreamingProtocol.h"
+
+QuickSpecBegin(SDLControlFramePayloadVideoStartServiceSpec)
+
+describe(@"Test encoding data", ^{
+ __block SDLControlFramePayloadVideoStartService *testPayload = nil;
+ __block int32_t testHeight = SDLControlFrameInt32NotFound;
+ __block int32_t testWidth = SDLControlFrameInt32NotFound;
+ __block SDLVideoStreamingCodec *testCodec = nil;
+ __block SDLVideoStreamingProtocol *testProtocol = nil;
+
+ context(@"with paramaters", ^{
+ beforeEach(^{
+ testHeight = 59794;
+ testWidth = 363;
+ testCodec = [SDLVideoStreamingCodec H265];
+ testProtocol = [SDLVideoStreamingProtocol RTMP];
+
+ testPayload = [[SDLControlFramePayloadVideoStartService alloc] initWithVideoHeight:testHeight width:testWidth protocol:testProtocol codec:testCodec];
+ });
+
+ it(@"should create the correct data", ^{
+ expect(testPayload.data.description).to(equal(@"<49000000 02766964 656f5072 6f746f63 6f6c0005 00000052 544d5000 10776964 7468006b 01000002 76696465 6f436f64 65630005 00000048 32363500 10686569 67687400 92e90000 00>"));
+ });
+ });
+
+ context(@"without parameters", ^{
+ beforeEach(^{
+ testHeight = SDLControlFrameInt32NotFound;
+ testWidth = SDLControlFrameInt32NotFound;
+ testCodec = nil;
+ testProtocol = nil;
+
+ testPayload = [[SDLControlFramePayloadVideoStartService alloc] initWithVideoHeight:testHeight width:testWidth protocol:testProtocol codec:testCodec];
+ });
+
+ it(@"should create no data", ^{
+ expect(testPayload.data.length).to(equal(0));
+ });
+ });
+});
+
+describe(@"Test decoding data", ^{
+ __block SDLControlFramePayloadVideoStartService *testPayload = nil;
+ __block NSData *testData = nil;
+ __block int32_t testHeight = SDLControlFrameInt32NotFound;
+ __block int32_t testWidth = SDLControlFrameInt32NotFound;
+ __block SDLVideoStreamingCodec *testCodec = nil;
+ __block SDLVideoStreamingProtocol *testProtocol = nil;
+
+ beforeEach(^{
+ testHeight = 787;
+ testWidth = 36365;
+ testCodec = [SDLVideoStreamingCodec THEORA];
+ testProtocol = [SDLVideoStreamingProtocol RTSP];
+
+ SDLControlFramePayloadVideoStartService *firstPayload = [[SDLControlFramePayloadVideoStartService alloc] initWithVideoHeight:testHeight width:testWidth protocol:testProtocol codec:testCodec];
+ testData = firstPayload.data;
+
+ testPayload = [[SDLControlFramePayloadVideoStartService alloc] initWithData:testData];
+ });
+
+ it(@"should output the correct params", ^{
+ expect(testPayload.height).to(equal(testHeight));
+ expect(testPayload.width).to(equal(testWidth));
+ expect(testPayload.videoCodec).to(equal(testCodec));
+ expect(testPayload.videoProtocol).to(equal(testProtocol));
+ });
+});
+
+QuickSpecEnd
diff --git a/SmartDeviceLinkTests/ProtocolSpecs/ControlFramePayloadSpecs/SDLControlFrameVideoStartServiceAckSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/ControlFramePayloadSpecs/SDLControlFrameVideoStartServiceAckSpec.m
new file mode 100644
index 000000000..b52740312
--- /dev/null
+++ b/SmartDeviceLinkTests/ProtocolSpecs/ControlFramePayloadSpecs/SDLControlFrameVideoStartServiceAckSpec.m
@@ -0,0 +1,86 @@
+
+#import <Foundation/Foundation.h>
+
+#import <Quick/Quick.h>
+#import <Nimble/Nimble.h>
+
+#import "SDLControlFramePayloadConstants.h"
+#import "SDLControlFramePayloadVideoStartServiceAck.h"
+#import "SDLVideoStreamingCodec.h"
+#import "SDLVideoStreamingProtocol.h"
+
+QuickSpecBegin(SDLControlFramePayloadVideoStartServiceAckSpec)
+
+describe(@"Test encoding data", ^{
+ __block SDLControlFramePayloadVideoStartServiceAck *testPayload = nil;
+ __block int64_t testMTU = SDLControlFrameInt64NotFound;
+ __block int32_t testHeight = SDLControlFrameInt32NotFound;
+ __block int32_t testWidth = SDLControlFrameInt32NotFound;
+ __block SDLVideoStreamingCodec *testCodec = nil;
+ __block SDLVideoStreamingProtocol *testProtocol = nil;
+
+ context(@"with paramaters", ^{
+ beforeEach(^{
+ testMTU = 1247988;
+ testHeight = 5974;
+ testWidth = 36;
+ testCodec = [SDLVideoStreamingCodec H264];
+ testProtocol = [SDLVideoStreamingProtocol RAW];
+
+ testPayload = [[SDLControlFramePayloadVideoStartServiceAck alloc] initWithMTU:testMTU height:testHeight width:testWidth protocol:testProtocol codec:testCodec];
+ });
+
+ it(@"should create the correct data", ^{
+ expect(testPayload.data.description).to(equal(@"<55000000 126d7475 00f40a13 00000000 00027669 64656f50 726f746f 636f6c00 04000000 52415700 10776964 74680024 00000002 76696465 6f436f64 65630005 00000048 32363400 10686569 67687400 56170000 00>"));
+ });
+ });
+
+ context(@"without parameters", ^{
+ beforeEach(^{
+ testMTU = SDLControlFrameInt64NotFound;
+ testHeight = SDLControlFrameInt32NotFound;
+ testWidth = SDLControlFrameInt32NotFound;
+ testCodec = nil;
+ testProtocol = nil;
+
+ testPayload = [[SDLControlFramePayloadVideoStartServiceAck alloc] initWithMTU:testMTU height:testHeight width:testWidth protocol:testProtocol codec:testCodec];
+ });
+
+ it(@"should create no data", ^{
+ expect(testPayload.data.length).to(equal(0));
+ });
+ });
+});
+
+describe(@"Test decoding data", ^{
+ __block SDLControlFramePayloadVideoStartServiceAck *testPayload = nil;
+ __block NSData *testData = nil;
+ __block int64_t testMTU = SDLControlFrameInt64NotFound;
+ __block int32_t testHeight = SDLControlFrameInt32NotFound;
+ __block int32_t testWidth = SDLControlFrameInt32NotFound;
+ __block SDLVideoStreamingCodec *testCodec = nil;
+ __block SDLVideoStreamingProtocol *testProtocol = nil;
+
+ beforeEach(^{
+ testMTU = 4584651;
+ testHeight = 787;
+ testWidth = 36365;
+ testCodec = [SDLVideoStreamingCodec VP8];
+ testProtocol = [SDLVideoStreamingProtocol RTSP];
+
+ SDLControlFramePayloadVideoStartServiceAck *firstPayload = [[SDLControlFramePayloadVideoStartServiceAck alloc] initWithMTU:testMTU height:testHeight width:testWidth protocol:testProtocol codec:testCodec];
+ testData = firstPayload.data;
+
+ testPayload = [[SDLControlFramePayloadVideoStartServiceAck alloc] initWithData:testData];
+ });
+
+ it(@"should output the correct params", ^{
+ expect(testPayload.mtu).to(equal(testMTU));
+ expect(testPayload.height).to(equal(testHeight));
+ expect(testPayload.width).to(equal(testWidth));
+ expect(testPayload.videoCodec).to(equal(testCodec));
+ expect(testPayload.videoProtocol).to(equal(testProtocol));
+ });
+});
+
+QuickSpecEnd
diff --git a/SmartDeviceLinkTests/ProtocolSpecs/HeaderSpecs/SDLProtocolHeaderSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/HeaderSpecs/SDLProtocolHeaderSpec.m
index 573003bc8..e00062a34 100644
--- a/SmartDeviceLinkTests/ProtocolSpecs/HeaderSpecs/SDLProtocolHeaderSpec.m
+++ b/SmartDeviceLinkTests/ProtocolSpecs/HeaderSpecs/SDLProtocolHeaderSpec.m
@@ -21,9 +21,21 @@ describe(@"HeaderForVersion Tests", ^ {
expect([SDLProtocolHeader headerForVersion:2]).to(beAKindOf(SDLV2ProtocolHeader.class));
});
- it(@"Should return latest version for unknown version", ^ {
- expect([SDLProtocolHeader headerForVersion:5]).to(raiseException().named(NSInvalidArgumentException));
+ it(@"Should return a v2 header for unknown version", ^ {
+ expect([SDLProtocolHeader headerForVersion:255].version).to(equal(255));
});
});
-QuickSpecEnd \ No newline at end of file
+describe(@"DetermineVersion Tests", ^ {
+ it(@"Should return the correct version", ^ {
+ const char bytesV1[8] = {0x10 | SDLFrameType_First, SDLServiceType_BulkData, SDLFrameData_StartSessionACK, 0x5E, 0x00, 0x00, 0x00, 0x00};
+ NSData* messageV1 = [NSData dataWithBytes:bytesV1 length:8];
+ expect(@([SDLProtocolHeader determineVersion:messageV1])).to(equal(@1));
+
+ const char bytesV2[12] = {0x20 | SDLFrameType_First, SDLServiceType_BulkData, SDLFrameData_StartSessionACK, 0x5E, 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x44};
+ NSData* messageV2 = [NSData dataWithBytes:bytesV2 length:12];
+ expect(@([SDLProtocolHeader determineVersion:messageV2])).to(equal(@2));
+ });
+});
+
+QuickSpecEnd
diff --git a/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolMessageSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolMessageSpec.m
index 12b634218..16e8d6091 100644
--- a/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolMessageSpec.m
+++ b/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolMessageSpec.m
@@ -38,18 +38,6 @@ describe(@"MessageWithHeader Tests", ^ {
});
});
-describe(@"DetermineVersion Tests", ^ {
- it(@"Should return the correct version", ^ {
- const char bytesV1[8] = {0x10 | SDLFrameType_First, SDLServiceType_BulkData, SDLFrameData_StartSessionACK, 0x5E, 0x00, 0x00, 0x00, 0x00};
- NSData* messageV1 = [NSData dataWithBytes:bytesV1 length:8];
- expect(@([SDLProtocolMessage determineVersion:messageV1])).to(equal(@1));
-
- const char bytesV2[12] = {0x20 | SDLFrameType_First, SDLServiceType_BulkData, SDLFrameData_StartSessionACK, 0x5E, 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x44};
- NSData* messageV2 = [NSData dataWithBytes:bytesV2 length:12];
- expect(@([SDLProtocolMessage determineVersion:messageV2])).to(equal(@2));
- });
-});
-
describe(@"Data tests", ^ {
it(@"Should return the correct data", ^ {
SDLProtocolMessage* testMessage = [[SDLProtocolMessage alloc] init];
@@ -69,4 +57,4 @@ describe(@"Data tests", ^ {
});
});
-QuickSpecEnd \ No newline at end of file
+QuickSpecEnd
diff --git a/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m
index e7224cc67..6512317a0 100644
--- a/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m
+++ b/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m
@@ -52,7 +52,7 @@ describe(@"Send StartService Tests", ^ {
}] sendData:[OCMArg any]];
testProtocol.transport = transportMock;
- [testProtocol startServiceWithType:SDLServiceType_BulkData];
+ [testProtocol startServiceWithType:SDLServiceType_BulkData payload:nil];
expect(@(verified)).toEventually(beTruthy());
});
@@ -74,7 +74,7 @@ describe(@"Send EndSession Tests", ^ {
SDLV1ProtocolHeader *testHeader = [[SDLV1ProtocolHeader alloc] init];
testHeader.serviceType = SDLServiceType_RPC;
testHeader.sessionID = 0x03;
- [testProtocol handleProtocolStartSessionACK:testHeader];
+ [testProtocol handleProtocolStartServiceACKMessage:[SDLProtocolMessage messageWithHeader:testHeader andPayload:nil]];
__block BOOL verified = NO;
id transportMock = OCMClassMock([SDLAbstractTransport class]);
@@ -103,7 +103,7 @@ describe(@"Send EndSession Tests", ^ {
SDLV2ProtocolHeader *testHeader = [[SDLV2ProtocolHeader alloc] initWithVersion:2];
testHeader.serviceType = SDLServiceType_RPC;
testHeader.sessionID = 0x61;
- [testProtocol handleProtocolStartSessionACK:testHeader];
+ [testProtocol handleProtocolStartServiceACKMessage:[SDLProtocolMessage messageWithHeader:testHeader andPayload:nil]];
__block BOOL verified = NO;
id transportMock = OCMClassMock([SDLAbstractTransport class]);
@@ -141,7 +141,7 @@ describe(@"SendRPCRequest Tests", ^ {
SDLV1ProtocolHeader *testHeader = [[SDLV1ProtocolHeader alloc] init];
testHeader.serviceType = SDLServiceType_RPC;
testHeader.sessionID = 0xFF;
- [testProtocol handleProtocolStartSessionACK:testHeader];
+ [testProtocol handleProtocolStartServiceACKMessage:[SDLProtocolMessage messageWithHeader:testHeader andPayload:nil]];
__block BOOL verified = NO;
id transportMock = OCMClassMock([SDLAbstractTransport class]);
@@ -181,7 +181,7 @@ describe(@"SendRPCRequest Tests", ^ {
SDLV2ProtocolHeader *testHeader = [[SDLV2ProtocolHeader alloc] initWithVersion:2];
testHeader.serviceType = SDLServiceType_RPC;
testHeader.sessionID = 0x01;
- [testProtocol handleProtocolStartSessionACK:testHeader];
+ [testProtocol handleProtocolStartServiceACKMessage:[SDLProtocolMessage messageWithHeader:testHeader andPayload:nil]];
__block BOOL verified = NO;
id transportMock = OCMClassMock([SDLAbstractTransport class]);
@@ -339,9 +339,9 @@ xdescribe(@"HandleProtocolSessionStarted Tests", ^ {
testHeader.bytesInPayload = 0;
[testProtocol.protocolDelegateTable addObject:delegateMock];
- [testProtocol handleProtocolStartSessionACK:testHeader];
+ [testProtocol handleProtocolStartServiceACKMessage:[SDLProtocolMessage messageWithHeader:testHeader andPayload:nil]];
- OCMExpect([delegateMock handleProtocolStartSessionACK:testHeader]);
+ OCMExpect([delegateMock handleProtocolStartServiceACKMessage:[SDLProtocolMessage messageWithHeader:testHeader andPayload:nil]]);
});
});
diff --git a/SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadAudioStartServiceAckSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadAudioStartServiceAckSpec.m
new file mode 100644
index 000000000..a168fc39d
--- /dev/null
+++ b/SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadAudioStartServiceAckSpec.m
@@ -0,0 +1,60 @@
+
+#import <Foundation/Foundation.h>
+
+#import <Quick/Quick.h>
+#import <Nimble/Nimble.h>
+
+#import "SDLControlFramePayloadConstants.h"
+#import "SDLControlFramePayloadAudioStartServiceAck.h"
+
+QuickSpecBegin(SDLControlFramePayloadAudioStartServiceAckSpec)
+
+describe(@"Test encoding data", ^{
+ __block SDLControlFramePayloadAudioStartServiceAck *testPayload = nil;
+ __block int64_t testMTU = 0;
+
+ context(@"with paramaters", ^{
+ beforeEach(^{
+ testMTU = 598464979;
+
+ testPayload = [[SDLControlFramePayloadAudioStartServiceAck alloc] initWithMTU:testMTU];
+ });
+
+ it(@"should create the correct data", ^{
+ expect(testPayload.data.description).to(equal(@"<12000000 126d7475 00d3d9ab 23000000 0000>"));
+ });
+ });
+
+ context(@"without parameters", ^{
+ beforeEach(^{
+ testMTU = SDLControlFrameInt64NotFound;
+
+ testPayload = [[SDLControlFramePayloadAudioStartServiceAck alloc] initWithMTU:testMTU];
+ });
+
+ it(@"should create no data", ^{
+ expect(testPayload.data.length).to(equal(0));
+ });
+ });
+});
+
+describe(@"Test decoding data", ^{
+ __block SDLControlFramePayloadAudioStartServiceAck *testPayload = nil;
+ __block NSData *testData = nil;
+ __block int64_t testMTU = 0;
+
+ beforeEach(^{
+ testMTU = 989786483;
+
+ SDLControlFramePayloadAudioStartServiceAck *firstPayload = [[SDLControlFramePayloadAudioStartServiceAck alloc] initWithMTU:testMTU];
+ testData = firstPayload.data;
+
+ testPayload = [[SDLControlFramePayloadAudioStartServiceAck alloc] initWithData:testData];
+ });
+
+ it(@"should output the correct params", ^{
+ expect(testPayload.mtu).to(equal(testMTU));
+ });
+});
+
+QuickSpecEnd
diff --git a/SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadEndServiceSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadEndServiceSpec.m
new file mode 100644
index 000000000..8f7a0c3d2
--- /dev/null
+++ b/SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadEndServiceSpec.m
@@ -0,0 +1,58 @@
+
+#import <Foundation/Foundation.h>
+
+#import <Quick/Quick.h>
+#import <Nimble/Nimble.h>
+
+#import "SDLControlFramePayloadConstants.h"
+#import "SDLControlFramePayloadEndService.h"
+
+QuickSpecBegin(SDLControlFramePayloadEndServiceSpec)
+
+describe(@"Test encoding data", ^{
+ __block SDLControlFramePayloadEndService *testPayload = nil;
+ __block int32_t testHashId = 0;
+
+ context(@"with paramaters", ^{
+ beforeEach(^{
+ testHashId = 145768957;
+ testPayload = [[SDLControlFramePayloadEndService alloc] initWithHashId:testHashId];
+ });
+
+ it(@"should create the correct data", ^{
+ expect(testPayload.data.description).to(equal(@"<11000000 10686173 68496400 fd41b008 00>"));
+ });
+ });
+
+ context(@"without parameters", ^{
+ beforeEach(^{
+ testHashId = SDLControlFrameInt32NotFound;
+ testPayload = [[SDLControlFramePayloadEndService alloc] initWithHashId:testHashId];
+ });
+
+ it(@"should create no data", ^{
+ expect(testPayload.data.length).to(equal(0));
+ });
+ });
+});
+
+describe(@"Test decoding data", ^{
+ __block SDLControlFramePayloadEndService *testPayload = nil;
+ __block NSData *testData = nil;
+ __block int32_t testHashId = 0;
+
+ beforeEach(^{
+ testHashId = 15457845;
+
+ SDLControlFramePayloadEndService *firstPayload = [[SDLControlFramePayloadEndService alloc] initWithHashId:testHashId];
+ testData = firstPayload.data;
+
+ testPayload = [[SDLControlFramePayloadEndService alloc] initWithData:testData];
+ });
+
+ it(@"should output the correct params", ^{
+ expect(testPayload.hashId).to(equal(testHashId));
+ });
+});
+
+QuickSpecEnd
diff --git a/SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadRPCStartServiceAckSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadRPCStartServiceAckSpec.m
new file mode 100644
index 000000000..ee6793249
--- /dev/null
+++ b/SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadRPCStartServiceAckSpec.m
@@ -0,0 +1,71 @@
+
+#import <Foundation/Foundation.h>
+
+#import <Quick/Quick.h>
+#import <Nimble/Nimble.h>
+
+#import "SDLControlFramePayloadConstants.h"
+#import "SDLControlFramePayloadRPCStartServiceAck.h"
+
+QuickSpecBegin(SDLControlFramePayloadRPCStartServiceAckSpec)
+
+describe(@"Test encoding data", ^{
+ __block SDLControlFramePayloadRPCStartServiceAck *testPayload = nil;
+ __block int32_t testHashId = 0;
+ __block int64_t testMTU = 0;
+ __block NSString *testProtocolVersion = nil;
+
+ context(@"with paramaters", ^{
+ beforeEach(^{
+ testHashId = 1457689;
+ testMTU = 5984649;
+ testProtocolVersion = @"1.32.32";
+
+ testPayload = [[SDLControlFramePayloadRPCStartServiceAck alloc] initWithHashId:testHashId mtu:testMTU protocolVersion:testProtocolVersion];
+ });
+
+ it(@"should create the correct data", ^{
+ expect(testPayload.data.description).to(equal(@"<3b000000 10686173 68496400 193e1600 126d7475 0089515b 00000000 00027072 6f746f63 6f6c5665 7273696f 6e000800 0000312e 33322e33 320000>"));
+ });
+ });
+
+ context(@"without parameters", ^{
+ beforeEach(^{
+ testHashId = SDLControlFrameInt32NotFound;
+ testMTU = SDLControlFrameInt64NotFound;
+
+ testPayload = [[SDLControlFramePayloadRPCStartServiceAck alloc] initWithHashId:testHashId mtu:testMTU protocolVersion:nil];
+ });
+
+ it(@"should create no data", ^{
+ expect(testPayload.data.length).to(equal(0));
+ });
+ });
+});
+
+describe(@"Test decoding data", ^{
+ __block SDLControlFramePayloadRPCStartServiceAck *testPayload = nil;
+ __block NSData *testData = nil;
+ __block int32_t testHashId = 0;
+ __block int64_t testMTU = 0;
+ __block NSString *testProtocolVersion = nil;
+
+ beforeEach(^{
+ testHashId = 1545784;
+ testMTU = 989786483;
+ testProtocolVersion = @"3.89.5";
+
+ SDLControlFramePayloadRPCStartServiceAck *firstPayload = [[SDLControlFramePayloadRPCStartServiceAck alloc] initWithHashId:testHashId mtu:testMTU protocolVersion:testProtocolVersion];
+ testData = firstPayload.data;
+
+ testPayload = [[SDLControlFramePayloadRPCStartServiceAck alloc] initWithData:testData];
+ });
+
+ it(@"should output the correct params", ^{
+ expect(testPayload.hashId).to(equal(testHashId));
+ expect(testPayload.mtu).to(equal(testMTU));
+ expect(testPayload.protocolVersion).to(equal(testProtocolVersion));
+ });
+});
+
+QuickSpecEnd
diff --git a/SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadRPCStartServiceSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadRPCStartServiceSpec.m
new file mode 100644
index 000000000..e8e773c8a
--- /dev/null
+++ b/SmartDeviceLinkTests/ProtocolSpecs/SDLControlFramePayloadRPCStartServiceSpec.m
@@ -0,0 +1,60 @@
+
+#import <Foundation/Foundation.h>
+
+#import <Quick/Quick.h>
+#import <Nimble/Nimble.h>
+
+#import "SDLControlFramePayloadConstants.h"
+#import "SDLControlFramePayloadRPCStartService.h"
+
+QuickSpecBegin(SDLControlFramePayloadRPCStartServiceSpec)
+
+describe(@"Test encoding data", ^{
+ __block SDLControlFramePayloadRPCStartService *testPayload = nil;
+ __block NSString *testProtocolVersion = nil;
+
+ context(@"with paramaters", ^{
+ beforeEach(^{
+ testProtocolVersion = @"74.32.2";
+
+ testPayload = [[SDLControlFramePayloadRPCStartService alloc] initWithVersion:testProtocolVersion];
+ });
+
+ it(@"should create the correct data", ^{
+ expect(testPayload.data.description).to(equal(@"<22000000 0270726f 746f636f 6c566572 73696f6e 00080000 0037342e 33322e32 0000>"));
+ });
+ });
+
+ context(@"without parameters", ^{
+ beforeEach(^{
+ testProtocolVersion = nil;
+
+ testPayload = [[SDLControlFramePayloadRPCStartService alloc] initWithVersion:testProtocolVersion];
+ });
+
+ it(@"should create no data", ^{
+ expect(testPayload.data.length).to(equal(0));
+ });
+ });
+});
+
+describe(@"Test decoding data", ^{
+ __block SDLControlFramePayloadRPCStartService *testPayload = nil;
+ __block NSData *testData = nil;
+ __block NSString *testProtocolVersion = nil;
+
+ beforeEach(^{
+ testProtocolVersion = @"59.63.47";
+
+ SDLControlFramePayloadRPCStartService *firstPayload = [[SDLControlFramePayloadRPCStartService alloc] initWithVersion:testProtocolVersion];
+ testData = firstPayload.data;
+
+ testPayload = [[SDLControlFramePayloadRPCStartService alloc] initWithData:testData];
+ });
+
+ it(@"should output the correct params", ^{
+ expect(testPayload.protocolVersion).to(equal(testProtocolVersion));
+ });
+});
+
+QuickSpecEnd
diff --git a/SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolMessageDisassemblerSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolMessageDisassemblerSpec.m
index 04fb30c5e..27aedff5b 100644
--- a/SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolMessageDisassemblerSpec.m
+++ b/SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolMessageDisassemblerSpec.m
@@ -24,7 +24,7 @@ describe(@"Disassemble Tests", ^ {
char dummyBytes[dataLength];
SDLGlobals *globals = [[SDLGlobals alloc] init];
- globals.maxHeadUnitVersion = 2;
+ globals.maxHeadUnitVersion = @"2.0.0";
const char testPayloadHeader[12] = {0x20, 0x55, 0x64, 0x73, 0x12, 0x34, 0x43, 0x21, (dataLength >> 24) & 0xFF, (dataLength >> 16) & 0xFF, (dataLength >> 8) & 0xFF, dataLength & 0xFF};
@@ -43,7 +43,7 @@ describe(@"Disassemble Tests", ^ {
testMessage.header = testHeader;
testMessage.payload = payloadData;
- NSArray* messageList = [SDLProtocolMessageDisassembler disassemble:testMessage withLimit:globals.maxMTUSize];
+ NSArray* messageList = [SDLProtocolMessageDisassembler disassemble:testMessage withLimit:[globals mtuSizeForServiceType:testHeader.serviceType]];
//Payload length per message
UInt32 payloadLength = 1012; // v1/2 MTU(1024) - header length(12)
@@ -92,4 +92,4 @@ describe(@"Disassemble Tests", ^ {
});
});
-QuickSpecEnd \ No newline at end of file
+QuickSpecEnd
diff --git a/SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolReceivedMessageRouterSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolReceivedMessageRouterSpec.m
index f045ae721..a9ceacba5 100644
--- a/SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolReceivedMessageRouterSpec.m
+++ b/SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolReceivedMessageRouterSpec.m
@@ -38,7 +38,7 @@ describe(@"HandleReceivedMessage Tests", ^ {
router.delegate = delegateMock;
[router handleReceivedMessage:testMessage];
- OCMVerify([delegateMock handleProtocolStartSessionACK:testMessage.header]);
+ OCMVerify([delegateMock handleProtocolStartServiceACKMessage:testMessage]);
});
});
diff --git a/SmartDeviceLinkTests/UtilitiesSpecs/SDLGlobalsSpec.m b/SmartDeviceLinkTests/UtilitiesSpecs/SDLGlobalsSpec.m
index 8acaaadcf..191f7b705 100644
--- a/SmartDeviceLinkTests/UtilitiesSpecs/SDLGlobalsSpec.m
+++ b/SmartDeviceLinkTests/UtilitiesSpecs/SDLGlobalsSpec.m
@@ -7,8 +7,6 @@ QuickSpecBegin(SDLGlobalsSpec)
describe(@"The SDLGlobals class", ^{
__block SDLGlobals *testGlobals = nil;
- __block NSNumber *v1And2MTUSize = @1024;
- __block NSNumber *v3And4MTUSize = @131084;
beforeEach(^{
testGlobals = [[SDLGlobals alloc] init];
@@ -16,70 +14,129 @@ describe(@"The SDLGlobals class", ^{
describe(@"when just initialized", ^{
it(@"should properly set protocol version", ^{
- expect(@(testGlobals.protocolVersion)).to(equal(@1));
+ expect(testGlobals.protocolVersion).to(equal(@"1.0.0"));
+ });
+
+ it(@"should properly set the major protocol version", ^{
+ expect(testGlobals.majorProtocolVersion).to(equal(1));
});
it(@"should properly set max head unit version", ^{
- expect(@(testGlobals.maxHeadUnitVersion)).to(equal(@0));
+ expect(testGlobals.maxHeadUnitVersion).to(equal(@"0.0.0"));
});
- it(@"should throw an exception trying to get max MTU size", ^{
- expect(@(testGlobals.maxMTUSize)).to(equal(v1And2MTUSize));
+ it(@"should give the v1 MTU size", ^{
+ expect([testGlobals mtuSizeForServiceType:SDLServiceType_RPC]).to(equal(SDLV1MTUSize));
});
});
describe(@"setting maxHeadUnitVersion should alter negotiated protocol version", ^{
it(@"should use the max head unit version when lower than max proxy version", ^{
- NSUInteger someIntLowerThanMaxProxyVersion = 2;
- testGlobals.maxHeadUnitVersion = someIntLowerThanMaxProxyVersion;
- expect(@(testGlobals.protocolVersion)).to(equal(@(someIntLowerThanMaxProxyVersion)));
- expect(@(testGlobals.maxHeadUnitVersion)).to(equal(@(someIntLowerThanMaxProxyVersion)));
+ NSString *someVersionLowerThanMaxProxyVersion = @"2.0.0";
+ testGlobals.maxHeadUnitVersion = someVersionLowerThanMaxProxyVersion;
+
+ expect(testGlobals.protocolVersion).to(equal(someVersionLowerThanMaxProxyVersion));
+ expect(testGlobals.maxHeadUnitVersion).to(equal(someVersionLowerThanMaxProxyVersion));
});
it(@"should use the max proxy version when lower than max head unit version", ^{
- NSUInteger someIntHigherThanMaxProxyVersion = 1000;
- testGlobals.maxHeadUnitVersion = someIntHigherThanMaxProxyVersion;
- expect(@(testGlobals.protocolVersion)).to(beLessThan(@(someIntHigherThanMaxProxyVersion)));
- expect(@(testGlobals.maxHeadUnitVersion)).to(equal(@(someIntHigherThanMaxProxyVersion)));
+ NSString *someVersionHigherThanMaxProxyVersion = @"1000.0.0";
+ testGlobals.maxHeadUnitVersion = someVersionHigherThanMaxProxyVersion;
+
+ expect(([testGlobals.protocolVersion compare:someVersionHigherThanMaxProxyVersion options:NSNumericSearch] == NSOrderedDescending)).to(beFalsy());
+ expect(testGlobals.maxHeadUnitVersion).to(equal(someVersionHigherThanMaxProxyVersion));
});
});
describe(@"getting the max MTU version", ^{
context(@"when protocol version is 1 - 2", ^{
it(@"should return the correct value when protocol version is 1", ^{
- testGlobals.maxHeadUnitVersion = 1;
- expect(@(testGlobals.maxMTUSize)).to(equal(v1And2MTUSize));
+ testGlobals.maxHeadUnitVersion = @"1.0.0";
+ expect([testGlobals mtuSizeForServiceType:SDLServiceType_RPC]).to(equal(SDLV1MTUSize));
});
it(@"should return the correct value when protocol version is 2", ^{
- testGlobals.maxHeadUnitVersion = 2;
- expect(@(testGlobals.maxMTUSize)).to(equal(v1And2MTUSize));
+ testGlobals.maxHeadUnitVersion = @"2.0.0";
+ expect([testGlobals mtuSizeForServiceType:SDLServiceType_RPC]).to(equal(SDLV1MTUSize));
});
});
context(@"when protocol version is 3 - 4", ^{
it(@"should return the correct value when protocol version is 3", ^{
- testGlobals.maxHeadUnitVersion = 3;
- expect(@(testGlobals.maxMTUSize)).to(equal(v3And4MTUSize));
+ testGlobals.maxHeadUnitVersion = @"3.0.0";
+ expect([testGlobals mtuSizeForServiceType:SDLServiceType_RPC]).to(equal(SDLV3MTUSize));
});
it(@"should return the correct value when protocol version is 4", ^{
- testGlobals.maxHeadUnitVersion = 4;
- expect(@(testGlobals.maxMTUSize)).to(equal(v3And4MTUSize));
+ testGlobals.maxHeadUnitVersion = @"4.0.0";
+ expect([testGlobals mtuSizeForServiceType:SDLServiceType_RPC]).to(equal(SDLV3MTUSize));
});
describe(@"when the max proxy version is lower than max head unit version", ^{
beforeEach(^{
- NSUInteger someIntHigherThanMaxProxyVersion = 1000;
- testGlobals.maxHeadUnitVersion = someIntHigherThanMaxProxyVersion;
+ NSString *someVersionHigherThanMaxProxyVersion = @"1000.0.0";
+ testGlobals.maxHeadUnitVersion = someVersionHigherThanMaxProxyVersion;
});
it(@"should return the v1 - 2 value", ^{
- expect(@(testGlobals.maxMTUSize)).to(equal(v1And2MTUSize));
+ expect([testGlobals mtuSizeForServiceType:SDLServiceType_RPC]).to(equal(SDLV1MTUSize));
});
});
});
});
+
+#pragma mark Dynamic MTU
+ describe(@"when dynamically setting MTU on protocol version 5", ^{
+ __block NSUInteger dynamicMTUSize1 = 12345;
+ __block NSUInteger dynamicMTUSize2 = 54321;
+
+ beforeEach(^{
+ testGlobals.maxHeadUnitVersion = @"5.0.0";
+ });
+
+ context(@"Setting the RPC service MTU", ^{
+ beforeEach(^{
+ [testGlobals setDynamicMTUSize:dynamicMTUSize1 forServiceType:SDLServiceType_RPC];
+ });
+
+ it(@"should set the RPC service MTU", ^{
+ expect([testGlobals mtuSizeForServiceType:SDLServiceType_RPC]).to(equal(dynamicMTUSize1));
+ });
+
+ it(@"should have the video service fall back to the RPC service MTU", ^{
+ expect([testGlobals mtuSizeForServiceType:SDLServiceType_Video]).to(equal(dynamicMTUSize1));
+ });
+ });
+
+ context(@"setting the video service MTU", ^{
+ beforeEach(^{
+ [testGlobals setDynamicMTUSize:dynamicMTUSize1 forServiceType:SDLServiceType_Video];
+ });
+
+ it(@"should not set the RPC service MTU", ^{
+ expect([testGlobals mtuSizeForServiceType:SDLServiceType_RPC]).to(equal(SDLV3MTUSize));
+ });
+
+ it(@"should have the video service fall back to the RPC service MTU", ^{
+ expect([testGlobals mtuSizeForServiceType:SDLServiceType_Video]).to(equal(dynamicMTUSize1));
+ });
+ });
+
+ context(@"setting both the video service and RPC service MTU", ^{
+ beforeEach(^{
+ [testGlobals setDynamicMTUSize:dynamicMTUSize1 forServiceType:SDLServiceType_RPC];
+ [testGlobals setDynamicMTUSize:dynamicMTUSize2 forServiceType:SDLServiceType_Video];
+ });
+
+ it(@"should set the RPC service MTU", ^{
+ expect([testGlobals mtuSizeForServiceType:SDLServiceType_RPC]).to(equal(dynamicMTUSize1));
+ });
+
+ it(@"should have the video service fall back to the RPC service MTU", ^{
+ expect([testGlobals mtuSizeForServiceType:SDLServiceType_Video]).to(equal(dynamicMTUSize2));
+ });
+ });
+ });
});
QuickSpecEnd
diff --git a/bson_c_lib b/bson_c_lib
new file mode 160000
+Subproject 9981c815541da97cc023bb510c172d09fefa908