diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2016-10-26 13:32:36 -0400 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2016-10-26 13:32:36 -0400 |
commit | ee5bf8caa5192fe8026b57a4e73e91cbb936ce6a (patch) | |
tree | 923af1218a044a71c3097577956ece01a51fafef | |
parent | a319ef8da9750c87737cb8c36131db9bd369288a (diff) | |
parent | 614e8b34a5cb20c1e5f9b19fb5dc48ad35380097 (diff) | |
download | sdl_ios-ee5bf8caa5192fe8026b57a4e73e91cbb936ce6a.tar.gz |
Merge branch 'feature/release_4.3.0_issue_458_inits' into release/4.3.0
115 files changed, 1345 insertions, 143 deletions
diff --git a/SmartDeviceLink/SDLAddCommand.h b/SmartDeviceLink/SDLAddCommand.h index fead3e2dc..d933cff61 100644 --- a/SmartDeviceLink/SDLAddCommand.h +++ b/SmartDeviceLink/SDLAddCommand.h @@ -8,7 +8,7 @@ @class SDLMenuParams; @class SDLImage; - +@class SDLImageType; /** * This class will add a command to the application's Command Menu SDLMenuParams @@ -57,6 +57,12 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithId:(UInt32)commandId vrCommands:(NSArray<NSString *> *)vrCommands handler:(SDLRPCNotificationHandler)handler; + +- (instancetype)initWithId:(UInt32)commandId vrCommands:(NSArray<NSString *> *)vrCommands menuName:(NSString *)menuName handler:(SDLRPCNotificationHandler)handler; + +- (instancetype)initWithId:(UInt32)commandId vrCommands:(NSArray<NSString *> *)vrCommands menuName:(NSString *)menuName parentId:(UInt32)parentId position:(UInt16)position iconValue:(NSString *)iconValue iconType:(SDLImageType *)iconType handler:(SDLRPCNotificationHandler)handler; + /** * A handler that will let you know when the button you created is subscribed. * diff --git a/SmartDeviceLink/SDLAddCommand.m b/SmartDeviceLink/SDLAddCommand.m index a264d164a..72eee7f41 100644 --- a/SmartDeviceLink/SDLAddCommand.m +++ b/SmartDeviceLink/SDLAddCommand.m @@ -34,6 +34,45 @@ return self; } +- (instancetype)initWithId:(UInt32)commandId vrCommands:(NSArray<NSString *> *)vrCommands handler:(SDLRPCNotificationHandler)handler { + return [self initWithId:commandId vrCommands:vrCommands menuName:nil handler:handler]; +} + +- (instancetype)initWithId:(UInt32)commandId vrCommands:(NSArray<NSString *> *)vrCommands menuName:(NSString *)menuName handler:(SDLRPCNotificationHandler)handler { + self = [self init]; + if (!self) { + return nil; + } + + self.cmdID = @(commandId); + + if (menuName != nil) { + self.menuParams = [[SDLMenuParams alloc] initWithMenuName:menuName]; + } + + self.vrCommands = [vrCommands mutableCopy]; + self.handler = handler; + + return self; + +} + +- (instancetype)initWithId:(UInt32)commandId vrCommands:(NSArray<NSString *> *)vrCommands menuName:(NSString *)menuName parentId:(UInt32)parentId position:(UInt16)position iconValue:(NSString *)iconValue iconType:(SDLImageType *)iconType handler:(SDLRPCNotificationHandler)handler { + self = [self initWithId:commandId vrCommands:vrCommands menuName:menuName handler:handler]; + if (!self) { + return nil; + } + + self.menuParams.parentID = @(parentId); + self.menuParams.position = @(position); + + if (iconValue != nil && iconType != nil) { + self.cmdIcon = [[SDLImage alloc] initWithName:iconValue ofType:iconType]; + } + + return self; +} + - (void)setCmdID:(NSNumber *)cmdID { if (cmdID != nil) { [parameters setObject:cmdID forKey:NAMES_cmdID]; diff --git a/SmartDeviceLink/SDLAddSubMenu.h b/SmartDeviceLink/SDLAddSubMenu.h index 0a749b382..94577ba68 100644 --- a/SmartDeviceLink/SDLAddSubMenu.h +++ b/SmartDeviceLink/SDLAddSubMenu.h @@ -31,6 +31,10 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithId:(UInt8)menuId menuName:(NSString *)menuName; + +- (instancetype)initWithId:(UInt8)menuId menuName:(NSString *)menuName position:(UInt8)position; + /** * @abstract a Menu ID that identifies a sub menu * @discussion This value is used in diff --git a/SmartDeviceLink/SDLAddSubMenu.m b/SmartDeviceLink/SDLAddSubMenu.m index f02192b00..983325dee 100644 --- a/SmartDeviceLink/SDLAddSubMenu.m +++ b/SmartDeviceLink/SDLAddSubMenu.m @@ -18,6 +18,31 @@ return self; } + +- (instancetype)initWithId:(UInt8)menuId menuName:(NSString *)menuName position:(UInt8)position { + self = [self initWithId:menuId menuName:menuName]; + if (!self) { + return nil; + } + + self.position = @(position); + + return self; +} + +- (instancetype)initWithId:(UInt8)menuId menuName:(NSString *)menuName { + self = [self init]; + if (!self) { + return nil; + } + + self.menuID = @(menuId); + self.menuName = menuName; + + return self; + +} + - (void)setMenuID:(NSNumber *)menuID { if (menuID != nil) { [parameters setObject:menuID forKey:NAMES_menuID]; diff --git a/SmartDeviceLink/SDLAlert.h b/SmartDeviceLink/SDLAlert.h index 59f909caa..303c8b439 100644 --- a/SmartDeviceLink/SDLAlert.h +++ b/SmartDeviceLink/SDLAlert.h @@ -4,6 +4,9 @@ #import "SDLRPCRequest.h" +@class SDLSoftButton; +@class SDLTTSChunk; + /** * Shows an alert which typically consists of text-to-speech message and text on the display. At least either alertText1, alertText2 or TTSChunks need to be provided. * @@ -47,6 +50,26 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithAlertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 duration:(UInt16)duration; + +- (instancetype)initWithAlertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3; + +- (instancetype)initWithAlertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 duration:(UInt16)duration; + +- (instancetype)initWithAlertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 duration:(UInt16)duration softButtons:(NSArray<SDLSoftButton *> *)softButtons; + +- (instancetype)initWithTTS:(NSString *)ttsText playTone:(BOOL)playTone; + +- (instancetype)initWithTTS:(NSString *)ttsText alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 playTone:(BOOL)playTone duration:(UInt16)duration; + +- (instancetype)initWithTTS:(NSString *)ttsText alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 playTone:(BOOL)playTone duration:(UInt16)duration; + +- (instancetype)initWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks playTone:(BOOL)playTone; + +- (instancetype)initWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 playTone:(BOOL)playTone softButtons:(NSArray<SDLSoftButton *> *)softButtons; + +- (instancetype)initWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 playTone:(BOOL)playTone duration:(UInt16)duration softButtons:(NSArray<SDLSoftButton *> *)softButtons; + /** * @abstract The String to be displayed in the first field of the display during the Alert diff --git a/SmartDeviceLink/SDLAlert.m b/SmartDeviceLink/SDLAlert.m index ddc7fdc3a..4c6110e21 100644 --- a/SmartDeviceLink/SDLAlert.m +++ b/SmartDeviceLink/SDLAlert.m @@ -5,6 +5,9 @@ #import "SDLNames.h" #import "SDLSoftButton.h" #import "SDLTTSChunk.h" +#import "SDLTTSChunkFactory.h" + +static UInt16 const SDLDefaultDuration = 5000; @implementation SDLAlert @@ -20,6 +23,60 @@ return self; } +- (instancetype)initWithAlertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 { + return [self initWithAlertText1:alertText1 alertText2:alertText2 alertText3:alertText3 duration:SDLDefaultDuration]; +} + +- (instancetype)initWithAlertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 duration:(UInt16)duration { + return [self initWithAlertText1:alertText1 alertText2:alertText2 alertText3:nil duration:duration]; +} + +- (instancetype)initWithAlertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 duration:(UInt16)duration { + return [self initWithAlertText1:alertText1 alertText2:alertText2 alertText3:alertText3 duration:duration softButtons:nil]; +} + +- (instancetype)initWithAlertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 duration:(UInt16)duration softButtons:(NSArray<SDLSoftButton *> *)softButtons { + return [self initWithTTSChunks:nil alertText1:alertText1 alertText2:alertText2 alertText3:alertText3 playTone:NO duration:duration softButtons:softButtons]; +} + +- (instancetype)initWithTTS:(NSString *)ttsText playTone:(BOOL)playTone { + return [self initWithTTS:ttsText alertText1:nil alertText2:nil playTone:playTone duration:SDLDefaultDuration]; +} + +- (instancetype)initWithTTS:(NSString *)ttsText alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 playTone:(BOOL)playTone duration:(UInt16)duration { + return [self initWithTTS:ttsText alertText1:alertText1 alertText2:alertText2 alertText3:nil playTone:playTone duration:duration]; +} + +- (instancetype)initWithTTS:(NSString *)ttsText alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 playTone:(BOOL)playTone duration:(UInt16)duration { + NSMutableArray* ttsChunks = [SDLTTSChunkFactory buildTTSChunksFromSimple:ttsText]; + return [self initWithTTSChunks:ttsChunks alertText1:alertText1 alertText2:alertText2 alertText3:alertText3 playTone:playTone duration:duration softButtons:nil]; +} + +- (instancetype)initWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks playTone:(BOOL)playTone { + return [self initWithTTSChunks:ttsChunks alertText1:nil alertText2:nil alertText3:nil playTone:playTone duration:SDLDefaultDuration softButtons:nil]; +} + +- (instancetype)initWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 playTone:(BOOL)playTone softButtons:(NSArray<SDLSoftButton *> *)softButtons { + return [self initWithTTSChunks:ttsChunks alertText1:alertText1 alertText2:alertText2 alertText3:alertText3 playTone:playTone duration:SDLDefaultDuration softButtons:softButtons]; +} + +- (instancetype)initWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 playTone:(BOOL)playTone duration:(UInt16)duration softButtons:(NSArray<SDLSoftButton *> *)softButtons { + self = [self init]; + if (!self) { + return nil; + } + + self.ttsChunks = [ttsChunks mutableCopy]; + self.alertText1 = alertText1; + self.alertText2 = alertText2; + self.alertText3 = alertText3; + self.playTone = @(playTone); + self.duration = @(duration); + self.softButtons = [softButtons mutableCopy]; + + return self; +} + - (void)setAlertText1:(NSString *)alertText1 { if (alertText1 != nil) { [parameters setObject:alertText1 forKey:NAMES_alertText1]; diff --git a/SmartDeviceLink/SDLAlertManeuver.h b/SmartDeviceLink/SDLAlertManeuver.h index 2bb8e12ed..d3ac7a8ed 100644 --- a/SmartDeviceLink/SDLAlertManeuver.h +++ b/SmartDeviceLink/SDLAlertManeuver.h @@ -4,6 +4,10 @@ #import "SDLRPCRequest.h" +@class SDLSoftButton; +@class SDLTTSChunk; + + /** * @since SmartDeviceLink 1.0 */ @@ -13,6 +17,9 @@ - (instancetype)init; - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithTTS:(NSString *)ttsText softButtons:(NSArray<SDLSoftButton *> *)softButtons; +- (instancetype)initWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks softButtons:(NSArray<SDLSoftButton *> *)softButtons; + @property (strong) NSMutableArray *ttsChunks; @property (strong) NSMutableArray *softButtons; diff --git a/SmartDeviceLink/SDLAlertManeuver.m b/SmartDeviceLink/SDLAlertManeuver.m index 81717506f..0bda5acaf 100644 --- a/SmartDeviceLink/SDLAlertManeuver.m +++ b/SmartDeviceLink/SDLAlertManeuver.m @@ -7,6 +7,7 @@ #import "SDLNames.h" #import "SDLSoftButton.h" #import "SDLTTSChunk.h" +#import "SDLTTSChunkFactory.h" @implementation SDLAlertManeuver @@ -22,6 +23,23 @@ return self; } +- (instancetype)initWithTTS:(NSString *)ttsText softButtons:(NSArray<SDLSoftButton *> *)softButtons { + NSMutableArray* ttsChunks = [SDLTTSChunkFactory buildTTSChunksFromSimple:ttsText]; + return [self initWithTTSChunks:ttsChunks softButtons:softButtons]; +} + +- (instancetype)initWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks softButtons:(NSArray<SDLSoftButton *> *)softButtons { + self = [self init]; + if (!self) { + return nil; + } + + self.ttsChunks = [ttsChunks mutableCopy]; + self.softButtons = [softButtons mutableCopy]; + + return self; +} + - (void)setTtsChunks:(NSMutableArray *)ttsChunks { if (ttsChunks != nil) { [parameters setObject:ttsChunks forKey:NAMES_ttsChunks]; diff --git a/SmartDeviceLink/SDLAppInfo.h b/SmartDeviceLink/SDLAppInfo.h index 414ee074e..c08fba9fd 100644 --- a/SmartDeviceLink/SDLAppInfo.h +++ b/SmartDeviceLink/SDLAppInfo.h @@ -5,6 +5,8 @@ @interface SDLAppInfo : SDLRPCStruct ++ (instancetype)currentAppInfo; + @property (strong) NSString *appDisplayName; @property (strong) NSString *appBundleID; @property (strong) NSString *appVersion; diff --git a/SmartDeviceLink/SDLAppInfo.m b/SmartDeviceLink/SDLAppInfo.m index 7318187bf..6894922af 100644 --- a/SmartDeviceLink/SDLAppInfo.m +++ b/SmartDeviceLink/SDLAppInfo.m @@ -4,8 +4,22 @@ #import "SDLAppInfo.h" #import "SDLNames.h" +static NSString *const SDLBundleShortVersionStringKey = @"CFBundleShortVersionString"; + @implementation SDLAppInfo ++ (instancetype)currentAppInfo { + static SDLAppInfo *appInfo = nil; + if (appInfo == nil) { + appInfo = [[SDLAppInfo alloc] init]; + NSBundle *mainBundle = [NSBundle mainBundle]; + NSDictionary *bundleDictionary = mainBundle.infoDictionary; + appInfo.appVersion = bundleDictionary[SDLBundleShortVersionStringKey]; + appInfo.appBundleID = mainBundle.bundleIdentifier; + } + return appInfo; +} + - (void)setAppDisplayName:(NSString *)appDisplayName { if (appDisplayName != nil) { [store setObject:appDisplayName forKey:NAMES_appDisplayName]; diff --git a/SmartDeviceLink/SDLChangeRegistration.h b/SmartDeviceLink/SDLChangeRegistration.h index 4bbc7c234..194c525da 100644 --- a/SmartDeviceLink/SDLChangeRegistration.h +++ b/SmartDeviceLink/SDLChangeRegistration.h @@ -29,6 +29,10 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithLanguage:(SDLLanguage *)language hmiDisplayLanguage:(SDLLanguage *)hmiDisplayLanguage; + +- (instancetype)initWithLanguage:(SDLLanguage *)language hmiDisplayLanguage:(SDLLanguage *)hmiDisplayLanguage appName:(NSString *)appName ttsName:(NSArray<SDLTTSChunk *> *)ttsName ngnMediaScreenAppName:(NSString *)ngnMediaScreenAppName vrSynonyms:(NSArray<NSString *> *)vrSynonyms; + /** * @abstract The language the app wants to change to */ diff --git a/SmartDeviceLink/SDLChangeRegistration.m b/SmartDeviceLink/SDLChangeRegistration.m index 00a7de885..4e3cc2446 100644 --- a/SmartDeviceLink/SDLChangeRegistration.m +++ b/SmartDeviceLink/SDLChangeRegistration.m @@ -21,6 +21,31 @@ return self; } +- (instancetype)initWithLanguage:(SDLLanguage *)language hmiDisplayLanguage:(SDLLanguage *)hmiDisplayLanguage { + self = [self initWithLanguage:language hmiDisplayLanguage:hmiDisplayLanguage appName:nil ttsName:nil ngnMediaScreenAppName:nil vrSynonyms:nil]; + if (!self) { + return nil; + } + + return self; +} + +- (instancetype)initWithLanguage:(SDLLanguage *)language hmiDisplayLanguage:(SDLLanguage *)hmiDisplayLanguage appName:(NSString *)appName ttsName:(NSArray *)ttsName ngnMediaScreenAppName:(NSString *)ngnMediaScreenAppName vrSynonyms:(NSArray*)vrSynonyms { + self = [self init]; + if (!self) { + return nil; + } + + self.language = language; + self.hmiDisplayLanguage = hmiDisplayLanguage; + self.appName = appName; + self.ttsName = ttsName; + self.ngnMediaScreenAppName = ngnMediaScreenAppName; + self.vrSynonyms = vrSynonyms; + + return self; +} + - (void)setLanguage:(SDLLanguage *)language { if (language != nil) { [parameters setObject:language forKey:NAMES_language]; diff --git a/SmartDeviceLink/SDLChoice.h b/SmartDeviceLink/SDLChoice.h index 478b33b5f..1c68a106f 100644 --- a/SmartDeviceLink/SDLChoice.h +++ b/SmartDeviceLink/SDLChoice.h @@ -64,6 +64,10 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithId:(UInt16)choiceId menuName:(NSString*)menuName vrCommands:(NSArray*)vrCommands; + +- (instancetype)initWithId:(UInt16)choiceId menuName:(NSString*)menuName vrCommands:(NSArray*)vrCommands image:(SDLImage*)image secondaryText:(NSString*)secondaryText secondaryImage:(SDLImage*)secondaryImage tertiaryText:(NSString*)tertiaryText; + /** * @abstract the application-scoped identifier that uniquely identifies this choice * diff --git a/SmartDeviceLink/SDLChoice.m b/SmartDeviceLink/SDLChoice.m index 83e1d56ae..89dc976f8 100644 --- a/SmartDeviceLink/SDLChoice.m +++ b/SmartDeviceLink/SDLChoice.m @@ -21,6 +21,33 @@ return self; } +- (instancetype)initWithId:(UInt16)choiceId menuName:(NSString*)menuName vrCommands:(NSArray*)vrCommands image:(SDLImage*)image secondaryText:(NSString*)secondaryText secondaryImage:(SDLImage*)secondaryImage tertiaryText:(NSString*)tertiaryText { + self = [self initWithId:choiceId menuName:menuName vrCommands:vrCommands]; + if (!self) { + return nil; + } + + self.image = image; + self.secondaryText = secondaryText; + self.secondaryImage = secondaryImage; + self.tertiaryText = tertiaryText; + + return self; +} + +- (instancetype)initWithId:(UInt16)choiceId menuName:(NSString*)menuName vrCommands:(NSArray*)vrCommands { + self = [self init]; + if (!self) { + return nil; + } + + self.choiceID = @(choiceId); + self.menuName = menuName; + self.vrCommands = [vrCommands mutableCopy]; + + return self; +} + - (void)setChoiceID:(NSNumber *)choiceID { if (choiceID != nil) { [store setObject:choiceID forKey:NAMES_choiceID]; diff --git a/SmartDeviceLink/SDLCreateInteractionChoiceSet.h b/SmartDeviceLink/SDLCreateInteractionChoiceSet.h index 721f505d7..18d910728 100644 --- a/SmartDeviceLink/SDLCreateInteractionChoiceSet.h +++ b/SmartDeviceLink/SDLCreateInteractionChoiceSet.h @@ -4,6 +4,8 @@ #import "SDLRPCRequest.h" +@class SDLChoice; + /** * Creates a Choice Set which can be used in subsequent *SDLPerformInteraction* Operations. * @@ -32,6 +34,8 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithId:(UInt32)choiceId choiceSet:(NSArray<SDLChoice *> *)choiceSet; + /** * @abstract A unique ID that identifies the Choice Set * diff --git a/SmartDeviceLink/SDLCreateInteractionChoiceSet.m b/SmartDeviceLink/SDLCreateInteractionChoiceSet.m index 32324d46e..512f8a891 100644 --- a/SmartDeviceLink/SDLCreateInteractionChoiceSet.m +++ b/SmartDeviceLink/SDLCreateInteractionChoiceSet.m @@ -21,6 +21,17 @@ return self; } +- (instancetype)initWithId:(UInt32)choiceId choiceSet:(NSArray *)choiceSet { + self = [self init]; + if (!self) { + return nil; + } + + self.interactionChoiceSetID = @(choiceId); + self.choiceSet = [choiceSet mutableCopy]; + return self; +} + - (void)setInteractionChoiceSetID:(NSNumber *)interactionChoiceSetID { if (interactionChoiceSetID != nil) { [parameters setObject:interactionChoiceSetID forKey:NAMES_interactionChoiceSetID]; diff --git a/SmartDeviceLink/SDLDeleteCommand.h b/SmartDeviceLink/SDLDeleteCommand.h index 4f3b74d90..24adaa9cd 100644 --- a/SmartDeviceLink/SDLDeleteCommand.h +++ b/SmartDeviceLink/SDLDeleteCommand.h @@ -32,6 +32,8 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithId:(UInt32)commandId; + /** * @abstract the Command ID that identifies the Command to be deleted from Command Menu * @discussion an NSNumber value representing Command ID diff --git a/SmartDeviceLink/SDLDeleteCommand.m b/SmartDeviceLink/SDLDeleteCommand.m index 13c51d7ed..03e765f25 100644 --- a/SmartDeviceLink/SDLDeleteCommand.m +++ b/SmartDeviceLink/SDLDeleteCommand.m @@ -20,6 +20,17 @@ return self; } +- (instancetype)initWithId:(UInt32)commandId { + self = [self init]; + if (!self) { + return nil; + } + + self.cmdID = @(commandId); + + return self; +} + - (void)setCmdID:(NSNumber *)cmdID { if (cmdID != nil) { [parameters setObject:cmdID forKey:NAMES_cmdID]; diff --git a/SmartDeviceLink/SDLDeleteFile.h b/SmartDeviceLink/SDLDeleteFile.h index 325782673..b0b1295ff 100644 --- a/SmartDeviceLink/SDLDeleteFile.h +++ b/SmartDeviceLink/SDLDeleteFile.h @@ -27,6 +27,8 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithFileName:(NSString *)fileName; + /** * @abstract a file reference name * @discussion a String value representing a file reference name diff --git a/SmartDeviceLink/SDLDeleteFile.m b/SmartDeviceLink/SDLDeleteFile.m index d7a4c18b2..355033c73 100644 --- a/SmartDeviceLink/SDLDeleteFile.m +++ b/SmartDeviceLink/SDLDeleteFile.m @@ -20,6 +20,17 @@ return self; } +- (instancetype)initWithFileName:(NSString *)fileName { + self = [self init]; + if (!self) { + return nil; + } + + self.syncFileName = fileName; + + return self; +} + - (void)setSyncFileName:(NSString *)syncFileName { if (syncFileName != nil) { [parameters setObject:syncFileName forKey:NAMES_syncFileName]; diff --git a/SmartDeviceLink/SDLDeleteFileOperation.m b/SmartDeviceLink/SDLDeleteFileOperation.m index 1b66a4209..7ebecffa5 100644 --- a/SmartDeviceLink/SDLDeleteFileOperation.m +++ b/SmartDeviceLink/SDLDeleteFileOperation.m @@ -11,8 +11,6 @@ #import "SDLConnectionManagerType.h" #import "SDLDeleteFile.h" #import "SDLDeleteFileResponse.h" -#import "SDLRPCRequestFactory.h" - NS_ASSUME_NONNULL_BEGIN @@ -47,7 +45,7 @@ NS_ASSUME_NONNULL_BEGIN } - (void)sdl_deleteFile { - SDLDeleteFile *deleteFile = [SDLRPCRequestFactory buildDeleteFileWithName:self.fileName correlationID:@0]; + SDLDeleteFile *deleteFile = [[SDLDeleteFile alloc] initWithFileName:self.fileName]; typeof(self) weakself = self; [self.connectionManager sendManagerRequest:deleteFile @@ -79,4 +77,4 @@ NS_ASSUME_NONNULL_BEGIN @end -NS_ASSUME_NONNULL_END
\ No newline at end of file +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLDeleteInteractionChoiceSet.h b/SmartDeviceLink/SDLDeleteInteractionChoiceSet.h index 28058064b..74acae89d 100644 --- a/SmartDeviceLink/SDLDeleteInteractionChoiceSet.h +++ b/SmartDeviceLink/SDLDeleteInteractionChoiceSet.h @@ -34,6 +34,8 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithId:(UInt32)choiceId; + /** * @abstract a unique ID that identifies the Choice Set * @discussion a unique ID that identifies the Choice Set diff --git a/SmartDeviceLink/SDLDeleteInteractionChoiceSet.m b/SmartDeviceLink/SDLDeleteInteractionChoiceSet.m index fd5d202b1..ff557b860 100644 --- a/SmartDeviceLink/SDLDeleteInteractionChoiceSet.m +++ b/SmartDeviceLink/SDLDeleteInteractionChoiceSet.m @@ -20,6 +20,17 @@ return self; } +- (instancetype)initWithId:(UInt32)choiceId { + self = [self init]; + if (!self) { + return nil; + } + + self.interactionChoiceSetID = @(choiceId); + + return self; +} + - (void)setInteractionChoiceSetID:(NSNumber *)interactionChoiceSetID { if (interactionChoiceSetID != nil) { [parameters setObject:interactionChoiceSetID forKey:NAMES_interactionChoiceSetID]; diff --git a/SmartDeviceLink/SDLDeleteSubMenu.h b/SmartDeviceLink/SDLDeleteSubMenu.h index 37c2dc544..a7d8aa5ad 100644 --- a/SmartDeviceLink/SDLDeleteSubMenu.h +++ b/SmartDeviceLink/SDLDeleteSubMenu.h @@ -29,6 +29,8 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithId:(UInt32)menuId; + /** * @abstract the MenuID that identifies the SDLSubMenu to be delete * @discussion <b>Notes: </b>Min Value: 0; Max Value: 2000000000 diff --git a/SmartDeviceLink/SDLDeleteSubMenu.m b/SmartDeviceLink/SDLDeleteSubMenu.m index 8727f44d3..565b16ff4 100644 --- a/SmartDeviceLink/SDLDeleteSubMenu.m +++ b/SmartDeviceLink/SDLDeleteSubMenu.m @@ -20,6 +20,17 @@ return self; } +- (instancetype)initWithId:(UInt32)menuId { + self = [self init]; + if (!self) { + return nil; + } + + self.menuID = @(menuId); + + return self; +} + - (void)setMenuID:(NSNumber *)menuID { if (menuID != nil) { [parameters setObject:menuID forKey:NAMES_menuID]; diff --git a/SmartDeviceLink/SDLDeviceInfo.h b/SmartDeviceLink/SDLDeviceInfo.h index 1bcbdaa27..b2ab1423c 100644 --- a/SmartDeviceLink/SDLDeviceInfo.h +++ b/SmartDeviceLink/SDLDeviceInfo.h @@ -10,6 +10,8 @@ - (instancetype)init; - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; ++ (instancetype)currentDevice; + @property (strong) NSString *hardware; @property (strong) NSString *firmwareRev; @property (strong) NSString *os; diff --git a/SmartDeviceLink/SDLDeviceInfo.m b/SmartDeviceLink/SDLDeviceInfo.m index 134aea629..a91e04935 100644 --- a/SmartDeviceLink/SDLDeviceInfo.m +++ b/SmartDeviceLink/SDLDeviceInfo.m @@ -3,8 +3,11 @@ #import "SDLDeviceInfo.h" -#import "SDLNames.h" +#import <CoreTelephony/CTCarrier.h> +#import <CoreTelephony/CTTelephonyNetworkInfo.h> +#import <UIKit/UIKit.h> +#import "SDLNames.h" @implementation SDLDeviceInfo @@ -20,6 +23,21 @@ return self; } ++ (instancetype)currentDevice { + static SDLDeviceInfo *deviceInfo = nil; + if (deviceInfo == nil) { + 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; +} + - (void)setHardware:(NSString *)hardware { if (hardware != nil) { [store setObject:hardware forKey:NAMES_hardware]; diff --git a/SmartDeviceLink/SDLDiagnosticMessage.h b/SmartDeviceLink/SDLDiagnosticMessage.h index 40ca013f2..bdce4110d 100644 --- a/SmartDeviceLink/SDLDiagnosticMessage.h +++ b/SmartDeviceLink/SDLDiagnosticMessage.h @@ -15,6 +15,8 @@ - (instancetype)init; - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithTargetId:(UInt16)targetId length:(UInt16)length data:(NSArray<NSNumber<SDLInt> *> *)data; + /** * Name of target ECU * diff --git a/SmartDeviceLink/SDLDiagnosticMessage.m b/SmartDeviceLink/SDLDiagnosticMessage.m index 8a45a8650..e1f4da2fd 100644 --- a/SmartDeviceLink/SDLDiagnosticMessage.m +++ b/SmartDeviceLink/SDLDiagnosticMessage.m @@ -20,6 +20,19 @@ return self; } +- (instancetype)initWithTargetId:(UInt16)targetId length:(UInt16)length data:(NSArray*)data { + self = [self init]; + if (!self) { + return nil; + } + + self.targetID = @(targetId); + self.messageLength = @(length); + self.messageData = [data mutableCopy]; + + return self; +} + - (void)setTargetID:(NSNumber *)targetID { if (targetID != nil) { [parameters setObject:targetID forKey:NAMES_targetID]; diff --git a/SmartDeviceLink/SDLDialNumber.h b/SmartDeviceLink/SDLDialNumber.h index 48cca6a6d..e04ccfb37 100644 --- a/SmartDeviceLink/SDLDialNumber.h +++ b/SmartDeviceLink/SDLDialNumber.h @@ -14,6 +14,8 @@ - (instancetype)init; - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithNumber:(NSString *)number; + /** * Up to 40 character string representing the phone number. All characters stripped except for '0'-'9', '*', '#', ',', ';', and '+' */ diff --git a/SmartDeviceLink/SDLDialNumber.m b/SmartDeviceLink/SDLDialNumber.m index 856f9ad75..2bc41beb5 100644 --- a/SmartDeviceLink/SDLDialNumber.m +++ b/SmartDeviceLink/SDLDialNumber.m @@ -20,6 +20,17 @@ return self; } +- (instancetype)initWithNumber:(NSString *)number { + self = [self init]; + if (!self) { + return nil; + } + + self.number = number; + + return self; +} + - (void)setNumber:(NSString *)number { if (number != nil) { parameters[NAMES_number] = number; diff --git a/SmartDeviceLink/SDLFileManager.m b/SmartDeviceLink/SDLFileManager.m index 4999b569e..84b20b890 100644 --- a/SmartDeviceLink/SDLFileManager.m +++ b/SmartDeviceLink/SDLFileManager.m @@ -20,7 +20,6 @@ #import "SDLNotificationConstants.h" #import "SDLPutFile.h" #import "SDLPutFileResponse.h" -#import "SDLRPCRequestFactory.h" #import "SDLStateMachine.h" #import "SDLUploadFileOperation.h" diff --git a/SmartDeviceLink/SDLGetDTCs.h b/SmartDeviceLink/SDLGetDTCs.h index 3d38a0079..e2e5ef438 100644 --- a/SmartDeviceLink/SDLGetDTCs.h +++ b/SmartDeviceLink/SDLGetDTCs.h @@ -26,6 +26,11 @@ * @param dict The dictionary to use */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; + +- (instancetype)initWithECUName:(UInt16)name; + +- (instancetype)initWithECUName:(UInt16)name mask:(UInt8)mask; + /** * @abstract a name of the module to receive the DTC form * @discussion an NSNumber value representing a name of the module to receive diff --git a/SmartDeviceLink/SDLGetDTCs.m b/SmartDeviceLink/SDLGetDTCs.m index cf7db88e5..19572bfdf 100644 --- a/SmartDeviceLink/SDLGetDTCs.m +++ b/SmartDeviceLink/SDLGetDTCs.m @@ -20,6 +20,28 @@ return self; } +- (instancetype)initWithECUName:(UInt16)name mask:(UInt8)mask { + self = [self initWithECUName:name]; + if (!self) { + return nil; + } + + self.dtcMask = @(mask); + + return self; +} + +- (instancetype)initWithECUName:(UInt16)name { + self = [self init]; + if (!self) { + return nil; + } + + self.ecuName = @(name); + + return self; +} + - (void)setEcuName:(NSNumber *)ecuName { if (ecuName != nil) { [parameters setObject:ecuName forKey:NAMES_ecuName]; diff --git a/SmartDeviceLink/SDLGetVehicleData.h b/SmartDeviceLink/SDLGetVehicleData.h index df2c1923e..6f7fddd1e 100644 --- a/SmartDeviceLink/SDLGetVehicleData.h +++ b/SmartDeviceLink/SDLGetVehicleData.h @@ -30,6 +30,7 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo emergencyEvent:(BOOL)emergencyEvent engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState gps:(BOOL)gps headLampStatus:(BOOL)headLampStatus instantFuelConsumption:(BOOL)instantFuelConsumption myKey:(BOOL)myKey odometer:(BOOL)odometer prndl:(BOOL)prndl rpm:(BOOL)rpm speed:(BOOL)speed steeringWheelAngle:(BOOL)steeringWheelAngle tirePressure:(BOOL)tirePressure vin:(BOOL)vin wiperStatus:(BOOL)wiperStatus; /** * @abstract A boolean value. If true, requests Gps data */ @@ -137,4 +138,4 @@ @property (strong) NSNumber *clusterModeStatus; @property (strong) NSNumber *myKey; -@end
\ No newline at end of file +@end diff --git a/SmartDeviceLink/SDLGetVehicleData.m b/SmartDeviceLink/SDLGetVehicleData.m index ab5d59a19..c79da6c6b 100644 --- a/SmartDeviceLink/SDLGetVehicleData.m +++ b/SmartDeviceLink/SDLGetVehicleData.m @@ -20,6 +20,41 @@ return self; } +- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo emergencyEvent:(BOOL)emergencyEvent engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState gps:(BOOL)gps headLampStatus:(BOOL)headLampStatus instantFuelConsumption:(BOOL)instantFuelConsumption myKey:(BOOL)myKey odometer:(BOOL)odometer prndl:(BOOL)prndl rpm:(BOOL)rpm speed:(BOOL)speed steeringWheelAngle:(BOOL)steeringWheelAngle tirePressure:(BOOL)tirePressure vin:(BOOL)vin wiperStatus:(BOOL)wiperStatus { + self = [self init]; + if (!self) { + return nil; + } + + self.accPedalPosition = @(accelerationPedalPosition); + self.airbagStatus = @(airbagStatus); + self.beltStatus = @(beltStatus); + self.bodyInformation = @(bodyInformation); + self.clusterModeStatus = @(clusterModeStatus); + self.deviceStatus = @(deviceStatus); + self.driverBraking = @(driverBraking); + self.eCallInfo = @(eCallInfo); + self.emergencyEvent = @(emergencyEvent); + self.engineTorque = @(engineTorque); + self.externalTemperature = @(externalTemperature); + self.fuelLevel = @(fuelLevel); + self.fuelLevel_State = @(fuelLevelState); + self.myKey = @(myKey); + self.odometer = @(odometer); + self.gps = @(gps); + self.headLampStatus = @(headLampStatus); + self.instantFuelConsumption = @(instantFuelConsumption); + self.prndl = @(prndl); + self.rpm = @(rpm); + self.speed = @(speed); + self.steeringWheelAngle = @(steeringWheelAngle); + self.tirePressure = @(tirePressure); + self.vin = @(vin); + self.wiperStatus = @(wiperStatus); + + return self; +} + - (void)setGps:(NSNumber *)gps { if (gps != nil) { [parameters setObject:gps forKey:NAMES_gps]; diff --git a/SmartDeviceLink/SDLImage.h b/SmartDeviceLink/SDLImage.h index 993107ec3..24c6dcdab 100644 --- a/SmartDeviceLink/SDLImage.h +++ b/SmartDeviceLink/SDLImage.h @@ -25,6 +25,8 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithName:(NSString *)name ofType:(SDLImageType *)imageType; + /** * @abstract The static hex icon value or the binary image file name identifier (sent by SDLPutFile) * diff --git a/SmartDeviceLink/SDLImage.m b/SmartDeviceLink/SDLImage.m index ef646f794..734f0e475 100644 --- a/SmartDeviceLink/SDLImage.m +++ b/SmartDeviceLink/SDLImage.m @@ -21,6 +21,18 @@ return self; } +- (instancetype)initWithName:(NSString *)name ofType:(SDLImageType *)imageType { + self = [self init]; + if (!self) { + return nil; + } + + self.value = name; + self.imageType = imageType; + + return self; +} + - (void)setValue:(NSString *)value { if (value != nil) { [store setObject:value forKey:NAMES_value]; diff --git a/SmartDeviceLink/SDLKeyboardProperties.h b/SmartDeviceLink/SDLKeyboardProperties.h index 8215a8938..f13c4c226 100644 --- a/SmartDeviceLink/SDLKeyboardProperties.h +++ b/SmartDeviceLink/SDLKeyboardProperties.h @@ -14,6 +14,8 @@ - (instancetype)init; - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithLanguage:(SDLLanguage*)language layout:(SDLKeyboardLayout*)layout keypressMode:(SDLKeypressMode*)keypressMode limitedCharacterList:(NSArray*)limitedCharacterList autoCompleteText:(NSString*)autoCompleteText; + @property (strong) SDLLanguage *language; @property (strong) SDLKeyboardLayout *keyboardLayout; @property (strong) SDLKeypressMode *keypressMode; diff --git a/SmartDeviceLink/SDLKeyboardProperties.m b/SmartDeviceLink/SDLKeyboardProperties.m index 896f3a99a..46849a7d5 100644 --- a/SmartDeviceLink/SDLKeyboardProperties.m +++ b/SmartDeviceLink/SDLKeyboardProperties.m @@ -23,6 +23,21 @@ return self; } +- (instancetype)initWithLanguage:(SDLLanguage*)language layout:(SDLKeyboardLayout*)layout keypressMode:(SDLKeypressMode*)keypressMode limitedCharacterList:(NSArray*)limitedCharacterList autoCompleteText:(NSString*)autoCompleteText { + self = [self init]; + if (!self) { + return nil; + } + + self.language = language; + self.keyboardLayout = layout; + self.keypressMode = keypressMode; + self.limitedCharacterList = [limitedCharacterList mutableCopy]; + self.autoCompleteText = autoCompleteText; + + return self; +} + - (void)setLanguage:(SDLLanguage *)language { if (language != nil) { [store setObject:language forKey:NAMES_language]; diff --git a/SmartDeviceLink/SDLLifecycleManager.m b/SmartDeviceLink/SDLLifecycleManager.m index 04e05e218..22a3a622e 100644 --- a/SmartDeviceLink/SDLLifecycleManager.m +++ b/SmartDeviceLink/SDLLifecycleManager.m @@ -31,7 +31,6 @@ #import "SDLProxy.h" #import "SDLProxyFactory.h" #import "SDLRPCNotificationNotification.h" -#import "SDLRPCRequestFactory.h" #import "SDLRegisterAppInterface.h" #import "SDLRegisterAppInterfaceResponse.h" #import "SDLResponseDispatcher.h" @@ -188,19 +187,7 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready"; } // Build a register app interface request with the configuration data - SDLRegisterAppInterface *regRequest = [SDLRPCRequestFactory buildRegisterAppInterfaceWithAppName:self.configuration.lifecycleConfig.appName languageDesired:self.configuration.lifecycleConfig.language appID:self.configuration.lifecycleConfig.appId]; - regRequest.isMediaApplication = @(self.configuration.lifecycleConfig.isMedia); - regRequest.ngnMediaScreenAppName = self.configuration.lifecycleConfig.shortAppName; - regRequest.hashID = self.configuration.lifecycleConfig.resumeHash; - regRequest.appHMIType = [NSMutableArray arrayWithObject:self.configuration.lifecycleConfig.appType]; - - if (self.configuration.lifecycleConfig.ttsName != nil) { - regRequest.ttsName = [NSMutableArray arrayWithArray:self.configuration.lifecycleConfig.ttsName]; - } - - if (self.configuration.lifecycleConfig.voiceRecognitionCommandNames != nil) { - regRequest.vrSynonyms = [NSMutableArray arrayWithArray:self.configuration.lifecycleConfig.voiceRecognitionCommandNames]; - } + SDLRegisterAppInterface* regRequest = [[SDLRegisterAppInterface alloc] initWithLifecycleConfiguration:self.configuration.lifecycleConfig]; // Send the request and depending on the response, post the notification __weak typeof(self) weakSelf = self; @@ -299,7 +286,7 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready"; } - (void)didEnterStateUnregistering { - SDLUnregisterAppInterface *unregisterRequest = [SDLRPCRequestFactory buildUnregisterAppInterfaceWithCorrelationID:[self sdl_getNextCorrelationId]]; + SDLUnregisterAppInterface *unregisterRequest = [[SDLUnregisterAppInterface alloc] init]; __weak typeof(self) weakSelf = self; [self sdl_sendRequest:unregisterRequest diff --git a/SmartDeviceLink/SDLMenuParams.h b/SmartDeviceLink/SDLMenuParams.h index 14f51e390..6a056d03f 100644 --- a/SmartDeviceLink/SDLMenuParams.h +++ b/SmartDeviceLink/SDLMenuParams.h @@ -23,6 +23,9 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithMenuName:(NSString*)menuName; + +- (instancetype)initWithMenuName:(NSString *)menuName parentId:(UInt32)parentId position:(UInt16)position; /** * @abstract the unique ID of an existing submenu to which a command will be added diff --git a/SmartDeviceLink/SDLMenuParams.m b/SmartDeviceLink/SDLMenuParams.m index 84fb595a8..0092d05be 100644 --- a/SmartDeviceLink/SDLMenuParams.m +++ b/SmartDeviceLink/SDLMenuParams.m @@ -20,6 +20,29 @@ return self; } +- (instancetype)initWithMenuName:(NSString *)menuName parentId:(UInt32)parentId position:(UInt16)position { + self = [self initWithMenuName:menuName]; + if (!self) { + return nil; + } + + self.parentID = @(parentId); + self.position = @(parentId); + + return self; +} + +- (instancetype)initWithMenuName:(NSString *)menuName { + self = [self init]; + if (!self) { + return nil; + } + + self.menuName = menuName; + + return self; +} + - (void)setParentID:(NSNumber *)parentID { if (parentID != nil) { [store setObject:parentID forKey:NAMES_parentID]; diff --git a/SmartDeviceLink/SDLPerformAudioPassThru.h b/SmartDeviceLink/SDLPerformAudioPassThru.h index 66dfacf19..1f495fbb2 100644 --- a/SmartDeviceLink/SDLPerformAudioPassThru.h +++ b/SmartDeviceLink/SDLPerformAudioPassThru.h @@ -33,6 +33,10 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithSamplingRate:(SDLSamplingRate*)samplingRate bitsPerSample:(SDLBitsPerSample*)bitsPerSample audioType:(SDLAudioType*)audioType maxDuration:(UInt32)maxDuration; + +- (instancetype)initWithInitialPrompt:(NSString *)initialPrompt audioPassThruDisplayText1:(NSString *)audioPassThruDisplayText1 audioPassThruDisplayText2:(NSString *)audioPassThruDisplayText2 samplingRate:(SDLSamplingRate *)samplingRate bitsPerSample:(SDLBitsPerSample *)bitsPerSample audioType:(SDLAudioType *)audioType maxDuration:(UInt32)maxDuration muteAudio:(BOOL)muteAudio; + /** * @abstract initial prompt which will be spoken before opening the audio pass * thru session by SDL diff --git a/SmartDeviceLink/SDLPerformAudioPassThru.m b/SmartDeviceLink/SDLPerformAudioPassThru.m index 67b0f05c3..28aa000e1 100644 --- a/SmartDeviceLink/SDLPerformAudioPassThru.m +++ b/SmartDeviceLink/SDLPerformAudioPassThru.m @@ -9,6 +9,7 @@ #import "SDLNames.h" #import "SDLSamplingRate.h" #import "SDLTTSChunk.h" +#import "SDLTTSChunkFactory.h" @implementation SDLPerformAudioPassThru @@ -25,6 +26,34 @@ return self; } +- (instancetype)initWithInitialPrompt:(NSString *)initialPrompt audioPassThruDisplayText1:(NSString *)audioPassThruDisplayText1 audioPassThruDisplayText2:(NSString *)audioPassThruDisplayText2 samplingRate:(SDLSamplingRate *)samplingRate bitsPerSample:(SDLBitsPerSample *)bitsPerSample audioType:(SDLAudioType *)audioType maxDuration:(UInt32)maxDuration muteAudio:(BOOL)muteAudio { + self = [self initWithSamplingRate:samplingRate bitsPerSample:bitsPerSample audioType:audioType maxDuration:maxDuration]; + if (!self) { + return nil; + } + + self.initialPrompt = [SDLTTSChunkFactory buildTTSChunksFromSimple:initialPrompt]; + self.audioPassThruDisplayText1 = audioPassThruDisplayText1; + self.audioPassThruDisplayText2 = audioPassThruDisplayText2; + self.muteAudio = @(muteAudio); + + return self; +} + +- (instancetype)initWithSamplingRate:(SDLSamplingRate*)samplingRate bitsPerSample:(SDLBitsPerSample*)bitsPerSample audioType:(SDLAudioType*)audioType maxDuration:(UInt32)maxDuration { + self = [self init]; + if (!self) { + return nil; + } + + self.samplingRate = samplingRate; + self.bitsPerSample = bitsPerSample; + self.audioType = audioType; + self.maxDuration = @(maxDuration); + + return self; +} + - (void)setInitialPrompt:(NSMutableArray *)initialPrompt { if (initialPrompt != nil) { [parameters setObject:initialPrompt forKey:NAMES_initialPrompt]; diff --git a/SmartDeviceLink/SDLPerformInteraction.h b/SmartDeviceLink/SDLPerformInteraction.h index 29f166c96..d023c3a73 100644 --- a/SmartDeviceLink/SDLPerformInteraction.h +++ b/SmartDeviceLink/SDLPerformInteraction.h @@ -6,6 +6,8 @@ @class SDLInteractionMode; @class SDLLayoutMode; +@class SDLTTSChunk; +@class SDLVRHelpItem; /** @@ -36,6 +38,20 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithInteractionChoiceSetId:(UInt16)interactionChoiceSetId; + +- (instancetype)initWithInteractionChoiceSetIdList:(NSArray<NSNumber<SDLInt> *> *)interactionChoiceSetIdList; + +- (instancetype)initWithInitialPrompt:(NSString *)initialPrompt initialText:(NSString *)initialText interactionChoiceSetID:(UInt16)interactionChoiceSetID; + +- (instancetype)initWithInitialPrompt:(NSString *)initialPrompt initialText:(NSString *)initialText interactionChoiceSetID:(UInt16)interactionChoiceSetID vrHelp:(NSArray<SDLVRHelpItem *> *)vrHelp; + +- (instancetype)initWithInitialPrompt:(NSString *)initialPrompt initialText:(NSString *)initialText interactionChoiceSetIDList:(NSArray<NSNumber<SDLInt> *> *)interactionChoiceSetIDList helpPrompt:(NSString *)helpPrompt timeoutPrompt:(NSString *)timeoutPrompt interactionMode:(SDLInteractionMode *)interactionMode timeout:(UInt16)timeout; + +- (instancetype)initWithInitialPrompt:(NSString *)initialPrompt initialText:(NSString *)initialText interactionChoiceSetIDList:(NSArray<NSNumber<SDLInt> *> *)interactionChoiceSetIDList helpPrompt:(NSString *)helpPrompt timeoutPrompt:(NSString *)timeoutPrompt interactionMode:(SDLInteractionMode *)interactionMode timeout:(UInt16)timeout vrHelp:(NSArray<SDLVRHelpItem *> *)vrHelp; + +- (instancetype)initWithInitialChunks:(NSArray<SDLTTSChunk *> *)initialChunks initialText:(NSString *)initialText interactionChoiceSetIDList:(NSArray<NSNumber<SDLInt> *> *)interactionChoiceSetIDList helpChunks:(NSArray<SDLTTSChunk *> *)helpChunks timeoutChunks:(NSArray *)timeoutChunks interactionMode:(SDLInteractionMode *)interactionMode timeout:(UInt16)timeout vrHelp:(NSArray<SDLVRHelpItem *> *)vrHelp; + /** * @abstract The Text that Displayed when the interaction begins. This text may * be overlaid by the "Listening" prompt during the interaction. Text is diff --git a/SmartDeviceLink/SDLPerformInteraction.m b/SmartDeviceLink/SDLPerformInteraction.m index de6c3622f..27550e04a 100644 --- a/SmartDeviceLink/SDLPerformInteraction.m +++ b/SmartDeviceLink/SDLPerformInteraction.m @@ -8,8 +8,11 @@ #import "SDLLayoutMode.h" #import "SDLNames.h" #import "SDLTTSChunk.h" +#import "SDLTTSChunkFactory.h" #import "SDLVRHelpItem.h" +static UInt16 const SDLDefaultTimeout = 10000; + @implementation SDLPerformInteraction - (instancetype)init { @@ -24,6 +27,57 @@ return self; } +- (instancetype)initWithInteractionChoiceSetId:(UInt16)interactionChoiceSetId { + return [self initWithInteractionChoiceSetIdList:@[@(interactionChoiceSetId)]]; +} + +- (instancetype)initWithInitialPrompt:(NSString *)initialPrompt initialText:(NSString *)initialText interactionChoiceSetID:(UInt16)interactionChoiceSetID { + return [self initWithInitialPrompt:initialPrompt initialText:initialText interactionChoiceSetID:interactionChoiceSetID vrHelp:nil]; +} + +- (instancetype)initWithInitialPrompt:(NSString *)initialPrompt initialText:(NSString *)initialText interactionChoiceSetID:(UInt16)interactionChoiceSetID vrHelp:(NSArray *)vrHelp { + return [self initWithInitialPrompt:initialPrompt initialText:initialText interactionChoiceSetIDList:@[@(interactionChoiceSetID)] helpPrompt:nil timeoutPrompt:nil interactionMode:nil timeout:SDLDefaultTimeout vrHelp:vrHelp]; +} + +- (instancetype)initWithInitialPrompt:(NSString *)initialPrompt initialText:(NSString *)initialText interactionChoiceSetIDList:(NSArray *)interactionChoiceSetIDList helpPrompt:(NSString *)helpPrompt timeoutPrompt:(NSString *)timeoutPrompt interactionMode:(SDLInteractionMode *)interactionMode timeout:(UInt16)timeout { + return [self initWithInitialPrompt:initialPrompt initialText:initialText interactionChoiceSetIDList:interactionChoiceSetIDList helpPrompt:helpPrompt timeoutPrompt:timeoutPrompt interactionMode:interactionMode timeout:timeout vrHelp:nil]; +} + +- (instancetype)initWithInitialPrompt:(NSString *)initialPrompt initialText:(NSString *)initialText interactionChoiceSetIDList:(NSArray *)interactionChoiceSetIDList helpPrompt:(NSString *)helpPrompt timeoutPrompt:(NSString *)timeoutPrompt interactionMode:(SDLInteractionMode *)interactionMode timeout:(UInt16)timeout vrHelp:(NSArray *)vrHelp { + NSMutableArray* initialChunks = [SDLTTSChunkFactory buildTTSChunksFromSimple:initialPrompt]; + NSMutableArray* helpChunks = [SDLTTSChunkFactory buildTTSChunksFromSimple:helpPrompt]; + NSMutableArray* timeoutChunks = [SDLTTSChunkFactory buildTTSChunksFromSimple:timeoutPrompt]; + return [self initWithInitialChunks:initialChunks initialText:initialText interactionChoiceSetIDList:interactionChoiceSetIDList helpChunks:helpChunks timeoutChunks:timeoutChunks interactionMode:interactionMode timeout:timeout vrHelp:vrHelp]; +} + +- (instancetype)initWithInitialChunks:(NSArray *)initialChunks initialText:(NSString *)initialText interactionChoiceSetIDList:(NSArray *)interactionChoiceSetIDList helpChunks:(NSArray *)helpChunks timeoutChunks:(NSArray *)timeoutChunks interactionMode:(SDLInteractionMode *)interactionMode timeout:(UInt16)timeout vrHelp:(NSArray *)vrHelp { + self = [self initWithInteractionChoiceSetIdList:interactionChoiceSetIDList]; + if (!self) { + return nil; + } + + self.initialPrompt = [initialChunks mutableCopy]; + self.initialText = initialText; + self.helpPrompt = [helpChunks mutableCopy]; + self.timeoutPrompt = [timeoutChunks mutableCopy]; + self.interactionMode = interactionMode; + self.timeout = @(timeout); + self.vrHelp = [vrHelp mutableCopy]; + + return self; +} + +- (instancetype)initWithInteractionChoiceSetIdList:(NSArray *)interactionChoiceSetIdList { + self = [self init]; + if (!self) { + return nil; + } + + self.interactionChoiceSetIDList = [interactionChoiceSetIdList mutableCopy]; + + return self; +} + - (void)setInitialText:(NSString *)initialText { if (initialText != nil) { [parameters setObject:initialText forKey:NAMES_initialText]; diff --git a/SmartDeviceLink/SDLPermissionConstants.h b/SmartDeviceLink/SDLPermissionConstants.h index eb9610921..d5e0250b0 100644 --- a/SmartDeviceLink/SDLPermissionConstants.h +++ b/SmartDeviceLink/SDLPermissionConstants.h @@ -10,7 +10,6 @@ #import "NSNumber+NumberType.h" - NS_ASSUME_NONNULL_BEGIN typedef NSString SDLPermissionRPCName; @@ -60,4 +59,4 @@ typedef NS_ENUM(NSUInteger, SDLPermissionGroupStatus) { */ typedef void (^SDLPermissionsChangedHandler)(NSDictionary<SDLPermissionRPCName *, NSNumber<SDLBool> *> *_Nonnull change, SDLPermissionGroupStatus status); -NS_ASSUME_NONNULL_END
\ No newline at end of file +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLProxy.m b/SmartDeviceLink/SDLProxy.m index 918a4e660..8fe0f4294 100644 --- a/SmartDeviceLink/SDLProxy.m +++ b/SmartDeviceLink/SDLProxy.m @@ -33,7 +33,6 @@ #import "SDLRPCPayload.h" #import "SDLRPCPayload.h" #import "SDLRPCPayload.h" -#import "SDLRPCRequestFactory.h" #import "SDLRPCResponse.h" #import "SDLRegisterAppInterfaceResponse.h" #import "SDLRequestType.h" @@ -697,7 +696,7 @@ const int POLICIES_CORRELATION_ID = 65535; for (id<SDLProxyListener> listener in self.proxyListeners) { if ([listener respondsToSelector:aSelector]) { // HAX: http://stackoverflow.com/questions/7017281/performselector-may-cause-a-leak-because-its-selector-is-unknown - ((void (*)(id, SEL, id))[(NSObject *)listener methodForSelector:aSelector])(listener, aSelector, object); + ((void ( *)(id, SEL, id))[(NSObject *)listener methodForSelector:aSelector])(listener, aSelector, object); } } } diff --git a/SmartDeviceLink/SDLPutFile.h b/SmartDeviceLink/SDLPutFile.h index eb7bae2bf..f2d94ccf2 100644 --- a/SmartDeviceLink/SDLPutFile.h +++ b/SmartDeviceLink/SDLPutFile.h @@ -29,6 +29,12 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithFileName:(NSString*)fileName fileType:(SDLFileType*)fileType; + +- (instancetype)initWithFileName:(NSString *)fileName fileType:(SDLFileType *)fileType persistentFile:(BOOL)persistentFile; + +- (instancetype)initWithFileName:(NSString *)fileName fileType:(SDLFileType *)fileType persistentFile:(BOOL)persistentFile systemFile:(BOOL)systemFile offset:(UInt64)offset length:(UInt64)length; + /** * A file reference name * diff --git a/SmartDeviceLink/SDLPutFile.m b/SmartDeviceLink/SDLPutFile.m index 69d83edcd..aeabe5531 100644 --- a/SmartDeviceLink/SDLPutFile.m +++ b/SmartDeviceLink/SDLPutFile.m @@ -21,6 +21,42 @@ return self; } +- (instancetype)initWithFileName:(NSString *)fileName fileType:(SDLFileType *)fileType persistentFile:(BOOL)persistentFile systemFile:(BOOL)systemFile offset:(UInt64)offset length:(UInt64)length { + self = [self initWithFileName:fileName fileType:fileType persistentFile:persistentFile]; + if (!self) { + return nil; + } + + self.systemFile = @(systemFile); + self.offset = @(offset); + self.length = @(length); + + return self; +} + +- (instancetype)initWithFileName:(NSString *)fileName fileType:(SDLFileType *)fileType persistentFile:(BOOL)persistentFile { + self = [self initWithFileName:fileName fileType:fileType]; + if (!self) { + return nil; + } + + self.persistentFile = @(persistentFile); + + return self; +} + +- (instancetype)initWithFileName:(NSString*)fileName fileType:(SDLFileType*)fileType { + self = [self init]; + if (!self) { + return nil; + } + + self.syncFileName = fileName; + self.fileType = fileType; + + return self; +} + - (void)setSyncFileName:(NSString *)syncFileName { if (syncFileName != nil) { [parameters setObject:syncFileName forKey:NAMES_syncFileName]; diff --git a/SmartDeviceLink/SDLRPCRequestFactory.h b/SmartDeviceLink/SDLRPCRequestFactory.h index 5b0146bbf..fce7c64e8 100644 --- a/SmartDeviceLink/SDLRPCRequestFactory.h +++ b/SmartDeviceLink/SDLRPCRequestFactory.h @@ -52,6 +52,7 @@ @class SDLSubscribeVehicleData; @class SDLSystemAction; @class SDLTextAlignment; +@class SDLTTSChunk; @class SDLUnregisterAppInterface; @class SDLUnsubscribeButton; @class SDLUnsubscribeVehicleData; @@ -59,168 +60,167 @@ @class SDLUpdateTurnList; -@interface SDLRPCRequestFactory : NSObject { +__deprecated_msg("use class's initializers instead") @interface SDLRPCRequestFactory : NSObject { } //***** AddCommand ***** -+ (SDLAddCommand *)buildAddCommandWithID:(NSNumber *)cmdID menuName:(NSString *)menuName parentID:(NSNumber *)parentID position:(NSNumber *)position vrCommands:(NSArray *)vrCommands iconValue:(NSString *)iconValue iconType:(SDLImageType *)iconType correlationID:(NSNumber *)correlationID __deprecated_msg("use buildAddCommandWithID:menuName:parentID:position:vrCommands:iconValue:iconType:handler: with SDLManager instead"); ++ (SDLAddCommand *)buildAddCommandWithID:(NSNumber *)cmdID menuName:(NSString *)menuName parentID:(NSNumber *)parentID position:(NSNumber *)position vrCommands:(NSArray *)vrCommands iconValue:(NSString *)iconValue iconType:(SDLImageType *)iconType correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLAddCommand's buildAddCommandWithID:vrCommands:menuName:parentID:position:iconValue:iconType:handler: instead"); ; -+ (SDLAddCommand *)buildAddCommandWithID:(NSNumber *)cmdID menuName:(NSString *)menuName vrCommands:(NSArray *)vrCommands correlationID:(NSNumber *)correlationID __deprecated_msg("use buildAddCommandWithID:menuName:vrCommands:handler: with SDLManager instead"); ++ (SDLAddCommand *)buildAddCommandWithID:(NSNumber *)cmdID menuName:(NSString *)menuName vrCommands:(NSArray *)vrCommands correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLAddCommands's initWithId:vrCommands:menuName:handler: instead"); + (SDLAddCommand *)buildAddCommandWithID:(NSNumber *)cmdID vrCommands:(NSArray *)vrCommands correlationID:(NSNumber *)correlationID __deprecated_msg("use buildAddCommandWithID:vrCommands:handler: with SDLManager instead"); -+ (SDLAddCommand *)buildAddCommandWithID:(NSNumber *)cmdID menuName:(NSString *)menuName parentID:(NSNumber *)parentID position:(NSNumber *)position vrCommands:(NSArray *)vrCommands iconValue:(NSString *)iconValue iconType:(SDLImageType *)iconType handler:(SDLRPCNotificationHandler)handler; ++ (SDLAddCommand *)buildAddCommandWithID:(NSNumber *)cmdID menuName:(NSString *)menuName parentID:(NSNumber *)parentID position:(NSNumber *)position vrCommands:(NSArray *)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 *)cmdID menuName:(NSString *)menuName vrCommands:(NSArray *)vrCommands handler:(SDLRPCNotificationHandler)handler; ++ (SDLAddCommand *)buildAddCommandWithID:(NSNumber *)cmdID menuName:(NSString *)menuName vrCommands:(NSArray *)vrCommands handler:(SDLRPCNotificationHandler)handler __deprecated_msg("use SDLAddCommand's initWithId:vrCommands:menuName:handler: instead"); -+ (SDLAddCommand *)buildAddCommandWithID:(NSNumber *)cmdID vrCommands:(NSArray *)vrCommands handler:(SDLRPCNotificationHandler)handler; ++ (SDLAddCommand *)buildAddCommandWithID:(NSNumber *)cmdID vrCommands:(NSArray *)vrCommands handler:(SDLRPCNotificationHandler)handler __deprecated_msg("use SDLAddCommand's initWithId:vrCommands:handler: instead"); //***** //***** AddSubMenu ***** -+ (SDLAddSubMenu *)buildAddSubMenuWithID:(NSNumber *)menuID menuName:(NSString *)menuName position:(NSNumber *)position correlationID:(NSNumber *)correlationID; ++ (SDLAddSubMenu *)buildAddSubMenuWithID:(NSNumber *)menuID menuName:(NSString *)menuName position:(NSNumber *)position correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLAddSubMenu's initWithId:menuName:position: instead"); -+ (SDLAddSubMenu *)buildAddSubMenuWithID:(NSNumber *)menuID menuName:(NSString *)menuName correlationID:(NSNumber *)correlationID; ++ (SDLAddSubMenu *)buildAddSubMenuWithID:(NSNumber *)menuID menuName:(NSString *)menuName correlationID:(NSNumber *)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 *)playTone duration:(NSNumber *)duration correlationID:(NSNumber *)correlationID; ++ (SDLAlert *)buildAlertWithTTS:(NSString *)ttsText alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 playTone:(NSNumber *)playTone duration:(NSNumber *)duration correlationID:(NSNumber *)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 *)playTone duration:(NSNumber *)duration correlationID:(NSNumber *)correlationID; ++ (SDLAlert *)buildAlertWithTTS:(NSString *)ttsText alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 playTone:(NSNumber *)playTone duration:(NSNumber *)duration correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLAlert's initWithTTS:alertText1:alertText2:playTone:duration: instead"); -+ (SDLAlert *)buildAlertWithTTS:(NSString *)ttsText playTone:(NSNumber *)playTone correlationID:(NSNumber *) - correlationID; ++ (SDLAlert *)buildAlertWithTTS:(NSString *)ttsText playTone:(NSNumber *)playTone correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLAlert's initWithTTS:playTone:duration: instead"); //*** -+ (SDLAlert *)buildAlertWithTTSChunks:(NSArray *)ttsChunks alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 playTone:(NSNumber *)playTone duration:(NSNumber *)duration softButtons:(NSArray *)softButtons correlationID:(NSNumber *)correlationID; ++ (SDLAlert *)buildAlertWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 playTone:(NSNumber *)playTone duration:(NSNumber *)duration softButtons:(NSArray<SDLSoftButton *> *)softButtons correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLAlert's initWithTTSChunks:alertText1:alertText2:alertText3:playTone:duration:softButtons: instead"); -+ (SDLAlert *)buildAlertWithTTSChunks:(NSArray *)ttsChunks playTone:(NSNumber *)playTone correlationID:(NSNumber *)correlationID; ++ (SDLAlert *)buildAlertWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks playTone:(NSNumber *)playTone correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLAlert's initWithTTSChunks:playTone: instead"); //*** -+ (SDLAlert *)buildAlertWithAlertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 duration:(NSNumber *)duration softButtons:(NSArray *)softButtons correlationID:(NSNumber *)correlationID; ++ (SDLAlert *)buildAlertWithAlertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 duration:(NSNumber *)duration softButtons:(NSArray<SDLSoftButton *> *)softButtons correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLAlert's initWithAlertText1:alertText2:alertText3:duration:softButtons: instead"); -+ (SDLAlert *)buildAlertWithAlertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 duration:(NSNumber *)duration correlationID:(NSNumber *)correlationID; ++ (SDLAlert *)buildAlertWithAlertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 duration:(NSNumber *)duration correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLAlert's initWithAlertText1:alertText2:alertText3:duration: instead"); -+ (SDLAlert *)buildAlertWithAlertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 duration:(NSNumber *)duration correlationID:(NSNumber *)correlationID; ++ (SDLAlert *)buildAlertWithAlertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 duration:(NSNumber *)duration correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLAlert's initWithAlertText1:alertText2:duration: instead"); //***** -+ (SDLAlertManeuver *)buildAlertManeuverwithTTSchunks:(NSMutableArray *)ttsChunks softButtons:(NSMutableArray *)softButtons correlationID:(NSNumber *)correlationID; ++ (SDLAlertManeuver *)buildAlertManeuverwithTTSchunks:(NSMutableArray *)ttsChunks softButtons:(NSMutableArray *)softButtons correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLAlertManeuver's initWithTTSChunks:softButtons: instead"); -+ (SDLChangeRegistration *)buildChangeRegistrationWithLanguage:(SDLLanguage *)language hmiDisplayLanguage:(SDLLanguage *)hmiDisplayLanguage correlationID:(NSNumber *)correlationID; ++ (SDLChangeRegistration *)buildChangeRegistrationWithLanguage:(SDLLanguage *)language hmiDisplayLanguage:(SDLLanguage *)hmiDisplayLanguage correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLChangeRegistration's initWithLanguage:hmiDisplayLanguage: instead"); -+ (SDLCreateInteractionChoiceSet *)buildCreateInteractionChoiceSetWithID:(NSNumber *)interactionChoiceSetID choiceSet:(NSArray *)choices correlationID:(NSNumber *)correlationID; ++ (SDLCreateInteractionChoiceSet *)buildCreateInteractionChoiceSetWithID:(NSNumber *)interactionChoiceSetID choiceSet:(NSArray *)choices correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLCreateInteractionChoiceSet's initWithId:choiceSet: instead"); -+ (SDLDeleteCommand *)buildDeleteCommandWithID:(NSNumber *)cmdID correlationID:(NSNumber *)correlationID; ++ (SDLDeleteCommand *)buildDeleteCommandWithID:(NSNumber *)cmdID correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLDeleteCommand's initWithId: instead"); -+ (SDLDeleteFile *)buildDeleteFileWithName:(NSString *)syncFileName correlationID:(NSNumber *)correlationID; ++ (SDLDeleteFile *)buildDeleteFileWithName:(NSString *)syncFileName correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLDeleteFile's initWithFileName: instead"); -+ (SDLDialNumber *)buildDialNumberWithNumber:(NSString *)phoneNumber; ++ (SDLDialNumber *)buildDialNumberWithNumber:(NSString *)phoneNumber __deprecated_msg("use SDLDialNumber's initWithNumber: instead"); -+ (SDLListFiles *)buildListFilesWithCorrelationID:(NSNumber *)correlationID; ++ (SDLListFiles *)buildListFilesWithCorrelationID:(NSNumber *)correlationID __deprecated_msg("use SDLListFiles's default initializer instead"); -+ (SDLDeleteInteractionChoiceSet *)buildDeleteInteractionChoiceSetWithID:(NSNumber *)interactionChoiceSetID correlationID:(NSNumber *)correlationID; ++ (SDLDeleteInteractionChoiceSet *)buildDeleteInteractionChoiceSetWithID:(NSNumber *)interactionChoiceSetID correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLDeleteInteractionChoiceSet's initWithId: instead"); -+ (SDLDeleteSubMenu *)buildDeleteSubMenuWithID:(NSNumber *)menuID correlationID:(NSNumber *)correlationID; ++ (SDLDeleteSubMenu *)buildDeleteSubMenuWithID:(NSNumber *)menuID correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLDeleteSubMenu's initWithId: instead"); -+ (SDLEndAudioPassThru *)buildEndAudioPassThruWithCorrelationID:(NSNumber *)correlationID; ++ (SDLEndAudioPassThru *)buildEndAudioPassThruWithCorrelationID:(NSNumber *)correlationID __deprecated_msg("use SDLEndAudioPassThru's default initializer instead"); -+ (SDLGetDTCs *)buildGetDTCsWithECUName:(NSNumber *)ecuName correlationID:(NSNumber *)correlationID; ++ (SDLGetDTCs *)buildGetDTCsWithECUName:(NSNumber *)ecuName correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLGetDTCs's initWithECUName: instead"); -+ (SDLGetVehicleData *)buildGetVehicleDataWithGPS:(NSNumber *)gps speed:(NSNumber *)speed rpm:(NSNumber *)rpm fuelLevel:(NSNumber *)fuelLevel fuelLevelState:(NSNumber *)fuelLevelState instantFuelConsumption:(NSNumber *)instantFuelConsumption externalTemperature:(NSNumber *)externalTemperature vin:(NSNumber *)vin prndl:(NSNumber *)prndl tirePressure:(NSNumber *)tirePressure odometer:(NSNumber *)odometer beltStatus:(NSNumber *)beltStatus bodyInformation:(NSNumber *)bodyInformation deviceStatus:(NSNumber *)deviceStatus driverBraking:(NSNumber *)driverBraking wiperStatus:(NSNumber *)wiperStatus headLampStatus:(NSNumber *)headLampStatus engineTorque:(NSNumber *)engineTorque accPedalPosition:(NSNumber *)accPedalPosition steeringWheelAngle:(NSNumber *)steeringWheelAngle correlationID:(NSNumber *)correlationID; ++ (SDLGetVehicleData *)buildGetVehicleDataWithGPS:(NSNumber *)gps speed:(NSNumber *)speed rpm:(NSNumber *)rpm fuelLevel:(NSNumber *)fuelLevel fuelLevelState:(NSNumber *)fuelLevelState instantFuelConsumption:(NSNumber *)instantFuelConsumption externalTemperature:(NSNumber *)externalTemperature vin:(NSNumber *)vin prndl:(NSNumber *)prndl tirePressure:(NSNumber *)tirePressure odometer:(NSNumber *)odometer beltStatus:(NSNumber *)beltStatus bodyInformation:(NSNumber *)bodyInformation deviceStatus:(NSNumber *)deviceStatus driverBraking:(NSNumber *)driverBraking wiperStatus:(NSNumber *)wiperStatus headLampStatus:(NSNumber *)headLampStatus engineTorque:(NSNumber *)engineTorque accPedalPosition:(NSNumber *)accPedalPosition steeringWheelAngle:(NSNumber *)steeringWheelAngle correlationID:(NSNumber *)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 *)maxDuration bitsPerSample:(SDLBitsPerSample *)bitsPerSample audioType:(SDLAudioType *)audioType muteAudio:(NSNumber *)muteAudio correlationID:(NSNumber *)correlationID; ++ (SDLPerformAudioPassThru *)buildPerformAudioPassThruWithInitialPrompt:(NSString *)initialPrompt audioPassThruDisplayText1:(NSString *)audioPassThruDisplayText1 audioPassThruDisplayText2:(NSString *)audioPassThruDisplayText2 samplingRate:(SDLSamplingRate *)samplingRate maxDuration:(NSNumber *)maxDuration bitsPerSample:(SDLBitsPerSample *)bitsPerSample audioType:(SDLAudioType *)audioType muteAudio:(NSNumber *)muteAudio correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLPerformAudioPassThru's initWithInitialPrompt:audioPassThruDisplayText1:audioPassThruDisplayText2:samplingRate:bitsPerSample:audioType:maxDuration:muteAudio: instead"); //***** PerformInteraction ***** -+ (SDLPerformInteraction *)buildPerformInteractionWithInitialChunks:(NSArray *)initialChunks initialText:(NSString *)initialText interactionChoiceSetIDList:(NSArray *)interactionChoiceSetIDList helpChunks:(NSArray *)helpChunks timeoutChunks:(NSArray *)timeoutChunks interactionMode:(SDLInteractionMode *)interactionMode timeout:(NSNumber *)timeout vrHelp:(NSArray *)vrHelp correlationID:(NSNumber *)correlationID; ++ (SDLPerformInteraction *)buildPerformInteractionWithInitialChunks:(NSArray *)initialChunks initialText:(NSString *)initialText interactionChoiceSetIDList:(NSArray *)interactionChoiceSetIDList helpChunks:(NSArray *)helpChunks timeoutChunks:(NSArray *)timeoutChunks interactionMode:(SDLInteractionMode *)interactionMode timeout:(NSNumber *)timeout vrHelp:(NSArray *)vrHelp correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLPerformInteraction's initWithInitialChunks:initialText:interactionChoiceSetIDList:helpChunks:timeoutChunks:interactionMode:timeout:vrHelp: instead"); //*** -+ (SDLPerformInteraction *)buildPerformInteractionWithInitialPrompt:(NSString *)initialPrompt initialText:(NSString *)initialText interactionChoiceSetIDList:(NSArray *)interactionChoiceSetIDList helpPrompt:(NSString *)helpPrompt timeoutPrompt:(NSString *)timeoutPrompt interactionMode:(SDLInteractionMode *)interactionMode timeout:(NSNumber *)timeout vrHelp:(NSArray *)vrHelp correlationID:(NSNumber *)correlationID; ++ (SDLPerformInteraction *)buildPerformInteractionWithInitialPrompt:(NSString *)initialPrompt initialText:(NSString *)initialText interactionChoiceSetIDList:(NSArray *)interactionChoiceSetIDList helpPrompt:(NSString *)helpPrompt timeoutPrompt:(NSString *)timeoutPrompt interactionMode:(SDLInteractionMode *)interactionMode timeout:(NSNumber *)timeout vrHelp:(NSArray *)vrHelp correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLPerformInteraction's initWithInitialPrompt:initialText:interactionChoiceSetIDList:helpPrompt:timeoutPrompt:interactionMode:timeout:vrHelp: instead"); -+ (SDLPerformInteraction *)buildPerformInteractionWithInitialPrompt:(NSString *)initialPrompt initialText:(NSString *)initialText interactionChoiceSetID:(NSNumber *)interactionChoiceSetID vrHelp:(NSArray *)vrHelp correlationID:(NSNumber *)correlationID; ++ (SDLPerformInteraction *)buildPerformInteractionWithInitialPrompt:(NSString *)initialPrompt initialText:(NSString *)initialText interactionChoiceSetID:(NSNumber *)interactionChoiceSetID vrHelp:(NSArray *)vrHelp correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLPerformInteraction's initWithInitialPrompt:initialText:interactionChoiceSetID:vrHelp: instead"); -+ (SDLPerformInteraction *)buildPerformInteractionWithInitialPrompt:(NSString *)initialPrompt initialText:(NSString *)initialText interactionChoiceSetIDList:(NSArray *)interactionChoiceSetIDList helpPrompt:(NSString *)helpPrompt timeoutPrompt:(NSString *)timeoutPrompt interactionMode:(SDLInteractionMode *)interactionMode timeout:(NSNumber *)timeout correlationID:(NSNumber *)correlationID; ++ (SDLPerformInteraction *)buildPerformInteractionWithInitialPrompt:(NSString *)initialPrompt initialText:(NSString *)initialText interactionChoiceSetIDList:(NSArray *)interactionChoiceSetIDList helpPrompt:(NSString *)helpPrompt timeoutPrompt:(NSString *)timeoutPrompt interactionMode:(SDLInteractionMode *)interactionMode timeout:(NSNumber *)timeout correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLPerformInteraction's initWithInitialPrompt:initialText:interactionChoiceSetIDList:helpPrompt:timeoutPrompt:interactionMode:timeout: instead"); -+ (SDLPerformInteraction *)buildPerformInteractionWithInitialPrompt:(NSString *)initialPrompt initialText:(NSString *)initialText interactionChoiceSetID:(NSNumber *)interactionChoiceSetID correlationID:(NSNumber *)correlationID; ++ (SDLPerformInteraction *)buildPerformInteractionWithInitialPrompt:(NSString *)initialPrompt initialText:(NSString *)initialText interactionChoiceSetID:(NSNumber *)interactionChoiceSetID correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLPerformInteraction's initWithInitialPrompt:initialText:interactionChoiceSetID: instead"); //***** -+ (SDLPutFile *)buildPutFileWithFileName:(NSString *)fileName fileType:(SDLFileType *)fileType persistentFile:(NSNumber *)persistentFile correlationId:(NSNumber *)correlationID; ++ (SDLPutFile *)buildPutFileWithFileName:(NSString *)fileName fileType:(SDLFileType *)fileType persistentFile:(NSNumber *)persistentFile correlationId:(NSNumber *)correlationID __deprecated_msg("use SDLPutFile's initWithFileName:fileType: instead"); + (SDLPutFile *)buildPutFileWithFileName:(NSString *)syncFileName fileType:(SDLFileType *)fileType persisistentFile:(NSNumber *)persistentFile correlationID:(NSNumber *)correlationID __deprecated_msg("use buildPutFileWithFileName:fileType:persistentFile:correlationID: instead"); -+ (SDLReadDID *)buildReadDIDWithECUName:(NSNumber *)ecuName didLocation:(NSArray *)didLocation correlationID:(NSNumber *)correlationID; ++ (SDLReadDID *)buildReadDIDWithECUName:(NSNumber *)ecuName didLocation:(NSArray *)didLocation correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLReadDID's initWithECUName:didLocation: instead"); //***** RegisterAppInterface ***** -+ (SDLRegisterAppInterface *)buildRegisterAppInterfaceWithAppName:(NSString *)appName ttsName:(NSMutableArray *)ttsName vrSynonyms:(NSMutableArray *)vrSynonyms isMediaApp:(NSNumber *)isMediaApp languageDesired:(SDLLanguage *)languageDesired hmiDisplayLanguageDesired:(SDLLanguage *)hmiDisplayLanguageDesired appID:(NSString *)appID; ++ (SDLRegisterAppInterface *)buildRegisterAppInterfaceWithAppName:(NSString *)appName ttsName:(NSMutableArray *)ttsName vrSynonyms:(NSMutableArray *)vrSynonyms isMediaApp:(NSNumber *)isMediaApp languageDesired:(SDLLanguage *)languageDesired hmiDisplayLanguageDesired:(SDLLanguage *)hmiDisplayLanguageDesired appID:(NSString *)appID __deprecated_msg("use SDLRegisterAppInterface's initWithAppName:appId:lanaugeDesired:isMediaApp:ttsName:vrSynonyms:hmiDisplayLanguageDesired: instead"); -+ (SDLRegisterAppInterface *)buildRegisterAppInterfaceWithAppName:(NSString *)appName isMediaApp:(NSNumber *)isMediaApp languageDesired:(SDLLanguage *)languageDesired appID:(NSString *)appID; ++ (SDLRegisterAppInterface *)buildRegisterAppInterfaceWithAppName:(NSString *)appName isMediaApp:(NSNumber *)isMediaApp languageDesired:(SDLLanguage *)languageDesired appID:(NSString *)appID __deprecated_msg("use SDLRegisterAppInterface's initWithAppName:appId:lanaugeDesired:isMediaApp: instead"); -+ (SDLRegisterAppInterface *)buildRegisterAppInterfaceWithAppName:(NSString *)appName languageDesired:(SDLLanguage *)laguageDesired appID:(NSString *)appID; ++ (SDLRegisterAppInterface *)buildRegisterAppInterfaceWithAppName:(NSString *)appName languageDesired:(SDLLanguage *)laguageDesired appID:(NSString *)appID __deprecated_msg("use SDLRegisterAppInterface's initWithAppName:appId:lanaugeDesired: instead"); //***** -+ (SDLResetGlobalProperties *)buildResetGlobalPropertiesWithProperties:(NSArray *)properties correlationID:(NSNumber *)correlationID; ++ (SDLResetGlobalProperties *)buildResetGlobalPropertiesWithProperties:(NSArray *)properties correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLResetGlobalProperties's initWithProperties: instead"); -+ (SDLSendLocation *)buildSendLocationWithLongitude:(NSNumber *)longitude latitude:(NSNumber *)latitude locationName:(NSString *)locationName locationDescription:(NSString *)locationDescription address:(NSArray *)address phoneNumber:(NSString *)phoneNumber image:(SDLImage *)image; ++ (SDLSendLocation *)buildSendLocationWithLongitude:(NSNumber *)longitude latitude:(NSNumber *)latitude locationName:(NSString *)locationName locationDescription:(NSString *)locationDescription address:(NSArray *)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 *)timeout softButtons:(NSArray *)softButtons correlationID:(NSNumber *)correlationID; ++ (SDLScrollableMessage *)buildScrollableMessage:(NSString *)scrollableMessageBody timeout:(NSNumber *)timeout softButtons:(NSArray<SDLSoftButton *> *)softButtons correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLScrollableMessage's initWithMessage:timeout:softButtons: instead"); -+ (SDLSetAppIcon *)buildSetAppIconWithFileName:(NSString *)syncFileName correlationID:(NSNumber *)correlationID; ++ (SDLSetAppIcon *)buildSetAppIconWithFileName:(NSString *)syncFileName correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLSetAppIcon's initWithFileName: instead"); -+ (SDLSetDisplayLayout *)buildSetDisplayLayout:(NSString *)displayLayout correlationID:(NSNumber *)correlationID; ++ (SDLSetDisplayLayout *)buildSetDisplayLayout:(NSString *)displayLayout correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLSetAppIcon's initWithLayout: instead"); //***** SetGlobalProperties ***** -+ (SDLSetGlobalProperties *)buildSetGlobalPropertiesWithHelpText:(NSString *)helpText timeoutText:(NSString *)timeoutText vrHelpTitle:(NSString *)vrHelpTitle vrHelp:(NSArray *)vrHelp correlationID:(NSNumber *)correlationID; ++ (SDLSetGlobalProperties *)buildSetGlobalPropertiesWithHelpText:(NSString *)helpText timeoutText:(NSString *)timeoutText vrHelpTitle:(NSString *)vrHelpTitle vrHelp:(NSArray *)vrHelp correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLSetGlobalProperties's initWithHelpText:timeoutText:vrHelpTitle:vrHelp: instead"); -+ (SDLSetGlobalProperties *)buildSetGlobalPropertiesWithHelpText:(NSString *)helpText timeoutText:(NSString *)timeoutText correlationID:(NSNumber *)correlationID; ++ (SDLSetGlobalProperties *)buildSetGlobalPropertiesWithHelpText:(NSString *)helpText timeoutText:(NSString *)timeoutText correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLSetGlobalProperties's initWithHelpText:timeoutText: instead"); //***** //***** SetMediaClockTimer ***** -+ (SDLSetMediaClockTimer *)buildSetMediaClockTimerWithHours:(NSNumber *)hours minutes:(NSNumber *)minutes seconds:(NSNumber *)seconds updateMode:(SDLUpdateMode *)updateMode correlationID:(NSNumber *)correlationID; ++ (SDLSetMediaClockTimer *)buildSetMediaClockTimerWithHours:(NSNumber *)hours minutes:(NSNumber *)minutes seconds:(NSNumber *)seconds updateMode:(SDLUpdateMode *)updateMode correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLSetMediaClockTimer's initWithHours:minutes:seconds:updateMode: instead"); -+ (SDLSetMediaClockTimer *)buildSetMediaClockTimerWithUpdateMode:(SDLUpdateMode *)updateMode correlationID:(NSNumber *)correlationID; ++ (SDLSetMediaClockTimer *)buildSetMediaClockTimerWithUpdateMode:(SDLUpdateMode *)updateMode correlationID:(NSNumber *)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 *)softButtons customPresets:(NSArray *)customPresets correlationID:(NSNumber *)correlationID; ++ (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 *)customPresets correlationID:(NSNumber *)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 *)correlationID; ++ (SDLShow *)buildShowWithMainField1:(NSString *)mainField1 mainField2:(NSString *)mainField2 statusBar:(NSString *)statusBar mediaClock:(NSString *)mediaClock mediaTrack:(NSString *)mediaTrack alignment:(SDLTextAlignment *)textAlignment correlationID:(NSNumber *)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 *)correlationID; ++ (SDLShow *)buildShowWithMainField1:(NSString *)mainField1 mainField2:(NSString *)mainField2 alignment:(SDLTextAlignment *)alignment correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLShow's initWithMainField1:mainField2:alignment: instead"); //***** //***** Slider ***** -+ (SDLSlider *)buildSliderDynamicFooterWithNumTicks:(NSNumber *)numTicks position:(NSNumber *)position sliderHeader:(NSString *)sliderHeader sliderFooter:(NSArray *)sliderFooter timeout:(NSNumber *)timeout correlationID:(NSNumber *)correlationID; ++ (SDLSlider *)buildSliderDynamicFooterWithNumTicks:(NSNumber *)numTicks position:(NSNumber *)position sliderHeader:(NSString *)sliderHeader sliderFooter:(NSArray *)sliderFooter timeout:(NSNumber *)timeout correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLSlider's initWithNumTicks:position:sliderHeader:sliderFooter:timeout: instead"); -+ (SDLSlider *)buildSliderStaticFooterWithNumTicks:(NSNumber *)numTicks position:(NSNumber *)position sliderHeader:(NSString *)sliderHeader sliderFooter:(NSString *)sliderFooter timeout:(NSNumber *)timeout correlationID:(NSNumber *)correlationID; ++ (SDLSlider *)buildSliderStaticFooterWithNumTicks:(NSNumber *)numTicks position:(NSNumber *)position sliderHeader:(NSString *)sliderHeader sliderFooter:(NSString *)sliderFooter timeout:(NSNumber *)timeout correlationID:(NSNumber *)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; ++ (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 *)ttsChunks correlationID:(NSNumber *)correlationID; ++ (SDLSpeak *)buildSpeakWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLSpeak's initWithTTSChunks: instead"); //*** -+ (SDLSpeak *)buildSpeakWithTTS:(NSString *)ttsText correlationID:(NSNumber *)correlationID; ++ (SDLSpeak *)buildSpeakWithTTS:(NSString *)ttsText correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLSpeak's initWithTTS: instead"); //***** + (SDLSubscribeButton *)buildSubscribeButtonWithName:(SDLButtonName *)buttonName correlationID:(NSNumber *)correlationID __deprecated_msg("use buildSubscribeButtonWithName:handler: with SDLManager instead"); -+ (SDLSubscribeButton *)buildSubscribeButtonWithName:(SDLButtonName *)buttonName handler:(SDLRPCNotificationHandler)handler; ++ (SDLSubscribeButton *)buildSubscribeButtonWithName:(SDLButtonName *)buttonName handler:(SDLRPCNotificationHandler)handler __deprecated_msg("use SDLSubscribeButton's initWithButtonName:handler: instead"); -+ (SDLSubscribeVehicleData *)buildSubscribeVehicleDataWithGPS:(NSNumber *)gps speed:(NSNumber *)speed rpm:(NSNumber *)rpm fuelLevel:(NSNumber *)fuelLevel fuelLevelState:(NSNumber *)fuelLevelState instantFuelConsumption:(NSNumber *)instantFuelConsumption externalTemperature:(NSNumber *)externalTemperature prndl:(NSNumber *)prndl tirePressure:(NSNumber *)tirePressure odometer:(NSNumber *)odometer beltStatus:(NSNumber *)beltStatus bodyInformation:(NSNumber *)bodyInformation deviceStatus:(NSNumber *)deviceStatus driverBraking:(NSNumber *)driverBraking wiperStatus:(NSNumber *)wiperStatus headLampStatus:(NSNumber *)headLampStatus engineTorque:(NSNumber *)engineTorque accPedalPosition:(NSNumber *)accPedalPosition steeringWheelAngle:(NSNumber *)steeringWheelAngle correlationID:(NSNumber *)correlationID; ++ (SDLSubscribeVehicleData *)buildSubscribeVehicleDataWithGPS:(NSNumber *)gps speed:(NSNumber *)speed rpm:(NSNumber *)rpm fuelLevel:(NSNumber *)fuelLevel fuelLevelState:(NSNumber *)fuelLevelState instantFuelConsumption:(NSNumber *)instantFuelConsumption externalTemperature:(NSNumber *)externalTemperature prndl:(NSNumber *)prndl tirePressure:(NSNumber *)tirePressure odometer:(NSNumber *)odometer beltStatus:(NSNumber *)beltStatus bodyInformation:(NSNumber *)bodyInformation deviceStatus:(NSNumber *)deviceStatus driverBraking:(NSNumber *)driverBraking wiperStatus:(NSNumber *)wiperStatus headLampStatus:(NSNumber *)headLampStatus engineTorque:(NSNumber *)engineTorque accPedalPosition:(NSNumber *)accPedalPosition steeringWheelAngle:(NSNumber *)steeringWheelAngle correlationID:(NSNumber *)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 *)distanceToManeuver distanceToManeuverScale:(NSNumber *)distanceToManeuverScale maneuverComplete:(NSNumber *)maneuverComplete softButtons:(NSMutableArray *)softButtons correlationID:(NSNumber *)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 *)distanceToManeuver distanceToManeuverScale:(NSNumber *)distanceToManeuverScale maneuverComplete:(NSNumber *)maneuverComplete softButtons:(NSMutableArray *)softButtons correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLShowConstantTBT's initWithNavigationText1:navigationText2:eta:timeToDestination:totalDistance:turnIcon:nextTurnIcon:distanceToManeuver:distanceToManeuverScale:maneuverComplete:softButtons: instead"); -+ (SDLUnregisterAppInterface *)buildUnregisterAppInterfaceWithCorrelationID:(NSNumber *)correlationID; ++ (SDLUnregisterAppInterface *)buildUnregisterAppInterfaceWithCorrelationID:(NSNumber *)correlationID __deprecated_msg("use SDLUnregisterAppInterface's default initializer instead"); -+ (SDLUnsubscribeButton *)buildUnsubscribeButtonWithName:(SDLButtonName *)buttonName correlationID:(NSNumber *)correlationID; ++ (SDLUnsubscribeButton *)buildUnsubscribeButtonWithName:(SDLButtonName *)buttonName correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLUnsubscribeButton's initWithButtonName: instead"); -+ (SDLUnsubscribeVehicleData *)buildUnsubscribeVehicleDataWithGPS:(NSNumber *)gps speed:(NSNumber *)speed rpm:(NSNumber *)rpm fuelLevel:(NSNumber *)fuelLevel fuelLevelState:(NSNumber *)fuelLevelState instantFuelConsumption:(NSNumber *)instantFuelConsumption externalTemperature:(NSNumber *)externalTemperature prndl:(NSNumber *)prndl tirePressure:(NSNumber *)tirePressure odometer:(NSNumber *)odometer beltStatus:(NSNumber *)beltStatus bodyInformation:(NSNumber *)bodyInformation deviceStatus:(NSNumber *)deviceStatus driverBraking:(NSNumber *)driverBraking wiperStatus:(NSNumber *)wiperStatus headLampStatus:(NSNumber *)headLampStatus engineTorque:(NSNumber *)engineTorque accPedalPosition:(NSNumber *)accPedalPosition steeringWheelAngle:(NSNumber *)steeringWheelAngle correlationID:(NSNumber *)correlationID; ++ (SDLUnsubscribeVehicleData *)buildUnsubscribeVehicleDataWithGPS:(NSNumber *)gps speed:(NSNumber *)speed rpm:(NSNumber *)rpm fuelLevel:(NSNumber *)fuelLevel fuelLevelState:(NSNumber *)fuelLevelState instantFuelConsumption:(NSNumber *)instantFuelConsumption externalTemperature:(NSNumber *)externalTemperature prndl:(NSNumber *)prndl tirePressure:(NSNumber *)tirePressure odometer:(NSNumber *)odometer beltStatus:(NSNumber *)beltStatus bodyInformation:(NSNumber *)bodyInformation deviceStatus:(NSNumber *)deviceStatus driverBraking:(NSNumber *)driverBraking wiperStatus:(NSNumber *)wiperStatus headLampStatus:(NSNumber *)headLampStatus engineTorque:(NSNumber *)engineTorque accPedalPosition:(NSNumber *)accPedalPosition steeringWheelAngle:(NSNumber *)steeringWheelAngle correlationID:(NSNumber *)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 *)turnList softButtons:(NSMutableArray *)softButtons correlationID:(NSNumber *)correlationID; ++ (SDLUpdateTurnList *)buildUpdateTurnListWithTurnList:(NSMutableArray *)turnList softButtons:(NSMutableArray *)softButtons correlationID:(NSNumber *)correlationID __deprecated_msg("use SDLUpdateTurnList initWithTurnList:softButtons: instead"); @end diff --git a/SmartDeviceLink/SDLRPCRequestFactory.m b/SmartDeviceLink/SDLRPCRequestFactory.m index 0d94c5a39..4424cea9c 100644 --- a/SmartDeviceLink/SDLRPCRequestFactory.m +++ b/SmartDeviceLink/SDLRPCRequestFactory.m @@ -167,7 +167,7 @@ static NSString *const SDLBundleShortVersionStringKey = @"CFBundleShortVersionSt } //*** -+ (SDLAlert *)buildAlertWithTTSChunks:(NSArray *)ttsChunks alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 playTone:(NSNumber *)playTone duration:(NSNumber *)duration softButtons:(NSArray *)softButtons correlationID:(NSNumber *)correlationID { ++ (SDLAlert *)buildAlertWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks alertText1:(NSString *)alertText1 alertText2:(NSString *)alertText2 alertText3:(NSString *)alertText3 playTone:(NSNumber *)playTone duration:(NSNumber *)duration softButtons:(NSArray<SDLSoftButton *> *)softButtons correlationID:(NSNumber *)correlationID { SDLAlert *msg = [[SDLAlert alloc] init]; msg.correlationID = correlationID; msg.alertText1 = alertText1; @@ -180,7 +180,7 @@ static NSString *const SDLBundleShortVersionStringKey = @"CFBundleShortVersionSt return msg; } -+ (SDLAlert *)buildAlertWithTTSChunks:(NSArray *)ttsChunks playTone:(NSNumber *)playTone correlationID:(NSNumber *)correlationID { ++ (SDLAlert *)buildAlertWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks playTone:(NSNumber *)playTone correlationID:(NSNumber *)correlationID { return [SDLRPCRequestFactory buildAlertWithTTSChunks:ttsChunks alertText1:nil alertText2:nil alertText3:nil playTone:playTone duration:nil softButtons:nil correlationID:correlationID]; } @@ -460,7 +460,7 @@ static NSString *const SDLBundleShortVersionStringKey = @"CFBundleShortVersionSt return msg; } -+ (SDLScrollableMessage *)buildScrollableMessage:(NSString *)scrollableMessageBody timeout:(NSNumber *)timeout softButtons:(NSArray *)softButtons correlationID:(NSNumber *)correlationID { ++ (SDLScrollableMessage *)buildScrollableMessage:(NSString *)scrollableMessageBody timeout:(NSNumber *)timeout softButtons:(NSArray<SDLSoftButton *> *)softButtons correlationID:(NSNumber *)correlationID { SDLScrollableMessage *msg = [[SDLScrollableMessage alloc] init]; msg.scrollableMessageBody = scrollableMessageBody; msg.timeout = timeout; @@ -548,7 +548,7 @@ static NSString *const SDLBundleShortVersionStringKey = @"CFBundleShortVersionSt //***** 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 *)softButtons customPresets:(NSArray *)customPresets correlationID:(NSNumber *)correlationID { ++ (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 *)customPresets correlationID:(NSNumber *)correlationID { SDLShow *msg = [[SDLShow alloc] init]; msg.correlationID = correlationID; msg.mainField1 = mainField1; @@ -642,7 +642,7 @@ static NSString *const SDLBundleShortVersionStringKey = @"CFBundleShortVersionSt //***** Speak ***** -+ (SDLSpeak *)buildSpeakWithTTSChunks:(NSArray *)ttsChunks correlationID:(NSNumber *)correlationID { ++ (SDLSpeak *)buildSpeakWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks correlationID:(NSNumber *)correlationID { SDLSpeak *msg = [[SDLSpeak alloc] init]; msg.correlationID = correlationID; msg.ttsChunks = [ttsChunks mutableCopy]; diff --git a/SmartDeviceLink/SDLRPCStruct.h b/SmartDeviceLink/SDLRPCStruct.h index e6b3bcccb..e0d0aacf4 100644 --- a/SmartDeviceLink/SDLRPCStruct.h +++ b/SmartDeviceLink/SDLRPCStruct.h @@ -4,6 +4,8 @@ #import <Foundation/Foundation.h> +#import "NSNumber+NumberType.h" + @interface SDLRPCStruct : NSObject { NSMutableDictionary *store; } diff --git a/SmartDeviceLink/SDLRPCStruct.m b/SmartDeviceLink/SDLRPCStruct.m index dd96fff5d..cd0f4d481 100644 --- a/SmartDeviceLink/SDLRPCStruct.m +++ b/SmartDeviceLink/SDLRPCStruct.m @@ -7,7 +7,6 @@ #import "SDLEnum.h" #import "SDLNames.h" - @implementation SDLRPCStruct - (id)initWithDictionary:(NSMutableDictionary *)dict { diff --git a/SmartDeviceLink/SDLReadDID.h b/SmartDeviceLink/SDLReadDID.h index 76df4a592..c1026ad05 100644 --- a/SmartDeviceLink/SDLReadDID.h +++ b/SmartDeviceLink/SDLReadDID.h @@ -30,6 +30,8 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithECUName:(UInt16)ecuNumber didLocation:(NSArray<NSNumber<SDLInt> *> *)didLocation; + /** * @abstract An ID of the vehicle module * <br/><b>Notes: </b>Minvalue:0; Maxvalue:65535 diff --git a/SmartDeviceLink/SDLReadDID.m b/SmartDeviceLink/SDLReadDID.m index 198d992e0..1298f7b24 100644 --- a/SmartDeviceLink/SDLReadDID.m +++ b/SmartDeviceLink/SDLReadDID.m @@ -20,6 +20,18 @@ return self; } +- (instancetype)initWithECUName:(UInt16)ecuName didLocation:(NSArray *)didLocation { + self = [self init]; + if (!self) { + return nil; + } + + self.ecuName = @(ecuName); + self.didLocation = [didLocation mutableCopy]; + + return self; +} + - (void)setEcuName:(NSNumber *)ecuName { if (ecuName != nil) { [parameters setObject:ecuName forKey:NAMES_ecuName]; diff --git a/SmartDeviceLink/SDLRegisterAppInterface.h b/SmartDeviceLink/SDLRegisterAppInterface.h index 642edd3e3..3c4093d2d 100644 --- a/SmartDeviceLink/SDLRegisterAppInterface.h +++ b/SmartDeviceLink/SDLRegisterAppInterface.h @@ -3,10 +3,12 @@ #import "SDLRPCRequest.h" +@class SDLAppInfo; @class SDLDeviceInfo; @class SDLLanguage; +@class SDLLifecycleConfiguration; @class SDLSyncMsgVersion; -@class SDLAppInfo; +@class SDLTTSChunk; /** * Registers the application's interface with SDL®, declaring properties of @@ -94,6 +96,14 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithLifecycleConfiguration:(SDLLifecycleConfiguration*)lifecycleConfiguration; + +- (instancetype)initWithAppName:(NSString *)appName appId:(NSString *)appId languageDesired:(SDLLanguage *)languageDesired; + +- (instancetype)initWithAppName:(NSString *)appName appId:(NSString *)appId languageDesired:(SDLLanguage *)languageDesired isMediaApp:(BOOL)isMediaApp; + +- (instancetype)initWithAppName:(NSString *)appName appId:(NSString *)appId languageDesired:(SDLLanguage *)languageDesired isMediaApp:(BOOL)isMediaApp ttsName:(NSArray<SDLTTSChunk *> *)ttsName vrSynonyms:(NSArray<NSString *> *)vrSynonyms hmiDisplayLanguageDesired:(SDLLanguage *)hmiDisplayLanguageDesired; + /** * @abstract The version of the SDL interface * diff --git a/SmartDeviceLink/SDLRegisterAppInterface.m b/SmartDeviceLink/SDLRegisterAppInterface.m index 36fac6627..3a2623021 100644 --- a/SmartDeviceLink/SDLRegisterAppInterface.m +++ b/SmartDeviceLink/SDLRegisterAppInterface.m @@ -7,6 +7,7 @@ #import "SDLAppHMIType.h" #import "SDLAppInfo.h" #import "SDLDeviceInfo.h" +#import "SDLLifecycleConfiguration.h" #import "SDLLanguage.h" #import "SDLNames.h" #import "SDLSyncMsgVersion.h" @@ -27,6 +28,39 @@ return self; } +- (instancetype)initWithLifecycleConfiguration:(SDLLifecycleConfiguration *)lifecycleConfiguration { + return [self initWithAppName:lifecycleConfiguration.appName appId:lifecycleConfiguration.appId languageDesired:lifecycleConfiguration.language isMediaApp:lifecycleConfiguration.isMedia ttsName:lifecycleConfiguration.ttsName vrSynonyms:lifecycleConfiguration.voiceRecognitionCommandNames hmiDisplayLanguageDesired:lifecycleConfiguration.language]; +} + +- (instancetype)initWithAppName:(NSString *)appName appId:(NSString *)appId languageDesired:(SDLLanguage *)languageDesired { + return [self initWithAppName:appName appId:appId languageDesired:languageDesired isMediaApp:NO]; +} + +- (instancetype)initWithAppName:(NSString *)appName appId:(NSString *)appId languageDesired:(SDLLanguage *)languageDesired isMediaApp:(BOOL)isMediaApp { + return [self initWithAppName:appName appId:appId languageDesired:languageDesired isMediaApp:isMediaApp ttsName:nil vrSynonyms:nil hmiDisplayLanguageDesired:languageDesired]; +} + +- (instancetype)initWithAppName:(NSString *)appName appId:(NSString *)appId languageDesired:(SDLLanguage *)languageDesired isMediaApp:(BOOL)isMediaApp ttsName:(NSArray *)ttsName vrSynonyms:(NSArray *)vrSynonyms hmiDisplayLanguageDesired:(SDLLanguage *)hmiDisplayLanguageDesired { + self = [self init]; + if (!self) { + return nil; + } + + self.appID = appId; + self.appName = appName; + self.hmiDisplayLanguageDesired = hmiDisplayLanguageDesired; + self.isMediaApplication = @(isMediaApp); + self.ngnMediaScreenAppName = appName; + self.ttsName = [ttsName copy]; + self.vrSynonyms = [vrSynonyms copy]; + self.syncMsgVersion = [[SDLSyncMsgVersion alloc] initWithMajorVersion:1 minorVersion:0]; + self.appInfo = [SDLAppInfo currentAppInfo]; + self.deviceInfo = [SDLDeviceInfo currentDevice]; + self.correlationID = @1; + + return self; +} + - (void)setSyncMsgVersion:(SDLSyncMsgVersion *)syncMsgVersion { if (syncMsgVersion != nil) { [parameters setObject:syncMsgVersion forKey:NAMES_syncMsgVersion]; diff --git a/SmartDeviceLink/SDLResetGlobalProperties.h b/SmartDeviceLink/SDLResetGlobalProperties.h index f30b59a41..b0080c422 100644 --- a/SmartDeviceLink/SDLResetGlobalProperties.h +++ b/SmartDeviceLink/SDLResetGlobalProperties.h @@ -4,6 +4,8 @@ #import "SDLRPCRequest.h" +@class SDLGlobalProperty; + /** * Resets the passed global properties to their default values as defined by * SDL @@ -34,6 +36,8 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithProperties:(NSArray<SDLGlobalProperty *> *)properties; + /** * @abstract An array of one or more GlobalProperty enumeration elements * indicating which global properties to reset to their default value diff --git a/SmartDeviceLink/SDLResetGlobalProperties.m b/SmartDeviceLink/SDLResetGlobalProperties.m index 350f96de0..795523206 100644 --- a/SmartDeviceLink/SDLResetGlobalProperties.m +++ b/SmartDeviceLink/SDLResetGlobalProperties.m @@ -21,6 +21,17 @@ return self; } +- (instancetype)initWithProperties:(NSArray *)properties { + self = [self init]; + if (!self) { + return nil; + } + + self.properties = [properties mutableCopy]; + + return self; +} + - (void)setProperties:(NSMutableArray *)properties { if (properties != nil) { [parameters setObject:properties forKey:NAMES_properties]; diff --git a/SmartDeviceLink/SDLScrollableMessage.h b/SmartDeviceLink/SDLScrollableMessage.h index 27e894221..3a1fe8415 100644 --- a/SmartDeviceLink/SDLScrollableMessage.h +++ b/SmartDeviceLink/SDLScrollableMessage.h @@ -4,6 +4,8 @@ #import "SDLRPCRequest.h" +@class SDLSoftButton; + /** * Creates a full screen overlay containing a large block of formatted text that * can be scrolled with up to 8 SoftButtons defined @@ -27,6 +29,10 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithMessage:(NSString *)message; + +- (instancetype)initWithMessage:(NSString *)message timeout:(UInt16)timeout softButtons:(NSArray<SDLSoftButton *> *)softButtons; + /** * @abstract A Body of text that can include newlines and tabs * @discussion A String value representing the Body of text that can include diff --git a/SmartDeviceLink/SDLScrollableMessage.m b/SmartDeviceLink/SDLScrollableMessage.m index 5995e7874..ada0d0a98 100644 --- a/SmartDeviceLink/SDLScrollableMessage.m +++ b/SmartDeviceLink/SDLScrollableMessage.m @@ -21,6 +21,29 @@ return self; } +- (instancetype)initWithMessage:(NSString *)message timeout:(UInt16)timeout softButtons:(NSArray<SDLSoftButton *> *)softButtons { + self = [self initWithMessage:message]; + if (!self) { + return nil; + } + + self.timeout = @(timeout); + self.softButtons = [softButtons mutableCopy]; + + return self; +} + +- (instancetype)initWithMessage:(NSString *)message { + self = [self init]; + if (!self) { + return nil; + } + + self.scrollableMessageBody = message; + + return self; +} + - (void)setScrollableMessageBody:(NSString *)scrollableMessageBody { if (scrollableMessageBody != nil) { [parameters setObject:scrollableMessageBody forKey:NAMES_scrollableMessageBody]; diff --git a/SmartDeviceLink/SDLSendLocation.h b/SmartDeviceLink/SDLSendLocation.h index cec60c422..7d0bb91ec 100644 --- a/SmartDeviceLink/SDLSendLocation.h +++ b/SmartDeviceLink/SDLSendLocation.h @@ -3,6 +3,7 @@ // SmartDeviceLink #import <Foundation/Foundation.h> +#import <CoreGraphics/CGBase.h> #import "SDLImage.h" #import "SDLRPCRequest.h" @@ -13,6 +14,8 @@ - (instancetype)init; - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithLongitude:(CGFloat)longitude latitude:(CGFloat)latitude locationName:(NSString *)locationName locationDescription:(NSString *)locationDescription address:(NSArray<NSString *> *)address phoneNumber:(NSString *)phoneNumber image:(SDLImage *)image; + /** * The longitudinal coordinate of the location. * diff --git a/SmartDeviceLink/SDLSendLocation.m b/SmartDeviceLink/SDLSendLocation.m index 7bf1c5c70..211ce2e96 100644 --- a/SmartDeviceLink/SDLSendLocation.m +++ b/SmartDeviceLink/SDLSendLocation.m @@ -27,6 +27,23 @@ return self; } +- (instancetype)initWithLongitude:(CGFloat)longitude latitude:(CGFloat)latitude locationName:(NSString *)locationName locationDescription:(NSString *)locationDescription address:(NSArray *)address phoneNumber:(NSString *)phoneNumber image:(SDLImage *)image { + self = [self init]; + if (!self) { + return nil; + } + + self.longitudeDegrees = @(longitude); + self.latitudeDegrees = @(latitude); + self.locationName = locationName; + self.locationDescription = locationDescription; + self.addressLines = address; + self.phoneNumber = phoneNumber; + self.locationImage = image; + + return self; +} + - (void)setLongitudeDegrees:(NSNumber *)longitudeDegrees { if (longitudeDegrees != nil) { parameters[NAMES_longitudeDegrees] = longitudeDegrees; diff --git a/SmartDeviceLink/SDLSetAppIcon.h b/SmartDeviceLink/SDLSetAppIcon.h index eee61deb5..17b30ad00 100644 --- a/SmartDeviceLink/SDLSetAppIcon.h +++ b/SmartDeviceLink/SDLSetAppIcon.h @@ -24,6 +24,9 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithFileName:(NSString *)fileName; + + /** * @abstract A file reference name * @discussion A String value representing a file reference name diff --git a/SmartDeviceLink/SDLSetAppIcon.m b/SmartDeviceLink/SDLSetAppIcon.m index 717eeb023..a5eec4e4d 100644 --- a/SmartDeviceLink/SDLSetAppIcon.m +++ b/SmartDeviceLink/SDLSetAppIcon.m @@ -20,6 +20,17 @@ return self; } +- (instancetype)initWithFileName:(NSString *)fileName { + self = [self init]; + if (!self) { + return nil; + } + + self.syncFileName = fileName; + + return self; +} + - (void)setSyncFileName:(NSString *)syncFileName { if (syncFileName != nil) { [parameters setObject:syncFileName forKey:NAMES_syncFileName]; diff --git a/SmartDeviceLink/SDLSetDisplayLayout.h b/SmartDeviceLink/SDLSetDisplayLayout.h index 15226a821..eae57de46 100644 --- a/SmartDeviceLink/SDLSetDisplayLayout.h +++ b/SmartDeviceLink/SDLSetDisplayLayout.h @@ -4,6 +4,8 @@ #import "SDLRPCRequest.h" +@class SDLPredefinedLayout; + /** * Used to set an alternate display layout. If not sent, default screen for * given platform will be shown @@ -24,6 +26,11 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithPredefinedLayout:(SDLPredefinedLayout *)predefinedLayout; + +- (instancetype)initWithLayout:(NSString *)displayLayout; + + /** * @abstract A display layout. Predefined or dynamically created screen layout. * Currently only predefined screen layouts are defined. Predefined layouts diff --git a/SmartDeviceLink/SDLSetDisplayLayout.m b/SmartDeviceLink/SDLSetDisplayLayout.m index ed812f647..2a1e0d0a3 100644 --- a/SmartDeviceLink/SDLSetDisplayLayout.m +++ b/SmartDeviceLink/SDLSetDisplayLayout.m @@ -5,6 +5,7 @@ #import "SDLSetDisplayLayout.h" #import "SDLNames.h" +#import "SDLPredefinedLayout.h" @implementation SDLSetDisplayLayout @@ -20,6 +21,21 @@ return self; } +- (instancetype)initWithPredefinedLayout:(SDLPredefinedLayout *)predefinedLayout { + return [self initWithLayout:predefinedLayout.value]; +} + +- (instancetype)initWithLayout:(NSString *)displayLayout { + self = [self init]; + if (!self) { + return nil; + } + + self.displayLayout = displayLayout; + + return self; +} + - (void)setDisplayLayout:(NSString *)displayLayout { if (displayLayout != nil) { [parameters setObject:displayLayout forKey:NAMES_displayLayout]; diff --git a/SmartDeviceLink/SDLSetGlobalProperties.h b/SmartDeviceLink/SDLSetGlobalProperties.h index 7ad36e8d5..4c0320f65 100644 --- a/SmartDeviceLink/SDLSetGlobalProperties.h +++ b/SmartDeviceLink/SDLSetGlobalProperties.h @@ -31,6 +31,12 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithHelpText:(NSString *)helpText timeoutText:(NSString *)timeoutText; + +- (instancetype)initWithHelpText:(NSString *)helpText timeoutText:(NSString *)timeoutText vrHelpTitle:(NSString *)vrHelpTitle vrHelp:(NSArray *)vrHelp; + +- (instancetype)initWithHelpText:(NSString *)helpText timeoutText:(NSString *)timeoutText vrHelpTitle:(NSString *)vrHelpTitle vrHelp:(NSArray *)vrHelp menuTitle:(NSString*)menuTitle menuIcon:(SDLImage*)menuIcon keyboardProperties:(SDLKeyboardProperties*)keyboardProperties; + /** * @abstract Sets a Vector<TTSChunk> for Help Prompt that Array of one or more * TTSChunk elements specifying the help prompt used in an interaction diff --git a/SmartDeviceLink/SDLSetGlobalProperties.m b/SmartDeviceLink/SDLSetGlobalProperties.m index ba9749e3e..1c8afb00b 100644 --- a/SmartDeviceLink/SDLSetGlobalProperties.m +++ b/SmartDeviceLink/SDLSetGlobalProperties.m @@ -8,6 +8,7 @@ #import "SDLKeyboardProperties.h" #import "SDLNames.h" #import "SDLTTSChunk.h" +#import "SDLTTSChunkFactory.h" #import "SDLVRHelpItem.h" @@ -25,6 +26,32 @@ return self; } +- (instancetype)initWithHelpText:(NSString *)helpText timeoutText:(NSString *)timeoutText { + return [self initWithHelpText:helpText timeoutText:timeoutText vrHelpTitle:nil vrHelp:nil]; +} + +- (instancetype)initWithHelpText:(NSString *)helpText timeoutText:(NSString *)timeoutText vrHelpTitle:(NSString *)vrHelpTitle vrHelp:(NSArray *)vrHelp { + return [self initWithHelpText:helpText timeoutText:timeoutText vrHelpTitle:vrHelpTitle vrHelp:vrHelp menuTitle:nil menuIcon:nil keyboardProperties:nil]; +} + +- (instancetype)initWithHelpText:(NSString *)helpText timeoutText:(NSString *)timeoutText vrHelpTitle:(NSString *)vrHelpTitle vrHelp:(NSArray *)vrHelp menuTitle:(NSString *)menuTitle menuIcon:(SDLImage *)menuIcon keyboardProperties:(SDLKeyboardProperties *)keyboardProperties { + self = [self init]; + if (!self) { + return nil; + } + + self.helpPrompt = [SDLTTSChunkFactory buildTTSChunksFromSimple:helpText]; + self.timeoutPrompt = [SDLTTSChunkFactory buildTTSChunksFromSimple:timeoutText]; + self.vrHelpTitle = vrHelpTitle; + self.vrHelp = [vrHelp mutableCopy]; + self.menuTitle = menuTitle; + self.menuIcon = menuIcon; + self.keyboardProperties = keyboardProperties; + + return self; +} + + - (void)setHelpPrompt:(NSMutableArray *)helpPrompt { if (helpPrompt != nil) { [parameters setObject:helpPrompt forKey:NAMES_helpPrompt]; diff --git a/SmartDeviceLink/SDLSetMediaClockTimer.h b/SmartDeviceLink/SDLSetMediaClockTimer.h index 71de56b35..c15c5a192 100644 --- a/SmartDeviceLink/SDLSetMediaClockTimer.h +++ b/SmartDeviceLink/SDLSetMediaClockTimer.h @@ -31,6 +31,10 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithUpdateMode:(SDLUpdateMode *)updateMode hours:(NSInteger)hours minutes:(NSInteger)minutes seconds:(NSInteger)seconds; + +- (instancetype)initWithUpdateMode:(SDLUpdateMode *)updateMode; + /** * @abstract A Start Time with specifying hour, minute, second values * diff --git a/SmartDeviceLink/SDLSetMediaClockTimer.m b/SmartDeviceLink/SDLSetMediaClockTimer.m index 325d0e347..04ef841b8 100644 --- a/SmartDeviceLink/SDLSetMediaClockTimer.m +++ b/SmartDeviceLink/SDLSetMediaClockTimer.m @@ -23,6 +23,29 @@ return self; } + +- (instancetype)initWithUpdateMode:(SDLUpdateMode *)updateMode hours:(NSInteger)hours minutes:(NSInteger)minutes seconds:(NSInteger)seconds { + self = [self initWithUpdateMode:updateMode]; + if (!self) { + return nil; + } + + self.startTime = [[SDLStartTime alloc] initWithHours:hours minutes:minutes seconds:seconds]; + + return self; +} + +- (instancetype)initWithUpdateMode:(SDLUpdateMode *)updateMode { + self = [self init]; + if (!self) { + return nil; + } + + self.updateMode = updateMode; + + return self; +} + - (void)setStartTime:(SDLStartTime *)startTime { if (startTime != nil) { [parameters setObject:startTime forKey:NAMES_startTime]; diff --git a/SmartDeviceLink/SDLShow.h b/SmartDeviceLink/SDLShow.h index 20cf84a92..c692bd84c 100644 --- a/SmartDeviceLink/SDLShow.h +++ b/SmartDeviceLink/SDLShow.h @@ -4,6 +4,7 @@ #import "SDLRPCRequest.h" @class SDLImage; +@class SDLSoftButton; @class SDLTextAlignment; @@ -42,6 +43,15 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithMainField1:(NSString *)mainField1 mainField2:(NSString *)mainField2 alignment:(SDLTextAlignment *)alignment; + +- (instancetype)initWithMainField1:(NSString*)mainField1 mainField2:(NSString *)mainField2 mainField3:(NSString*)mainField3 mainField4:(NSString*)mainField4 alignment:(SDLTextAlignment *)alignment; + +- (instancetype)initWithMainField1:(NSString *)mainField1 mainField2:(NSString *)mainField2 alignment:(SDLTextAlignment *)alignment statusBar:(NSString *)statusBar mediaClock:(NSString *)mediaClock mediaTrack:(NSString *)mediaTrack; + +- (instancetype)initWithMainField1:(NSString *)mainField1 mainField2:(NSString *)mainField2 mainField3:(NSString *)mainField3 mainField4:(NSString *)mainField4 alignment:(SDLTextAlignment *)alignment statusBar:(NSString *)statusBar mediaClock:(NSString *)mediaClock mediaTrack:(NSString *)mediaTrack graphic:(SDLImage *)graphic softButtons:(NSArray<SDLSoftButton *> *)softButtons customPresets:(NSArray<NSString *> *)customPresets; + + /** * @abstract The text displayed in a single-line display, or in the upper display * line in a two-line display diff --git a/SmartDeviceLink/SDLShow.m b/SmartDeviceLink/SDLShow.m index 933167159..a6edbdf09 100644 --- a/SmartDeviceLink/SDLShow.m +++ b/SmartDeviceLink/SDLShow.m @@ -24,6 +24,39 @@ return self; } +- (instancetype)initWithMainField1:(NSString *)mainField1 mainField2:(NSString *)mainField2 alignment:(SDLTextAlignment *)alignment { + return [self initWithMainField1:mainField1 mainField2:mainField2 mainField3:nil mainField4:nil alignment:alignment]; +} + +- (instancetype)initWithMainField1:(NSString*)mainField1 mainField2:(NSString *)mainField2 mainField3:(NSString*)mainField3 mainField4:(NSString*)mainField4 alignment:(SDLTextAlignment *)alignment { + return [self initWithMainField1:mainField1 mainField2:mainField2 mainField3:mainField3 mainField4:mainField4 alignment:alignment statusBar:nil mediaClock:nil mediaTrack:nil graphic:nil softButtons:nil customPresets:nil]; +} + +- (instancetype)initWithMainField1:(NSString *)mainField1 mainField2:(NSString *)mainField2 alignment:(SDLTextAlignment *)alignment statusBar:(NSString *)statusBar mediaClock:(NSString *)mediaClock mediaTrack:(NSString *)mediaTrack { + return [self initWithMainField1:mainField1 mainField2:mainField2 mainField3:nil mainField4:nil alignment:alignment statusBar:statusBar mediaClock:mediaClock mediaTrack:mediaTrack graphic:nil softButtons:nil customPresets:nil]; +} + +- (instancetype)initWithMainField1:(NSString *)mainField1 mainField2:(NSString *)mainField2 mainField3:(NSString *)mainField3 mainField4:(NSString *)mainField4 alignment:(SDLTextAlignment *)alignment statusBar:(NSString *)statusBar mediaClock:(NSString *)mediaClock mediaTrack:(NSString *)mediaTrack graphic:(SDLImage *)graphic softButtons:(NSArray<SDLSoftButton *> *)softButtons customPresets:(NSArray<NSString *> *)customPresets { + self = [self init]; + if (!self) { + return nil; + } + + self.mainField1 = mainField1; + self.mainField2 = mainField2; + self.mainField3 = mainField3; + self.mainField4 = mainField4; + self.statusBar = statusBar; + self.mediaClock = mediaClock; + self.mediaTrack = mediaTrack; + self.alignment = alignment; + self.graphic = graphic; + self.softButtons = [softButtons mutableCopy]; + self.customPresets = [customPresets mutableCopy]; + + return self; +} + - (void)setMainField1:(NSString *)mainField1 { if (mainField1 != nil) { [parameters setObject:mainField1 forKey:NAMES_mainField1]; diff --git a/SmartDeviceLink/SDLShowConstantTBT.h b/SmartDeviceLink/SDLShowConstantTBT.h index ae5dda108..b0d60bf97 100644 --- a/SmartDeviceLink/SDLShowConstantTBT.h +++ b/SmartDeviceLink/SDLShowConstantTBT.h @@ -3,7 +3,10 @@ #import "SDLRPCRequest.h" +#import <CoreGraphics/CGBase.h> + @class SDLImage; +@class SDLSoftButton; /** This RPC is used to update the user with navigation information<br> @@ -18,6 +21,8 @@ - (instancetype)init; - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithNavigationText1:(NSString *)navigationText1 navigationText2:(NSString *)navigationText2 eta:(NSString *)eta timeToDestination:(NSString *)timeToDestination totalDistance:(NSString *)totalDistance turnIcon:(SDLImage *)turnIcon nextTurnIcon:(SDLImage *)nextTurnIcon distanceToManeuver:(CGFloat)distanceToManeuver distanceToManeuverScale:(CGFloat)distanceToManeuverScale maneuverComplete:(BOOL)maneuverComplete softButtons:(NSArray<SDLSoftButton *> *)softButtons; + @property (strong) NSString *navigationText1; @property (strong) NSString *navigationText2; @property (strong) NSString *eta; diff --git a/SmartDeviceLink/SDLShowConstantTBT.m b/SmartDeviceLink/SDLShowConstantTBT.m index c3f87f071..0e021d831 100644 --- a/SmartDeviceLink/SDLShowConstantTBT.m +++ b/SmartDeviceLink/SDLShowConstantTBT.m @@ -23,6 +23,27 @@ return self; } +- (instancetype)initWithNavigationText1:(NSString *)navigationText1 navigationText2:(NSString *)navigationText2 eta:(NSString *)eta timeToDestination:(NSString *)timeToDestination totalDistance:(NSString *)totalDistance turnIcon:(SDLImage *)turnIcon nextTurnIcon:(SDLImage *)nextTurnIcon distanceToManeuver:(CGFloat)distanceToManeuver distanceToManeuverScale:(CGFloat)distanceToManeuverScale maneuverComplete:(BOOL)maneuverComplete softButtons:(NSArray<SDLSoftButton *> *)softButtons { + self = [self init]; + if (!self) { + return nil; + } + + self.navigationText1 = navigationText1; + self.navigationText2 = navigationText2; + self.eta = eta; + self.timeToDestination = timeToDestination; + self.totalDistance = totalDistance; + self.turnIcon = turnIcon; + self.nextTurnIcon = nextTurnIcon; + self.distanceToManeuver = @(distanceToManeuver); + self.distanceToManeuverScale = @(distanceToManeuverScale); + self.maneuverComplete = @(maneuverComplete); + self.softButtons = [softButtons mutableCopy]; + + return self; +} + - (void)setNavigationText1:(NSString *)navigationText1 { if (navigationText1 != nil) { [parameters setObject:navigationText1 forKey:NAMES_navigationText1]; diff --git a/SmartDeviceLink/SDLSlider.h b/SmartDeviceLink/SDLSlider.h index 04724d780..7651bd57f 100644 --- a/SmartDeviceLink/SDLSlider.h +++ b/SmartDeviceLink/SDLSlider.h @@ -25,6 +25,12 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position; + +- (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader sliderFooter:(NSString *)sliderFooter timeout:(UInt16)timeout; + +- (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader sliderFooters:(NSArray<NSString *> *)sliderFooters timeout:(UInt16)timeout; + /** * @abstract Represents a number of selectable items on a horizontal axis * diff --git a/SmartDeviceLink/SDLSlider.m b/SmartDeviceLink/SDLSlider.m index 80a56d1aa..a5a983bc6 100644 --- a/SmartDeviceLink/SDLSlider.m +++ b/SmartDeviceLink/SDLSlider.m @@ -20,6 +20,42 @@ return self; } +- (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader sliderFooter:(NSString *)sliderFooter timeout:(UInt16)timeout { + NSMutableArray *sliderFooters = [NSMutableArray arrayWithCapacity:numTicks]; + + // Populates array with the same footer value for each position + for (int i = 0; i < sliderFooters.count; i++) { + sliderFooters[0] = sliderFooter; + } + + return [self initWithNumTicks:numTicks position:position sliderHeader:sliderHeader sliderFooter:[sliderFooters copy] timeout:timeout]; +} + +- (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position sliderHeader:(NSString *)sliderHeader sliderFooters:(NSArray<NSString *> *)sliderFooters timeout:(UInt16)timeout { + self = [self initWithNumTicks:numTicks position:position]; + if (!self) { + return nil; + } + + self.sliderHeader = sliderHeader; + self.sliderFooter = [sliderFooters mutableCopy]; + self.timeout = @(timeout); + + return self; +} + +- (instancetype)initWithNumTicks:(UInt8)numTicks position:(UInt8)position { + self = [self init]; + if (!self) { + return nil; + } + + self.numTicks = @(numTicks); + self.position = @(position); + + return self; +} + - (void)setNumTicks:(NSNumber *)numTicks { if (numTicks != nil) { [parameters setObject:numTicks forKey:NAMES_numTicks]; diff --git a/SmartDeviceLink/SDLSoftButton.h b/SmartDeviceLink/SDLSoftButton.h index aeefc8a9c..cfc62a33e 100644 --- a/SmartDeviceLink/SDLSoftButton.h +++ b/SmartDeviceLink/SDLSoftButton.h @@ -18,6 +18,8 @@ - (instancetype)initWithHandler:(SDLRPCNotificationHandler)handler; - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithType:(SDLSoftButtonType *)tyle text:(NSString *)text image:(SDLImage *)image highlighted:(BOOL)highlighted buttonId:(UInt16)buttonId systemAction:(SDLSystemAction *)systemAction handler:(SDLRPCNotificationHandler)handler; + @property (copy, nonatomic) SDLRPCNotificationHandler handler; @property (strong) SDLSoftButtonType *type; diff --git a/SmartDeviceLink/SDLSoftButton.m b/SmartDeviceLink/SDLSoftButton.m index 201144f20..818047f8a 100644 --- a/SmartDeviceLink/SDLSoftButton.m +++ b/SmartDeviceLink/SDLSoftButton.m @@ -34,6 +34,23 @@ return self; } +- (instancetype)initWithType:(SDLSoftButtonType *)type text:(NSString *)text image:(SDLImage *)image highlighted:(BOOL)highlighted buttonId:(UInt16)buttonId systemAction:(SDLSystemAction *)systemAction handler:(SDLRPCNotificationHandler)handler { + self = [self initWithHandler:handler]; + if (!self) { + return nil; + } + + self.type = type; + self.text = text; + self.image = image; + self.isHighlighted = @(highlighted); + self.softButtonID = @(buttonId); + self.systemAction = systemAction; + self.handler = handler; + + return self; +} + - (void)setType:(SDLSoftButtonType *)type { if (type != nil) { [store setObject:type forKey:NAMES_type]; diff --git a/SmartDeviceLink/SDLSpeak.h b/SmartDeviceLink/SDLSpeak.h index 8e6eb8e7e..f6485030a 100644 --- a/SmartDeviceLink/SDLSpeak.h +++ b/SmartDeviceLink/SDLSpeak.h @@ -3,6 +3,8 @@ #import "SDLRPCRequest.h" +@class SDLTTSChunk; + /** * Speaks a phrase over the vehicle audio system using SDL's TTS (text-to-speech) engine. The provided text to be spoken can be simply a text phrase, or it can consist of phoneme specifications to direct SDL's TTS engine to speak a "speech-sculpted" phrase. * @@ -50,6 +52,10 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithTTS:(NSString *)ttsText; + +- (instancetype)initWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks; + /** * @abstract An array of TTSChunk structs which, taken together, specify the phrase to be spoken * diff --git a/SmartDeviceLink/SDLSpeak.m b/SmartDeviceLink/SDLSpeak.m index 8f19b925b..deefde886 100644 --- a/SmartDeviceLink/SDLSpeak.m +++ b/SmartDeviceLink/SDLSpeak.m @@ -6,6 +6,7 @@ #import "SDLNames.h" #import "SDLTTSChunk.h" +#import "SDLTTSChunkFactory.h" @implementation SDLSpeak @@ -21,6 +22,22 @@ return self; } +- (instancetype)initWithTTS:(NSString *)ttsText { + NSMutableArray* ttsChunks = [SDLTTSChunkFactory buildTTSChunksFromSimple:ttsText]; + return [self initWithTTSChunks:ttsChunks]; +} + +- (instancetype)initWithTTSChunks:(NSArray<SDLTTSChunk *> *)ttsChunks { + self = [self init]; + if (!self) { + return nil; + } + + self.ttsChunks = [ttsChunks mutableCopy]; + + return self; +} + - (void)setTtsChunks:(NSMutableArray *)ttsChunks { if (ttsChunks != nil) { [parameters setObject:ttsChunks forKey:NAMES_ttsChunks]; diff --git a/SmartDeviceLink/SDLStartTime.h b/SmartDeviceLink/SDLStartTime.h index 55eb147d6..923a6656c 100644 --- a/SmartDeviceLink/SDLStartTime.h +++ b/SmartDeviceLink/SDLStartTime.h @@ -23,6 +23,8 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithHours:(UInt8)hours minutes:(UInt8)minutes seconds:(UInt8)seconds; + /** * @abstract The hour of the media clock * diff --git a/SmartDeviceLink/SDLStartTime.m b/SmartDeviceLink/SDLStartTime.m index 4745bf712..15b6a3f0c 100644 --- a/SmartDeviceLink/SDLStartTime.m +++ b/SmartDeviceLink/SDLStartTime.m @@ -20,6 +20,19 @@ return self; } +- (instancetype)initWithHours:(UInt8)hours minutes:(UInt8)minutes seconds:(UInt8)seconds { + self = [self init]; + if (!self) { + return nil; + } + + self.hours = @(hours); + self.minutes = @(minutes); + self.seconds = @(seconds); + + return self; +} + - (void)setHours:(NSNumber *)hours { if (hours != nil) { [store setObject:hours forKey:NAMES_hours]; diff --git a/SmartDeviceLink/SDLSubscribeButton.h b/SmartDeviceLink/SDLSubscribeButton.h index 05c2acd23..9baa7d052 100644 --- a/SmartDeviceLink/SDLSubscribeButton.h +++ b/SmartDeviceLink/SDLSubscribeButton.h @@ -84,6 +84,8 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithButtonName:(SDLButtonName *)buttonName handler:(SDLRPCNotificationHandler)handler; + /** * A handler that will let you know when the button you subscribed to is selected. * diff --git a/SmartDeviceLink/SDLSubscribeButton.m b/SmartDeviceLink/SDLSubscribeButton.m index ee0191943..69290eaa4 100644 --- a/SmartDeviceLink/SDLSubscribeButton.m +++ b/SmartDeviceLink/SDLSubscribeButton.m @@ -33,6 +33,18 @@ return self; } +- (instancetype)initWithButtonName:(SDLButtonName *)buttonName handler:(SDLRPCNotificationHandler)handler { + self = [self init]; + if (!self) { + return nil; + } + + self.buttonName = buttonName; + self.handler = handler; + + return self; +} + - (void)setButtonName:(SDLButtonName *)buttonName { if (buttonName != nil) { [parameters setObject:buttonName forKey:NAMES_buttonName]; diff --git a/SmartDeviceLink/SDLSubscribeVehicleData.h b/SmartDeviceLink/SDLSubscribeVehicleData.h index e357cd484..e0e5a799e 100644 --- a/SmartDeviceLink/SDLSubscribeVehicleData.h +++ b/SmartDeviceLink/SDLSubscribeVehicleData.h @@ -34,6 +34,8 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo emergencyEvent:(BOOL)emergencyEvent engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState gps:(BOOL)gps headLampStatus:(BOOL)headLampStatus instantFuelConsumption:(BOOL)instantFuelConsumption myKey:(BOOL)myKey odometer:(BOOL)odometer prndl:(BOOL)prndl rpm:(BOOL)rpm speed:(BOOL)speed steeringWheelAngle:(BOOL)steeringWheelAngle tirePressure:(BOOL)tirePressure wiperStatus:(BOOL)wiperStatus; + /** * @abstract A boolean value. If true, subscribes Gps data */ diff --git a/SmartDeviceLink/SDLSubscribeVehicleData.m b/SmartDeviceLink/SDLSubscribeVehicleData.m index 55ec5e9d0..c9938a09d 100644 --- a/SmartDeviceLink/SDLSubscribeVehicleData.m +++ b/SmartDeviceLink/SDLSubscribeVehicleData.m @@ -20,6 +20,40 @@ return self; } +- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo emergencyEvent:(BOOL)emergencyEvent engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState gps:(BOOL)gps headLampStatus:(BOOL)headLampStatus instantFuelConsumption:(BOOL)instantFuelConsumption myKey:(BOOL)myKey odometer:(BOOL)odometer prndl:(BOOL)prndl rpm:(BOOL)rpm speed:(BOOL)speed steeringWheelAngle:(BOOL)steeringWheelAngle tirePressure:(BOOL)tirePressure wiperStatus:(BOOL)wiperStatus { + self = [self init]; + if (!self) { + return nil; + } + + self.accPedalPosition = @(accelerationPedalPosition); + self.airbagStatus = @(airbagStatus); + self.beltStatus = @(beltStatus); + self.bodyInformation = @(bodyInformation); + self.clusterModeStatus = @(clusterModeStatus); + self.deviceStatus = @(deviceStatus); + self.driverBraking = @(driverBraking); + self.eCallInfo = @(eCallInfo); + self.emergencyEvent = @(emergencyEvent); + self.engineTorque = @(engineTorque); + self.externalTemperature = @(externalTemperature); + self.fuelLevel = @(fuelLevel); + self.fuelLevel_State = @(fuelLevelState); + self.myKey = @(myKey); + self.odometer = @(odometer); + self.gps = @(gps); + self.headLampStatus = @(headLampStatus); + self.instantFuelConsumption = @(instantFuelConsumption); + self.prndl = @(prndl); + self.rpm = @(rpm); + self.speed = @(speed); + self.steeringWheelAngle = @(steeringWheelAngle); + self.tirePressure = @(tirePressure); + self.wiperStatus = @(wiperStatus); + + return self; +} + - (void)setGps:(NSNumber *)gps { if (gps != nil) { [parameters setObject:gps forKey:NAMES_gps]; diff --git a/SmartDeviceLink/SDLSyncMsgVersion.h b/SmartDeviceLink/SDLSyncMsgVersion.h index 98b573eec..8e4e16eae 100644 --- a/SmartDeviceLink/SDLSyncMsgVersion.h +++ b/SmartDeviceLink/SDLSyncMsgVersion.h @@ -23,6 +23,8 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithMajorVersion:(NSInteger)majorVersion minorVersion:(NSInteger)minorVersion; + /** * @abstract The major version indicates versions that is not-compatible to previous versions * diff --git a/SmartDeviceLink/SDLSyncMsgVersion.m b/SmartDeviceLink/SDLSyncMsgVersion.m index 2d516539e..4de144bd4 100644 --- a/SmartDeviceLink/SDLSyncMsgVersion.m +++ b/SmartDeviceLink/SDLSyncMsgVersion.m @@ -20,6 +20,18 @@ return self; } +- (instancetype)initWithMajorVersion:(NSInteger)majorVersion minorVersion:(NSInteger)minorVersion { + self = [self init]; + if (!self) { + return nil; + } + + self.majorVersion = @(majorVersion); + self.minorVersion = @(minorVersion); + + return self; +} + - (void)setMajorVersion:(NSNumber *)majorVersion { if (majorVersion != nil) { [store setObject:majorVersion forKey:NAMES_majorVersion]; diff --git a/SmartDeviceLink/SDLSystemRequest.h b/SmartDeviceLink/SDLSystemRequest.h index 479b5d18e..4492760ca 100644 --- a/SmartDeviceLink/SDLSystemRequest.h +++ b/SmartDeviceLink/SDLSystemRequest.h @@ -17,6 +17,8 @@ - (instancetype)init; - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithType:(SDLRequestType *)requestType fileName:(NSString *)fileName; + @property (strong) SDLRequestType *requestType; @property (strong) NSString *fileName; diff --git a/SmartDeviceLink/SDLSystemRequest.m b/SmartDeviceLink/SDLSystemRequest.m index 836b44447..5deaff059 100644 --- a/SmartDeviceLink/SDLSystemRequest.m +++ b/SmartDeviceLink/SDLSystemRequest.m @@ -22,6 +22,18 @@ return self; } +- (instancetype)initWithType:(SDLRequestType *)requestType fileName:(NSString *)fileName { + self = [self init]; + if (!self) { + return nil; + } + + self.requestType = requestType; + self.fileName = fileName; + + return self; +} + - (void)setRequestType:(SDLRequestType *)requestType { if (requestType != nil) { [parameters setObject:requestType forKey:NAMES_requestType]; diff --git a/SmartDeviceLink/SDLTTSChunk.h b/SmartDeviceLink/SDLTTSChunk.h index a304c3d99..60ebc6f24 100644 --- a/SmartDeviceLink/SDLTTSChunk.h +++ b/SmartDeviceLink/SDLTTSChunk.h @@ -52,6 +52,8 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithText:(NSString*)text type:(SDLSpeechCapabilities*)type; + /** * @abstract Text to be spoken, or a phoneme specification, or the name of a pre-recorded sound. The contents of this field are indicated by the "type" field. * diff --git a/SmartDeviceLink/SDLTTSChunk.m b/SmartDeviceLink/SDLTTSChunk.m index 7e45413eb..7884751a6 100644 --- a/SmartDeviceLink/SDLTTSChunk.m +++ b/SmartDeviceLink/SDLTTSChunk.m @@ -21,6 +21,18 @@ return self; } +- (instancetype)initWithText:(NSString*)text type:(SDLSpeechCapabilities*)type { + self = [self init]; + if (!self) { + return nil; + } + + self.text = text; + self.type = type; + + return self; +} + - (void)setText:(NSString *)text { if (text != nil) { [store setObject:text forKey:NAMES_text]; diff --git a/SmartDeviceLink/SDLTTSChunkFactory.m b/SmartDeviceLink/SDLTTSChunkFactory.m index c27983d3a..ec5b37ec9 100644 --- a/SmartDeviceLink/SDLTTSChunkFactory.m +++ b/SmartDeviceLink/SDLTTSChunkFactory.m @@ -10,9 +10,7 @@ @implementation SDLTTSChunkFactory + (SDLTTSChunk *)buildTTSChunkForString:(NSString *)text type:(SDLSpeechCapabilities *)type { - SDLTTSChunk *ret = [[SDLTTSChunk alloc] init]; - ret.text = text; - ret.type = type; + SDLTTSChunk *ret = [[SDLTTSChunk alloc] initWithText:text type:type]; return ret; } diff --git a/SmartDeviceLink/SDLTurn.h b/SmartDeviceLink/SDLTurn.h index ef2cf9ebe..5c9b155a5 100644 --- a/SmartDeviceLink/SDLTurn.h +++ b/SmartDeviceLink/SDLTurn.h @@ -12,6 +12,8 @@ - (instancetype)init; - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithNavigationText:(NSString*)navigationText turnIcon:(SDLImage*)icon; + @property (strong) NSString *navigationText; @property (strong) SDLImage *turnIcon; diff --git a/SmartDeviceLink/SDLTurn.m b/SmartDeviceLink/SDLTurn.m index 875fa2e73..2e753c8be 100644 --- a/SmartDeviceLink/SDLTurn.m +++ b/SmartDeviceLink/SDLTurn.m @@ -21,6 +21,18 @@ return self; } +- (instancetype)initWithNavigationText:(NSString*)navigationText turnIcon:(SDLImage*)icon { + self = [self init]; + if (!self) { + return nil; + } + + self.navigationText = navigationText; + self.turnIcon = icon; + + return self; +} + - (void)setNavigationText:(NSString *)navigationText { if (navigationText != nil) { [store setObject:navigationText forKey:NAMES_navigationText]; diff --git a/SmartDeviceLink/SDLUnsubscribeButton.h b/SmartDeviceLink/SDLUnsubscribeButton.h index bb16f43f5..b2ed32e00 100644 --- a/SmartDeviceLink/SDLUnsubscribeButton.h +++ b/SmartDeviceLink/SDLUnsubscribeButton.h @@ -33,6 +33,8 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithButtonName:(SDLButtonName *)buttonName; + /** * @abstract A name of the button to unsubscribe from * @discussion An Enumeration value, see <i> diff --git a/SmartDeviceLink/SDLUnsubscribeButton.m b/SmartDeviceLink/SDLUnsubscribeButton.m index 9853fa9da..90df09b24 100644 --- a/SmartDeviceLink/SDLUnsubscribeButton.m +++ b/SmartDeviceLink/SDLUnsubscribeButton.m @@ -22,6 +22,17 @@ return self; } +- (instancetype)initWithButtonName:(SDLButtonName *)buttonName { + self = [self init]; + if (!self) { + return nil; + } + + self.buttonName = buttonName; + + return self; +} + - (void)setButtonName:(SDLButtonName *)buttonName { if (buttonName != nil) { [parameters setObject:buttonName forKey:NAMES_buttonName]; diff --git a/SmartDeviceLink/SDLUnsubscribeVehicleData.h b/SmartDeviceLink/SDLUnsubscribeVehicleData.h index 389173256..47cd85322 100644 --- a/SmartDeviceLink/SDLUnsubscribeVehicleData.h +++ b/SmartDeviceLink/SDLUnsubscribeVehicleData.h @@ -31,6 +31,8 @@ */ - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo emergencyEvent:(BOOL)emergencyEvent engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState gps:(BOOL)gps headLampStatus:(BOOL)headLampStatus instantFuelConsumption:(BOOL)instantFuelConsumption myKey:(BOOL)myKey odometer:(BOOL)odometer prndl:(BOOL)prndl rpm:(BOOL)rpm speed:(BOOL)speed steeringWheelAngle:(BOOL)steeringWheelAngle tirePressure:(BOOL)tirePressure wiperStatus:(BOOL)wiperStatus; + /** * @abstract A boolean value. If true, unsubscribes Gps data */ diff --git a/SmartDeviceLink/SDLUnsubscribeVehicleData.m b/SmartDeviceLink/SDLUnsubscribeVehicleData.m index 11aa044e1..5771808fb 100644 --- a/SmartDeviceLink/SDLUnsubscribeVehicleData.m +++ b/SmartDeviceLink/SDLUnsubscribeVehicleData.m @@ -20,6 +20,40 @@ return self; } +- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo emergencyEvent:(BOOL)emergencyEvent engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState gps:(BOOL)gps headLampStatus:(BOOL)headLampStatus instantFuelConsumption:(BOOL)instantFuelConsumption myKey:(BOOL)myKey odometer:(BOOL)odometer prndl:(BOOL)prndl rpm:(BOOL)rpm speed:(BOOL)speed steeringWheelAngle:(BOOL)steeringWheelAngle tirePressure:(BOOL)tirePressure wiperStatus:(BOOL)wiperStatus { + self = [self init]; + if (!self) { + return nil; + } + + self.accPedalPosition = @(accelerationPedalPosition); + self.airbagStatus = @(airbagStatus); + self.beltStatus = @(beltStatus); + self.bodyInformation = @(bodyInformation); + self.clusterModeStatus = @(clusterModeStatus); + self.deviceStatus = @(deviceStatus); + self.driverBraking = @(driverBraking); + self.eCallInfo = @(eCallInfo); + self.emergencyEvent = @(emergencyEvent); + self.engineTorque = @(engineTorque); + self.externalTemperature = @(externalTemperature); + self.fuelLevel = @(fuelLevel); + self.fuelLevel_State = @(fuelLevelState); + self.myKey = @(myKey); + self.odometer = @(odometer); + self.gps = @(gps); + self.headLampStatus = @(headLampStatus); + self.instantFuelConsumption = @(instantFuelConsumption); + self.prndl = @(prndl); + self.rpm = @(rpm); + self.speed = @(speed); + self.steeringWheelAngle = @(steeringWheelAngle); + self.tirePressure = @(tirePressure); + self.wiperStatus = @(wiperStatus); + + return self; +} + - (void)setGps:(NSNumber *)gps { if (gps != nil) { [parameters setObject:gps forKey:NAMES_gps]; diff --git a/SmartDeviceLink/SDLUpdateTurnList.h b/SmartDeviceLink/SDLUpdateTurnList.h index d5d9daf6a..17f507ffa 100644 --- a/SmartDeviceLink/SDLUpdateTurnList.h +++ b/SmartDeviceLink/SDLUpdateTurnList.h @@ -4,6 +4,9 @@ #import "SDLRPCRequest.h" +@class SDLSoftButton; +@class SDLTurn; + /** Updates the list of next maneuvers, which can be requested by the user pressing the softbutton<br> * “Turns” on the Navigation base screen. Three softbuttons are predefined by the system: Up, Down, Close. *<p> @@ -15,6 +18,8 @@ - (instancetype)init; - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithTurnList:(NSArray<SDLTurn *> *)turnList softButtons:(NSArray<SDLSoftButton *> *)softButtons; + /** * Optional, SDLTurn, 1 - 100 entries */ diff --git a/SmartDeviceLink/SDLUpdateTurnList.m b/SmartDeviceLink/SDLUpdateTurnList.m index 7063c9c29..65cb06fb0 100644 --- a/SmartDeviceLink/SDLUpdateTurnList.m +++ b/SmartDeviceLink/SDLUpdateTurnList.m @@ -22,6 +22,18 @@ return self; } +- (instancetype)initWithTurnList:(NSArray *)turnList softButtons:(NSArray<SDLSoftButton *> *)softButtons { + self = [self init]; + if (!self) { + return nil; + } + + self.turnList = [turnList mutableCopy]; + self.softButtons = [softButtons mutableCopy]; + + return self; +} + - (void)setTurnList:(NSMutableArray *)turnList { if (turnList != nil) { [parameters setObject:turnList forKey:NAMES_turnList]; diff --git a/SmartDeviceLink/SDLUploadFileOperation.m b/SmartDeviceLink/SDLUploadFileOperation.m index a3c5c26da..a88b9a0c2 100644 --- a/SmartDeviceLink/SDLUploadFileOperation.m +++ b/SmartDeviceLink/SDLUploadFileOperation.m @@ -14,7 +14,6 @@ #import "SDLGlobals.h" #import "SDLPutFile.h" #import "SDLPutFileResponse.h" -#import "SDLRPCRequestFactory.h" #import "SDLRPCResponse.h" @@ -130,7 +129,7 @@ NS_ASSUME_NONNULL_BEGIN // http://stackoverflow.com/a/503201 Make sure we get the exact number of packets we need for (int i = 0; i < (((fileData.length - 1) / mtuSize) + 1); i++) { - SDLPutFile *putFile = [SDLRPCRequestFactory buildPutFileWithFileName:file.name fileType:file.fileType persistentFile:@(file.isPersistent) correlationId:nil]; + SDLPutFile *putFile = [[SDLPutFile alloc] initWithFileName:file.name fileType:file.fileType persistentFile:file.isPersistent]; putFile.offset = @(currentOffset); // Set the length putfile based on the offset diff --git a/SmartDeviceLink/SDLVrHelpItem.h b/SmartDeviceLink/SDLVrHelpItem.h index a46c1301b..21c23b003 100644 --- a/SmartDeviceLink/SDLVrHelpItem.h +++ b/SmartDeviceLink/SDLVrHelpItem.h @@ -12,6 +12,10 @@ - (instancetype)init; - (instancetype)initWithDictionary:(NSMutableDictionary *)dict; +- (instancetype)initWithText:(NSString*)text image:(SDLImage*)image; + +- (instancetype)initWithText:(NSString*)text image:(SDLImage*)image position:(UInt8)position; + @property (strong) NSString *text; @property (strong) SDLImage *image; @property (strong) NSNumber *position; diff --git a/SmartDeviceLink/SDLVrHelpItem.m b/SmartDeviceLink/SDLVrHelpItem.m index 4ed2c1409..5e9177b04 100644 --- a/SmartDeviceLink/SDLVrHelpItem.m +++ b/SmartDeviceLink/SDLVrHelpItem.m @@ -21,6 +21,29 @@ return self; } +- (instancetype)initWithText:(NSString*)text image:(SDLImage*)image position:(UInt8)position { + self = [self initWithText:text image:image]; + if (!self) { + return nil; + } + + self.position = @(position); + + return self; +} + +- (instancetype)initWithText:(NSString*)text image:(SDLImage*)image { + self = [self init]; + if (!self) { + return nil; + } + + self.text = text; + self.image = image; + + return self; +} + - (void)setText:(NSString *)text { if (text != nil) { [store setObject:text forKey:NAMES_text]; diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m index 2422223b5..55a7fcde1 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m @@ -21,7 +21,6 @@ #import "SDLProxyFactory.h" #import "SDLRegisterAppInterface.h" #import "SDLRegisterAppInterfaceResponse.h" -#import "SDLRPCRequestFactory.h" #import "SDLShow.h" #import "SDLStateMachine.h" #import "SDLTextAlignment.h" @@ -40,7 +39,7 @@ QuickConfigurationBegin(SendingRPCsConfiguration) it(@"cannot publicly send RPCs", ^{ __block NSError *testError = nil; SDLLifecycleManager *testManager = exampleContext()[@"manager"]; - SDLShow *testShow = [SDLRPCRequestFactory buildShowWithMainField1:@"test" mainField2:nil alignment:nil correlationID:@1]; + SDLShow *testShow = [[SDLShow alloc] initWithMainField1:@"test" mainField2:nil alignment:nil]; [testManager sendRequest:testShow withResponseHandler:^(__kindof SDLRPCRequest * _Nullable request, __kindof SDLRPCResponse * _Nullable response, NSError * _Nullable error) { testError = error; @@ -260,7 +259,7 @@ describe(@"a lifecycle manager", ^{ }); it(@"can send an RPC", ^{ - SDLShow *testShow = [SDLRPCRequestFactory buildShowWithMainField1:@"test" mainField2:nil alignment:nil correlationID:@1]; + SDLShow *testShow = [[SDLShow alloc] initWithMainField1:@"test" mainField2:nil alignment:nil]; [testManager sendRequest:testShow]; OCMVerify([proxyMock sendRPC:[OCMArg isKindOfClass:[SDLShow class]]]); diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLPermissionFilterSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLPermissionFilterSpec.m index a60d6fd3b..ede06caf6 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLPermissionFilterSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLPermissionFilterSpec.m @@ -1,7 +1,6 @@ #import <Quick/Quick.h> #import <Nimble/Nimble.h> -#import "NSNumber+NumberType.h" #import "SDLPermissionConstants.h" #import "SDLPermissionFilter.h" diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLResponseDispatcherSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLResponseDispatcherSpec.m index dd6330093..47059877d 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLResponseDispatcherSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLResponseDispatcherSpec.m @@ -13,7 +13,6 @@ #import "SDLReadDID.h" #import "SDLReadDIDResponse.h" #import "SDLResponseDispatcher.h" -#import "SDLRPCRequestFactory.h" #import "SDLScrollableMessage.h" #import "SDLShow.h" #import "SDLSoftButton.h" @@ -116,17 +115,19 @@ describe(@"a response dispatcher", ^{ __block NSUInteger numTimesHandlerCalled = 0; beforeEach(^{ - testShow = [SDLRPCRequestFactory buildShowWithMainField1:@"Test Show" mainField2:nil alignment:[SDLTextAlignment CENTERED] correlationID:@1]; + testShow = [[SDLShow alloc] initWithMainField1:@"Test Show" mainField2:nil alignment:[SDLTextAlignment CENTERED]]; + testShow.correlationID = @1; }); context(@"with a correct soft button and handler", ^{ beforeEach(^{ numTimesHandlerCalled = 0; - testSoftButton1 = [SDLRPCRequestFactory buildSoftButtonWithType:[SDLSoftButtonType TEXT] text:@"test" image:nil highlighted:NO buttonID:1 systemAction:[SDLSystemAction DEFAULT_ACTION] handler:^(__kindof SDLRPCNotification * _Nonnull notification) { + testSoftButton1 = [[SDLSoftButton alloc] initWithType:[SDLSoftButtonType TEXT] text:@"test" image:nil highlighted:NO buttonId:1 systemAction:[SDLSystemAction DEFAULT_ACTION] handler:^(__kindof SDLRPCNotification * _Nonnull notification) { numTimesHandlerCalled++; }]; testShow.softButtons = [@[testSoftButton1] mutableCopy]; + testShow.correlationID = @1; [testDispatcher storeRequest:testShow handler:nil]; }); @@ -179,7 +180,7 @@ describe(@"a response dispatcher", ^{ context(@"with a correct soft button but no handler", ^{ beforeEach(^{ - testSoftButton1 = [SDLRPCRequestFactory buildSoftButtonWithType:[SDLSoftButtonType TEXT] text:@"test" image:nil highlighted:NO buttonID:1 systemAction:[SDLSystemAction DEFAULT_ACTION] handler:nil]; + testSoftButton1 = [[SDLSoftButton alloc] initWithType:[SDLSoftButtonType TEXT] text:@"test" image:nil highlighted:NO buttonId:1 systemAction:[SDLSystemAction DEFAULT_ACTION] handler:nil]; }); it(@"should not add the soft button", ^{ @@ -189,7 +190,7 @@ describe(@"a response dispatcher", ^{ context(@"with a malformed soft button", ^{ beforeEach(^{ - testSoftButton1 = [SDLRPCRequestFactory buildSoftButtonWithType:[SDLSoftButtonType TEXT] text:@"test" image:nil highlighted:NO buttonID:1 systemAction:[SDLSystemAction DEFAULT_ACTION] handler:^(__kindof SDLRPCNotification * _Nonnull notification) {}]; + testSoftButton1 = [[SDLSoftButton alloc] initWithType:[SDLSoftButtonType TEXT] text:@"test" image:nil highlighted:NO buttonId:1 systemAction:[SDLSystemAction DEFAULT_ACTION] handler:^(__kindof SDLRPCNotification * _Nonnull notification) {}]; }); it(@"should throw an exception if there's no button id", ^{ @@ -211,7 +212,7 @@ describe(@"a response dispatcher", ^{ context(@"storing a command request", ^{ __block SDLAddCommand *testAddCommand = nil; - __block NSNumber *testCommandId = nil; + __block UInt32 testCommandId = 0; __block NSUInteger numTimesHandlerCalled = 0; __block NSNumber *testAddCommandCorrelationId = nil; @@ -219,11 +220,11 @@ describe(@"a response dispatcher", ^{ context(@"with a handler", ^{ beforeEach(^{ - testCommandId = @1; + testCommandId = 1; testAddCommandCorrelationId = @42; numTimesHandlerCalled = 0; - testAddCommand = [SDLRPCRequestFactory buildAddCommandWithID:testCommandId vrCommands:nil handler:^(__kindof SDLRPCNotification * _Nonnull notification) { + testAddCommand = [[SDLAddCommand alloc] initWithId:testCommandId vrCommands:nil handler:^(__kindof SDLRPCNotification * _Nonnull notification) { numTimesHandlerCalled++; }]; testAddCommand.correlationID = testAddCommandCorrelationId; @@ -252,7 +253,7 @@ describe(@"a response dispatcher", ^{ context(@"that correspond to the created button", ^{ beforeEach(^{ testOnCommand = [[SDLOnCommand alloc] init]; - testOnCommand.cmdID = testCommandId; + testOnCommand.cmdID = @(testCommandId); [[NSNotificationCenter defaultCenter] postNotificationName:SDLDidReceiveCommandNotification object:nil userInfo:@{ SDLNotificationUserInfoObject: testOnCommand }]; }); @@ -288,7 +289,7 @@ describe(@"a response dispatcher", ^{ testDeleteCommand = [[SDLDeleteCommand alloc] init]; testDeleteCommand.correlationID = testDeleteCommandCorrelationId; - testDeleteCommand.cmdID = testCommandId; + testDeleteCommand.cmdID = @(testCommandId); [testDispatcher storeRequest:testDeleteCommand handler:nil]; @@ -310,7 +311,7 @@ describe(@"a response dispatcher", ^{ context(@"without a handler", ^{ beforeEach(^{ - testAddCommand = [SDLRPCRequestFactory buildAddCommandWithID:@1 vrCommands:nil handler:nil]; + testAddCommand = [[SDLAddCommand alloc] initWithId:1 vrCommands:nil handler:nil]; }); it(@"should not add the command", ^{ @@ -333,7 +334,7 @@ describe(@"a response dispatcher", ^{ testSubscribeCorrelationId = @42; numTimesHandlerCalled = 0; - testSubscribeButton = [SDLRPCRequestFactory buildSubscribeButtonWithName:testButtonName handler:^(__kindof SDLRPCNotification * _Nonnull notification) { + testSubscribeButton = [[SDLSubscribeButton alloc] initWithButtonName:testButtonName handler:^(__kindof SDLRPCNotification * _Nonnull notification) { numTimesHandlerCalled++; }]; testSubscribeButton.correlationID = testSubscribeCorrelationId; @@ -429,7 +430,7 @@ describe(@"a response dispatcher", ^{ context(@"without a handler", ^{ beforeEach(^{ - testSubscribeButton = [SDLRPCRequestFactory buildSubscribeButtonWithName:[SDLButtonName OK] handler:nil]; + testSubscribeButton = [[SDLSubscribeButton alloc] initWithButtonName:[SDLButtonName OK] handler:nil]; }); it(@"should not add the subscription", ^{ @@ -443,7 +444,8 @@ describe(@"a response dispatcher", ^{ __block SDLSoftButton *testSoftButton1 = nil; beforeEach(^{ - testAlert = [SDLRPCRequestFactory buildAlertWithAlertText1:@"test 1" alertText2:@"test 1" alertText3:nil duration:@1 softButtons:nil correlationID:@1]; + testAlert = [[SDLAlert alloc] initWithAlertText1:@"test 1" alertText2:@"test 1" alertText3:nil duration:1 softButtons:nil]; + testAlert.correlationID = @1; }); context(@"with a correct soft button and handler", ^{ @@ -452,7 +454,7 @@ describe(@"a response dispatcher", ^{ beforeEach(^{ numTimesHandlerCalled = 0; - testSoftButton1 = [SDLRPCRequestFactory buildSoftButtonWithType:[SDLSoftButtonType TEXT] text:@"test" image:nil highlighted:NO buttonID:1 systemAction:[SDLSystemAction DEFAULT_ACTION] handler:^(__kindof SDLRPCNotification * _Nonnull notification) { + testSoftButton1 = [[SDLSoftButton alloc] initWithType:[SDLSoftButtonType TEXT] text:@"test" image:nil highlighted:NO buttonId:1 systemAction:[SDLSystemAction DEFAULT_ACTION] handler:^(__kindof SDLRPCNotification * _Nonnull notification) { numTimesHandlerCalled++; }]; @@ -509,7 +511,7 @@ describe(@"a response dispatcher", ^{ context(@"with a correct soft button but no handler", ^{ beforeEach(^{ - testSoftButton1 = [SDLRPCRequestFactory buildSoftButtonWithType:[SDLSoftButtonType TEXT] text:@"test" image:nil highlighted:NO buttonID:1 systemAction:[SDLSystemAction DEFAULT_ACTION] handler:nil]; + testSoftButton1 = [[SDLSoftButton alloc] initWithType:[SDLSoftButtonType TEXT] text:@"test" image:nil highlighted:NO buttonId:1 systemAction:[SDLSystemAction DEFAULT_ACTION] handler:nil]; }); it(@"should not add the soft button", ^{ @@ -519,7 +521,7 @@ describe(@"a response dispatcher", ^{ context(@"with a malformed soft button", ^{ beforeEach(^{ - testSoftButton1 = [SDLRPCRequestFactory buildSoftButtonWithType:[SDLSoftButtonType TEXT] text:@"test" image:nil highlighted:NO buttonID:1 systemAction:[SDLSystemAction DEFAULT_ACTION] handler:^(__kindof SDLRPCNotification * _Nonnull notification) {}]; + testSoftButton1 = [[SDLSoftButton alloc] initWithType:[SDLSoftButtonType TEXT] text:@"test" image:nil highlighted:NO buttonId:1 systemAction:[SDLSystemAction DEFAULT_ACTION] handler:^(__kindof SDLRPCNotification * _Nonnull notification) {}]; }); it(@"should throw an exception if there's no button id", ^{ @@ -544,7 +546,8 @@ describe(@"a response dispatcher", ^{ __block SDLSoftButton *testSoftButton1 = nil; beforeEach(^{ - testScrollableMessage = [SDLRPCRequestFactory buildScrollableMessage:@"test" timeout:@1 softButtons:nil correlationID:@1]; + testScrollableMessage = [[SDLScrollableMessage alloc] initWithMessage:@"test" timeout:1 softButtons:nil]; + testScrollableMessage.correlationID = @1; }); context(@"with a correct soft button and handler", ^{ @@ -553,7 +556,7 @@ describe(@"a response dispatcher", ^{ beforeEach(^{ numTimesHandlerCalled = 0; - testSoftButton1 = [SDLRPCRequestFactory buildSoftButtonWithType:[SDLSoftButtonType TEXT] text:@"test" image:nil highlighted:NO buttonID:1 systemAction:[SDLSystemAction DEFAULT_ACTION] handler:^(__kindof SDLRPCNotification * _Nonnull notification) { + testSoftButton1 = [[SDLSoftButton alloc] initWithType:[SDLSoftButtonType TEXT] text:@"test" image:nil highlighted:NO buttonId:1 systemAction:[SDLSystemAction DEFAULT_ACTION] handler:^(__kindof SDLRPCNotification * _Nonnull notification) { numTimesHandlerCalled++; }]; @@ -610,7 +613,7 @@ describe(@"a response dispatcher", ^{ context(@"with a correct soft button but no handler", ^{ beforeEach(^{ - testSoftButton1 = [SDLRPCRequestFactory buildSoftButtonWithType:[SDLSoftButtonType TEXT] text:@"test" image:nil highlighted:NO buttonID:1 systemAction:[SDLSystemAction DEFAULT_ACTION] handler:nil]; + testSoftButton1 = [[SDLSoftButton alloc] initWithType:[SDLSoftButtonType TEXT] text:@"test" image:nil highlighted:NO buttonId:1 systemAction:[SDLSystemAction DEFAULT_ACTION] handler:nil]; }); it(@"should not add the soft button", ^{ @@ -620,7 +623,7 @@ describe(@"a response dispatcher", ^{ context(@"with a malformed soft button", ^{ beforeEach(^{ - testSoftButton1 = [SDLRPCRequestFactory buildSoftButtonWithType:[SDLSoftButtonType TEXT] text:@"test" image:nil highlighted:NO buttonID:1 systemAction:[SDLSystemAction DEFAULT_ACTION] handler:^(__kindof SDLRPCNotification * _Nonnull notification) {}]; + testSoftButton1 = [[SDLSoftButton alloc] initWithType:[SDLSoftButtonType TEXT] text:@"test" image:nil highlighted:NO buttonId:1 systemAction:[SDLSystemAction DEFAULT_ACTION] handler:^(__kindof SDLRPCNotification * _Nonnull notification) {}]; }); it(@"should throw an exception if there's no button id", ^{ diff --git a/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m index 10efc2554..52dd249bf 100644 --- a/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m +++ b/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m @@ -307,7 +307,7 @@ describe(@"HandleBytesFromTransport Tests", ^ { // expect(@(messageReceived.header.serviceType)).to(equal(@(SDLServiceType_RPC))); // expect(@(messageReceived.header.frameData)).to(equal(@(SDLFrameData_SingleFrame))); // expect(@(messageReceived.header.bytesInPayload)).to(equal(@(payloadData.length))); -// expect(@(((SDLV2ProtocolHeader*)messageReceived.header).messageID)).to(equal(@1)); +// expect(@(((SDLV2ProtocolHeader *)messageReceived.header).messageID)).to(equal(@1)); // // }] handleReceivedMessage:[OCMArg any]]; // testProtocol.transport = routerMock; diff --git a/SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolReceivedMessageRouterSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolReceivedMessageRouterSpec.m index 6b13e5dad..f88f0a192 100644 --- a/SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolReceivedMessageRouterSpec.m +++ b/SmartDeviceLinkTests/ProtocolSpecs/SDLProtocolReceivedMessageRouterSpec.m @@ -67,7 +67,7 @@ describe(@"HandleReceivedMessage Tests", ^ { [invocation getArgument:&message atIndex:2]; - SDLV2ProtocolMessage* messageReceived = (SDLV2ProtocolMessage*)message; + SDLV2ProtocolMessage* messageReceived = (SDLV2ProtocolMessage *)message; expect(messageReceived).to(beIdenticalTo(testMessage)); }] ignoringNonObjectArgs] onProtocolMessageReceived:[OCMArg any]]; diff --git a/SmartDeviceLinkTests/RPCSpecs/FactorySpecs/SDLRPCRequestFactorySpec.m b/SmartDeviceLinkTests/RPCSpecs/FactorySpecs/SDLRPCRequestFactorySpec.m index d02cfbd2c..1f2ad1a70 100644 --- a/SmartDeviceLinkTests/RPCSpecs/FactorySpecs/SDLRPCRequestFactorySpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/FactorySpecs/SDLRPCRequestFactorySpec.m @@ -11,6 +11,8 @@ #import "SmartDeviceLink.h" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" QuickSpecBegin(SDLRPCRequestFactorySpec) @@ -1017,4 +1019,4 @@ describe(@"SDLUpdateTurnList Tests", ^ { QuickSpecEnd - +#pragma clang diagnostic pop diff --git a/SmartDeviceLinkTests/UtilitiesSpecs/Touches/SDLTouchManagerSpec.m b/SmartDeviceLinkTests/UtilitiesSpecs/Touches/SDLTouchManagerSpec.m index 9ce6e50e8..50303e2a0 100644 --- a/SmartDeviceLinkTests/UtilitiesSpecs/Touches/SDLTouchManagerSpec.m +++ b/SmartDeviceLinkTests/UtilitiesSpecs/Touches/SDLTouchManagerSpec.m @@ -63,7 +63,7 @@ describe(@"SDLTouchManager Tests", ^{ __block void (^performTouchEvent)(SDLTouchManager* touchManager, SDLOnTouchEvent* onTouchEvent) = ^(SDLTouchManager* touchManager, SDLOnTouchEvent* onTouchEvent) { SEL onOnTouchEvent = NSSelectorFromString(@"onOnTouchEvent:"); - ((void (*)(id, SEL, id))[touchManager methodForSelector:onOnTouchEvent])(touchManager, onOnTouchEvent, onTouchEvent); + ((void ( *)(id, SEL, id))[touchManager methodForSelector:onOnTouchEvent])(touchManager, onOnTouchEvent, onTouchEvent); }; beforeEach(^{ diff --git a/SmartDeviceLink_Example/Classes/ProxyManager.m b/SmartDeviceLink_Example/Classes/ProxyManager.m index f73ef6ea0..38aa4ce7b 100644 --- a/SmartDeviceLink_Example/Classes/ProxyManager.m +++ b/SmartDeviceLink_Example/Classes/ProxyManager.m @@ -115,7 +115,7 @@ NS_ASSUME_NONNULL_BEGIN self.initialShowState = SDLHMIInitialShowStateShown; - SDLShow *show = [SDLRPCRequestFactory buildShowWithMainField1:@"SDL" mainField2:@"Test App" alignment:[SDLTextAlignment CENTERED] correlationID:@0]; + SDLShow* show = [[SDLShow alloc] initWithMainField1:@"SDL" mainField2:@"Test App" alignment:[SDLTextAlignment CENTERED]]; SDLSoftButton *pointingSoftButton = [self.class pointingSoftButtonWithManager:self.sdlManager]; show.softButtons = [@[pointingSoftButton] mutableCopy]; show.graphic = [self.class mainGraphicImage]; @@ -129,8 +129,7 @@ NS_ASSUME_NONNULL_BEGIN config.shortAppName = @"SDL Example"; config.appIcon = appIconArt; config.voiceRecognitionCommandNames = @[@"S D L Example"]; - config.ttsName = @[[SDLTTSChunkFactory buildTTSChunkForString:config.shortAppName type:[SDLSpeechCapabilities TEXT]]]; - + config.ttsName = @[[[SDLTTSChunk alloc] initWithText:config.shortAppName type:[SDLSpeechCapabilities TEXT]]]; return config; } @@ -184,21 +183,20 @@ NS_ASSUME_NONNULL_BEGIN + (SDLSpeak *)appNameSpeak { SDLSpeak *speak = [[SDLSpeak alloc] init]; - speak.ttsChunks = [NSMutableArray arrayWithObject:[SDLTTSChunkFactory buildTTSChunkForString:@"S D L Example App" type:[SDLSpeechCapabilities TEXT]]]; - + speak.ttsChunks = [NSMutableArray arrayWithObject:[[SDLTTSChunk alloc] initWithText:@"S D L Example App" type:[SDLSpeechCapabilities TEXT]]]; return speak; } + (SDLSpeak *)goodJobSpeak { SDLSpeak *speak = [[SDLSpeak alloc] init]; - speak.ttsChunks = [NSMutableArray arrayWithObject:[SDLTTSChunkFactory buildTTSChunkForString:@"Good job" type:[SDLSpeechCapabilities TEXT]]]; + speak.ttsChunks = [NSMutableArray arrayWithObject:[[SDLTTSChunk alloc] initWithText:@"Good Job" type:[SDLSpeechCapabilities TEXT]]]; return speak; } + (SDLSpeak *)youMissedItSpeak { SDLSpeak *speak = [[SDLSpeak alloc] init]; - speak.ttsChunks = [NSMutableArray arrayWithObject:[SDLTTSChunkFactory buildTTSChunkForString:@"You missed it" type:[SDLSpeechCapabilities TEXT]]]; + speak.ttsChunks = [NSMutableArray arrayWithObject:[[SDLTTSChunk alloc] initWithText:@"You missed it" type:[SDLSpeechCapabilities TEXT]]]; return speak; } @@ -221,11 +219,11 @@ NS_ASSUME_NONNULL_BEGIN + (void)sendPerformOnlyChoiceInteractionWithManager:(SDLManager *)manager { SDLPerformInteraction *performOnlyChoiceInteraction = [[SDLPerformInteraction alloc] init]; performOnlyChoiceInteraction.initialText = @"Choose the only one! You have 5 seconds..."; - performOnlyChoiceInteraction.initialPrompt = [NSMutableArray arrayWithObject:[SDLTTSChunkFactory buildTTSChunkForString:@"Choose it" type:[SDLSpeechCapabilities TEXT]]]; + performOnlyChoiceInteraction.initialPrompt = [NSMutableArray arrayWithObject:[[SDLTTSChunk alloc] initWithText:@"Choose it" type:[SDLSpeechCapabilities TEXT]]]; performOnlyChoiceInteraction.interactionMode = [SDLInteractionMode BOTH]; performOnlyChoiceInteraction.interactionChoiceSetIDList = [NSMutableArray arrayWithObject:@0]; - performOnlyChoiceInteraction.helpPrompt = [NSMutableArray arrayWithObject:[SDLTTSChunkFactory buildTTSChunkForString:@"Do it" type:[SDLSpeechCapabilities TEXT]]]; - performOnlyChoiceInteraction.timeoutPrompt = [NSMutableArray arrayWithObject:[SDLTTSChunkFactory buildTTSChunkForString:@"Too late" type:[SDLSpeechCapabilities TEXT]]]; + performOnlyChoiceInteraction.helpPrompt = [NSMutableArray arrayWithObject:[[SDLTTSChunk alloc] initWithText:@"Do it" type:[SDLSpeechCapabilities TEXT]]]; + performOnlyChoiceInteraction.timeoutPrompt = [NSMutableArray arrayWithObject:[[SDLTTSChunk alloc] initWithText:@"Too late" type:[SDLSpeechCapabilities TEXT]]]; performOnlyChoiceInteraction.timeout = @5000; performOnlyChoiceInteraction.interactionLayout = [SDLLayoutMode LIST_ONLY]; @@ -273,7 +271,7 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - Files / Artwork -+ (SDLArtwork*)pointingSoftButtonArtwork { ++ (SDLArtwork *)pointingSoftButtonArtwork { return [SDLArtwork artworkWithImage:[UIImage imageNamed:@"sdl_softbutton_icon"] name:PointingSoftButtonArtworkName asImageFormat:SDLArtworkImageFormatPNG]; } |