diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2017-07-20 14:40:07 -0400 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2017-07-20 15:11:00 -0400 |
commit | f03bee571896a14a0a59be1ce8e9b1279031d380 (patch) | |
tree | eb71642fcb4b4bc735f25f18cc779574a599ade3 | |
parent | 67e5b140530f1affb04ec8ecf218a26679398eec (diff) | |
download | sdl_ios-f03bee571896a14a0a59be1ce8e9b1279031d380.tar.gz |
Change what BSON payload objects are
* Allow max MTU size to be manually set to account for protocol v5 variable MTU sizes
* Create a control frame payload type instead of control frame types
-rw-r--r-- | SmartDeviceLink-iOS.xcodeproj/project.pbxproj | 74 | ||||
-rw-r--r-- | SmartDeviceLink/SDLControlFramePayloadConstants.h | 13 | ||||
-rw-r--r-- | SmartDeviceLink/SDLControlFramePayloadConstants.m | 13 | ||||
-rw-r--r-- | SmartDeviceLink/SDLControlFramePayloadRPCStartService.h | 24 | ||||
-rw-r--r-- | SmartDeviceLink/SDLControlFramePayloadRPCStartService.m | 68 | ||||
-rw-r--r-- | SmartDeviceLink/SDLControlFramePayloadRPCStartServiceAck.h | 23 | ||||
-rw-r--r-- | SmartDeviceLink/SDLControlFramePayloadRPCStartServiceAck.m | 76 | ||||
-rw-r--r-- | SmartDeviceLink/SDLControlFramePayloadRPCStartServiceNak.h | 22 | ||||
-rw-r--r-- | SmartDeviceLink/SDLControlFramePayloadRPCStartServiceNak.m | 27 | ||||
-rw-r--r-- | SmartDeviceLink/SDLControlFramePayloadType.h | 20 | ||||
-rw-r--r-- | SmartDeviceLink/SDLControlFrameStartService.h | 17 | ||||
-rw-r--r-- | SmartDeviceLink/SDLControlFrameStartService.m | 53 | ||||
-rw-r--r-- | SmartDeviceLink/SDLControlMessage.h | 13 | ||||
-rw-r--r-- | SmartDeviceLink/SDLControlMessage.m | 13 | ||||
-rw-r--r-- | SmartDeviceLink/SDLGlobals.h | 6 | ||||
-rw-r--r-- | SmartDeviceLink/SDLGlobals.m | 26 |
16 files changed, 368 insertions, 120 deletions
diff --git a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj index da9f28665..1d0b7b887 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 /* SDLControlFramePayloadRPCStartServiceNak.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D4631121F2136B60092EFDC /* SDLControlFramePayloadRPCStartServiceNak.h */; }; + 5D4631151F2136B60092EFDC /* SDLControlFramePayloadRPCStartServiceNak.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D4631131F2136B60092EFDC /* SDLControlFramePayloadRPCStartServiceNak.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 */; }; @@ -873,10 +880,8 @@ 5DA49CD91F1E890500E65FC5 /* bson_util.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DA49CD31F1E890500E65FC5 /* bson_util.h */; }; 5DA49CDC1F1E890D00E65FC5 /* emhashmap.c in Sources */ = {isa = PBXBuildFile; fileRef = 5DA49CDA1F1E890D00E65FC5 /* emhashmap.c */; }; 5DA49CDD1F1E890D00E65FC5 /* emhashmap.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DA49CDB1F1E890D00E65FC5 /* emhashmap.h */; }; - 5DA49CE51F1EA83300E65FC5 /* SDLControlFrameStartService.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DA49CE31F1EA83300E65FC5 /* SDLControlFrameStartService.h */; }; - 5DA49CE61F1EA83300E65FC5 /* SDLControlFrameStartService.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DA49CE41F1EA83300E65FC5 /* SDLControlFrameStartService.m */; }; - 5DA49CED1F1FD9F600E65FC5 /* SDLControlMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DA49CEB1F1FD9F600E65FC5 /* SDLControlMessage.h */; }; - 5DA49CEE1F1FD9F600E65FC5 /* SDLControlMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DA49CEC1F1FD9F600E65FC5 /* SDLControlMessage.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 */; }; @@ -1345,6 +1350,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 /* SDLControlFramePayloadRPCStartServiceNak.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLControlFramePayloadRPCStartServiceNak.h; sourceTree = "<group>"; }; + 5D4631131F2136B60092EFDC /* SDLControlFramePayloadRPCStartServiceNak.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLControlFramePayloadRPCStartServiceNak.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; }; @@ -1946,10 +1958,8 @@ 5DA49CD31F1E890500E65FC5 /* bson_util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bson_util.h; sourceTree = "<group>"; }; 5DA49CDA1F1E890D00E65FC5 /* emhashmap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = emhashmap.c; sourceTree = "<group>"; }; 5DA49CDB1F1E890D00E65FC5 /* emhashmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = emhashmap.h; sourceTree = "<group>"; }; - 5DA49CE31F1EA83300E65FC5 /* SDLControlFrameStartService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLControlFrameStartService.h; sourceTree = "<group>"; }; - 5DA49CE41F1EA83300E65FC5 /* SDLControlFrameStartService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLControlFrameStartService.m; sourceTree = "<group>"; }; - 5DA49CEB1F1FD9F600E65FC5 /* SDLControlMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLControlMessage.h; sourceTree = "<group>"; }; - 5DA49CEC1F1FD9F600E65FC5 /* SDLControlMessage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLControlMessage.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>"; }; @@ -2593,6 +2603,27 @@ 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 */, + 5D4631121F2136B60092EFDC /* SDLControlFramePayloadRPCStartServiceNak.h */, + 5D4631131F2136B60092EFDC /* SDLControlFramePayloadRPCStartServiceNak.m */, + ); + name = "RPC Service"; + sourceTree = "<group>"; + }; 5D4832991A8EA27200252386 /* Storyboards */ = { isa = PBXGroup; children = ( @@ -3333,7 +3364,7 @@ 5D5935021A851D8700687FB9 /* Message */ = { isa = PBXGroup; children = ( - 5DA49CE21F1EA77900E65FC5 /* Control Frames */, + 5DA49CE21F1EA77900E65FC5 /* Control Frame Payloads */, 5D61FB5B1A84238B00846EE7 /* SDLProtocolMessage.h */, 5D61FB5C1A84238B00846EE7 /* SDLProtocolMessage.m */, 5D61FC0A1A84238C00846EE7 /* SDLV1ProtocolMessage.h */, @@ -3698,15 +3729,15 @@ name = emhashmap; sourceTree = "<group>"; }; - 5DA49CE21F1EA77900E65FC5 /* Control Frames */ = { + 5DA49CE21F1EA77900E65FC5 /* Control Frame Payloads */ = { isa = PBXGroup; children = ( - 5DA49CEB1F1FD9F600E65FC5 /* SDLControlMessage.h */, - 5DA49CEC1F1FD9F600E65FC5 /* SDLControlMessage.m */, - 5DA49CE31F1EA83300E65FC5 /* SDLControlFrameStartService.h */, - 5DA49CE41F1EA83300E65FC5 /* SDLControlFrameStartService.m */, + 5D46310E1F2135850092EFDC /* SDLControlFramePayloadConstants.h */, + 5D46310F1F2135850092EFDC /* SDLControlFramePayloadConstants.m */, + 5D46310D1F2133940092EFDC /* RPC Service */, + 5D4631051F2125F70092EFDC /* @protocols */, ); - name = "Control Frames"; + name = "Control Frame Payloads"; sourceTree = "<group>"; }; 5DAE06711BDEC68700F9B498 /* Developer API Tests */ = { @@ -4250,6 +4281,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 */, @@ -4259,10 +4291,10 @@ 5D61FE011A84238C00846EE7 /* SDLVehicleDataNotificationStatus.h in Headers */, 5D61FDC91A84238C00846EE7 /* SDLTextField.h in Headers */, 5D6F7A351BC5B9B60070BF37 /* SDLLockScreenViewController.h in Headers */, - 5DA49CED1F1FD9F600E65FC5 /* SDLControlMessage.h in Headers */, 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 */, @@ -4276,7 +4308,7 @@ 5D6F7A2B1BC45BF70070BF37 /* SDLRequestHandler.h in Headers */, 5D61FDB51A84238C00846EE7 /* SDLSyncMsgVersion.h in Headers */, 5DA102A41D4122C700C15826 /* NSMutableDictionary+SafeRemove.h in Headers */, - 5DA49CE51F1EA83300E65FC5 /* SDLControlFrameStartService.h in Headers */, + 5DA49CE51F1EA83300E65FC5 /* SDLControlFramePayloadRPCStartService.h in Headers */, 5D61FE031A84238C00846EE7 /* SDLVehicleDataResult.h in Headers */, 5D61FD911A84238C00846EE7 /* SDLShowConstantTBT.h in Headers */, 5D61FC331A84238C00846EE7 /* SDLAddSubMenuResponse.h in Headers */, @@ -4326,6 +4358,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 */, @@ -4335,6 +4368,7 @@ 5D82041E1BCD8E6100D0A41B /* SDLConfiguration.h in Headers */, 5D61FD4A1A84238C00846EE7 /* SDLProtocolMessageAssembler.h in Headers */, 5D61FD4C1A84238C00846EE7 /* SDLProtocolMessageDisassembler.h in Headers */, + 5D4631141F2136B60092EFDC /* SDLControlFramePayloadRPCStartServiceNak.h in Headers */, 5D61FD4E1A84238C00846EE7 /* SDLProtocolReceivedMessageRouter.h in Headers */, 97E26DEC1E807AD70074A3C7 /* SDLMutableDataQueue.h in Headers */, 5D61FDF71A84238C00846EE7 /* SDLV1ProtocolMessage.h in Headers */, @@ -4599,7 +4633,6 @@ 5D61FC971A84238C00846EE7 /* SDLECallConfirmationStatus.m in Sources */, 5D61FC4A1A84238C00846EE7 /* SDLAudioType.m in Sources */, 5D61FDE61A84238C00846EE7 /* SDLUnregisterAppInterfaceResponse.m in Sources */, - 5DA49CEE1F1FD9F600E65FC5 /* SDLControlMessage.m in Sources */, 5D61FC481A84238C00846EE7 /* SDLAudioStreamingState.m in Sources */, 5D61FCC81A84238C00846EE7 /* SDLIAPTransport.m in Sources */, 5D61FE101A84238C00846EE7 /* SDLVrHelpItem.m in Sources */, @@ -4607,6 +4640,7 @@ 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 */, @@ -4671,6 +4705,7 @@ 5D4D67B11D2FE2F900468B4A /* SDLResponseDispatcher.m in Sources */, 5D61FD801A84238C00846EE7 /* SDLSetAppIcon.m in Sources */, 5D61FD3C1A84238C00846EE7 /* SDLPresetBankCapabilities.m in Sources */, + 5D4631151F2136B60092EFDC /* SDLControlFramePayloadRPCStartServiceNak.m in Sources */, 5D61FDB81A84238C00846EE7 /* SDLSyncPData.m in Sources */, 5DA49CD61F1E890500E65FC5 /* bson_object.c in Sources */, 5D61FD221A84238C00846EE7 /* SDLOnVehicleData.m in Sources */, @@ -4763,6 +4798,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 */, @@ -4798,7 +4834,7 @@ 5D61FE021A84238C00846EE7 /* SDLVehicleDataNotificationStatus.m in Sources */, 5D61FDD81A84238C00846EE7 /* SDLTouchType.m in Sources */, 5D61FDD61A84238C00846EE7 /* SDLTouchEventCapabilities.m in Sources */, - 5DA49CE61F1EA83300E65FC5 /* SDLControlFrameStartService.m in Sources */, + 5DA49CE61F1EA83300E65FC5 /* SDLControlFramePayloadRPCStartService.m in Sources */, 5DA102A51D4122C700C15826 /* NSMutableDictionary+SafeRemove.m in Sources */, 5D61FCF11A84238C00846EE7 /* SDLLockScreenStatusManager.m in Sources */, 5D61FDAC1A84238C00846EE7 /* SDLStartTime.m in Sources */, diff --git a/SmartDeviceLink/SDLControlFramePayloadConstants.h b/SmartDeviceLink/SDLControlFramePayloadConstants.h new file mode 100644 index 000000000..e2e3b7fde --- /dev/null +++ b/SmartDeviceLink/SDLControlFramePayloadConstants.h @@ -0,0 +1,13 @@ +// +// SDLControlFramePayloadConstants.h +// SmartDeviceLink-iOS +// +// Created by Joel Fischer on 7/20/17. +// Copyright © 2017 smartdevicelink. All rights reserved. +// + +#import <Foundation/Foundation.h> + +extern char *const protocolVersionKey; +extern char *const hashIdKey; +extern char *const mtuKey; diff --git a/SmartDeviceLink/SDLControlFramePayloadConstants.m b/SmartDeviceLink/SDLControlFramePayloadConstants.m new file mode 100644 index 000000000..b8c22bf12 --- /dev/null +++ b/SmartDeviceLink/SDLControlFramePayloadConstants.m @@ -0,0 +1,13 @@ +// +// SDLControlFramePayloadConstants.m +// SmartDeviceLink-iOS +// +// Created by Joel Fischer on 7/20/17. +// Copyright © 2017 smartdevicelink. All rights reserved. +// + +#import "SDLControlFramePayloadConstants.h" + +char *const protocolVersionKey = "protocolVersion"; +char *const hashIdKey = "hashId"; +char *const mtuKey = "mtu"; diff --git a/SmartDeviceLink/SDLControlFramePayloadRPCStartService.h b/SmartDeviceLink/SDLControlFramePayloadRPCStartService.h new file mode 100644 index 000000000..f0be5259e --- /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> + +@property (copy, nonatomic, readonly) NSString *protocolVersion; + +- (instancetype)initWithMajorVersion:(NSUInteger)majorVersion minorVersion:(NSUInteger)minorVersion patchVersion:(NSUInteger)patchVersion; +- (instancetype)initWithData:(NSData *)data; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLControlFramePayloadRPCStartService.m b/SmartDeviceLink/SDLControlFramePayloadRPCStartService.m new file mode 100644 index 000000000..66a696492 --- /dev/null +++ b/SmartDeviceLink/SDLControlFramePayloadRPCStartService.m @@ -0,0 +1,68 @@ +// +// 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) NSString *protocolVersion; + +@end + + +@implementation SDLControlFramePayloadRPCStartService + +- (instancetype)initWithMajorVersion:(NSUInteger)majorVersion minorVersion:(NSUInteger)minorVersion patchVersion:(NSUInteger)patchVersion { + self = [super init]; + if (!self) return nil; + + _protocolVersion = [NSString stringWithFormat:@"%lu.%lu.%lu", majorVersion, minorVersion, patchVersion]; + + return self; +} + +- (instancetype)initWithData:(NSData *)data { + self = [super init]; + if (!self) return nil; + + [self sdl_parse:data]; + + return self; +} + +- (NSData *)data { + BsonObject payloadObject; + bson_object_initialize_default(&payloadObject); + + bson_object_put_string(&payloadObject, protocolVersionKey, (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.protocolVersion = [NSString stringWithUTF8String:bson_object_get_string(&payloadObject, protocolVersionKey)]; + + bson_object_deinitialize(&payloadObject); +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLControlFramePayloadRPCStartServiceAck.h b/SmartDeviceLink/SDLControlFramePayloadRPCStartServiceAck.h new file mode 100644 index 000000000..529acf005 --- /dev/null +++ b/SmartDeviceLink/SDLControlFramePayloadRPCStartServiceAck.h @@ -0,0 +1,23 @@ +// +// 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> + +@property (assign, nonatomic, readonly) int32_t hashId; +@property (assign, nonatomic, readonly) int64_t mtu; +@property (copy, nonatomic, readonly) NSString *protocolVersion; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLControlFramePayloadRPCStartServiceAck.m b/SmartDeviceLink/SDLControlFramePayloadRPCStartServiceAck.m new file mode 100644 index 000000000..8e44bcb06 --- /dev/null +++ b/SmartDeviceLink/SDLControlFramePayloadRPCStartServiceAck.m @@ -0,0 +1,76 @@ +// +// 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) NSString *protocolVersion; + +@end + + +@implementation SDLControlFramePayloadRPCStartServiceAck + +- (instancetype)initWithHashId:(int32_t)hashId mtu:(int64_t)mtu majorVersion:(NSUInteger)major minorVersion:(NSUInteger)minor patchVersion:(NSUInteger)patch { + self = [super init]; + if (!self) return nil; + + _hashId = hashId; + _mtu = mtu; + _protocolVersion = [NSString stringWithFormat:@"%lu.%lu.%lu", major, minor, patch]; + + return self; +} + +- (instancetype)initWithData:(NSData *)data { + self = [super init]; + if (!self) return nil; + + [self sdl_parse:data]; + + return self; +} + +- (NSData *)data { + BsonObject payloadObject; + bson_object_initialize_default(&payloadObject); + + bson_object_put_int32(&payloadObject, hashIdKey, self.hashId); + bson_object_put_int64(&payloadObject, mtuKey, self.mtu); + bson_object_put_string(&payloadObject, protocolVersionKey, (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, hashIdKey); + self.mtu = bson_object_get_int64(&payloadObject, mtuKey); + self.protocolVersion = [NSString stringWithUTF8String:bson_object_get_string(&payloadObject, protocolVersionKey)]; + + bson_object_deinitialize(&payloadObject); +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLControlFramePayloadRPCStartServiceNak.h b/SmartDeviceLink/SDLControlFramePayloadRPCStartServiceNak.h new file mode 100644 index 000000000..0929dfa9e --- /dev/null +++ b/SmartDeviceLink/SDLControlFramePayloadRPCStartServiceNak.h @@ -0,0 +1,22 @@ +// +// SDLControlFramePayloadRPCStartServiceNak.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 SDLControlFramePayloadRPCStartServiceNak : NSObject <SDLControlFramePayloadType> + +@property (copy, nonatomic, readonly) NSArray<NSString *> *rejectedParams; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLControlFramePayloadRPCStartServiceNak.m b/SmartDeviceLink/SDLControlFramePayloadRPCStartServiceNak.m new file mode 100644 index 000000000..238553f4c --- /dev/null +++ b/SmartDeviceLink/SDLControlFramePayloadRPCStartServiceNak.m @@ -0,0 +1,27 @@ +// +// SDLControlFramePayloadRPCStartServiceNak.m +// SmartDeviceLink-iOS +// +// Created by Joel Fischer on 7/20/17. +// Copyright © 2017 smartdevicelink. All rights reserved. +// + +#import "SDLControlFramePayloadRPCStartServiceNak.h" + +#import "bson_object.h" +#import "SDLControlFramePayloadConstants.h" + + +NS_ASSUME_NONNULL_BEGIN + +@interface SDLControlFramePayloadRPCStartServiceNak () + +@property (copy, nonatomic, readwrite) NSArray<NSString *> *rejectedParams; + +@end + +@implementation SDLControlFramePayloadRPCStartServiceNak + +@end + +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLControlFramePayloadType.h b/SmartDeviceLink/SDLControlFramePayloadType.h new file mode 100644 index 000000000..f7e7d6827 --- /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> + +- (NSData *)data; +- (instancetype)initWithData:(NSData *)data;; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLControlFrameStartService.h b/SmartDeviceLink/SDLControlFrameStartService.h deleted file mode 100644 index d3423a23f..000000000 --- a/SmartDeviceLink/SDLControlFrameStartService.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// SDLControlFrameStartService.h -// SmartDeviceLink-iOS -// -// Created by Joel Fischer on 7/18/17. -// Copyright © 2017 smartdevicelink. All rights reserved. -// - -#import <SmartDeviceLink/SmartDeviceLink.h> - -@interface SDLControlFrameStartService : SDLProtocolMessage - -@property (copy, nonatomic, readonly) NSString *versionNumber; - -- (instancetype)initWithMajorVersion:(int32_t)majorVersion minorVersion:(int32_t)minorVersion patchVersion:(int32_t)patchVersion; - -@end diff --git a/SmartDeviceLink/SDLControlFrameStartService.m b/SmartDeviceLink/SDLControlFrameStartService.m deleted file mode 100644 index 808ea6d11..000000000 --- a/SmartDeviceLink/SDLControlFrameStartService.m +++ /dev/null @@ -1,53 +0,0 @@ -// -// SDLControlFrameStartService.m -// SmartDeviceLink-iOS -// -// Created by Joel Fischer on 7/18/17. -// Copyright © 2017 smartdevicelink. All rights reserved. -// - -#import "SDLControlFrameStartService.h" - -#import "bson_object.h" - -char *const versionKey = "protocolVersion"; - -@interface SDLControlFrameStartService () - -@property (copy, nonatomic, readwrite) NSString *versionNumber; - -@end - - -@implementation SDLControlFrameStartService - -- (instancetype)initWithMajorVersion:(int32_t)majorVersion minorVersion:(int32_t)minorVersion patchVersion:(int32_t)patchVersion { - self = [super init]; - if (!self) return nil; - - _versionNumber = [NSString stringWithFormat:@"%d.%d.%d", majorVersion, minorVersion, patchVersion]; - - return self; -} - -- (NSData *)payload { - BsonObject payloadObject; - bson_object_initialize_default(&payloadObject); - - bson_object_put_string(&payloadObject, versionKey, (char *)self.versionNumber.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)setPayload:(NSData *)payload { - BsonObject payloadObject = bson_object_from_bytes((BytePtr)payload.bytes); - - self.versionNumber = [NSString stringWithUTF8String:bson_object_get_string(&payloadObject, versionKey)]; -} - -@end diff --git a/SmartDeviceLink/SDLControlMessage.h b/SmartDeviceLink/SDLControlMessage.h deleted file mode 100644 index def843584..000000000 --- a/SmartDeviceLink/SDLControlMessage.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// SDLControlMessage.h -// SmartDeviceLink-iOS -// -// Created by Joel Fischer on 7/19/17. -// Copyright © 2017 smartdevicelink. All rights reserved. -// - -#import <SmartDeviceLink/SmartDeviceLink.h> - -@interface SDLControlMessage : SDLProtocolMessage - -@end diff --git a/SmartDeviceLink/SDLControlMessage.m b/SmartDeviceLink/SDLControlMessage.m deleted file mode 100644 index 9927c2582..000000000 --- a/SmartDeviceLink/SDLControlMessage.m +++ /dev/null @@ -1,13 +0,0 @@ -// -// SDLControlMessage.m -// SmartDeviceLink-iOS -// -// Created by Joel Fischer on 7/19/17. -// Copyright © 2017 smartdevicelink. All rights reserved. -// - -#import "SDLControlMessage.h" - -@implementation SDLControlMessage - -@end diff --git a/SmartDeviceLink/SDLGlobals.h b/SmartDeviceLink/SDLGlobals.h index fced9d4e9..475552ddc 100644 --- a/SmartDeviceLink/SDLGlobals.h +++ b/SmartDeviceLink/SDLGlobals.h @@ -11,10 +11,14 @@ #define SDL_SYSTEM_VERSION_LESS_THAN(version) ([[[UIDevice currentDevice] systemVersion] compare:version options:NSNumericSearch] == NSOrderedAscending) #define BLOCK_RETURN return +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 maxMTUSize; @property (assign, nonatomic) NSUInteger maxHeadUnitVersion; + (instancetype)globals; diff --git a/SmartDeviceLink/SDLGlobals.m b/SmartDeviceLink/SDLGlobals.m index 7f122c01e..61737b613 100644 --- a/SmartDeviceLink/SDLGlobals.m +++ b/SmartDeviceLink/SDLGlobals.m @@ -9,10 +9,14 @@ #import "SDLGlobals.h" static const NSUInteger maxProxyVersion = 4; +NSUInteger const SDLDefaultMTUSize = UINT32_MAX; +NSUInteger const SDLV1MTUSize = 1024; +NSUInteger const SDLV3MTUSize = 131024; @interface SDLGlobals () +@property (assign, nonatomic) NSUInteger backingMaxMTUSize; @property (assign, nonatomic) NSUInteger protocolVersion; @end @@ -38,6 +42,7 @@ static const NSUInteger maxProxyVersion = 4; _protocolVersion = 1; _maxHeadUnitVersion = 0; + _backingMaxMTUSize = SDLDefaultMTUSize; return self; } @@ -52,26 +57,39 @@ static const NSUInteger maxProxyVersion = 4; } - (NSUInteger)maxMTUSize { + // VERSION DEPENDENT CODE switch (self.protocolVersion) { 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: { // 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; + return SDLV1MTUSize; } else { - return 131084; + return SDLV3MTUSize; } } break; + case 5: { + // V5 has a negotiated MTU size from the head unit + if (self.backingMaxMTUSize == SDLDefaultMTUSize) { + return SDLV3MTUSize; + } else { + return self.backingMaxMTUSize; + } + } default: { - NSAssert(NO, @"Unknown version number: %@", @(self.protocolVersion)); + NSAssert(NO, @"Unknown version number for MTU Size: %@", @(self.protocolVersion)); return 0; } } } +- (void)setMaxMTUSize:(NSUInteger)maxMTUSize { + _backingMaxMTUSize = maxMTUSize; +} + @end |