diff options
author | Muller, Alexander (A.) <amulle19@ford.com> | 2017-01-12 11:08:08 -0800 |
---|---|---|
committer | Muller, Alexander (A.) <amulle19@ford.com> | 2017-01-12 11:08:08 -0800 |
commit | dea2d0055db1941eae3b385309dd734f54a0d203 (patch) | |
tree | f4981e69086453596b55238a8828bd952730232d | |
parent | 1f5f90d1409842bc9a0b1579f4988fe0ad94f36e (diff) | |
download | sdl_ios-feature/sdl_0020_request_factory_removal.tar.gz |
Removed SDLRPCRequestFactory from project.feature/sdl_0020_request_factory_removal
-rw-r--r-- | SmartDeviceLink-iOS.podspec | 1 | ||||
-rw-r--r-- | SmartDeviceLink-iOS.xcodeproj/project.pbxproj | 28 | ||||
-rw-r--r-- | SmartDeviceLink/SDLProxy.h | 1 | ||||
-rw-r--r-- | SmartDeviceLink/SDLRPCRequestFactory.h | 230 | ||||
-rw-r--r-- | SmartDeviceLink/SDLRPCRequestFactory.m | 752 | ||||
-rw-r--r-- | SmartDeviceLink/SmartDeviceLink.h | 3 | ||||
-rw-r--r-- | SmartDeviceLinkTests/RPCSpecs/FactorySpecs/SDLRPCRequestFactorySpec.m | 1022 |
7 files changed, 0 insertions, 2037 deletions
diff --git a/SmartDeviceLink-iOS.podspec b/SmartDeviceLink-iOS.podspec index 07b8cc899..dbbc6d037 100644 --- a/SmartDeviceLink-iOS.podspec +++ b/SmartDeviceLink-iOS.podspec @@ -42,7 +42,6 @@ s.public_header_files = [ 'SmartDeviceLink/SDLRPCRequest.h', 'SmartDeviceLink/SDLRPCResponse.h', 'SmartDeviceLink/SDLRPCStruct.h', -'SmartDeviceLink/SDLRPCRequestFactory.h', 'SmartDeviceLink/SDLAddCommand.h', 'SmartDeviceLink/SDLAddSubMenu.h', 'SmartDeviceLink/SDLAlert.h', diff --git a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj index c19ea0aa1..a4dc0ce5b 100644 --- a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj +++ b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj @@ -74,7 +74,6 @@ 162E830B1A9BDE8B00906325 /* SDLVrCapabilitiesSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 162E82231A9BDE8A00906325 /* SDLVrCapabilitiesSpec.m */; }; 162E830C1A9BDE8B00906325 /* SDLWarningLightStatusSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 162E82241A9BDE8A00906325 /* SDLWarningLightStatusSpec.m */; }; 162E830D1A9BDE8B00906325 /* SDLWiperStatusSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 162E82251A9BDE8A00906325 /* SDLWiperStatusSpec.m */; }; - 162E830E1A9BDE8B00906325 /* SDLRPCRequestFactorySpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 162E82271A9BDE8A00906325 /* SDLRPCRequestFactorySpec.m */; }; 162E830F1A9BDE8B00906325 /* SDLOnAppInterfaceUnregisteredSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 162E82291A9BDE8A00906325 /* SDLOnAppInterfaceUnregisteredSpec.m */; }; 162E83101A9BDE8B00906325 /* SDLOnAudioPassThruSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 162E822A1A9BDE8A00906325 /* SDLOnAudioPassThruSpec.m */; }; 162E83111A9BDE8B00906325 /* SDLOnButtonEventSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 162E822B1A9BDE8A00906325 /* SDLOnButtonEventSpec.m */; }; @@ -611,8 +610,6 @@ 5D61FD701A84238C00846EE7 /* SDLRPCPayload.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D61FB831A84238B00846EE7 /* SDLRPCPayload.m */; }; 5D61FD711A84238C00846EE7 /* SDLRPCRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D61FB841A84238B00846EE7 /* SDLRPCRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5D61FD721A84238C00846EE7 /* SDLRPCRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D61FB851A84238B00846EE7 /* SDLRPCRequest.m */; }; - 5D61FD731A84238C00846EE7 /* SDLRPCRequestFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D61FB861A84238B00846EE7 /* SDLRPCRequestFactory.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5D61FD741A84238C00846EE7 /* SDLRPCRequestFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D61FB871A84238B00846EE7 /* SDLRPCRequestFactory.m */; }; 5D61FD751A84238C00846EE7 /* SDLRPCResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D61FB881A84238B00846EE7 /* SDLRPCResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5D61FD761A84238C00846EE7 /* SDLRPCResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D61FB891A84238B00846EE7 /* SDLRPCResponse.m */; }; 5D61FD771A84238C00846EE7 /* SDLSamplingRate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D61FB8A1A84238B00846EE7 /* SDLSamplingRate.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -1086,7 +1083,6 @@ 162E82231A9BDE8A00906325 /* SDLVrCapabilitiesSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLVrCapabilitiesSpec.m; sourceTree = "<group>"; }; 162E82241A9BDE8A00906325 /* SDLWarningLightStatusSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLWarningLightStatusSpec.m; sourceTree = "<group>"; }; 162E82251A9BDE8A00906325 /* SDLWiperStatusSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLWiperStatusSpec.m; sourceTree = "<group>"; }; - 162E82271A9BDE8A00906325 /* SDLRPCRequestFactorySpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLRPCRequestFactorySpec.m; sourceTree = "<group>"; }; 162E82291A9BDE8A00906325 /* SDLOnAppInterfaceUnregisteredSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLOnAppInterfaceUnregisteredSpec.m; sourceTree = "<group>"; }; 162E822A1A9BDE8A00906325 /* SDLOnAudioPassThruSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLOnAudioPassThruSpec.m; sourceTree = "<group>"; }; 162E822B1A9BDE8A00906325 /* SDLOnButtonEventSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLOnButtonEventSpec.m; sourceTree = "<group>"; }; @@ -1649,8 +1645,6 @@ 5D61FB831A84238B00846EE7 /* SDLRPCPayload.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLRPCPayload.m; sourceTree = "<group>"; }; 5D61FB841A84238B00846EE7 /* SDLRPCRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLRPCRequest.h; sourceTree = "<group>"; }; 5D61FB851A84238B00846EE7 /* SDLRPCRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLRPCRequest.m; sourceTree = "<group>"; }; - 5D61FB861A84238B00846EE7 /* SDLRPCRequestFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLRPCRequestFactory.h; sourceTree = "<group>"; }; - 5D61FB871A84238B00846EE7 /* SDLRPCRequestFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLRPCRequestFactory.m; sourceTree = "<group>"; }; 5D61FB881A84238B00846EE7 /* SDLRPCResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLRPCResponse.h; sourceTree = "<group>"; }; 5D61FB891A84238B00846EE7 /* SDLRPCResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLRPCResponse.m; sourceTree = "<group>"; }; 5D61FB8A1A84238B00846EE7 /* SDLSamplingRate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLSamplingRate.h; sourceTree = "<group>"; }; @@ -2038,7 +2032,6 @@ isa = PBXGroup; children = ( 162E81E11A9BDE8A00906325 /* EnumSpecs */, - 162E82261A9BDE8A00906325 /* FactorySpecs */, 162E82281A9BDE8A00906325 /* NotificationSpecs */, 162E823B1A9BDE8A00906325 /* PayloadSpecs */, 162E823D1A9BDE8A00906325 /* RequestSpecs */, @@ -2125,14 +2118,6 @@ path = EnumSpecs; sourceTree = "<group>"; }; - 162E82261A9BDE8A00906325 /* FactorySpecs */ = { - isa = PBXGroup; - children = ( - 162E82271A9BDE8A00906325 /* SDLRPCRequestFactorySpec.m */, - ); - path = FactorySpecs; - sourceTree = "<group>"; - }; 162E82281A9BDE8A00906325 /* NotificationSpecs */ = { isa = PBXGroup; children = ( @@ -2595,7 +2580,6 @@ children = ( 5D5934FF1A851B8400687FB9 /* Superclasses */, 5D5935041A851E1A00687FB9 /* Payload */, - 5D5935031A851E1100687FB9 /* Factories */, 5D5934F11A85162800687FB9 /* Requests */, 5D5934F21A85163200687FB9 /* Responses */, 5D5934F31A85164500687FB9 /* Structs */, @@ -3243,15 +3227,6 @@ name = Message; sourceTree = "<group>"; }; - 5D5935031A851E1100687FB9 /* Factories */ = { - isa = PBXGroup; - children = ( - 5D61FB861A84238B00846EE7 /* SDLRPCRequestFactory.h */, - 5D61FB871A84238B00846EE7 /* SDLRPCRequestFactory.m */, - ); - name = Factories; - sourceTree = "<group>"; - }; 5D5935041A851E1A00687FB9 /* Payload */ = { isa = PBXGroup; children = ( @@ -4074,7 +4049,6 @@ 5D61FCF21A84238C00846EE7 /* SDLLockScreenStatus.h in Headers */, 5D61FCD31A84238C00846EE7 /* SDLImageResolution.h in Headers */, 5D61FD541A84238C00846EE7 /* SDLProxyListener.h in Headers */, - 5D61FD731A84238C00846EE7 /* SDLRPCRequestFactory.h in Headers */, 5D61FC5D1A84238C00846EE7 /* SDLChangeRegistrationResponse.h in Headers */, 5D61FDCD1A84238C00846EE7 /* SDLTimerMode.h in Headers */, E9C32B961AB20BA200F283AF /* SDLTimer.h in Headers */, @@ -4665,7 +4639,6 @@ 5D61FD3A1A84238C00846EE7 /* SDLPrerecordedSpeech.m in Sources */, 5D61FCA11A84238C00846EE7 /* SDLEncodedSyncPDataResponse.m in Sources */, 5D61FD401A84238C00846EE7 /* SDLPrioritizedObjectCollection.m in Sources */, - 5D61FD741A84238C00846EE7 /* SDLRPCRequestFactory.m in Sources */, 5D61FDC61A84238C00846EE7 /* SDLTCPTransport.m in Sources */, 5D61FE0E1A84238C00846EE7 /* SDLVRCapabilities.m in Sources */, 5D61FDC21A84238C00846EE7 /* SDLSystemRequestResponse.m in Sources */, @@ -4736,7 +4709,6 @@ 162E82E31A9BDE8B00906325 /* SDLIgnitionStatusSpec.m in Sources */, 162E83511A9BDE8B00906325 /* SDLDeleteInteractionChoiceSetResponseSpec.m in Sources */, DA9F7EB41DCC086400ACAE48 /* SDLDateTimeSpec.m in Sources */, - 162E830E1A9BDE8B00906325 /* SDLRPCRequestFactorySpec.m in Sources */, 162E82E41A9BDE8B00906325 /* SDLImageFieldNameSpec.m in Sources */, 162E82ED1A9BDE8B00906325 /* SDLMaintenanceModeStatusSpec.m in Sources */, 5DB92D2D1AC4A34F00C15BB0 /* SDLPrioritizedObjectCollectionSpec.m in Sources */, diff --git a/SmartDeviceLink/SDLProxy.h b/SmartDeviceLink/SDLProxy.h index 865cf0b12..67f402f62 100644 --- a/SmartDeviceLink/SDLProxy.h +++ b/SmartDeviceLink/SDLProxy.h @@ -6,7 +6,6 @@ @class SDLProtocol; @class SDLPutFile; @class SDLRPCMessage; -@class SDLRPCRequestFactory; @class SDLStreamingMediaManager; @class SDLTimer; diff --git a/SmartDeviceLink/SDLRPCRequestFactory.h b/SmartDeviceLink/SDLRPCRequestFactory.h deleted file mode 100644 index ce3aebda1..000000000 --- a/SmartDeviceLink/SDLRPCRequestFactory.h +++ /dev/null @@ -1,230 +0,0 @@ -// SDLRPCRequestFactory.h -// - -#import <Foundation/Foundation.h> - -#import "SDLAppHMIType.h" -#import "SDLAudioType.h" -#import "SDLBitsPerSample.h" -#import "SDLButtonName.h" -#import "SDLFileType.h" -#import "SDLGlobalProperty.h" -#import "SDLImageType.h" -#import "SDLInteractionMode.h" -#import "SDLLanguage.h" -#import "SDLNotificationConstants.h" -#import "SDLSamplingRate.h" -#import "SDLSoftButtonType.h" -#import "SDLSystemAction.h" -#import "SDLTextAlignment.h" -#import "SDLUpdateMode.h" -#import "SDLVRHelpItem.h" - -@class SDLAddCommand; -@class SDLAddSubMenu; -@class SDLAlert; -@class SDLAlertManeuver; -@class SDLChangeRegistration; -@class SDLChoice; -@class SDLCreateInteractionChoiceSet; -@class SDLDeleteCommand; -@class SDLDeleteFile; -@class SDLDeleteInteractionChoiceSet; -@class SDLDeleteSubMenu; -@class SDLDialNumber; -@class SDLEndAudioPassThru; -@class SDLGetDTCs; -@class SDLGetVehicleData; -@class SDLImage; -@class SDLListFiles; -@class SDLPerformAudioPassThru; -@class SDLPerformInteraction; -@class SDLPutFile; -@class SDLReadDID; -@class SDLRegisterAppInterface; -@class SDLResetGlobalProperties; -@class SDLScrollableMessage; -@class SDLSendLocation; -@class SDLSetAppIcon; -@class SDLSetDisplayLayout; -@class SDLSetGlobalProperties; -@class SDLSetMediaClockTimer; -@class SDLShow; -@class SDLShowConstantTBT; -@class SDLSlider; -@class SDLSoftButton; -@class SDLSpeak; -@class SDLSubscribeButton; -@class SDLSubscribeVehicleData; -@class SDLTTSChunk; -@class SDLTurn; -@class SDLUnregisterAppInterface; -@class SDLUnsubscribeButton; -@class SDLUnsubscribeVehicleData; -@class SDLUpdateTurnList; - - -__deprecated_msg("use class's initializers instead") @interface SDLRPCRequestFactory : NSObject { -} - -//***** AddCommand ***** -+ (SDLAddCommand *)buildAddCommandWithID:(NSNumber<SDLInt> *)cmdID menuName:(NSString *)menuName parentID:(NSNumber<SDLInt> *)parentID position:(NSNumber<SDLInt> *)position vrCommands:(NSArray<NSString *> *)vrCommands iconValue:(NSString *)iconValue iconType:(SDLImageType)iconType correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLAddCommand's buildAddCommandWithID:vrCommands:menuName:parentID:position:iconValue:iconType:handler: instead"); -; - -+ (SDLAddCommand *)buildAddCommandWithID:(NSNumber<SDLInt> *)cmdID menuName:(NSString *)menuName vrCommands:(NSArray<NSString *> *)vrCommands correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLAddCommands's initWithId:vrCommands:menuName:handler: instead"); - -+ (SDLAddCommand *)buildAddCommandWithID:(NSNumber<SDLInt> *)cmdID vrCommands:(NSArray<NSString *> *)vrCommands correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use buildAddCommandWithID:vrCommands:handler: with SDLManager instead"); - -+ (SDLAddCommand *)buildAddCommandWithID:(NSNumber<SDLInt> *)cmdID menuName:(NSString *)menuName parentID:(NSNumber<SDLInt> *)parentID position:(NSNumber<SDLInt> *)position vrCommands:(NSArray<NSString *> *)vrCommands iconValue:(NSString *)iconValue iconType:(SDLImageType)iconType handler:(SDLRPCNotificationHandler)handler __deprecated_msg("use SDLAddCommand's initWithId:vrCommands:menuName:parentId:position:iconValue:iconType:handler: instead"); - -+ (SDLAddCommand *)buildAddCommandWithID:(NSNumber<SDLInt> *)cmdID menuName:(NSString *)menuName vrCommands:(NSArray<NSString *> *)vrCommands handler:(SDLRPCNotificationHandler)handler __deprecated_msg("use SDLAddCommand's initWithId:vrCommands:menuName:handler: instead"); - -+ (SDLAddCommand *)buildAddCommandWithID:(NSNumber<SDLInt> *)cmdID vrCommands:(NSArray<NSString *> *)vrCommands handler:(SDLRPCNotificationHandler)handler __deprecated_msg("use SDLAddCommand's initWithId:vrCommands:handler: instead"); -//***** - - -//***** AddSubMenu ***** -+ (SDLAddSubMenu *)buildAddSubMenuWithID:(NSNumber<SDLInt> *)menuID menuName:(NSString *)menuName position:(NSNumber<SDLInt> *)position correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLAddSubMenu's initWithId:menuName:position: instead"); - -+ (SDLAddSubMenu *)buildAddSubMenuWithID:(NSNumber<SDLInt> *)menuID menuName:(NSString *)menuName correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLAddSubMenu's initWithId:menuName: instead"); -//***** - - -//***** Alert ***** -+ (SDLAlert *)buildAlertWithTTS:(NSString *)ttsText alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 playTone:(NSNumber<SDLBool> *)playTone duration:(NSNumber<SDLInt> *)duration correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLAlert's initWithTTS:alertText1:alertText2:alertText3:playTone:duration: instead"); - -+ (SDLAlert *)buildAlertWithTTS:(NSString *)ttsText alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 playTone:(NSNumber<SDLBool> *)playTone duration:(NSNumber<SDLInt> *)duration correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLAlert's initWithTTS:alertText1:alertText2:playTone:duration: instead"); - -+ (SDLAlert *)buildAlertWithTTS:(NSString *)ttsText playTone:(NSNumber<SDLBool> *)playTone correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLAlert's initWithTTS:playTone:duration: instead"); - -//*** -+ (SDLAlert *)buildAlertWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 playTone:(NSNumber<SDLBool> *)playTone duration:(NSNumber<SDLInt> *)duration softButtons:(NSArray<SDLSoftButton *> *)softButtons correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLAlert's initWithTTSChunks:alertText1:alertText2:alertText3:playTone:duration:softButtons: instead"); - -+ (SDLAlert *)buildAlertWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks playTone:(NSNumber<SDLBool> *)playTone correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLAlert's initWithTTSChunks:playTone: instead"); - -//*** -+ (SDLAlert *)buildAlertWithAlertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 duration:(NSNumber<SDLInt> *)duration softButtons:(NSArray<SDLSoftButton *> *)softButtons correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLAlert's initWithAlertText1:alertText2:alertText3:duration:softButtons: instead"); - -+ (SDLAlert *)buildAlertWithAlertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 duration:(NSNumber<SDLInt> *)duration correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLAlert's initWithAlertText1:alertText2:alertText3:duration: instead"); - -+ (SDLAlert *)buildAlertWithAlertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 duration:(NSNumber<SDLInt> *)duration correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLAlert's initWithAlertText1:alertText2:duration: instead"); -//***** - -+ (SDLAlertManeuver *)buildAlertManeuverwithTTSchunks:(NSMutableArray<SDLTTSChunk *> *)ttsChunks softButtons:(NSMutableArray<SDLSoftButton *> *)softButtons correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLAlertManeuver's initWithTTSChunks:softButtons: instead"); - -+ (SDLChangeRegistration *)buildChangeRegistrationWithLanguage:(SDLLanguage)language hmiDisplayLanguage:(SDLLanguage)hmiDisplayLanguage correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLChangeRegistration's initWithLanguage:hmiDisplayLanguage: instead"); - -+ (SDLCreateInteractionChoiceSet *)buildCreateInteractionChoiceSetWithID:(NSNumber<SDLInt> *)interactionChoiceSetID choiceSet:(NSArray<SDLChoice *> *)choices correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLCreateInteractionChoiceSet's initWithId:choiceSet: instead"); - -+ (SDLDeleteCommand *)buildDeleteCommandWithID:(NSNumber<SDLInt> *)cmdID correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLDeleteCommand's initWithId: instead"); - -+ (SDLDeleteFile *)buildDeleteFileWithName:(NSString *)syncFileName correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLDeleteFile's initWithFileName: instead"); - -+ (SDLDialNumber *)buildDialNumberWithNumber:(NSString *)phoneNumber __deprecated_msg("use SDLDialNumber's initWithNumber: instead"); - -+ (SDLListFiles *)buildListFilesWithCorrelationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLListFiles's default initializer instead"); - -+ (SDLDeleteInteractionChoiceSet *)buildDeleteInteractionChoiceSetWithID:(NSNumber<SDLInt> *)interactionChoiceSetID correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLDeleteInteractionChoiceSet's initWithId: instead"); - -+ (SDLDeleteSubMenu *)buildDeleteSubMenuWithID:(NSNumber<SDLInt> *)menuID correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLDeleteSubMenu's initWithId: instead"); - -+ (SDLEndAudioPassThru *)buildEndAudioPassThruWithCorrelationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLEndAudioPassThru's default initializer instead"); - -+ (SDLGetDTCs *)buildGetDTCsWithECUName:(NSNumber<SDLInt> *)ecuName correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLGetDTCs's initWithECUName: instead"); - -+ (SDLGetVehicleData *)buildGetVehicleDataWithGPS:(NSNumber<SDLBool> *)gps speed:(NSNumber<SDLBool> *)speed rpm:(NSNumber<SDLBool> *)rpm fuelLevel:(NSNumber<SDLBool> *)fuelLevel fuelLevelState:(NSNumber<SDLBool> *)fuelLevelState instantFuelConsumption:(NSNumber<SDLBool> *)instantFuelConsumption externalTemperature:(NSNumber<SDLBool> *)externalTemperature vin:(NSNumber<SDLBool> *)vin prndl:(NSNumber<SDLBool> *)prndl tirePressure:(NSNumber<SDLBool> *)tirePressure odometer:(NSNumber<SDLBool> *)odometer beltStatus:(NSNumber<SDLBool> *)beltStatus bodyInformation:(NSNumber<SDLBool> *)bodyInformation deviceStatus:(NSNumber<SDLBool> *)deviceStatus driverBraking:(NSNumber<SDLBool> *)driverBraking wiperStatus:(NSNumber<SDLBool> *)wiperStatus headLampStatus:(NSNumber<SDLBool> *)headLampStatus engineTorque:(NSNumber<SDLBool> *)engineTorque accPedalPosition:(NSNumber<SDLBool> *)accPedalPosition steeringWheelAngle:(NSNumber<SDLBool> *)steeringWheelAngle correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLGetVehicleData's initWithAccelerationPedalPosition:airbagStatus:beltStatus:bodyInformation:clusterModeStatus:deviceStatus:driverBraking:eCallInfo:emergencyEvent:engineTorque:externalTemperature:fuelLevel:fuelLevelState:gps:headLampStatus:instantFuelConsumption:myKey:odometer:prndl:rpm:speed:steeringWheelAngle:tirePressure:vin:wiperStatus: instead"); - -+ (SDLPerformAudioPassThru *)buildPerformAudioPassThruWithInitialPrompt:(NSString *)initialPrompt audioPassThruDisplayText1:(NSString *)audioPassThruDisplayText1 audioPassThruDisplayText2:(NSString *)audioPassThruDisplayText2 samplingRate:(SDLSamplingRate)samplingRate maxDuration:(NSNumber<SDLInt> *)maxDuration bitsPerSample:(SDLBitsPerSample)bitsPerSample audioType:(SDLAudioType)audioType muteAudio:(NSNumber<SDLBool> *)muteAudio correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLPerformAudioPassThru's initWithInitialPrompt:audioPassThruDisplayText1:audioPassThruDisplayText2:samplingRate:bitsPerSample:audioType:maxDuration:muteAudio: instead"); - - -//***** PerformInteraction ***** -+ (SDLPerformInteraction *)buildPerformInteractionWithInitialChunks:(NSArray<SDLTTSChunk *> *)initialChunks initialText:(NSString *)initialText interactionChoiceSetIDList:(NSArray<NSNumber<SDLInt> *> *)interactionChoiceSetIDList helpChunks:(NSArray<SDLTTSChunk *> *)helpChunks timeoutChunks:(NSArray<SDLTTSChunk *> *)timeoutChunks interactionMode:(SDLInteractionMode)interactionMode timeout:(NSNumber<SDLInt> *)timeout vrHelp:(NSArray<SDLVRHelpItem *> *)vrHelp correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLPerformInteraction's initWithInitialChunks:initialText:interactionChoiceSetIDList:helpChunks:timeoutChunks:interactionMode:timeout:vrHelp: instead"); - -//*** -+ (SDLPerformInteraction *)buildPerformInteractionWithInitialPrompt:(NSString *)initialPrompt initialText:(NSString *)initialText interactionChoiceSetIDList:(NSArray<NSNumber<SDLInt> *> *)interactionChoiceSetIDList helpPrompt:(NSString *)helpPrompt timeoutPrompt:(NSString *)timeoutPrompt interactionMode:(SDLInteractionMode)interactionMode timeout:(NSNumber<SDLInt> *)timeout vrHelp:(NSArray<SDLVRHelpItem *> *)vrHelp correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLPerformInteraction's initWithInitialPrompt:initialText:interactionChoiceSetIDList:helpPrompt:timeoutPrompt:interactionMode:timeout:vrHelp: instead"); - -+ (SDLPerformInteraction *)buildPerformInteractionWithInitialPrompt:(NSString *)initialPrompt initialText:(NSString *)initialText interactionChoiceSetID:(NSNumber<SDLInt> *)interactionChoiceSetID vrHelp:(NSArray<SDLVRHelpItem *> *)vrHelp correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLPerformInteraction's initWithInitialPrompt:initialText:interactionChoiceSetID:vrHelp: instead"); - -+ (SDLPerformInteraction *)buildPerformInteractionWithInitialPrompt:(NSString *)initialPrompt initialText:(NSString *)initialText interactionChoiceSetIDList:(NSArray<NSNumber<SDLInt> *> *)interactionChoiceSetIDList helpPrompt:(NSString *)helpPrompt timeoutPrompt:(NSString *)timeoutPrompt interactionMode:(SDLInteractionMode)interactionMode timeout:(NSNumber<SDLInt> *)timeout correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLPerformInteraction's initWithInitialPrompt:initialText:interactionChoiceSetIDList:helpPrompt:timeoutPrompt:interactionMode:timeout: instead"); - -+ (SDLPerformInteraction *)buildPerformInteractionWithInitialPrompt:(NSString *)initialPrompt initialText:(NSString *)initialText interactionChoiceSetID:(NSNumber<SDLInt> *)interactionChoiceSetID correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLPerformInteraction's initWithInitialPrompt:initialText:interactionChoiceSetID: instead"); -//***** - -+ (SDLPutFile *)buildPutFileWithFileName:(NSString *)fileName fileType:(SDLFileType)fileType persistentFile:(NSNumber<SDLBool> *)persistentFile correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLPutFile's initWithFileName:fileType: instead"); -+ (SDLPutFile *)buildPutFileWithFileName:(NSString *)syncFileName fileType:(SDLFileType)fileType persisistentFile:(NSNumber<SDLBool> *)persistentFile correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use buildPutFileWithFileName:fileType:persistentFile:correlationID: instead"); - -+ (SDLReadDID *)buildReadDIDWithECUName:(NSNumber<SDLInt> *)ecuName didLocation:(NSArray<NSNumber<SDLInt> *> *)didLocation correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLReadDID's initWithECUName:didLocation: instead"); - -//***** RegisterAppInterface ***** -+ (SDLRegisterAppInterface *)buildRegisterAppInterfaceWithAppName:(NSString *)appName ttsName:(NSMutableArray<SDLTTSChunk *> *)ttsName vrSynonyms:(NSMutableArray<NSString *> *)vrSynonyms isMediaApp:(NSNumber<SDLBool> *)isMediaApp languageDesired:(SDLLanguage)languageDesired hmiDisplayLanguageDesired:(SDLLanguage)hmiDisplayLanguageDesired appID:(NSString *)appID __deprecated_msg("use SDLRegisterAppInterface's initWithAppName:appId:languageDesired:isMediaApp:appType:shortAppName:ttsName:vrSynonyms:hmiDisplayLanguageDesired:resumeHash: instead"); - -+ (SDLRegisterAppInterface *)buildRegisterAppInterfaceWithAppName:(NSString *)appName isMediaApp:(NSNumber<SDLBool> *)isMediaApp languageDesired:(SDLLanguage)languageDesired appID:(NSString *)appID __deprecated_msg("use SDLRegisterAppInterface's initWithAppName:appId:lanaugeDesired:isMediaApp:appType:shortAppName: instead"); - -+ (SDLRegisterAppInterface *)buildRegisterAppInterfaceWithAppName:(NSString *)appName languageDesired:(SDLLanguage)laguageDesired appID:(NSString *)appID __deprecated_msg("use SDLRegisterAppInterface's initWithAppName:appId:lanaugeDesired: instead"); -//***** - -+ (SDLResetGlobalProperties *)buildResetGlobalPropertiesWithProperties:(NSArray<SDLGlobalProperty> *)properties correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLResetGlobalProperties's initWithProperties: instead"); - -+ (SDLSendLocation *)buildSendLocationWithLongitude:(NSNumber<SDLFloat> *)longitude latitude:(NSNumber<SDLFloat> *)latitude locationName:(NSString *)locationName locationDescription:(NSString *)locationDescription address:(NSArray<NSString *> *)address phoneNumber:(NSString *)phoneNumber image:(SDLImage *)image __deprecated_msg("use SDLSendLocation's initWithLongitude:latitude:locationName:locationDescription:address:phoneNumber:image: instead"); - -+ (SDLScrollableMessage *)buildScrollableMessage:(NSString *)scrollableMessageBody timeout:(NSNumber<SDLInt> *)timeout softButtons:(NSArray<SDLSoftButton *> *)softButtons correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLScrollableMessage's initWithMessage:timeout:softButtons: instead"); - -+ (SDLSetAppIcon *)buildSetAppIconWithFileName:(NSString *)syncFileName correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLSetAppIcon's initWithFileName: instead"); - -+ (SDLSetDisplayLayout *)buildSetDisplayLayout:(NSString *)displayLayout correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLSetAppIcon's initWithLayout: instead"); - - -//***** SetGlobalProperties ***** -+ (SDLSetGlobalProperties *)buildSetGlobalPropertiesWithHelpText:(NSString *)helpText timeoutText:(NSString *)timeoutText vrHelpTitle:(NSString *)vrHelpTitle vrHelp:(NSArray<SDLVRHelpItem *> *)vrHelp correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLSetGlobalProperties's initWithHelpText:timeoutText:vrHelpTitle:vrHelp: instead"); - -+ (SDLSetGlobalProperties *)buildSetGlobalPropertiesWithHelpText:(NSString *)helpText timeoutText:(NSString *)timeoutText correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLSetGlobalProperties's initWithHelpText:timeoutText: instead"); -//***** - - -//***** SetMediaClockTimer ***** -+ (SDLSetMediaClockTimer *)buildSetMediaClockTimerWithHours:(NSNumber<SDLInt> *)hours minutes:(NSNumber<SDLInt> *)minutes seconds:(NSNumber<SDLInt> *)seconds updateMode:(SDLUpdateMode)updateMode correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLSetMediaClockTimer's initWithHours:minutes:seconds:updateMode: instead"); - -+ (SDLSetMediaClockTimer *)buildSetMediaClockTimerWithUpdateMode:(SDLUpdateMode)updateMode correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLSetMediaClockTimer's initWithUpdateMode: instead"); -//***** - - -//***** Show ***** -+ (SDLShow *)buildShowWithMainField1:(NSString *)mainField1 mainField2:(NSString *)mainField2 mainField3:(NSString *)mainField3 mainField4:(NSString *)mainField4 statusBar:(NSString *)statusBar mediaClock:(NSString *)mediaClock mediaTrack:(NSString *)mediaTrack alignment:(SDLTextAlignment)textAlignment graphic:(SDLImage *)graphic softButtons:(NSArray<SDLSoftButton *> *)softButtons customPresets:(NSArray<NSString *> *)customPresets correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLShow's initWithMainField1:mainField2:mainField3:mainField4:alignment:statusBar:mediaClock:mediaTrack:graphic:softButtons:customPresets: instead"); - -+ (SDLShow *)buildShowWithMainField1:(NSString *)mainField1 mainField2:(NSString *)mainField2 statusBar:(NSString *)statusBar mediaClock:(NSString *)mediaClock mediaTrack:(NSString *)mediaTrack alignment:(SDLTextAlignment)textAlignment correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLShow's initWithMainField1:mainField2:alignment:statusBar:mediaClock:mediaTrack: instead"); - -+ (SDLShow *)buildShowWithMainField1:(NSString *)mainField1 mainField2:(NSString *)mainField2 alignment:(SDLTextAlignment)alignment correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLShow's initWithMainField1:mainField2:alignment: instead"); -//***** - - -//***** Slider ***** -+ (SDLSlider *)buildSliderDynamicFooterWithNumTicks:(NSNumber<SDLInt> *)numTicks position:(NSNumber<SDLInt> *)position sliderHeader:(NSString *)sliderHeader sliderFooter:(NSArray<NSString *> *)sliderFooter timeout:(NSNumber<SDLInt> *)timeout correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLSlider's initWithNumTicks:position:sliderHeader:sliderFooter:timeout: instead"); - -+ (SDLSlider *)buildSliderStaticFooterWithNumTicks:(NSNumber<SDLInt> *)numTicks position:(NSNumber<SDLInt> *)position sliderHeader:(NSString *)sliderHeader sliderFooter:(NSString *)sliderFooter timeout:(NSNumber<SDLInt> *)timeout correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLSlider's initWithNumTicks:position:sliderHeader:sliderFooters:timeout: instead"); -//***** - -+ (SDLSoftButton *)buildSoftButtonWithType:(SDLSoftButtonType)type text:(NSString *)text image:(SDLImage *)image highlighted:(BOOL)highlighted buttonID:(UInt16)buttonID systemAction:(SDLSystemAction)systemAction handler:(SDLRPCNotificationHandler)handler __deprecated_msg("use SDLSoftButton's initWithType:text:image:highlighted:buttonId:systemAction:handler: instead"); - -//***** Speak ***** -+ (SDLSpeak *)buildSpeakWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLSpeak's initWithTTSChunks: instead"); - -//*** -+ (SDLSpeak *)buildSpeakWithTTS:(NSString *)ttsText correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLSpeak's initWithTTS: instead"); -//***** - -+ (SDLSubscribeButton *)buildSubscribeButtonWithName:(SDLButtonName)buttonName correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use buildSubscribeButtonWithName:handler: with SDLManager instead"); - -+ (SDLSubscribeButton *)buildSubscribeButtonWithName:(SDLButtonName)buttonName handler:(SDLRPCNotificationHandler)handler __deprecated_msg("use SDLSubscribeButton's initWithButtonName:handler: instead"); - -+ (SDLSubscribeVehicleData *)buildSubscribeVehicleDataWithGPS:(NSNumber<SDLBool> *)gps speed:(NSNumber<SDLBool> *)speed rpm:(NSNumber<SDLBool> *)rpm fuelLevel:(NSNumber<SDLBool> *)fuelLevel fuelLevelState:(NSNumber<SDLBool> *)fuelLevelState instantFuelConsumption:(NSNumber<SDLBool> *)instantFuelConsumption externalTemperature:(NSNumber<SDLBool> *)externalTemperature prndl:(NSNumber<SDLBool> *)prndl tirePressure:(NSNumber<SDLBool> *)tirePressure odometer:(NSNumber<SDLBool> *)odometer beltStatus:(NSNumber<SDLBool> *)beltStatus bodyInformation:(NSNumber<SDLBool> *)bodyInformation deviceStatus:(NSNumber<SDLBool> *)deviceStatus driverBraking:(NSNumber<SDLBool> *)driverBraking wiperStatus:(NSNumber<SDLBool> *)wiperStatus headLampStatus:(NSNumber<SDLBool> *)headLampStatus engineTorque:(NSNumber<SDLBool> *)engineTorque accPedalPosition:(NSNumber<SDLBool> *)accPedalPosition steeringWheelAngle:(NSNumber<SDLBool> *)steeringWheelAngle correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLSubscribeVehicleData's initWithAccelerationPedalPosition:airbagStatus:beltStatus:bodyInformation:clusterModeStatus:deviceStatus:driverBraking:eCallInfo:emergencyEvent:engineTorque:externalTemperature:fuelLevel:fuelLevelState:gps:headLampStatus:instantFuelConsumption:myKey:odometer:prndl:rpm:speed:steeringWheelAngle:tirePressure:wiperStatus: instead"); - -+ (SDLShowConstantTBT *)buildShowConstantTBTWithString:(NSString *)navigationText1 navigationText2:(NSString *)navigationText2 eta:(NSString *)eta timeToDestination:(NSString *)timeToDestination totalDistance:(NSString *)totalDistance turnIcon:(SDLImage *)turnIcon nextTurnIcon:(SDLImage *)nextTurnIcon distanceToManeuver:(NSNumber<SDLFloat> *)distanceToManeuver distanceToManeuverScale:(NSNumber<SDLFloat> *)distanceToManeuverScale maneuverComplete:(NSNumber<SDLFloat> *)maneuverComplete softButtons:(NSMutableArray<SDLSoftButton *> *)softButtons correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLShowConstantTBT's initWithNavigationText1:navigationText2:eta:timeToDestination:totalDistance:turnIcon:nextTurnIcon:distanceToManeuver:distanceToManeuverScale:maneuverComplete:softButtons: instead"); - -+ (SDLUnregisterAppInterface *)buildUnregisterAppInterfaceWithCorrelationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLUnregisterAppInterface's default initializer instead"); - -+ (SDLUnsubscribeButton *)buildUnsubscribeButtonWithName:(SDLButtonName)buttonName correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLUnsubscribeButton's initWithButtonName: instead"); - -+ (SDLUnsubscribeVehicleData *)buildUnsubscribeVehicleDataWithGPS:(NSNumber<SDLBool> *)gps speed:(NSNumber<SDLBool> *)speed rpm:(NSNumber<SDLBool> *)rpm fuelLevel:(NSNumber<SDLBool> *)fuelLevel fuelLevelState:(NSNumber<SDLBool> *)fuelLevelState instantFuelConsumption:(NSNumber<SDLBool> *)instantFuelConsumption externalTemperature:(NSNumber<SDLBool> *)externalTemperature prndl:(NSNumber<SDLBool> *)prndl tirePressure:(NSNumber<SDLBool> *)tirePressure odometer:(NSNumber<SDLBool> *)odometer beltStatus:(NSNumber<SDLBool> *)beltStatus bodyInformation:(NSNumber<SDLBool> *)bodyInformation deviceStatus:(NSNumber<SDLBool> *)deviceStatus driverBraking:(NSNumber<SDLBool> *)driverBraking wiperStatus:(NSNumber<SDLBool> *)wiperStatus headLampStatus:(NSNumber<SDLBool> *)headLampStatus engineTorque:(NSNumber<SDLBool> *)engineTorque accPedalPosition:(NSNumber<SDLBool> *)accPedalPosition steeringWheelAngle:(NSNumber<SDLBool> *)steeringWheelAngle correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLSubscribeVehicleData's initWithAccelerationPedalPosition:airbagStatus:beltStatus:bodyInformation:clusterModeStatus:deviceStatus:driverBraking:eCallInfo:emergencyEvent:engineTorque:externalTemperature:fuelLevel:fuelLevelState:gps:headLampStatus:instantFuelConsumption:myKey:odometer:prndl:rpm:speed:steeringWheelAngle:tirePressure:wiperStatus: instead"); - -+ (SDLUpdateTurnList *)buildUpdateTurnListWithTurnList:(NSMutableArray<SDLTurn *> *)turnList softButtons:(NSMutableArray<SDLSoftButton *> *)softButtons correlationID:(NSNumber<SDLInt> *)correlationID __deprecated_msg("use SDLUpdateTurnList initWithTurnList:softButtons: instead"); -@end diff --git a/SmartDeviceLink/SDLRPCRequestFactory.m b/SmartDeviceLink/SDLRPCRequestFactory.m deleted file mode 100644 index 54296aa0e..000000000 --- a/SmartDeviceLink/SDLRPCRequestFactory.m +++ /dev/null @@ -1,752 +0,0 @@ -// SDLRPCRequestFactory.m -// - -#import "SDLRPCRequestFactory.h" -#import <CoreTelephony/CTCarrier.h> -#import <CoreTelephony/CTTelephonyNetworkInfo.h> -#import <UIKit/UIKit.h> - -#import "SDLAddCommand.h" -#import "SDLAddSubMenu.h" -#import "SDLAlert.h" -#import "SDLAlertManeuver.h" -#import "SDLAppHMIType.h" -#import "SDLAppInfo.h" -#import "SDLChangeRegistration.h" -#import "SDLCreateInteractionChoiceSet.h" -#import "SDLDebugTool.h" -#import "SDLDeleteCommand.h" -#import "SDLDeleteFile.h" -#import "SDLDeleteInteractionChoiceSet.h" -#import "SDLDeleteSubMenu.h" -#import "SDLDeviceInfo.h" -#import "SDLDialNumber.h" -#import "SDLEndAudioPassThru.h" -#import "SDLGetDTCs.h" -#import "SDLGetVehicleData.h" -#import "SDLImage.h" -#import "SDLListFiles.h" -#import "SDLMenuParams.h" -#import "SDLPerformAudioPassThru.h" -#import "SDLPerformInteraction.h" -#import "SDLPutFile.h" -#import "SDLReadDID.h" -#import "SDLRegisterAppInterface.h" -#import "SDLResetGlobalProperties.h" -#import "SDLScrollableMessage.h" -#import "SDLSendLocation.h" -#import "SDLSetAppIcon.h" -#import "SDLSetDisplayLayout.h" -#import "SDLSetGlobalProperties.h" -#import "SDLSetMediaClockTimer.h" -#import "SDLShow.h" -#import "SDLShowConstantTBT.h" -#import "SDLSlider.h" -#import "SDLSoftButton.h" -#import "SDLSpeak.h" -#import "SDLSpeechCapabilities.h" -#import "SDLStartTime.h" -#import "SDLSubscribeButton.h" -#import "SDLSubscribeVehicleData.h" -#import "SDLSyncMsgVersion.h" -#import "SDLTTSChunk.h" -#import "SDLTTSChunkFactory.h" -#import "SDLUnregisterAppInterface.h" -#import "SDLUnsubscribeButton.h" -#import "SDLUnsubscribeVehicleData.h" -#import "SDLUpdateTurnList.h" - -static NSString *const SDLBundleShortVersionStringKey = @"CFBundleShortVersionString"; - -@implementation SDLRPCRequestFactory - -//***** AddCommand ***** -+ (SDLAddCommand *)buildAddCommandWithID:(NSNumber<SDLInt> *)cmdID menuName:(NSString *)menuName parentID:(NSNumber<SDLInt> *)parentID position:(NSNumber<SDLInt> *)position vrCommands:(NSArray<NSString *> *)vrCommands iconValue:(NSString *)iconValue iconType:(SDLImageType)iconType correlationID:(NSNumber<SDLInt> *)correlationID { - SDLAddCommand *msg = [[SDLAddCommand alloc] init]; - - msg.cmdID = cmdID; - - if (menuName != nil || parentID != nil || position != nil) { - SDLMenuParams *menuParams = [[SDLMenuParams alloc] init]; - menuParams.menuName = menuName; - menuParams.parentID = parentID; - menuParams.position = position; - msg.menuParams = menuParams; - } - msg.vrCommands = [vrCommands mutableCopy]; - - if (iconValue != nil || iconType != nil) { - SDLImage *icon = [[SDLImage alloc] init]; - icon.value = iconValue; - icon.imageType = iconType; - msg.cmdIcon = icon; - } - - msg.correlationID = correlationID; - - return msg; -} - -+ (SDLAddCommand *)buildAddCommandWithID:(NSNumber<SDLInt> *)cmdID menuName:(NSString *)menuName parentID:(NSNumber<SDLInt> *)parentID position:(NSNumber<SDLInt> *)position vrCommands:(NSArray<NSString *> *)vrCommands iconValue:(NSString *)iconValue iconType:(SDLImageType)iconType handler:(SDLRPCNotificationHandler)handler { - SDLAddCommand *msg = [[SDLAddCommand alloc] initWithHandler:handler]; - - msg.cmdID = cmdID; - - if (menuName != nil || parentID != nil || position != nil) { - SDLMenuParams *menuParams = [[SDLMenuParams alloc] init]; - menuParams.menuName = menuName; - menuParams.parentID = parentID; - menuParams.position = position; - msg.menuParams = menuParams; - } - msg.vrCommands = [vrCommands mutableCopy]; - - if (iconValue != nil || iconType != nil) { - SDLImage *icon = [[SDLImage alloc] init]; - icon.value = iconValue; - icon.imageType = iconType; - msg.cmdIcon = icon; - } - - return msg; -} - -+ (SDLAddCommand *)buildAddCommandWithID:(NSNumber<SDLInt> *)cmdID menuName:(NSString *)menuName vrCommands:(NSArray<NSString *> *)vrCommands correlationID:(NSNumber<SDLInt> *)correlationID { - return [SDLRPCRequestFactory buildAddCommandWithID:cmdID menuName:menuName parentID:nil position:nil vrCommands:vrCommands iconValue:nil iconType:nil correlationID:correlationID]; -} - -+ (SDLAddCommand *)buildAddCommandWithID:(NSNumber<SDLInt> *)cmdID menuName:(NSString *)menuName vrCommands:(NSArray<NSString *> *)vrCommands handler:(SDLRPCNotificationHandler)handler { - return [SDLRPCRequestFactory buildAddCommandWithID:cmdID menuName:menuName parentID:nil position:nil vrCommands:vrCommands iconValue:nil iconType:nil handler:handler]; -} - -+ (SDLAddCommand *)buildAddCommandWithID:(NSNumber<SDLInt> *)cmdID vrCommands:(NSArray<NSString *> *)vrCommands correlationID:(NSNumber<SDLInt> *)correlationID { - return [SDLRPCRequestFactory buildAddCommandWithID:cmdID menuName:nil vrCommands:vrCommands correlationID:correlationID]; -} - -+ (SDLAddCommand *)buildAddCommandWithID:(NSNumber<SDLInt> *)cmdID vrCommands:(NSArray<NSString *> *)vrCommands handler:(SDLRPCNotificationHandler)handler { - return [SDLRPCRequestFactory buildAddCommandWithID:cmdID menuName:nil vrCommands:vrCommands handler:handler]; -} -//***** - - -//***** AddSubMenu ***** -+ (SDLAddSubMenu *)buildAddSubMenuWithID:(NSNumber<SDLInt> *)menuID menuName:(NSString *)menuName position:(NSNumber<SDLInt> *)position correlationID:(NSNumber<SDLInt> *)correlationID { - SDLAddSubMenu *msg = [[SDLAddSubMenu alloc] init]; - msg.correlationID = correlationID; - msg.menuID = menuID; - msg.menuName = menuName; - msg.position = position; - return msg; -} - -+ (SDLAddSubMenu *)buildAddSubMenuWithID:(NSNumber<SDLInt> *)menuID menuName:(NSString *)menuName correlationID:(NSNumber<SDLInt> *)correlationID { - return [SDLRPCRequestFactory buildAddSubMenuWithID:menuID menuName:menuName position:nil correlationID:correlationID]; -} -//***** - - -//***** Alert ***** -+ (SDLAlert *)buildAlertWithTTS:(NSString *)ttsText alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 playTone:(NSNumber<SDLBool> *)playTone duration:(NSNumber<SDLInt> *)duration correlationID:(NSNumber<SDLInt> *)correlationID { - SDLTTSChunk *simpleChunk = [[SDLTTSChunk alloc] init]; - simpleChunk.text = ttsText; - simpleChunk.type = SDLSpeechCapabilitiesText; - NSArray<SDLTTSChunk *> *ttsChunks = [NSArray arrayWithObject:simpleChunk]; - - return [SDLRPCRequestFactory buildAlertWithTTSChunks:ttsChunks alertText1:alertText1 alertText2:alertText2 alertText3:alertText3 playTone:playTone duration:duration softButtons:nil correlationID:correlationID]; -} - -+ (SDLAlert *)buildAlertWithTTS:(NSString *)ttsText alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 playTone:(NSNumber<SDLBool> *)playTone duration:(NSNumber<SDLInt> *)duration correlationID:(NSNumber<SDLInt> *)correlationID { - return [SDLRPCRequestFactory buildAlertWithTTS:ttsText alertText1:alertText1 alertText2:alertText2 alertText3:nil playTone:playTone duration:duration correlationID:correlationID]; -} - -+ (SDLAlert *)buildAlertWithTTS:(NSString *)ttsText playTone:(NSNumber<SDLBool> *)playTone correlationID:(NSNumber<SDLInt> *)correlationID { - return [SDLRPCRequestFactory buildAlertWithTTS:ttsText alertText1:nil alertText2:nil alertText3:nil playTone:playTone duration:nil correlationID:correlationID]; -} - -//*** -+ (SDLAlert *)buildAlertWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 playTone:(NSNumber<SDLBool> *)playTone duration:(NSNumber<SDLInt> *)duration softButtons:(NSArray<SDLSoftButton *> *)softButtons correlationID:(NSNumber<SDLInt> *)correlationID { - SDLAlert *msg = [[SDLAlert alloc] init]; - msg.correlationID = correlationID; - msg.alertText1 = alertText1; - msg.alertText2 = alertText2; - msg.alertText3 = alertText3; - msg.ttsChunks = [ttsChunks mutableCopy]; - msg.playTone = playTone; - msg.duration = duration; - msg.softButtons = [softButtons mutableCopy]; - return msg; -} - -+ (SDLAlert *)buildAlertWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks playTone:(NSNumber<SDLBool> *)playTone correlationID:(NSNumber<SDLInt> *)correlationID { - return [SDLRPCRequestFactory buildAlertWithTTSChunks:ttsChunks alertText1:nil alertText2:nil alertText3:nil playTone:playTone duration:nil softButtons:nil correlationID:correlationID]; -} - -//*** -+ (SDLAlert *)buildAlertWithAlertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 duration:(NSNumber<SDLInt> *)duration softButtons:(NSMutableArray<SDLSoftButton *> *)softButtons correlationID:(NSNumber<SDLInt> *)correlationID { - return [SDLRPCRequestFactory buildAlertWithTTSChunks:nil alertText1:alertText1 alertText2:alertText2 alertText3:alertText3 playTone:nil duration:duration softButtons:softButtons correlationID:correlationID]; -} - -+ (SDLAlert *)buildAlertWithAlertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 duration:(NSNumber<SDLInt> *)duration correlationID:(NSNumber<SDLInt> *)correlationID { - return [SDLRPCRequestFactory buildAlertWithTTSChunks:nil alertText1:alertText1 alertText2:alertText2 alertText3:alertText3 playTone:nil duration:duration softButtons:nil correlationID:correlationID]; -} - -+ (SDLAlert *)buildAlertWithAlertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 duration:(NSNumber<SDLInt> *)duration correlationID:(NSNumber<SDLInt> *)correlationID { - return [SDLRPCRequestFactory buildAlertWithTTSChunks:nil alertText1:alertText1 alertText2:alertText2 alertText3:nil playTone:nil duration:duration softButtons:nil correlationID:correlationID]; -} -//***** - - -+ (SDLAlertManeuver *)buildAlertManeuverwithTTSchunks:(NSMutableArray<SDLTTSChunk *> *)ttsChunks softButtons:(NSMutableArray<SDLSoftButton *> *)softButtons correlationID:(NSNumber<SDLInt> *)correlationID { - SDLAlertManeuver *msg = [[SDLAlertManeuver alloc] init]; - msg.ttsChunks = ttsChunks; - msg.softButtons = softButtons; - msg.correlationID = correlationID; - return msg; -} - -+ (SDLChangeRegistration *)buildChangeRegistrationWithLanguage:(SDLLanguage)language hmiDisplayLanguage:(SDLLanguage)hmiDisplayLanguage correlationID:(NSNumber<SDLInt> *)correlationID { - SDLChangeRegistration *msg = [[SDLChangeRegistration alloc] init]; - msg.language = language; - msg.hmiDisplayLanguage = hmiDisplayLanguage; - msg.correlationID = correlationID; - - return msg; -} - -+ (SDLCreateInteractionChoiceSet *)buildCreateInteractionChoiceSetWithID:(NSNumber<SDLInt> *)interactionChoiceSetID choiceSet:(NSArray<SDLChoice *> *)choices correlationID:(NSNumber<SDLInt> *)correlationID { - SDLCreateInteractionChoiceSet *msg = [[SDLCreateInteractionChoiceSet alloc] init]; - msg.interactionChoiceSetID = interactionChoiceSetID; - msg.choiceSet = [choices mutableCopy]; - msg.correlationID = correlationID; - - return msg; -} - -+ (SDLDeleteCommand *)buildDeleteCommandWithID:(NSNumber<SDLInt> *)cmdID correlationID:(NSNumber<SDLInt> *)correlationID { - SDLDeleteCommand *msg = [[SDLDeleteCommand alloc] init]; - msg.cmdID = cmdID; - msg.correlationID = correlationID; - - return msg; -} - -+ (SDLDeleteFile *)buildDeleteFileWithName:(NSString *)syncFileName correlationID:(NSNumber<SDLInt> *)correlationID { - SDLDeleteFile *msg = [[SDLDeleteFile alloc] init]; - msg.syncFileName = syncFileName; - msg.correlationID = correlationID; - - return msg; -} - -+ (SDLDialNumber *)buildDialNumberWithNumber:(NSString *)phoneNumber { - SDLDialNumber *msg = [[SDLDialNumber alloc] init]; - msg.number = phoneNumber; - - return msg; -} - -+ (SDLListFiles *)buildListFilesWithCorrelationID:(NSNumber<SDLInt> *)correlationID { - SDLListFiles *msg = [[SDLListFiles alloc] init]; - msg.correlationID = correlationID; - - return msg; -} - -+ (SDLDeleteInteractionChoiceSet *)buildDeleteInteractionChoiceSetWithID:(NSNumber<SDLInt> *)interactionChoiceSetID correlationID:(NSNumber<SDLInt> *)correlationID { - SDLDeleteInteractionChoiceSet *msg = [[SDLDeleteInteractionChoiceSet alloc] init]; - msg.interactionChoiceSetID = interactionChoiceSetID; - msg.correlationID = correlationID; - - return msg; -} - -+ (SDLDeleteSubMenu *)buildDeleteSubMenuWithID:(NSNumber<SDLInt> *)menuID correlationID:(NSNumber<SDLInt> *)correlationID { - SDLDeleteSubMenu *msg = [[SDLDeleteSubMenu alloc] init]; - msg.menuID = menuID; - msg.correlationID = correlationID; - - return msg; -} - -+ (SDLEndAudioPassThru *)buildEndAudioPassThruWithCorrelationID:(NSNumber<SDLInt> *)correlationID { - SDLEndAudioPassThru *msg = [[SDLEndAudioPassThru alloc] init]; - msg.correlationID = correlationID; - - return msg; -} - -+ (SDLGetDTCs *)buildGetDTCsWithECUName:(NSNumber<SDLInt> *)ecuName correlationID:(NSNumber<SDLInt> *)correlationID { - SDLGetDTCs *msg = [[SDLGetDTCs alloc] init]; - msg.ecuName = ecuName; - msg.correlationID = correlationID; - - return msg; -} - -+ (SDLGetVehicleData *)buildGetVehicleDataWithGPS:(NSNumber<SDLBool> *)gps speed:(NSNumber<SDLBool> *)speed rpm:(NSNumber<SDLBool> *)rpm fuelLevel:(NSNumber<SDLBool> *)fuelLevel fuelLevelState:(NSNumber<SDLBool> *)fuelLevelState instantFuelConsumption:(NSNumber<SDLBool> *)instantFuelConsumption externalTemperature:(NSNumber<SDLBool> *)externalTemperature vin:(NSNumber<SDLBool> *)vin prndl:(NSNumber<SDLBool> *)prndl tirePressure:(NSNumber<SDLBool> *)tirePressure odometer:(NSNumber<SDLBool> *)odometer beltStatus:(NSNumber<SDLBool> *)beltStatus bodyInformation:(NSNumber<SDLBool> *)bodyInformation deviceStatus:(NSNumber<SDLBool> *)deviceStatus driverBraking:(NSNumber<SDLBool> *)driverBraking wiperStatus:(NSNumber<SDLBool> *)wiperStatus headLampStatus:(NSNumber<SDLBool> *)headLampStatus engineTorque:(NSNumber<SDLBool> *)engineTorque accPedalPosition:(NSNumber<SDLBool> *)accPedalPosition steeringWheelAngle:(NSNumber<SDLBool> *)steeringWheelAngle correlationID:(NSNumber<SDLInt> *)correlationID { - SDLGetVehicleData *msg = [[SDLGetVehicleData alloc] init]; - msg.gps = gps; - msg.speed = speed; - msg.rpm = rpm; - msg.fuelLevel = fuelLevel; - msg.fuelLevel_State = fuelLevelState; - msg.instantFuelConsumption = instantFuelConsumption; - msg.externalTemperature = externalTemperature; - msg.vin = vin; - msg.prndl = prndl; - msg.tirePressure = tirePressure; - msg.odometer = odometer; - msg.beltStatus = beltStatus; - msg.bodyInformation = bodyInformation; - msg.deviceStatus = deviceStatus; - msg.driverBraking = driverBraking; - msg.wiperStatus = wiperStatus; - msg.headLampStatus = headLampStatus; - msg.engineTorque = engineTorque; - msg.accPedalPosition = accPedalPosition; - msg.steeringWheelAngle = steeringWheelAngle; - msg.correlationID = correlationID; - - return msg; -} - -+ (SDLPerformAudioPassThru *)buildPerformAudioPassThruWithInitialPrompt:(NSString *)initialPrompt audioPassThruDisplayText1:(NSString *)audioPassThruDisplayText1 audioPassThruDisplayText2:(NSString *)audioPassThruDisplayText2 samplingRate:(SDLSamplingRate)samplingRate maxDuration:(NSNumber<SDLInt> *)maxDuration bitsPerSample:(SDLBitsPerSample)bitsPerSample audioType:(SDLAudioType)audioType muteAudio:(NSNumber<SDLBool> *)muteAudio correlationID:(NSNumber<SDLInt> *)correlationID { - NSArray<SDLTTSChunk *> *initialChunks = [SDLTTSChunk textChunksFromString:initialPrompt]; - - SDLPerformAudioPassThru *msg = [[SDLPerformAudioPassThru alloc] init]; - msg.initialPrompt = [initialChunks mutableCopy]; - msg.audioPassThruDisplayText1 = audioPassThruDisplayText1; - msg.audioPassThruDisplayText2 = audioPassThruDisplayText2; - msg.samplingRate = samplingRate; - msg.maxDuration = maxDuration; - msg.bitsPerSample = bitsPerSample; - msg.audioType = audioType; - msg.muteAudio = muteAudio; - msg.correlationID = correlationID; - - return msg; -} - - -//***** PerformInteraction ***** -+ (SDLPerformInteraction *)buildPerformInteractionWithInitialChunks:(NSArray<SDLTTSChunk *> *)initialChunks initialText:(NSString *)initialText interactionChoiceSetIDList:(NSArray<NSNumber *> *)interactionChoiceSetIDList helpChunks:(NSArray<SDLTTSChunk *> *)helpChunks timeoutChunks:(NSArray<SDLTTSChunk *> *)timeoutChunks interactionMode:(SDLInteractionMode)interactionMode timeout:(NSNumber<SDLInt> *)timeout vrHelp:(NSArray<SDLVRHelpItem *> *)vrHelp correlationID:(NSNumber<SDLInt> *)correlationID { - SDLPerformInteraction *msg = [[SDLPerformInteraction alloc] init]; - msg.initialPrompt = [initialChunks mutableCopy]; - msg.initialText = initialText; - msg.interactionChoiceSetIDList = [interactionChoiceSetIDList mutableCopy]; - msg.helpPrompt = [helpChunks mutableCopy]; - msg.timeoutPrompt = [timeoutChunks mutableCopy]; - msg.interactionMode = interactionMode; - msg.timeout = timeout; - msg.vrHelp = [vrHelp mutableCopy]; - msg.correlationID = correlationID; - - return msg; -} - -//*** -+ (SDLPerformInteraction *)buildPerformInteractionWithInitialPrompt:(NSString *)initialPrompt initialText:(NSString *)initialText interactionChoiceSetIDList:(NSArray<NSNumber *> *)interactionChoiceSetIDList helpPrompt:(NSString *)helpPrompt timeoutPrompt:(NSString *)timeoutPrompt interactionMode:(SDLInteractionMode)interactionMode timeout:(NSNumber<SDLInt> *)timeout vrHelp:(NSArray<SDLVRHelpItem *> *)vrHelp correlationID:(NSNumber<SDLInt> *)correlationID { - NSArray<SDLTTSChunk *> *initialChunks = [SDLTTSChunkFactory buildTTSChunksFromSimple:initialPrompt]; - NSArray<SDLTTSChunk *> *helpChunks = [SDLTTSChunkFactory buildTTSChunksFromSimple:helpPrompt]; - NSArray<SDLTTSChunk *> *timeoutChunks = [SDLTTSChunkFactory buildTTSChunksFromSimple:timeoutPrompt]; - - return [SDLRPCRequestFactory buildPerformInteractionWithInitialChunks:initialChunks initialText:initialText interactionChoiceSetIDList:interactionChoiceSetIDList helpChunks:helpChunks timeoutChunks:timeoutChunks interactionMode:interactionMode timeout:timeout vrHelp:vrHelp correlationID:correlationID]; -} - -+ (SDLPerformInteraction *)buildPerformInteractionWithInitialPrompt:(NSString *)initialPrompt initialText:(NSString *)initialText interactionChoiceSetID:(NSNumber<SDLInt> *)interactionChoiceSetID vrHelp:(NSArray<SDLVRHelpItem *> *)vrHelp correlationID:(NSNumber<SDLInt> *)correlationID { - NSArray<NSNumber *> *interactionChoiceSetIDList = [NSArray arrayWithObject:interactionChoiceSetID]; - NSArray<SDLTTSChunk *> *initialChunks = [SDLTTSChunkFactory buildTTSChunksFromSimple:initialPrompt]; - - return [SDLRPCRequestFactory buildPerformInteractionWithInitialChunks:initialChunks initialText:initialText interactionChoiceSetIDList:interactionChoiceSetIDList helpChunks:nil timeoutChunks:nil interactionMode:SDLInteractionModeBoth timeout:nil vrHelp:vrHelp correlationID:correlationID]; -} - -+ (SDLPerformInteraction *)buildPerformInteractionWithInitialPrompt:(NSString *)initialPrompt initialText:(NSString *)initialText interactionChoiceSetIDList:(NSArray<NSNumber *> *)interactionChoiceSetIDList helpPrompt:(NSString *)helpPrompt timeoutPrompt:(NSString *)timeoutPrompt interactionMode:(SDLInteractionMode)interactionMode timeout:(NSNumber<SDLInt> *)timeout correlationID:(NSNumber<SDLInt> *)correlationID { - return [SDLRPCRequestFactory buildPerformInteractionWithInitialPrompt:initialPrompt initialText:initialText interactionChoiceSetIDList:interactionChoiceSetIDList helpPrompt:helpPrompt timeoutPrompt:timeoutPrompt interactionMode:interactionMode timeout:timeout vrHelp:nil correlationID:(NSNumber<SDLInt> *)correlationID]; -} - -+ (SDLPerformInteraction *)buildPerformInteractionWithInitialPrompt:(NSString *)initialPrompt initialText:(NSString *)initialText interactionChoiceSetID:(NSNumber<SDLInt> *)interactionChoiceSetID correlationID:(NSNumber<SDLInt> *)correlationID { - return [SDLRPCRequestFactory buildPerformInteractionWithInitialPrompt:initialPrompt initialText:initialText interactionChoiceSetID:interactionChoiceSetID vrHelp:nil correlationID:correlationID]; -} -//***** - -+ (SDLPutFile *)buildPutFileWithFileName:(NSString *)fileName fileType:(SDLFileType)fileType persistentFile:(NSNumber<SDLBool> *)persistentFile correlationID:(NSNumber<SDLInt> *)correlationID { - SDLPutFile *msg = [[SDLPutFile alloc] init]; - msg.syncFileName = fileName; - - msg.fileType = fileType; - msg.persistentFile = persistentFile; - msg.correlationID = correlationID; - - return msg; -} - -+ (SDLPutFile *)buildPutFileWithFileName:(NSString *)syncFileName fileType:(SDLFileType)fileType persisistentFile:(NSNumber<SDLBool> *)persistentFile correlationID:(NSNumber<SDLInt> *)correlationID { - return [self buildPutFileWithFileName:syncFileName fileType:fileType persistentFile:persistentFile correlationID:correlationID]; -} - -+ (SDLReadDID *)buildReadDIDWithECUName:(NSNumber<SDLInt> *)ecuName didLocation:(NSArray<NSNumber *> *)didLocation correlationID:(NSNumber<SDLInt> *)correlationID { - SDLReadDID *msg = [[SDLReadDID alloc] init]; - msg.ecuName = ecuName; - msg.didLocation = [didLocation mutableCopy]; - msg.correlationID = correlationID; - - return msg; -} - -//***** RegisterAppInterface ***** -+ (SDLRegisterAppInterface *)buildRegisterAppInterfaceWithAppName:(NSString *)appName ttsName:(NSArray<SDLTTSChunk *> *)ttsName vrSynonyms:(NSArray<NSString *> *)vrSynonyms isMediaApp:(NSNumber<SDLFloat> *)isMediaApp languageDesired:(SDLLanguage)languageDesired hmiDisplayLanguageDesired:(SDLLanguage)hmiDisplayLanguageDesired appID:(NSString *)appID { - SDLRegisterAppInterface *msg = [[SDLRegisterAppInterface alloc] init]; - SDLSyncMsgVersion *version = [[SDLSyncMsgVersion alloc] init]; - version.majorVersion = [NSNumber numberWithInt:1]; - version.minorVersion = [NSNumber numberWithInt:0]; - msg.syncMsgVersion = version; - msg.appName = appName; - msg.ttsName = [ttsName mutableCopy]; - msg.ngnMediaScreenAppName = appName; - msg.vrSynonyms = [vrSynonyms mutableCopy]; - msg.isMediaApplication = isMediaApp; - msg.languageDesired = languageDesired; - msg.hmiDisplayLanguageDesired = hmiDisplayLanguageDesired; - msg.appID = appID; - msg.deviceInfo = [self sdl_buildDeviceInfo]; - msg.correlationID = [NSNumber numberWithInt:1]; - SDLAppInfo *appInfo = [self sdl_buildAppInfo]; - appInfo.appDisplayName = appName; - msg.appInfo = appInfo; - return msg; -} - -+ (SDLDeviceInfo *)sdl_buildDeviceInfo { - SDLDeviceInfo *deviceInfo = [[SDLDeviceInfo alloc] init]; - deviceInfo.hardware = [UIDevice currentDevice].model; - deviceInfo.os = [UIDevice currentDevice].systemName; - deviceInfo.osVersion = [UIDevice currentDevice].systemVersion; - CTTelephonyNetworkInfo *netinfo = [[CTTelephonyNetworkInfo alloc] init]; - CTCarrier *carrier = netinfo.subscriberCellularProvider; - NSString *carrierName = carrier.carrierName; - deviceInfo.carrier = carrierName; - - return deviceInfo; -} - -+ (SDLAppInfo *)sdl_buildAppInfo { - SDLAppInfo *appInfo = [[SDLAppInfo alloc] init]; - NSBundle *mainBundle = [NSBundle mainBundle]; - NSDictionary *bundleDictionary = mainBundle.infoDictionary; - appInfo.appVersion = bundleDictionary[SDLBundleShortVersionStringKey]; - appInfo.appBundleID = mainBundle.bundleIdentifier; - return appInfo; -} - -+ (SDLRegisterAppInterface *)buildRegisterAppInterfaceWithAppName:(NSString *)appName isMediaApp:(NSNumber<SDLFloat> *)isMediaApp languageDesired:(SDLLanguage)languageDesired appID:(NSString *)appID { - NSMutableArray<NSString *> *syns = [NSMutableArray arrayWithObject:appName]; - return [SDLRPCRequestFactory buildRegisterAppInterfaceWithAppName:appName ttsName:nil vrSynonyms:syns isMediaApp:isMediaApp languageDesired:languageDesired hmiDisplayLanguageDesired:languageDesired appID:appID]; -} - -+ (SDLRegisterAppInterface *)buildRegisterAppInterfaceWithAppName:(NSString *)appName languageDesired:(SDLLanguage)languageDesired appID:(NSString *)appID { - return [SDLRPCRequestFactory buildRegisterAppInterfaceWithAppName:appName isMediaApp:@NO languageDesired:languageDesired appID:appID]; -} -//***** - - -+ (SDLResetGlobalProperties *)buildResetGlobalPropertiesWithProperties:(NSArray<SDLGlobalProperty> *)properties correlationID:(NSNumber<SDLInt> *)correlationID { - SDLResetGlobalProperties *msg = [[SDLResetGlobalProperties alloc] init]; - msg.properties = [properties mutableCopy]; - msg.correlationID = correlationID; - - return msg; -} - -+ (SDLScrollableMessage *)buildScrollableMessage:(NSString *)scrollableMessageBody timeout:(NSNumber<SDLInt> *)timeout softButtons:(NSArray<SDLSoftButton *> *)softButtons correlationID:(NSNumber<SDLInt> *)correlationID { - SDLScrollableMessage *msg = [[SDLScrollableMessage alloc] init]; - msg.scrollableMessageBody = scrollableMessageBody; - msg.timeout = timeout; - msg.softButtons = [softButtons mutableCopy]; - msg.correlationID = correlationID; - - return msg; -} - -+ (SDLSendLocation *)buildSendLocationWithLongitude:(NSNumber<SDLFloat> *)longitude latitude:(NSNumber<SDLFloat> *)latitude locationName:(NSString *)locationName locationDescription:(NSString *)locationDescription address:(NSArray<NSString *> *)address phoneNumber:(NSString *)phoneNumber image:(SDLImage *)image { - SDLSendLocation *msg = [[SDLSendLocation alloc] init]; - msg.longitudeDegrees = longitude; - msg.latitudeDegrees = latitude; - msg.locationName = locationName; - msg.locationDescription = locationDescription; - msg.addressLines = address; - msg.phoneNumber = phoneNumber; - msg.locationImage = image; - - return msg; -} - -+ (SDLSetAppIcon *)buildSetAppIconWithFileName:(NSString *)syncFileName correlationID:(NSNumber<SDLInt> *)correlationID { - SDLSetAppIcon *msg = [[SDLSetAppIcon alloc] init]; - msg.syncFileName = syncFileName; - msg.correlationID = correlationID; - - return msg; -} - -+ (SDLSetDisplayLayout *)buildSetDisplayLayout:(NSString *)displayLayout correlationID:(NSNumber<SDLInt> *)correlationID { - SDLSetDisplayLayout *msg = [[SDLSetDisplayLayout alloc] init]; - msg.displayLayout = displayLayout; - msg.correlationID = correlationID; - - return msg; -} - - -//***** SetGlobalProperties ***** -+ (SDLSetGlobalProperties *)buildSetGlobalPropertiesWithHelpText:(NSString *)helpText timeoutText:(NSString *)timeoutText vrHelpTitle:(NSString *)vrHelpTitle vrHelp:(NSArray<SDLVRHelpItem *> *)vrHelp correlationID:(NSNumber<SDLInt> *)correlationID { - SDLSetGlobalProperties *msg = [[SDLSetGlobalProperties alloc] init]; - msg.helpPrompt = [SDLTTSChunk textChunksFromString:helpText]; - msg.timeoutPrompt = [SDLTTSChunk textChunksFromString:timeoutText]; - msg.vrHelpTitle = vrHelpTitle; - msg.vrHelp = [vrHelp mutableCopy]; - msg.correlationID = correlationID; - - return msg; -} - -+ (SDLSetGlobalProperties *)buildSetGlobalPropertiesWithHelpText:(NSString *)helpText timeoutText:(NSString *)timeoutText correlationID:(NSNumber<SDLInt> *)correlationID { - SDLSetGlobalProperties *msg = [[SDLSetGlobalProperties alloc] init]; - msg.helpPrompt = [SDLTTSChunk textChunksFromString:helpText]; - msg.timeoutPrompt = [SDLTTSChunk textChunksFromString:timeoutText]; - msg.correlationID = correlationID; - - return msg; -} -//***** - - -//***** SetMediaClockTimer ***** -+ (SDLSetMediaClockTimer *)buildSetMediaClockTimerWithHours:(NSNumber<SDLInt> *)hours minutes:(NSNumber<SDLInt> *)minutes seconds:(NSNumber<SDLInt> *)seconds updateMode:(SDLUpdateMode)updateMode correlationID:(NSNumber<SDLInt> *)correlationID { - SDLSetMediaClockTimer *msg = [[SDLSetMediaClockTimer alloc] init]; - SDLStartTime *startTime = [[SDLStartTime alloc] init]; - startTime.hours = hours; - startTime.minutes = minutes; - startTime.seconds = seconds; - msg.startTime = startTime; - msg.updateMode = updateMode; - msg.correlationID = correlationID; - - return msg; -} - -+ (SDLSetMediaClockTimer *)buildSetMediaClockTimerWithUpdateMode:(SDLUpdateMode)updateMode correlationID:(NSNumber<SDLInt> *)correlationID { - SDLSetMediaClockTimer *msg = [[SDLSetMediaClockTimer alloc] init]; - msg.updateMode = updateMode; - msg.correlationID = correlationID; - - return msg; -} -//***** - - -//***** Show ***** -+ (SDLShow *)buildShowWithMainField1:(NSString *)mainField1 mainField2:(NSString *)mainField2 mainField3:(NSString *)mainField3 mainField4:(NSString *)mainField4 statusBar:(NSString *)statusBar mediaClock:(NSString *)mediaClock mediaTrack:(NSString *)mediaTrack alignment:(SDLTextAlignment)textAlignment graphic:(SDLImage *)graphic softButtons:(NSArray<SDLSoftButton *> *)softButtons customPresets:(NSArray<NSString *> *)customPresets correlationID:(NSNumber<SDLInt> *)correlationID { - SDLShow *msg = [[SDLShow alloc] init]; - msg.correlationID = correlationID; - msg.mainField1 = mainField1; - msg.mainField2 = mainField2; - msg.mainField3 = mainField3; - msg.mainField4 = mainField4; - msg.statusBar = statusBar; - msg.mediaClock = mediaClock; - msg.mediaTrack = mediaTrack; - msg.alignment = textAlignment; - msg.graphic = graphic; - msg.softButtons = [softButtons mutableCopy]; - msg.customPresets = [customPresets mutableCopy]; - - return msg; -} - -+ (SDLShow *)buildShowWithMainField1:(NSString *)mainField1 mainField2:(NSString *)mainField2 statusBar:(NSString *)statusBar mediaClock:(NSString *)mediaClock mediaTrack:(NSString *)mediaTrack alignment:(SDLTextAlignment)textAlignment correlationID:(NSNumber<SDLInt> *)correlationID { - SDLShow *msg = [[SDLShow alloc] init]; - msg.correlationID = correlationID; - msg.mainField1 = mainField1; - msg.mainField2 = mainField2; - msg.statusBar = statusBar; - msg.mediaClock = mediaClock; - msg.mediaTrack = mediaTrack; - msg.alignment = textAlignment; - - return msg; -} - -+ (SDLShow *)buildShowWithMainField1:(NSString *)mainField1 mainField2:(NSString *)mainField2 alignment:(SDLTextAlignment)alignment correlationID:(NSNumber<SDLInt> *)correlationID { - return [SDLRPCRequestFactory buildShowWithMainField1:mainField1 mainField2:mainField2 statusBar:nil mediaClock:nil mediaTrack:nil alignment:alignment correlationID:correlationID]; -} - -+ (SDLShowConstantTBT *)buildShowConstantTBTWithString:(NSString *)navigationText1 navigationText2:(NSString *)navigationText2 eta:(NSString *)eta timeToDestination:(NSString *)timeToDestination totalDistance:(NSString *)totalDistance turnIcon:(SDLImage *)turnIcon nextTurnIcon:(SDLImage *)nextTurnIcon distanceToManeuver:(NSNumber<SDLFloat> *)distanceToManeuver distanceToManeuverScale:(NSNumber<SDLFloat> *)distanceToManeuverScale maneuverComplete:(NSNumber<SDLBool> *)maneuverComplete softButtons:(NSMutableArray<SDLSoftButton *> *)softButtons correlationID:(NSNumber<SDLInt> *)correlationID { - SDLShowConstantTBT *msg = [[SDLShowConstantTBT alloc] init]; - msg.navigationText1 = navigationText1; - msg.navigationText2 = navigationText2; - msg.eta = eta; - msg.timeToDestination = timeToDestination; - msg.totalDistance = totalDistance; - msg.turnIcon = turnIcon; - msg.nextTurnIcon = nextTurnIcon; - msg.distanceToManeuver = distanceToManeuver; - msg.distanceToManeuverScale = distanceToManeuverScale; - msg.maneuverComplete = maneuverComplete; - msg.softButtons = [softButtons mutableCopy]; - msg.correlationID = correlationID; - - return msg; -} -//***** - - -//***** Slider ***** -+ (SDLSlider *)buildSliderDynamicFooterWithNumTicks:(NSNumber<SDLInt> *)numTicks position:(NSNumber<SDLInt> *)position sliderHeader:(NSString *)sliderHeader sliderFooter:(NSArray<NSString *> *)sliderFooter timeout:(NSNumber<SDLInt> *)timeout correlationID:(NSNumber<SDLInt> *)correlationID { - SDLSlider *msg = [[SDLSlider alloc] init]; - msg.correlationID = correlationID; - msg.numTicks = numTicks; - msg.position = position; - msg.sliderHeader = sliderHeader; - msg.sliderFooter = [sliderFooter mutableCopy]; - msg.timeout = timeout; - - return msg; -} - -+ (SDLSlider *)buildSliderStaticFooterWithNumTicks:(NSNumber<SDLInt> *)numTicks position:(NSNumber<SDLInt> *)position sliderHeader:(NSString *)sliderHeader sliderFooter:(NSString *)sliderFooter timeout:(NSNumber<SDLInt> *)timeout correlationID:(NSNumber<SDLInt> *)correlationID { - NSArray<NSString *> *sliderFooters = [NSArray arrayWithObject:sliderFooter]; - - // Populates array with the same footer value for each position - for (UInt32 i = 1; i < numTicks.unsignedIntegerValue; i++) { - sliderFooters = [sliderFooters arrayByAddingObject:sliderFooter]; - } - - return [SDLRPCRequestFactory buildSliderDynamicFooterWithNumTicks:numTicks position:position sliderHeader:sliderHeader sliderFooter:sliderFooters timeout:timeout correlationID:correlationID]; -} -//***** - -+ (SDLSoftButton *)buildSoftButtonWithType:(SDLSoftButtonType)type text:(NSString *)text image:(SDLImage *)image highlighted:(BOOL)highlighted buttonID:(UInt16)buttonID systemAction:(SDLSystemAction)systemAction handler:(SDLRPCNotificationHandler)handler { - SDLSoftButton *button = [[SDLSoftButton alloc] initWithHandler:handler]; - button.type = type; - button.text = text; - button.image = image; - button.isHighlighted = @(highlighted); - button.softButtonID = @(buttonID); - button.systemAction = systemAction; - - return button; -} - - -//***** Speak ***** -+ (SDLSpeak *)buildSpeakWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks correlationID:(NSNumber<SDLInt> *)correlationID { - SDLSpeak *msg = [[SDLSpeak alloc] init]; - msg.correlationID = correlationID; - msg.ttsChunks = [ttsChunks mutableCopy]; - - return msg; -} - -//*** -+ (SDLSpeak *)buildSpeakWithTTS:(NSString *)ttsText correlationID:(NSNumber<SDLInt> *)correlationID { - SDLTTSChunk *simpleChunk = [[SDLTTSChunk alloc] init]; - simpleChunk.text = ttsText; - simpleChunk.type = SDLSpeechCapabilitiesText; - NSArray<SDLTTSChunk *> *ttsChunks = [NSMutableArray arrayWithObject:simpleChunk]; - - return [SDLRPCRequestFactory buildSpeakWithTTSChunks:ttsChunks correlationID:correlationID]; -} -//***** - -+ (SDLSubscribeButton *)buildSubscribeButtonWithName:(SDLButtonName)buttonName correlationID:(NSNumber<SDLInt> *)correlationID { - SDLSubscribeButton *msg = [[SDLSubscribeButton alloc] init]; - msg.buttonName = buttonName; - msg.correlationID = correlationID; - - return msg; -} - -+ (SDLSubscribeButton *)buildSubscribeButtonWithName:(SDLButtonName)buttonName handler:(SDLRPCNotificationHandler)handler { - SDLSubscribeButton *msg = [[SDLSubscribeButton alloc] initWithHandler:handler]; - msg.buttonName = buttonName; - - return msg; -} - -+ (SDLSubscribeVehicleData *)buildSubscribeVehicleDataWithGPS:(NSNumber<SDLBool> *)gps speed:(NSNumber<SDLBool> *)speed rpm:(NSNumber<SDLBool> *)rpm fuelLevel:(NSNumber<SDLBool> *)fuelLevel fuelLevelState:(NSNumber<SDLBool> *)fuelLevelState instantFuelConsumption:(NSNumber<SDLBool> *)instantFuelConsumption externalTemperature:(NSNumber<SDLBool> *)externalTemperature prndl:(NSNumber<SDLBool> *)prndl tirePressure:(NSNumber<SDLBool> *)tirePressure odometer:(NSNumber<SDLBool> *)odometer beltStatus:(NSNumber<SDLBool> *)beltStatus bodyInformation:(NSNumber<SDLBool> *)bodyInformation deviceStatus:(NSNumber<SDLBool> *)deviceStatus driverBraking:(NSNumber<SDLBool> *)driverBraking wiperStatus:(NSNumber<SDLBool> *)wiperStatus headLampStatus:(NSNumber<SDLBool> *)headLampStatus engineTorque:(NSNumber<SDLBool> *)engineTorque accPedalPosition:(NSNumber<SDLBool> *)accPedalPosition steeringWheelAngle:(NSNumber<SDLBool> *)steeringWheelAngle correlationID:(NSNumber<SDLInt> *)correlationID { - SDLSubscribeVehicleData *msg = [[SDLSubscribeVehicleData alloc] init]; - msg.gps = gps; - msg.speed = speed; - msg.rpm = rpm; - msg.fuelLevel = fuelLevel; - msg.fuelLevel_State = fuelLevelState; - msg.instantFuelConsumption = instantFuelConsumption; - msg.externalTemperature = externalTemperature; - msg.prndl = prndl; - msg.tirePressure = tirePressure; - msg.odometer = odometer; - msg.beltStatus = beltStatus; - msg.bodyInformation = bodyInformation; - msg.deviceStatus = deviceStatus; - msg.driverBraking = driverBraking; - msg.wiperStatus = wiperStatus; - msg.headLampStatus = headLampStatus; - msg.engineTorque = engineTorque; - msg.accPedalPosition = accPedalPosition; - msg.steeringWheelAngle = steeringWheelAngle; - msg.correlationID = correlationID; - - return msg; -} - -+ (SDLUnregisterAppInterface *)buildUnregisterAppInterfaceWithCorrelationID:(NSNumber<SDLInt> *)correlationID { - SDLUnregisterAppInterface *msg = [[SDLUnregisterAppInterface alloc] init]; - msg.correlationID = correlationID; - - return msg; -} - -+ (SDLUnsubscribeButton *)buildUnsubscribeButtonWithName:(SDLButtonName)buttonName correlationID:(NSNumber<SDLInt> *)correlationID { - SDLUnsubscribeButton *msg = [[SDLUnsubscribeButton alloc] init]; - msg.buttonName = buttonName; - msg.correlationID = correlationID; - - return msg; -} - -+ (SDLUnsubscribeVehicleData *)buildUnsubscribeVehicleDataWithGPS:(NSNumber<SDLBool> *)gps speed:(NSNumber<SDLBool> *)speed rpm:(NSNumber<SDLBool> *)rpm fuelLevel:(NSNumber<SDLBool> *)fuelLevel fuelLevelState:(NSNumber<SDLBool> *)fuelLevelState instantFuelConsumption:(NSNumber<SDLBool> *)instantFuelConsumption externalTemperature:(NSNumber<SDLBool> *)externalTemperature prndl:(NSNumber<SDLBool> *)prndl tirePressure:(NSNumber<SDLBool> *)tirePressure odometer:(NSNumber<SDLBool> *)odometer beltStatus:(NSNumber<SDLBool> *)beltStatus bodyInformation:(NSNumber<SDLBool> *)bodyInformation deviceStatus:(NSNumber<SDLBool> *)deviceStatus driverBraking:(NSNumber<SDLBool> *)driverBraking wiperStatus:(NSNumber<SDLBool> *)wiperStatus headLampStatus:(NSNumber<SDLBool> *)headLampStatus engineTorque:(NSNumber<SDLBool> *)engineTorque accPedalPosition:(NSNumber<SDLBool> *)accPedalPosition steeringWheelAngle:(NSNumber<SDLBool> *)steeringWheelAngle correlationID:(NSNumber<SDLInt> *)correlationID { - SDLUnsubscribeVehicleData *msg = [[SDLUnsubscribeVehicleData alloc] init]; - msg.gps = gps; - msg.speed = speed; - msg.rpm = rpm; - msg.fuelLevel = fuelLevel; - msg.fuelLevel_State = fuelLevelState; - msg.instantFuelConsumption = instantFuelConsumption; - msg.externalTemperature = externalTemperature; - msg.prndl = prndl; - msg.tirePressure = tirePressure; - msg.odometer = odometer; - msg.beltStatus = beltStatus; - msg.bodyInformation = bodyInformation; - msg.deviceStatus = deviceStatus; - msg.driverBraking = driverBraking; - msg.wiperStatus = wiperStatus; - msg.headLampStatus = headLampStatus; - msg.engineTorque = engineTorque; - msg.accPedalPosition = accPedalPosition; - msg.steeringWheelAngle = steeringWheelAngle; - msg.correlationID = correlationID; - - return msg; -} - -+ (SDLUpdateTurnList *)buildUpdateTurnListWithTurnList:(NSMutableArray<SDLTurn *> *)turnList softButtons:(NSMutableArray<SDLSoftButton *> *)softButtons correlationID:(NSNumber<SDLInt> *)correlationID { - SDLUpdateTurnList *msg = [[SDLUpdateTurnList alloc] init]; - msg.turnList = [turnList mutableCopy]; - msg.softButtons = [softButtons mutableCopy]; - msg.correlationID = correlationID; - - return msg; -} - -@end diff --git a/SmartDeviceLink/SmartDeviceLink.h b/SmartDeviceLink/SmartDeviceLink.h index 17cbaa1fa..7e469b0f7 100644 --- a/SmartDeviceLink/SmartDeviceLink.h +++ b/SmartDeviceLink/SmartDeviceLink.h @@ -51,9 +51,6 @@ FOUNDATION_EXPORT const unsigned char SmartDeviceLinkVersionString[]; #import "SDLRPCResponse.h" #import "SDLRPCStruct.h" -// Factories -#import "SDLRPCRequestFactory.h" - // Requests #import "SDLAddCommand.h" #import "SDLAddSubMenu.h" diff --git a/SmartDeviceLinkTests/RPCSpecs/FactorySpecs/SDLRPCRequestFactorySpec.m b/SmartDeviceLinkTests/RPCSpecs/FactorySpecs/SDLRPCRequestFactorySpec.m deleted file mode 100644 index c8574977c..000000000 --- a/SmartDeviceLinkTests/RPCSpecs/FactorySpecs/SDLRPCRequestFactorySpec.m +++ /dev/null @@ -1,1022 +0,0 @@ -// -// SmartDeviceLinkTests.m -// SmartDeviceLinkTests - - -#import <Foundation/Foundation.h> - -#import <Quick/Quick.h> -#import <Nimble/Nimble.h> -#import <OCMock/OCMock.h> - -#import "SmartDeviceLink.h" - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - -QuickSpecBegin(SDLRPCRequestFactorySpec) - -describe(@"BuildAddCommand Tests", ^ { - it(@"Should build correctly", ^ { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - SDLAddCommand* message = [SDLRPCRequestFactory buildAddCommandWithID:@33 menuName:@"Menu" parentID:@4 position:@500 - vrCommands:nil iconValue:@"No" iconType:SDLImageTypeStatic correlationID:@94]; -#pragma clang diagnostic pop - - expect([message menuParams].position).to(equal(@500)); - expect([message menuParams].menuName).to(equal(@"Menu")); - expect([message menuParams].parentID).to(equal(@4)); - expect([message cmdIcon].value).to(equal(@"No")); - expect([message cmdIcon].imageType).to(equal(SDLImageTypeStatic)); - expect(message.vrCommands).to(beNil()); - expect(message.cmdID).to(equal(@33)); - expect(message.correlationID).to(equal(@94)); - - NSArray<NSString *> *aliases = @[@"Joe1", @"Joe2", @"Joe3", - @"--------------------------------ASLONGOFASTRINGASICANPOSSIBLYMAKEINASINGLELINE---------------------------------"]; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - message = [SDLRPCRequestFactory buildAddCommandWithID:@276 menuName:@"Arbitrary" vrCommands:aliases correlationID:@200]; -#pragma clang diagnostic pop - - expect([message menuParams].position).to(beNil()); - expect([message menuParams].menuName).to(equal(@"Arbitrary")); - expect([message menuParams].parentID).to(beNil()); - expect(message.vrCommands).to(equal(aliases)); - expect(message.cmdIcon).to(beNil()); - expect(message.cmdID).to(equal(@276)); - expect(message.correlationID).to(equal(@200)); - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - message = [SDLRPCRequestFactory buildAddCommandWithID:@9001 vrCommands:@[@" ", @" ", @" ", @""] correlationID:@27]; -#pragma clang diagnostic pop - - expect(message.menuParams).to(beNil()); - expect(message.vrCommands).to(equal(@[@" ", @" ", @" ", @""])); - expect(message.cmdIcon).to(beNil()); - expect(message.cmdID).to(equal(@9001)); - expect(message.correlationID).to(equal(@27)); - }); -}); - -describe(@"BuildAddSubMenu Tests", ^ { - it(@"Should build correctly", ^ { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - SDLAddSubMenu* message = [SDLRPCRequestFactory buildAddSubMenuWithID:@234234 menuName:@"QWERTY" position:@3 correlationID:@13]; -#pragma clang diagnostic pop - - expect(message.menuName).to(equal(@"QWERTY")); - expect(message.position).to(equal(@3)); - expect(message.menuID).to(equal(@234234)); - expect(message.correlationID).to(equal(@13)); - - message = [SDLRPCRequestFactory buildAddSubMenuWithID:@444 menuName:@"Words" correlationID:@423]; - - expect(message.menuName).to(equal(@"Words")); - expect(message.position).to(beNil()); - expect(message.menuID).to(equal(@444)); - expect(message.correlationID).to(equal(@423)); - }); -}); - -describe(@"BuildAlert Tests", ^ { - context(@"With Text", ^ { - it(@"Should build correctly", ^ { - NSArray<SDLSoftButton *> *softButtons = @[[[SDLSoftButton alloc] init]]; - SDLAlert* message = [SDLRPCRequestFactory buildAlertWithAlertText1:@"String1" alertText2:@"String2" alertText3:@"String3" - duration:@9999 softButtons:softButtons correlationID:@41]; - - expect(message.alertText1).to(equal(@"String1")); - expect(message.alertText2).to(equal(@"String2")); - expect(message.alertText3).to(equal(@"String3")); - expect(message.ttsChunks).to(beNil()); - expect(message.duration).to(equal(@9999)); - expect(message.playTone).to(beNil()); - expect(message.progressIndicator).to(beNil()); - expect(message.softButtons).to(equal(softButtons)); - expect(message.correlationID).to(equal(@41)); - - message = [SDLRPCRequestFactory buildAlertWithAlertText1:@"Alarming" alertText2:@"Astonishing" alertText3:@"Attention" - duration:@3000 correlationID:@11234]; - - expect(message.alertText1).to(equal(@"Alarming")); - expect(message.alertText2).to(equal(@"Astonishing")); - expect(message.alertText3).to(equal(@"Attention")); - expect(message.ttsChunks).to(beNil()); - expect(message.duration).to(equal(@3000)); - expect(message.playTone).to(beNil()); - expect(message.progressIndicator).to(beNil()); - expect(message.softButtons).to(beNil()); - expect(message.correlationID).to(equal(@11234)); - - message = [SDLRPCRequestFactory buildAlertWithAlertText1:@"1" alertText2:@"2" duration:@4153 correlationID:@1432143]; - - expect(message.alertText1).to(equal(@"1")); - expect(message.alertText2).to(equal(@"2")); - expect(message.alertText3).to(beNil()); - expect(message.ttsChunks).to(beNil()); - expect(message.duration).to(equal(@4153)); - expect(message.playTone).to(beNil()); - expect(message.progressIndicator).to(beNil()); - expect(message.softButtons).to(beNil()); - expect(message.correlationID).to(equal(@1432143)); - }); - }); - - context(@"With TTS", ^ { - it(@"Should build correctly", ^ { - SDLAlert* message = [SDLRPCRequestFactory buildAlertWithTTS:@"Wat" alertText1:@"11" alertText2:@"12" alertText3:@"13" - playTone:@NO duration:@3424 correlationID:@9999999]; - - expect(message.alertText1).to(equal(@"11")); - expect(message.alertText2).to(equal(@"12")); - expect(message.alertText3).to(equal(@"13")); - expect(((SDLTTSChunk*)[message ttsChunks][0]).text).to(equal(@"Wat")); - expect(message.duration).to(equal(@3424)); - expect(message.playTone).to(equal(@NO)); - expect(message.progressIndicator).to(beNil()); - expect(message.softButtons).to(beNil()); - expect(message.correlationID).to(equal(@9999999)); - - message = [SDLRPCRequestFactory buildAlertWithTTS:@"Say This" alertText1:@"hgkj" alertText2:@"bgydhgfc" - playTone:@YES duration:@6546 correlationID:@65436786]; - - expect(message.alertText1).to(equal(@"hgkj")); - expect(message.alertText2).to(equal(@"bgydhgfc")); - expect(message.alertText3).to(beNil()); - expect(((SDLTTSChunk*)[message ttsChunks][0]).text).to(equal(@"Say This")); - expect(message.duration).to(equal(@6546)); - expect(message.playTone).to(equal(@YES)); - expect(message.progressIndicator).to(beNil()); - expect(message.softButtons).to(beNil()); - expect(message.correlationID).to(equal(@65436786)); - - message = [SDLRPCRequestFactory buildAlertWithTTS:@"Surprise" playTone:@YES correlationID:@34]; - - expect(message.alertText1).to(beNil()); - expect(message.alertText2).to(beNil()); - expect(message.alertText3).to(beNil()); - expect(((SDLTTSChunk*)[message ttsChunks][0]).text).to(equal(@"Surprise")); - expect(message.duration).to(beNil()); - expect(message.playTone).to(equal(@YES)); - expect(message.progressIndicator).to(beNil()); - expect(message.softButtons).to(beNil()); - expect(message.correlationID).to(equal(@34)); - }); - }); - - context(@"With TTSChunks", ^ { - it(@"Should build correctly", ^ { - NSArray<SDLSoftButton *> *softButtons = @[[[SDLSoftButton alloc] init]]; - NSArray<SDLTTSChunk *> *ttsChunks = @[[[SDLTTSChunk alloc] init]]; - SDLAlert* message = [SDLRPCRequestFactory buildAlertWithTTSChunks:ttsChunks alertText1:@"Astonish" alertText2:@"Hi" alertText3:@"Alert" - playTone:@NO duration:@4145 softButtons:softButtons correlationID:@19]; - - expect(message.alertText1).to(equal(@"Astonish")); - expect(message.alertText2).to(equal(@"Hi")); - expect(message.alertText3).to(equal(@"Alert")); - expect(message.ttsChunks).to(equal(ttsChunks)); - expect(message.duration).to(equal(@4145)); - expect(message.playTone).to(equal(@NO)); - expect(message.progressIndicator).to(beNil()); - expect(message.softButtons).to(equal(softButtons)); - expect(message.correlationID).to(equal(@19)); - - message = [SDLRPCRequestFactory buildAlertWithTTSChunks:ttsChunks playTone:@YES correlationID:@1234321]; - - expect(message.alertText1).to(beNil()); - expect(message.alertText2).to(beNil()); - expect(message.alertText3).to(beNil()); - expect(message.ttsChunks).to(equal(ttsChunks)); - expect(message.duration).to(beNil()); - expect(message.playTone).to(equal(@YES)); - expect(message.progressIndicator).to(beNil()); - expect(message.softButtons).to(beNil()); - expect(message.correlationID).to(equal(@1234321)); - }); - }); -}); - - -describe(@"SDLAlertManeuver Tests", ^ { - __block NSMutableArray<SDLSoftButton *> *softButtons = nil; - __block NSMutableArray<SDLTTSChunk *> *ttsChunks = nil; - __block SDLAlertManeuver *message = nil; - - describe(@"Should build correctly", ^ { - beforeEach(^{ - softButtons = [@[[[SDLSoftButton alloc] init]] mutableCopy]; - ttsChunks = [@[[[SDLTTSChunk alloc] init]] mutableCopy]; - message = [SDLRPCRequestFactory buildAlertManeuverwithTTSchunks:ttsChunks softButtons:softButtons correlationID:@1234]; - }); - - it(@"Should properly set TTS Chunks", ^{ - expect(message.ttsChunks).to(equal(ttsChunks)); - }); - - it(@"Should properly set Soft Buttons", ^{ - expect(message.softButtons).to(equal(softButtons)); - }); - - it(@"Should properly set Correlation ID", ^{ - expect(message.correlationID).to(equal(@1234)); - }); - }); -}); - - -describe(@"BuildChangeRegistration Tests", ^ { - it(@"Should build correctly", ^ { - SDLChangeRegistration* message = [SDLRPCRequestFactory buildChangeRegistrationWithLanguage:SDLLanguageEnGb hmiDisplayLanguage:SDLLanguageDeDe correlationID:@22336644]; - - expect(message.language).to(equal(SDLLanguageEnGb)); - expect(message.hmiDisplayLanguage).to(equal(SDLLanguageDeDe)); - expect(message.correlationID).to(equal(@22336644)); - }); -}); - -describe(@"BuildCreateInteractionChoiceSet Tests", ^ { - it(@"Should build correctly", ^ { - NSArray<SDLChoice *> *choices = @[[[SDLChoice alloc] init]]; - SDLCreateInteractionChoiceSet* message = [SDLRPCRequestFactory buildCreateInteractionChoiceSetWithID:@4567654 choiceSet:choices correlationID:@0]; - - expect(message.interactionChoiceSetID).to(equal(@4567654)); - expect(message.choiceSet).to(equal(choices)); - expect(message.correlationID).to(equal(@0)); - }); -}); - -describe(@"BuildDeleteCommand Tests", ^ { - it(@"Should build correctly", ^ { - SDLDeleteCommand* message = [SDLRPCRequestFactory buildDeleteCommandWithID:@2 correlationID:@234]; - - expect(message.cmdID).to(equal(@2)); - expect(message.correlationID).to(equal(@234)); - }); -}); - -describe(@"BuildDeleteFile Tests", ^ { - it(@"Should build correctly", ^ { - SDLDeleteFile* message = [SDLRPCRequestFactory buildDeleteFileWithName:@"CRITICAL_FILE" correlationID:@4930]; - - expect(message.syncFileName).to(equal(@"CRITICAL_FILE")); - expect(message.correlationID).to(equal(@4930)); - }); -}); - -describe(@"BuildListFiles Tests", ^ { - it(@"Should build correctly", ^ { - SDLListFiles* message = [SDLRPCRequestFactory buildListFilesWithCorrelationID:@13123]; - - expect(message.correlationID).to(equal(@13123)); - }); -}); - -describe(@"BuildDeleteInteractionChoiceSet Tests", ^ { - it(@"Should build correctly", ^ { - SDLDeleteInteractionChoiceSet* message = [SDLRPCRequestFactory buildDeleteInteractionChoiceSetWithID:@46765426 correlationID:@46765426]; - - expect(message.interactionChoiceSetID).to(equal(@46765426)); - expect(message.correlationID).to(equal(@46765426)); - }); -}); - -describe(@"BuildDeleteSubMenu Tests", ^ { - it(@"Should build correctly", ^ { - SDLDeleteSubMenu* message = [SDLRPCRequestFactory buildDeleteSubMenuWithID:@3515 correlationID:@5153]; - - expect(message.menuID).to(equal(@3515)); - expect(message.correlationID).to(equal(@5153)); - }); -}); - -describe(@"BuildDialNumber", ^{ - __block SDLDialNumber *message = nil; - __block NSString *someNumberString = nil; - - describe(@"when built correctly", ^{ - beforeEach(^{ - someNumberString = @"1234567890"; - message = [SDLRPCRequestFactory buildDialNumberWithNumber:someNumberString]; - }); - - it(@"should not be nil", ^{ - expect(message).toNot(beNil()); - }); - - it(@"should have number set properly", ^{ - expect(message.number).to(equal(someNumberString)); - }); - }); -}); - -describe(@"BuildEndAudioPassThru Tests", ^ { - it(@"Should build correctly", ^ { - SDLEndAudioPassThru* message = [SDLRPCRequestFactory buildEndAudioPassThruWithCorrelationID:@13123]; - - expect(message.correlationID).to(equal(@13123)); - }); -}); - -describe(@"BuildGetDTCs Tests", ^ { - it(@"Should build correctly", ^ { - SDLGetDTCs* message = [SDLRPCRequestFactory buildGetDTCsWithECUName:@255 correlationID:@60806050]; - - expect(message.ecuName).to(equal(@255)); - expect(message.dtcMask).to(beNil()); - expect(message.correlationID).to(equal(@60806050)); - }); -}); - -describe(@"BuildGetVehicleData Tests", ^ { - it(@"Should build correctly", ^ { - SDLGetVehicleData* message = [SDLRPCRequestFactory buildGetVehicleDataWithGPS:@YES speed:@NO rpm:@NO - fuelLevel:@YES fuelLevelState:@YES instantFuelConsumption:@NO - externalTemperature:@YES vin:@YES prndl:@YES - tirePressure:@NO odometer:@NO beltStatus:@NO - bodyInformation:@YES deviceStatus:@NO driverBraking:@NO - wiperStatus:@NO headLampStatus:@YES engineTorque:@YES - accPedalPosition:@NO steeringWheelAngle:@YES correlationID:@936]; - - expect(message.gps).to(equal(@YES)); - expect(message.speed).to(equal(@NO)); - expect(message.rpm).to(equal(@NO)); - expect(message.fuelLevel).to(equal(@YES)); - expect(message.fuelLevel_State).to(equal(@YES)); - expect(message.instantFuelConsumption).to(equal(@NO)); - expect(message.externalTemperature).to(equal(@YES)); - expect(message.vin).to(equal(@YES)); - expect(message.prndl).to(equal(@YES)); - expect(message.tirePressure).to(equal(@NO)); - expect(message.odometer).to(equal(@NO)); - expect(message.beltStatus).to(equal(@NO)); - expect(message.bodyInformation).to(equal(@YES)); - expect(message.deviceStatus).to(equal(@NO)); - expect(message.driverBraking).to(equal(@NO)); - expect(message.wiperStatus).to(equal(@NO)); - expect(message.headLampStatus).to(equal(@YES)); - expect(message.engineTorque).to(equal(@YES)); - expect(message.accPedalPosition).to(equal(@NO)); - expect(message.steeringWheelAngle).to(equal(@YES)); - expect(message.eCallInfo).to(beNil()); - expect(message.airbagStatus).to(beNil()); - expect(message.emergencyEvent).to(beNil()); - expect(message.clusterModeStatus).to(beNil()); - expect(message.myKey).to(beNil()); - expect(message.correlationID).to(equal(@936)); - }); -}); - -describe(@"BuildPerformAudioPassThru Tests", ^ { - it(@"Should build correctly", ^ { - SDLPerformAudioPassThru* message = [SDLRPCRequestFactory buildPerformAudioPassThruWithInitialPrompt:@"" audioPassThruDisplayText1:@"Display1" audioPassThruDisplayText2:@"Display2" - samplingRate:SDLSamplingRate44KHZ maxDuration:@10 bitsPerSample:SDLBitsPerSample16Bit audioType:SDLAudioTypePCM - muteAudio:@NO correlationID:@2500]; - - expect(((SDLTTSChunk*)[message initialPrompt][0]).text).to(beNil()); - expect(message.audioPassThruDisplayText1).to(equal(@"Display1")); - expect(message.audioPassThruDisplayText2).to(equal(@"Display2")); - expect(message.samplingRate).to(equal(SDLSamplingRate44KHZ)); - expect(message.maxDuration).to(equal(@10)); - expect(message.bitsPerSample).to(equal(SDLBitsPerSample16Bit)); - expect(message.audioType).to(equal(SDLAudioTypePCM)); - expect(message.muteAudio).to(equal(@NO)); - expect(message.correlationID).to(equal(@2500)); - }); -}); - -describe(@"BuildPerformInteraction Tests", ^ { - context(@"With Initial Chunks", ^ { - it(@"Should build correctly", ^ { - NSArray<SDLTTSChunk *> *initialChunks = @[[[SDLTTSChunk alloc] init]]; - NSArray<SDLTTSChunk *> *helpChunks = @[[[SDLTTSChunk alloc] init]]; - NSArray<SDLTTSChunk *> *timeoutChunks = @[[[SDLTTSChunk alloc] init]]; - NSArray<SDLVRHelpItem *> *vrHelp = @[[[SDLVRHelpItem alloc] init]]; - SDLPerformInteraction* message = [SDLRPCRequestFactory buildPerformInteractionWithInitialChunks:initialChunks initialText:@"Start" interactionChoiceSetIDList:@[@878] - helpChunks:helpChunks timeoutChunks:timeoutChunks interactionMode:SDLInteractionModeManualOnly timeout:@7500 - vrHelp:vrHelp correlationID:@272727]; - - expect(message.initialPrompt).to(equal(initialChunks)); - expect(message.initialText).to(equal(@"Start")); - expect(message.interactionChoiceSetIDList).to(equal(@[@878])); - expect(message.helpPrompt).to(equal(helpChunks)); - expect(message.timeoutPrompt).to(equal(timeoutChunks)); - expect(message.interactionMode).to(equal(SDLInteractionModeManualOnly)); - expect(message.timeout).to(equal(@7500)); - expect(message.vrHelp).to(equal(vrHelp)); - expect(message.interactionLayout).to(beNil()); - expect(message.correlationID).to(equal(@272727)); - }); - }); - - context(@"With Initial Prompt", ^ { - it(@"Should build correctly", ^ { - NSArray<SDLVRHelpItem *> *vrHelp = @[[[SDLVRHelpItem alloc] init]]; - SDLPerformInteraction* message = [SDLRPCRequestFactory buildPerformInteractionWithInitialPrompt:@"Nothing" initialText:@"Still Nothing" interactionChoiceSetIDList:@[@4223, @1337] - helpPrompt:@"A Whole Lot of Nothing" timeoutPrompt:@"Time Remaining" interactionMode:SDLInteractionModeVoiceRecognitionOnly - timeout:@5600 vrHelp:vrHelp correlationID:@31564]; - - expect(((SDLTTSChunk*)[message initialPrompt][0]).text).to(equal(@"Nothing")); - expect(message.initialText).to(equal(@"Still Nothing")); - expect(message.interactionChoiceSetIDList).to(equal(@[@4223, @1337])); - expect(((SDLTTSChunk*)[message helpPrompt][0]).text).to(equal(@"A Whole Lot of Nothing")); - expect(((SDLTTSChunk*)[message timeoutPrompt][0]).text).to(equal(@"Time Remaining")); - expect(message.interactionMode).to(equal(SDLInteractionModeVoiceRecognitionOnly)); - expect(message.timeout).to(equal(@5600)); - expect(message.vrHelp).to(equal(vrHelp)); - expect(message.interactionLayout).to(beNil()); - expect(message.correlationID).to(equal(@31564)); - - message = [SDLRPCRequestFactory buildPerformInteractionWithInitialPrompt:@"A" initialText:@"B" interactionChoiceSetIDList:@[@1, @2, @3, @4] helpPrompt:@"C" timeoutPrompt:@"D" - interactionMode:SDLInteractionModeBoth timeout:@10000 correlationID:@7734]; - - expect(((SDLTTSChunk*)[message initialPrompt][0]).text).to(equal(@"A")); - expect(message.initialText).to(equal(@"B")); - expect(message.interactionChoiceSetIDList).to(equal(@[@1, @2, @3, @4])); - expect(((SDLTTSChunk*)[message helpPrompt][0]).text).to(equal(@"C")); - expect(((SDLTTSChunk*)[message timeoutPrompt][0]).text).to(equal(@"D")); - expect(message.interactionMode).to(equal(SDLInteractionModeBoth)); - expect(message.timeout).to(equal(@10000)); - expect(message.vrHelp).to(beNil()); - expect(message.interactionLayout).to(beNil()); - expect(message.correlationID).to(equal(@7734)); - - message = [SDLRPCRequestFactory buildPerformInteractionWithInitialPrompt:@"Initializing" initialText:@"Initialized" interactionChoiceSetID:@1456 vrHelp:vrHelp correlationID:@7056704]; - - expect(((SDLTTSChunk*)[message initialPrompt][0]).text).to(equal(@"Initializing")); - expect(message.initialText).to(equal(@"Initialized")); - expect(message.interactionChoiceSetIDList).to(equal(@[@1456])); - expect(message.helpPrompt).to(beNil()); - expect(message.timeoutPrompt).to(beNil()); - //Don't know whether the reason for this failure is a bug... - expect(message.interactionMode).to(equal(SDLInteractionModeBoth)); - expect(message.timeout).to(beNil()); - expect(message.vrHelp).to(equal(vrHelp)); - expect(message.interactionLayout).to(beNil()); - expect(message.correlationID).to(equal(@7056704)); - - message = [SDLRPCRequestFactory buildPerformInteractionWithInitialPrompt:@"#$%@" initialText:@"!%%&&^$" interactionChoiceSetID:@105503 correlationID:@1454156465]; - - expect(((SDLTTSChunk*)[message initialPrompt][0]).text).to(equal(@"#$%@")); - expect(message.initialText).to(equal(@"!%%&&^$")); - expect(message.interactionChoiceSetIDList).to(equal(@[@105503])); - expect(message.helpPrompt).to(beNil()); - expect(message.timeoutPrompt).to(beNil()); - expect(message.interactionMode).to(equal(SDLInteractionModeBoth)); - expect(message.timeout).to(beNil()); - expect(message.vrHelp).to(beNil()); - expect(message.interactionLayout).to(beNil()); - expect(message.correlationID).to(equal(@1454156465)); - }); - }); -}); - -describe(@"BuildPutFile Tests", ^ { - it(@"Should build correctly", ^ { - SDLPutFile* message = [SDLRPCRequestFactory buildPutFileWithFileName:@"YES!?" fileType:SDLFileTypeBMP persistentFile:@165636 correlationID:@147986]; - - expect(message.syncFileName).to(equal(@"YES!?")); - expect(message.fileType).to(equal(SDLFileTypeBMP)); - expect(message.persistentFile).to(equal(@165636)); - expect(message.correlationID).to(equal(@147986)); - }); -}); - -describe(@"BuildReadDID Tests", ^ { - it(@"Should build correctly", ^ { - SDLReadDID* message = [SDLRPCRequestFactory buildReadDIDWithECUName:@12500 didLocation:@[@1, @5, @10, @10, @5, @1] correlationID:@6465678]; - - expect(message.ecuName).to(equal(@12500)); - expect(message.didLocation).to(equal(@[@1, @5, @10, @10, @5, @1])); - expect(message.correlationID).to(equal(@6465678)); - }); -}); - -describe(@"BuildRegisterAppInterface Tests", ^ { - it(@"Should build correctly", ^ { - // Mock the infomation that will be pulled from the mainBundle. - id bundleMock = OCMPartialMock([NSBundle mainBundle]); - OCMStub([bundleMock infoDictionary]).andReturn(@{@"CFBundleShortVersionString" : @"1.2.3.4"}); - OCMStub([bundleMock bundleIdentifier]).andReturn(@"com.register.test"); - - NSMutableArray<SDLTTSChunk *> *ttsName = [NSMutableArray arrayWithArray:@[[[SDLTTSChunk alloc] init]]]; - NSMutableArray<NSString *> *synonyms = [NSMutableArray arrayWithArray:@[@"Q", @"W", @"E", @"R"]]; - SDLRegisterAppInterface* message = [SDLRPCRequestFactory buildRegisterAppInterfaceWithAppName:@"Interface" ttsName:ttsName vrSynonyms:synonyms - isMediaApp:@YES languageDesired:SDLLanguageEnUs - hmiDisplayLanguageDesired:SDLLanguageEsMx appID:@"6h43g"]; - - expect(message.syncMsgVersion).toNot(beNil()); - expect(message.syncMsgVersion.majorVersion).to(equal(@1)); - expect(message.syncMsgVersion.minorVersion).to(equal(@0)); - - expect(message.appInfo.appBundleID).to(equal(@"com.register.test")); - expect(message.appInfo.appDisplayName).to(equal(@"Interface")); - expect(message.appInfo.appVersion).to(equal(@"1.2.3.4")); - - expect(message.appName).to(equal(@"Interface")); - expect(message.ttsName).to(equal(ttsName)); - expect(message.ngnMediaScreenAppName).to(equal(@"Interface")); - expect(message.vrSynonyms).to(equal(@[@"Q", @"W", @"E", @"R"])); - expect(message.isMediaApplication).to(equal(@YES)); - expect(message.languageDesired).to(equal(SDLLanguageEnUs)); - expect(message.hmiDisplayLanguageDesired).to(equal(SDLLanguageEsMx)); - expect(message.appHMIType).to(beNil()); - expect(message.hashID).to(beNil()); - expect(message.deviceInfo).toNot(beNil()); - expect(message.appID).to(equal(@"6h43g")); - expect(message.correlationID).to(equal(@1)); - - message = [SDLRPCRequestFactory buildRegisterAppInterfaceWithAppName:@"Register App Interface" isMediaApp:@NO languageDesired:SDLLanguagePtBr appID:@"36g6rsw4"]; - - expect(message.syncMsgVersion).toNot(beNil()); - expect(message.syncMsgVersion.majorVersion).to(equal(@1)); - expect(message.syncMsgVersion.minorVersion).to(equal(@0)); - - expect(message.appInfo.appBundleID).to(equal(@"com.register.test")); - expect(message.appInfo.appDisplayName).to(equal(@"Register App Interface")); - expect(message.appInfo.appVersion).to(equal(@"1.2.3.4")); - - expect(message.appName).to(equal(@"Register App Interface")); - expect(message.ttsName).to(beNil()); - expect(message.ngnMediaScreenAppName).to(equal(@"Register App Interface")); - expect(message.vrSynonyms).to(equal(@[@"Register App Interface"])); - expect(message.isMediaApplication).to(equal(@NO)); - expect(message.languageDesired).to(equal(SDLLanguagePtBr)); - expect(message.hmiDisplayLanguageDesired).to(equal(SDLLanguagePtBr)); - expect(message.appHMIType).to(beNil()); - expect(message.hashID).to(beNil()); - expect(message.deviceInfo).toNot(beNil()); - expect(message.appID).to(equal(@"36g6rsw4")); - expect(message.correlationID).to(equal(@1)); - - message = [SDLRPCRequestFactory buildRegisterAppInterfaceWithAppName:@"..." languageDesired:SDLLanguageCsCz appID:@"56ht5j"]; - - expect(message.syncMsgVersion).toNot(beNil()); - expect(message.syncMsgVersion.majorVersion).to(equal(@1)); - expect(message.syncMsgVersion.minorVersion).to(equal(@0)); - - expect(message.appInfo.appBundleID).to(equal(@"com.register.test")); - expect(message.appInfo.appDisplayName).to(equal(@"...")); - expect(message.appInfo.appVersion).to(equal(@"1.2.3.4")); - - expect(message.appName).to(equal(@"...")); - expect(message.ttsName).to(beNil()); - expect(message.ngnMediaScreenAppName).to(equal(@"...")); - expect(message.vrSynonyms).to(equal(@[@"..."])); - expect(message.isMediaApplication).to(equal(@NO)); - expect(message.languageDesired).to(equal(SDLLanguageCsCz)); - expect(message.hmiDisplayLanguageDesired).to(equal(SDLLanguageCsCz)); - expect(message.appHMIType).to(beNil()); - expect(message.hashID).to(beNil()); - expect(message.deviceInfo).toNot(beNil()); - expect(message.appID).to(equal(@"56ht5j")); - expect(message.correlationID).to(equal(@1)); - }); -}); - -describe(@"BuildResetGlobalProperties Tests", ^ { - it(@"Should build correctly", ^ { - SDLResetGlobalProperties* message = [SDLRPCRequestFactory buildResetGlobalPropertiesWithProperties:@[SDLGlobalPropertyMenuName, SDLGlobalPropertyTimeoutPrompt] - correlationID:@906842]; - - expect(message.properties).to(equal(@[SDLGlobalPropertyMenuName, SDLGlobalPropertyTimeoutPrompt])); - expect(message.correlationID).to(equal(@906842)); - }); -}); - -describe(@"BuildSendLocation", ^{ - __block SDLSendLocation *message = nil; - __block NSNumber *someLongitude = nil; - __block NSNumber *someLatitude = nil; - __block NSString *someLocation = nil; - __block NSString *someLocationDescription = nil; - __block NSArray<NSString *> *someAddressLines = nil; - __block NSString *somePhoneNumber = nil; - __block SDLImage *someImage = nil; - - describe(@"when built correctly", ^{ - beforeEach(^{ - someLongitude = @123.4567; - someLatitude = @65.4321; - someLocation = @"Livio"; - someLocationDescription = @"A great place to work"; - someAddressLines = @[@"3136 Hilton Rd", @"Ferndale, MI", @"48220"]; - somePhoneNumber = @"248-591-0333"; - someImage = [[SDLImage alloc] init]; - - message = [SDLRPCRequestFactory buildSendLocationWithLongitude:someLongitude latitude:someLatitude locationName:someLocation locationDescription:someLocationDescription address:someAddressLines phoneNumber:somePhoneNumber image:someImage]; - }); - - it(@"should not be nil", ^{ - expect(message).toNot(beNil()); - }); - - it(@"should properly set longitude", ^{ - expect(message.longitudeDegrees).to(equal(someLongitude)); - }); - - it(@"should properly set latitude", ^{ - expect(message.latitudeDegrees).to(equal(someLatitude)); - }); - - it(@"should properly set location", ^{ - expect(message.locationName).to(equal(someLocation)); - }); - - it(@"should properly set location description", ^{ - expect(message.locationDescription).to(equal(someLocationDescription)); - }); - - it(@"should properly set address lines", ^{ - expect(message.addressLines).to(equal(someAddressLines)); - }); - - it(@"should properly set phone number", ^{ - expect(message.phoneNumber).to(equal(somePhoneNumber)); - }); - - it(@"should properly set image", ^{ - expect(message.locationImage).to(equal(someImage)); - }); - }); -}); - -describe(@"BuildScrollableMessage Tests", ^ { - it(@"Should build correctly", ^ { - NSArray<SDLSoftButton *> *softButtons = @[[[SDLSoftButton alloc] init]]; - SDLScrollableMessage* message = [SDLRPCRequestFactory buildScrollableMessage:@"Message Box" timeout:@37821 softButtons:softButtons correlationID:@9783356]; - - expect(message.scrollableMessageBody).to(equal(@"Message Box")); - expect(message.timeout).to(equal(@37821)); - expect(message.softButtons).to(equal(softButtons)); - expect(message.correlationID).to(equal(@9783356)); - }); -}); - -describe(@"BuildSetAppIcon Tests", ^ { - it(@"Should build correctly", ^ { - SDLSetAppIcon* message = [SDLRPCRequestFactory buildSetAppIconWithFileName:@"Iconic" correlationID:@465819]; - - expect(message.syncFileName).to(equal(@"Iconic")); - expect(message.correlationID).to(equal(@465819)); - }); -}); - -describe(@"BuildSetDisplayLayout Tests", ^ { - it(@"Should build correctly", ^ { - SDLSetDisplayLayout* message = [SDLRPCRequestFactory buildSetDisplayLayout:@"NONE" correlationID:@467926]; - - expect(message.displayLayout).to(equal(@"NONE")); - expect(message.correlationID).to(equal(@467926)); - }); -}); - -describe(@"BuildSetGlobalProperties Tests", ^ { - it(@"Should build correctly", ^ { - NSArray<SDLVRHelpItem *> *help = @[[[SDLVRHelpItem alloc] init]]; - SDLSetGlobalProperties* message = [SDLRPCRequestFactory buildSetGlobalPropertiesWithHelpText:@"Beyond Help" timeoutText:@"You took too long" vrHelpTitle:@"Voice" - vrHelp:help correlationID:@5666666]; - - expect(((SDLTTSChunk*)[message helpPrompt][0]).text).to(equal(@"Beyond Help")); - expect(((SDLTTSChunk*)[message timeoutPrompt][0]).text).to(equal(@"You took too long")); - expect(message.vrHelpTitle).to(equal(@"Voice")); - expect(message.vrHelp).to(equal(help)); - expect(message.menuTitle).to(beNil()); - expect(message.menuIcon).to(beNil()); - expect(message.keyboardProperties).to(beNil()); - expect(message.correlationID).to(equal(@5666666)); - - message = [SDLRPCRequestFactory buildSetGlobalPropertiesWithHelpText:@"Helpful" timeoutText:@"Timed Out" correlationID:@10010100]; - - expect(((SDLTTSChunk*)[message helpPrompt][0]).text).to(equal(@"Helpful")); - expect(((SDLTTSChunk*)[message timeoutPrompt][0]).text).to(equal(@"Timed Out")); - expect(message.vrHelpTitle).to(beNil()); - expect(message.vrHelp).to(beNil()); - expect(message.menuTitle).to(beNil()); - expect(message.menuIcon).to(beNil()); - expect(message.keyboardProperties).to(beNil()); - expect(message.correlationID).to(equal(@10010100)); - }); -}); - -describe(@"BuildSetMediaClockTimer Tests", ^ { - it(@"Should build correctly", ^ { - SDLSetMediaClockTimer* message = [SDLRPCRequestFactory buildSetMediaClockTimerWithHours:@15 minutes:@36 seconds:@11 updateMode:SDLUpdateModeCountDown correlationID:@404]; - - expect([message startTime].hours).to(equal(@15)); - expect([message startTime].minutes).to(equal(@36)); - expect([message startTime].seconds).to(equal(@11)); - expect(message.endTime).to(beNil()); - expect(message.updateMode).to(equal(SDLUpdateModeCountDown)); - expect(message.correlationID).to(equal(@404)); - - message = [SDLRPCRequestFactory buildSetMediaClockTimerWithUpdateMode:SDLUpdateModeResume correlationID:@11213141]; - - expect(message.startTime).to(beNil()); - expect(message.endTime).to(beNil()); - expect(message.updateMode).to(equal(SDLUpdateModeResume)); - expect(message.correlationID).to(equal(@11213141)); - }); -}); - -describe(@"BuildShow Tests", ^ { - it(@"Should build correctly", ^ { - SDLImage* image = [[SDLImage alloc] init]; - NSArray<SDLSoftButton *> *softButtons = @[[[SDLSoftButton alloc] init]]; - SDLShow* message = [SDLRPCRequestFactory buildShowWithMainField1:@"11" mainField2:@"22" mainField3:@"33" mainField4:@"44" statusBar:@"Bar" mediaClock:@"Time" mediaTrack:@"Crucial Line" - alignment:SDLTextAlignmentCenter graphic:image softButtons:softButtons customPresets:@[@"w", @"x", @"y", @"z"] correlationID:@3432343]; - - expect(message.mainField1).to(equal(@"11")); - expect(message.mainField2).to(equal(@"22")); - expect(message.mainField3).to(equal(@"33")); - expect(message.mainField4).to(equal(@"44")); - expect(message.statusBar).to(equal(@"Bar")); - expect(message.mediaClock).to(equal(@"Time")); - expect(message.mediaTrack).to(equal(@"Crucial Line")); - expect(message.alignment).to(equal(SDLTextAlignmentCenter)); - expect(message.graphic).to(equal(image)); - expect(message.secondaryGraphic).to(beNil()); - expect(message.softButtons).to(equal(softButtons)); - expect(message.customPresets).to(equal(@[@"w", @"x", @"y", @"z"])); - expect(message.correlationID).to(equal(@3432343)); - - message = [SDLRPCRequestFactory buildShowWithMainField1:@"A" mainField2:@"S" statusBar:@"D" mediaClock:@"F" mediaTrack:@"G" alignment:SDLTextAlignmentRight correlationID:@999]; - - expect(message.mainField1).to(equal(@"A")); - expect(message.mainField2).to(equal(@"S")); - expect(message.mainField3).to(beNil()); - expect(message.mainField4).to(beNil()); - expect(message.statusBar).to(equal(@"D")); - expect(message.mediaClock).to(equal(@"F")); - expect(message.mediaTrack).to(equal(@"G")); - expect(message.alignment).to(equal(SDLTextAlignmentRight)); - expect(message.graphic).to(beNil()); - expect(message.secondaryGraphic).to(beNil()); - expect(message.softButtons).to(beNil()); - expect(message.customPresets).to(beNil()); - expect(message.correlationID).to(equal(@999)); - - message = [SDLRPCRequestFactory buildShowWithMainField1:@"Hello" mainField2:@"World" alignment:SDLTextAlignmentLeft correlationID:@38792607]; - - expect(message.mainField1).to(equal(@"Hello")); - expect(message.mainField2).to(equal(@"World")); - expect(message.mainField3).to(beNil()); - expect(message.mainField4).to(beNil()); - expect(message.statusBar).to(beNil()); - expect(message.mediaClock).to(beNil()); - expect(message.mediaTrack).to(beNil()); - expect(message.alignment).to(equal(SDLTextAlignmentLeft)); - expect(message.graphic).to(beNil()); - expect(message.secondaryGraphic).to(beNil()); - expect(message.softButtons).to(beNil()); - expect(message.customPresets).to(beNil()); - expect(message.correlationID).to(equal(@38792607)); - }); -}); - -describe(@"SDLShowConstantTBT Tests", ^ { - __block NSMutableArray<SDLSoftButton *> *softButtons = nil; - __block SDLImage *image1 = nil; - __block SDLImage *image2 = nil; - __block SDLShowConstantTBT *message = nil; - - describe(@"Should build correctly", ^ { - beforeEach(^{ - softButtons = [@[[[SDLSoftButton alloc] init]] mutableCopy]; - image1 = [[SDLImage alloc]init]; - image2 = [[SDLImage alloc]init]; - message = [SDLRPCRequestFactory buildShowConstantTBTWithString:@"Navigation Text 1" navigationText2:@"Navigation Text 2" eta:@"ETA String" timeToDestination:@"10:31 PM" totalDistance:@"1000 Miles" turnIcon:image1 nextTurnIcon:image2 distanceToManeuver:@100.11 distanceToManeuverScale:@10.20 maneuverComplete:@23.2 softButtons:softButtons correlationID:@1234]; - }); - - it(@"Should properly set title navigation text", ^{ - expect(message.navigationText1).to(equal(@"Navigation Text 1")); - }); - - it(@"Should properly set secondary navigation text", ^{ - expect(message.navigationText2).to(equal(@"Navigation Text 2")); - }); - - it(@"Should properly set Estimated Time Of Arrival (ETA)", ^{ - expect(message.eta).to(equal(@"ETA String")); - }); - - it(@"Should properly set time to distance", ^{ - expect(message.timeToDestination).to(equal(@"10:31 PM")); - }); - - it(@"Should properly set total distance", ^{ - expect(message.totalDistance).to(equal(@"1000 Miles")); - }); - - it(@"Should properly set first turn icon", ^{ - expect(message.turnIcon).to(equal(image1)); - }); - - it(@"Should properly set second turn icon", ^{ - expect(message.nextTurnIcon).to(equal(image2)); - }); - - it(@"Should properly set distance to maneuver", ^{ - expect(message.distanceToManeuver).to(equal(@100.11)); - }); - - it(@"Should properly set scale for distance to maneuver", ^{ - expect(message.distanceToManeuverScale).to(equal(@10.20)); - }); - - it(@"Should properly set maneuver complete", ^{ - expect(message.maneuverComplete).to(equal(@23.2)); - }); - - it(@"Should properly set soft buttons", ^{ - expect(message.softButtons).to(equal(softButtons)); - }); - - it(@"Should properly set the correlation ID", ^{ - expect(message.correlationID).to(equal(@1234)); - }); - }); -}); - -describe(@"BuildSlider Tests", ^ { - it(@"Should build correctly", ^ { - SDLSlider* message = [SDLRPCRequestFactory buildSliderDynamicFooterWithNumTicks:@3 position:@2 sliderHeader:@"HEAD" sliderFooter:@[@"FOOT1", @"FOOT2", @"FOOT3"] timeout:@32321 - correlationID:@200]; - - expect(message.numTicks).to(equal(@3)); - expect(message.position).to(equal(@2)); - expect(message.sliderHeader).to(equal(@"HEAD")); - expect(message.sliderFooter).to(equal(@[@"FOOT1", @"FOOT2", @"FOOT3"])); - expect(message.timeout).to(equal(@32321)); - expect(message.correlationID).to(equal(@200)); - - message = [SDLRPCRequestFactory buildSliderStaticFooterWithNumTicks:@4 position:@2 sliderHeader:@"UP" sliderFooter:@"DOWN" timeout:@65535 correlationID:@1024]; - - expect(message.numTicks).to(equal(@4)); - expect(message.position).to(equal(@2)); - expect(message.sliderHeader).to(equal(@"UP")); - expect(message.sliderFooter).to(equal(@[@"DOWN", @"DOWN", @"DOWN", @"DOWN"])); - expect(message.timeout).to(equal(@65535)); - expect(message.correlationID).to(equal(@1024)); - }); -}); - -describe(@"BuildSpeak Tests", ^ { - it(@"Should build correctly", ^ { - NSArray<SDLTTSChunk *> *ttsChunks = @[[[SDLTTSChunk alloc] init]]; - SDLSpeak* message = [SDLRPCRequestFactory buildSpeakWithTTS:@"GREETINGS HUMAN" correlationID:@65]; - - expect(((SDLTTSChunk*)[message ttsChunks][0]).text).to(equal(@"GREETINGS HUMAN")); - expect(message.correlationID).to(equal(@65)); - - message = [SDLRPCRequestFactory buildSpeakWithTTSChunks:ttsChunks correlationID:@56]; - - expect(message.ttsChunks).to(equal(ttsChunks)); - expect(message.correlationID).to(equal(@56)); - }); -}); - -describe(@"BuildSubscribeButton Tests", ^ { - it(@"Should build correctly", ^ { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - SDLSubscribeButton* message = [SDLRPCRequestFactory buildSubscribeButtonWithName:SDLButtonNameSearch correlationID:@5555555]; -#pragma clang diagnostic pop - - expect(message.buttonName).to(equal(SDLButtonNameSearch)); - expect(message.correlationID).to(equal(@5555555)); - }); -}); - -describe(@"BuildSubscribeVehicleData Tests", ^ { - it(@"Should build correctly", ^ { - SDLSubscribeVehicleData* message = [SDLRPCRequestFactory buildSubscribeVehicleDataWithGPS:@YES speed:@YES rpm:@YES - fuelLevel:@NO fuelLevelState:@NO instantFuelConsumption:@NO - externalTemperature:@YES prndl:@YES tirePressure:@YES - odometer:@NO beltStatus:@NO bodyInformation:@NO - deviceStatus:@YES driverBraking:@YES wiperStatus:@YES - headLampStatus:@NO engineTorque:@NO accPedalPosition:@NO - steeringWheelAngle:@YES correlationID:@3692581470]; - - expect(message.gps).to(equal(@YES)); - expect(message.speed).to(equal(@YES)); - expect(message.rpm).to(equal(@YES)); - expect(message.fuelLevel).to(equal(@NO)); - expect(message.fuelLevel_State).to(equal(@NO)); - expect(message.instantFuelConsumption).to(equal(@NO)); - expect(message.externalTemperature).to(equal(@YES)); - expect(message.prndl).to(equal(@YES)); - expect(message.tirePressure).to(equal(@YES)); - expect(message.odometer).to(equal(@NO)); - expect(message.beltStatus).to(equal(@NO)); - expect(message.bodyInformation).to(equal(@NO)); - expect(message.deviceStatus).to(equal(@YES)); - expect(message.driverBraking).to(equal(@YES)); - expect(message.wiperStatus).to(equal(@YES)); - expect(message.headLampStatus).to(equal(@NO)); - expect(message.engineTorque).to(equal(@NO)); - expect(message.accPedalPosition).to(equal(@NO)); - expect(message.steeringWheelAngle).to(equal(@YES)); - expect(message.eCallInfo).to(beNil()); - expect(message.airbagStatus).to(beNil()); - expect(message.emergencyEvent).to(beNil()); - expect(message.clusterModeStatus).to(beNil()); - expect(message.myKey).to(beNil()); - expect(message.correlationID).to(equal(@3692581470)); - }); -}); - -describe(@"BuildUnregisterAppInterface Tests", ^ { - it(@"Should build correctly", ^ { - SDLUnregisterAppInterface* message = [SDLRPCRequestFactory buildUnregisterAppInterfaceWithCorrelationID:@4200]; - - expect(message.correlationID).to(equal(@4200)); - }); -}); - -describe(@"BuildUnsubscribeButton Tests", ^ { - it(@"Should build correctly", ^ { - SDLUnsubscribeButton* message = [SDLRPCRequestFactory buildUnsubscribeButtonWithName:SDLButtonNameOk correlationID:@88]; - - expect(message.buttonName).to(equal(SDLButtonNameOk)); - expect(message.correlationID).to(equal(@88)); - }); -}); - -describe(@"BuildSubscribeVehicleData Tests", ^ { - it(@"Should build correctly", ^ { - SDLSubscribeVehicleData* message = [SDLRPCRequestFactory buildSubscribeVehicleDataWithGPS:@YES speed:@NO rpm:@YES - fuelLevel:@YES fuelLevelState:@NO instantFuelConsumption:@NO - externalTemperature:@YES prndl:@NO tirePressure:@YES - odometer:@YES beltStatus:@NO bodyInformation:@NO - deviceStatus:@YES driverBraking:@NO wiperStatus:@YES - headLampStatus:@YES engineTorque:@NO accPedalPosition:@NO - steeringWheelAngle:@YES correlationID:@1627384950]; - - expect(message.gps).to(equal(@YES)); - expect(message.speed).to(equal(@NO)); - expect(message.rpm).to(equal(@YES)); - expect(message.fuelLevel).to(equal(@YES)); - expect(message.fuelLevel_State).to(equal(@NO)); - expect(message.instantFuelConsumption).to(equal(@NO)); - expect(message.externalTemperature).to(equal(@YES)); - expect(message.prndl).to(equal(@NO)); - expect(message.tirePressure).to(equal(@YES)); - expect(message.odometer).to(equal(@YES)); - expect(message.beltStatus).to(equal(@NO)); - expect(message.bodyInformation).to(equal(@NO)); - expect(message.deviceStatus).to(equal(@YES)); - expect(message.driverBraking).to(equal(@NO)); - expect(message.wiperStatus).to(equal(@YES)); - expect(message.headLampStatus).to(equal(@YES)); - expect(message.engineTorque).to(equal(@NO)); - expect(message.accPedalPosition).to(equal(@NO)); - expect(message.steeringWheelAngle).to(equal(@YES)); - expect(message.eCallInfo).to(beNil()); - expect(message.airbagStatus).to(beNil()); - expect(message.emergencyEvent).to(beNil()); - expect(message.clusterModeStatus).to(beNil()); - expect(message.myKey).to(beNil()); - expect(message.correlationID).to(equal(@1627384950)); - }); -}); - -describe(@"SDLUpdateTurnList Tests", ^ { - __block NSMutableArray<SDLSoftButton *> *softButtons = nil; - __block NSMutableArray<SDLTurn *> *turns = nil; - __block SDLUpdateTurnList *message = nil; - - __block SDLTurn *turn1 = nil; - __block SDLTurn *turn2 = nil; - - describe(@"Should build correctly", ^ { - beforeEach(^{ - softButtons = [@[[[SDLSoftButton alloc] init]] mutableCopy]; - - turn1 = [[SDLTurn alloc] init]; - turn2 = [[SDLTurn alloc] init]; - turns = [@[turn1, turn2] mutableCopy]; - - message = [SDLRPCRequestFactory buildUpdateTurnListWithTurnList:turns softButtons:softButtons correlationID:@1234]; - }); - - it(@"Should properly set Turns", ^{ - expect(message.turnList).to(equal(turns)); - }); - - it(@"Should properly set Soft Buttons", ^{ - expect(message.softButtons).to(equal(softButtons)); - }); - - it(@"Should properly set Correlation Id", ^{ - expect(message.correlationID).to(equal(@1234)); - }); - }); -}); - -QuickSpecEnd - -#pragma clang diagnostic pop |