diff --git a/SmartDeviceLink/SDLAbstractProtocol.h b/SmartDeviceLink/SDLAbstractProtocol.h index 9c15260fe..e629e302a 100644 --- a/SmartDeviceLink/SDLAbstractProtocol.h +++ b/SmartDeviceLink/SDLAbstractProtocol.h @@ -20,26 +20,16 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, copy) NSString *appId; // Sending -- (void)sendStartSessionWithType:(SDLServiceType)serviceType __deprecated_msg(("Use startServiceWithType:payload: instead")); -- (void)startServiceWithType:(SDLServiceType)serviceType __deprecated_msg(("Use startServiceWithType:payload: instead")); - (void)startServiceWithType:(SDLServiceType)serviceType payload:(nullable NSData *)payload; - -- (void)startSecureServiceWithType:(SDLServiceType)serviceType completionHandler:(void (^)(BOOL success, NSError *error))completionHandler __deprecated_msg(("Use startSecureServiceWithType:payload:completionHandler instead"));; - (void)startSecureServiceWithType:(SDLServiceType)serviceType payload:(nullable NSData *)payload completionHandler:(void (^)(BOOL success, NSError *error))completionHandler; - -- (void)sendEndSessionWithType:(SDLServiceType)serviceType __deprecated_msg(("Use endServiceWithType: instead")); - (void)endServiceWithType:(SDLServiceType)serviceType; -- (void)sendRPCRequest:(SDLRPCRequest *)rpcRequest __deprecated_msg(("Use sendRPC: instead")); - (void)sendRPC:(SDLRPCMessage *)message; - (BOOL)sendRPC:(SDLRPCMessage *)message encrypted:(BOOL)encryption error:(NSError **)error; - (void)sendRawData:(NSData *)data withServiceType:(SDLServiceType)serviceType; - (void)sendEncryptedRawData:(NSData *)data onService:(SDLServiceType)serviceType; -- (void)sendRawDataStream:(NSInputStream *)inputStream withServiceType:(SDLServiceType)serviceType __deprecated_msg("This is not implemented and will cause a crash if called"); -- (void)sendHeartbeat __deprecated_msg("This is not implemented and will cause a crash if called"); - // Recieving - (void)handleBytesFromTransport:(NSData *)receivedData; diff --git a/SmartDeviceLink/SDLAbstractProtocol.m b/SmartDeviceLink/SDLAbstractProtocol.m index c38b00902..fa3502799 100644 --- a/SmartDeviceLink/SDLAbstractProtocol.m +++ b/SmartDeviceLink/SDLAbstractProtocol.m @@ -17,30 +17,14 @@ - (instancetype)init { } // Implement in subclasses. -- (void)sendStartSessionWithType:(SDLServiceType)serviceType { - [self doesNotRecognizeSelector:_cmd]; -} - -- (void)startServiceWithType:(SDLServiceType)serviceType { - [self doesNotRecognizeSelector:_cmd]; -} - - (void)startServiceWithType:(SDLServiceType)serviceType payload:(nullable NSData *)payload { [self doesNotRecognizeSelector:_cmd]; } -- (void)startSecureServiceWithType:(SDLServiceType)serviceType completionHandler:(void (^)(BOOL, NSError *))completionHandler { - [self doesNotRecognizeSelector:_cmd]; -} - - (void)startSecureServiceWithType:(SDLServiceType)serviceType payload:(nullable NSData *)payload completionHandler:(void (^)(BOOL, NSError *))completionHandler { [self doesNotRecognizeSelector:_cmd]; } -- (void)sendEndSessionWithType:(SDLServiceType)serviceType { - [self doesNotRecognizeSelector:_cmd]; -} - - (void)endServiceWithType:(SDLServiceType)serviceType { [self doesNotRecognizeSelector:_cmd]; } @@ -54,14 +38,6 @@ - (BOOL)sendRPC:(SDLRPCMessage *)message encrypted:(BOOL)encryption error:(NSErr return NO; } -- (void)sendRPCRequest:(SDLRPCRequest *)rpcRequest { - [self doesNotRecognizeSelector:_cmd]; -} - -- (void)sendHeartbeat { - [self doesNotRecognizeSelector:_cmd]; -} - - (void)handleBytesFromTransport:(NSData *)receivedData { [self doesNotRecognizeSelector:_cmd]; } @@ -70,10 +46,6 @@ - (void)sendRawData:(NSData *)data withServiceType:(SDLServiceType)serviceType { [self doesNotRecognizeSelector:_cmd]; } -- (void)sendRawDataStream:(NSInputStream *)inputStream withServiceType:(SDLServiceType)serviceType { - [self doesNotRecognizeSelector:_cmd]; -} - - (void)sendEncryptedRawData:(NSData *)data onService:(SDLServiceType)serviceType { [self doesNotRecognizeSelector:_cmd]; } diff --git a/SmartDeviceLink/SDLConfiguration.h b/SmartDeviceLink/SDLConfiguration.h index 52706376b..c5a758b59 100644 --- a/SmartDeviceLink/SDLConfiguration.h +++ b/SmartDeviceLink/SDLConfiguration.h @@ -37,42 +37,6 @@ NS_ASSUME_NONNULL_BEGIN */ @property (copy, nonatomic, readonly) SDLStreamingMediaConfiguration *streamingMediaConfig; -/** - Create a new configuration to be passed into SDLManager with a custom lifecycle, lock screen, and a default logging configuration. - - @param lifecycleConfiguration The lifecycle configuration to be used. - @return The configuration - */ -- (instancetype)initWithLifecycle:(SDLLifecycleConfiguration *)lifecycleConfiguration __deprecated_msg(("Use initWithLifecycle:lockScreen:logging: instead")); - -/** - Create a new configuration to be passed into SDLManager with a custom lifecycle, lock screen, and a default logging configuration. - - @param lifecycleConfiguration The lifecycle configuration to be used. - @return The configuration - */ -+ (instancetype)configurationWithLifecycle:(SDLLifecycleConfiguration *)lifecycleConfiguration __deprecated_msg(("Use configurationWithLifecycle:lockScreen:logging: instead")); - -/** - * Create a new configuration to be passed into SDLManager with a custom lifecycle, lock screen, and a default logging configuration. - * - * @param lifecycleConfig The lifecycle configuration to be used. - * @param lockScreenConfig The lockscreen configuration to be used, or `enabledConfiguration` if nil. - * - * @return The configuration - */ -- (instancetype)initWithLifecycle:(SDLLifecycleConfiguration *)lifecycleConfig lockScreen:(nullable SDLLockScreenConfiguration *)lockScreenConfig __deprecated_msg(("Use initWithLifecycle:lockScreen:logging: instead")); - -/** - * Create a new configuration to be passed into SDLManager with a custom lifecycle, lock screen, and a default logging configuration. - * - * @param lifecycleConfig The lifecycle configuration to be used. - * @param lockScreenConfig The lockscreen configuration to be used, or `enabledConfiguration` if nil. - * - * @return The configuration - */ -+ (instancetype)configurationWithLifecycle:(SDLLifecycleConfiguration *)lifecycleConfig lockScreen:(nullable SDLLockScreenConfiguration *)lockScreenConfig __deprecated_msg(("Use configurationWithLifecycle:lockScreen:logging: instead")); - /** Create a new configuration to be passed into SDLManager with a custom lifecycle, lock screen, and logging configuration. diff --git a/SmartDeviceLink/SDLConfiguration.m b/SmartDeviceLink/SDLConfiguration.m index ebb7477d9..bff1e8aad 100644 --- a/SmartDeviceLink/SDLConfiguration.m +++ b/SmartDeviceLink/SDLConfiguration.m @@ -59,12 +59,15 @@ - (instancetype)initWithLifecycle:(SDLLifecycleConfiguration *)lifecycleConfig l _lifecycleConfig = lifecycleConfig; _lockScreenConfig = lockScreenConfig ?: [SDLLockScreenConfiguration enabledConfiguration]; _loggingConfig = logConfig ?: [SDLLogConfiguration defaultConfiguration]; + _streamingMediaConfig = streamingMediaConfig; if (_streamingMediaConfig != nil) { - NSAssert(!([_lifecycleConfig.appType isEqualToEnum:SDLAppHMITypeNavigation] || [_lifecycleConfig.appType isEqualToEnum:SDLAppHMITypeProjection]), @"You should only set a streaming media configuration if your app is a NAVIGATION or PROJECTION HMI type"); + // If we have a streaming config, the apptype MUST be navigation or projection + NSAssert(([_lifecycleConfig.appType isEqualToEnum:SDLAppHMITypeNavigation] || [_lifecycleConfig.appType isEqualToEnum:SDLAppHMITypeProjection]), @"You should only set a streaming media configuration if your app is a NAVIGATION or PROJECTION HMI type"); _streamingMediaConfig = streamingMediaConfig; } else { - NSAssert(([_lifecycleConfig.appType isEqualToEnum:SDLAppHMITypeNavigation] || [_lifecycleConfig.appType isEqualToEnum:SDLAppHMITypeProjection]), @"If your app is a NAVIGATION or PROJECTION HMI type, you must set a streaming media configuration on SDLConfiguration"); + // If we don't have a streaming config, we MUST NOT be navigation or projection + NSAssert(!([_lifecycleConfig.appType isEqualToEnum:SDLAppHMITypeNavigation] || [_lifecycleConfig.appType isEqualToEnum:SDLAppHMITypeProjection]), @"If your app is a NAVIGATION or PROJECTION HMI type, you must set a streaming media configuration on SDLConfiguration"); } return self; diff --git a/SmartDeviceLink/SDLProtocol.h b/SmartDeviceLink/SDLProtocol.h index ea6df9667..a0a4d1ecd 100644 --- a/SmartDeviceLink/SDLProtocol.h +++ b/SmartDeviceLink/SDLProtocol.h @@ -17,18 +17,11 @@ extern NSString *const SDLProtocolSecurityErrorDomain; @interface SDLProtocol : SDLAbstractProtocol // Sending -- (void)sendStartSessionWithType:(SDLServiceType)serviceType __deprecated_msg(("Use startServiceWithType: instead")); -- (void)startServiceWithType:(SDLServiceType)serviceType __deprecated_msg(("Use startServiceWithType:payload: instead")); - (void)startServiceWithType:(SDLServiceType)serviceType payload:(nullable NSData *)payload; - -- (void)startSecureServiceWithType:(SDLServiceType)serviceType completionHandler:(void (^)(BOOL success, NSError *error))completionHandler __deprecated_msg(("Use startSecureServiceWithType:payload:completionHandler instead")); - (void)startSecureServiceWithType:(SDLServiceType)serviceType payload:(nullable NSData *)payload completionHandler:(void (^)(BOOL success, NSError *error))completionHandler; - -- (void)sendEndSessionWithType:(SDLServiceType)serviceType __deprecated_msg(("Use endServiceWithType: instead")); - (void)endServiceWithType:(SDLServiceType)serviceType; - (void)sendRPC:(SDLRPCMessage *)message; - (BOOL)sendRPC:(SDLRPCMessage *)message encrypted:(BOOL)encryption error:(NSError **)error; -- (void)sendRPCRequest:(SDLRPCRequest *)rpcRequest __deprecated_msg(("Use sendRPC: instead")); - (void)sendRawData:(NSData *)data withServiceType:(SDLServiceType)serviceType; - (void)sendEncryptedRawData:(NSData *)data onService:(SDLServiceType)serviceType; diff --git a/SmartDeviceLink/SDLProtocol.m b/SmartDeviceLink/SDLProtocol.m index 1adef65f0..186226414 100644 --- a/SmartDeviceLink/SDLProtocol.m +++ b/SmartDeviceLink/SDLProtocol.m @@ -82,27 +82,15 @@ - (UInt8)sdl_retrieveSessionIDforServiceType:(SDLServiceType)serviceType { return header.sessionID; } -- (void)sendStartSessionWithType:(SDLServiceType)serviceType { - [self startServiceWithType:serviceType payload:nil]; -} - #pragma mark - Start Service -- (void)startServiceWithType:(SDLServiceType)serviceType { - [self startServiceWithType:serviceType payload:nil]; -} - - (void)startServiceWithType:(SDLServiceType)serviceType payload:(nullable NSData *)payload { // No encryption, just build and send the message synchronously SDLProtocolMessage *message = [self sdl_createStartServiceMessageWithType:serviceType encrypted:NO payload:payload]; [self sdl_sendDataToTransport:message.data onService:serviceType]; } -- (void)startSecureServiceWithType:(SDLServiceType)serviceType completionHandler:(void (^)(BOOL success, NSError *error))completionHandler { - [self startSecureServiceWithType:serviceType payload:nil completionHandler:completionHandler]; -} - - (void)startSecureServiceWithType:(SDLServiceType)serviceType payload:(nullable NSData *)payload completionHandler:(void (^)(BOOL success, NSError *error))completionHandler { [self sdl_initializeTLSEncryptionWithCompletionHandler:^(BOOL success, NSError *error) { if (!success) { @@ -177,10 +165,6 @@ - (void)sdl_initializeTLSEncryptionWithCompletionHandler:(void (^)(BOOL success, #pragma mark - End Service -- (void)sendEndSessionWithType:(SDLServiceType)serviceType { - [self endServiceWithType:serviceType]; -} - - (void)endServiceWithType:(SDLServiceType)serviceType { SDLProtocolHeader *header = [SDLProtocolHeader headerForVersion:[SDLGlobals sharedGlobals].majorProtocolVersion]; header.frameType = SDLFrameTypeControl; @@ -295,11 +279,6 @@ - (BOOL)sendRPC:(SDLRPCMessage *)message encrypted:(BOOL)encryption error:(NSErr return YES; } -// SDLRPCRequest in from app -> SDLProtocolMessage out to transport layer. -- (void)sendRPCRequest:(SDLRPCRequest *)rpcRequest { - [self sendRPC:rpcRequest]; -} - // Use for normal messages - (void)sdl_sendDataToTransport:(NSData *)data onService:(NSInteger)priority { [_prioritizedCollection addObject:data withPriority:priority]; @@ -461,19 +440,6 @@ - (void)handleProtocolStartServiceACKMessage:(SDLProtocolMessage *)startServiceA if ([listener respondsToSelector:@selector(handleProtocolStartServiceACKMessage:)]) { [listener handleProtocolStartServiceACKMessage:startServiceACK]; } - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - if ([listener respondsToSelector:@selector(handleProtocolStartSessionACK:)]) { - [listener handleProtocolStartSessionACK:startServiceACK.header]; - } - - if ([listener respondsToSelector:@selector(handleProtocolStartSessionACK:sessionID:version:)]) { - [listener handleProtocolStartSessionACK:startServiceACK.header.serviceType - sessionID:startServiceACK.header.sessionID - version:startServiceACK.header.version]; -#pragma clang diagnostic pop - } } } @@ -484,13 +450,6 @@ - (void)handleProtocolStartServiceNAKMessage:(SDLProtocolMessage *)startServiceN if ([listener respondsToSelector:@selector(handleProtocolStartServiceNAKMessage:)]) { [listener handleProtocolStartServiceNAKMessage:startServiceNAK]; } - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - if ([listener respondsToSelector:@selector(handleProtocolStartSessionNACK:)]) { - [listener handleProtocolStartSessionNACK:startServiceNAK.header.serviceType]; - } -#pragma clang diagnostic pop } } @@ -502,14 +461,7 @@ - (void)handleProtocolEndServiceACKMessage:(SDLProtocolMessage *)endServiceACK { if ([listener respondsToSelector:@selector(handleProtocolEndServiceACKMessage:)]) { [listener handleProtocolEndServiceACKMessage:endServiceACK]; } - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - if ([listener respondsToSelector:@selector(handleProtocolEndSessionACK:)]) { - [listener handleProtocolEndSessionACK:endServiceACK.header.serviceType]; - } } -#pragma clang diagnostic pop } - (void)handleProtocolEndServiceNAKMessage:(SDLProtocolMessage *)endServiceNAK { @@ -519,14 +471,7 @@ - (void)handleProtocolEndServiceNAKMessage:(SDLProtocolMessage *)endServiceNAK { if ([listener respondsToSelector:@selector(handleProtocolEndServiceNAKMessage:)]) { [listener handleProtocolEndServiceNAKMessage:endServiceNAK]; } - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - if ([listener respondsToSelector:@selector(handleProtocolEndSessionNACK:)]) { - [listener handleProtocolEndSessionNACK:endServiceNAK.header.serviceType]; - } } -#pragma clang diagnostic pop } - (void)handleHeartbeatForSession:(Byte)session { diff --git a/SmartDeviceLink/SDLProtocolHeader.h b/SmartDeviceLink/SDLProtocolHeader.h index cfef757fe..e28539597 100644 --- a/SmartDeviceLink/SDLProtocolHeader.h +++ b/SmartDeviceLink/SDLProtocolHeader.h @@ -46,7 +46,6 @@ NS_ASSUME_NONNULL_BEGIN @property (assign, nonatomic, readonly) UInt8 version; @property (assign, nonatomic, readonly) NSUInteger size; -@property (assign, nonatomic) BOOL compressed __deprecated_msg("This is a mirror for encrypted"); @property (assign, nonatomic) BOOL encrypted; @property (assign, nonatomic) SDLFrameType frameType; @property (assign, nonatomic) SDLServiceType serviceType; diff --git a/SmartDeviceLink/SDLProtocolHeader.m b/SmartDeviceLink/SDLProtocolHeader.m index 2c193fecb..afe93724d 100644 --- a/SmartDeviceLink/SDLProtocolHeader.m +++ b/SmartDeviceLink/SDLProtocolHeader.m @@ -22,14 +22,6 @@ - (instancetype)init { return self; } -- (BOOL)compressed { - return _encrypted; -} - -- (void)setCompressed:(BOOL)compressed { - _encrypted = compressed; -} - - (id)copyWithZone:(nullable NSZone *)zone { [self doesNotRecognizeSelector:_cmd]; return 0; diff --git a/SmartDeviceLink/SDLProtocolListener.h b/SmartDeviceLink/SDLProtocolListener.h index 0657fc2c0..7888a9ee3 100644 --- a/SmartDeviceLink/SDLProtocolListener.h +++ b/SmartDeviceLink/SDLProtocolListener.h @@ -17,11 +17,6 @@ NS_ASSUME_NONNULL_BEGIN - (void)handleProtocolEndServiceNAKMessage:(SDLProtocolMessage *)endServiceNAK; // Older protocol handlers -- (void)handleProtocolStartSessionACK:(SDLServiceType)serviceType sessionID:(Byte)sessionID version:(Byte)version __deprecated_msg("use handleProtocolStartSessionACKMessage: instead"); -- (void)handleProtocolStartSessionACK:(SDLProtocolHeader *)header __deprecated_msg("use handleProtocolStartSessionACKMessage: instead"); -- (void)handleProtocolStartSessionNACK:(SDLServiceType)serviceType __deprecated_msg("use handleProtocolStartSessionNAKMessage: instead"); -- (void)handleProtocolEndSessionACK:(SDLServiceType)serviceType __deprecated_msg("use handleProtocolEndSessionACKMessage: instead"); -- (void)handleProtocolEndSessionNACK:(SDLServiceType)serviceType __deprecated_msg("use handleProtocolEndSessionNAKMessage: instead"); - (void)handleHeartbeatForSession:(Byte)session; - (void)handleHeartbeatACK; - (void)onProtocolMessageReceived:(SDLProtocolMessage *)msg; diff --git a/SmartDeviceLink/SDLProtocolMessage.h b/SmartDeviceLink/SDLProtocolMessage.h index 893c6ee09..4028ec497 100644 --- a/SmartDeviceLink/SDLProtocolMessage.h +++ b/SmartDeviceLink/SDLProtocolMessage.h @@ -19,8 +19,6 @@ NS_ASSUME_NONNULL_BEGIN - (NSString *)description; - (nullable NSDictionary *)rpcDictionary; // Use for RPC type messages to obtain the data in a dictionary -+ (UInt8)determineVersion:(NSData *)data __deprecated_msg(("Use SDLProtocolHeader determineVersion: instead")); - @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLProtocolMessage.m b/SmartDeviceLink/SDLProtocolMessage.m index b4a5fb5d9..66680e40e 100644 --- a/SmartDeviceLink/SDLProtocolMessage.m +++ b/SmartDeviceLink/SDLProtocolMessage.m @@ -49,10 +49,6 @@ - (NSData *)data { return dataOut; } -+ (UInt8)determineVersion:(NSData *)data { - return [SDLProtocolHeader determineVersion:data]; -} - - (NSString *)description { // Print the header data. NSMutableString *description = [[NSMutableString alloc] init]; diff --git a/SmartDeviceLink/SDLProxy.h b/SmartDeviceLink/SDLProxy.h index 80018677c..6beb28d8d 100644 --- a/SmartDeviceLink/SDLProxy.h +++ b/SmartDeviceLink/SDLProxy.h @@ -37,10 +37,8 @@ __deprecated_msg("Use SDLManager instead") - (void)removeDelegate:(NSObject *)delegate; - (void)sendRPC:(SDLRPCMessage *)message; -- (void)sendRPCRequest:(SDLRPCMessage *)msg __deprecated_msg("use -sendRPC: instead"); - (void)handleRPCDictionary:(NSDictionary *)dictionary; -- (void)handleRpcMessage:(NSDictionary *)msg __deprecated_msg("use -handleRPCDictionary: instead"); - (void)handleProtocolMessage:(SDLProtocolMessage *)msgData; diff --git a/SmartDeviceLink/SDLProxy.m b/SmartDeviceLink/SDLProxy.m index 16ed595a1..ef5eb9857 100644 --- a/SmartDeviceLink/SDLProxy.m +++ b/SmartDeviceLink/SDLProxy.m @@ -194,7 +194,8 @@ - (void)addSecurityManagers:(NSArray *)securityManagerClasses forAppId:(N - (void)onProtocolOpened { _isConnected = YES; SDLLogV(@"Proxy RPC protocol opened"); - [self.protocol startServiceWithType:SDLServiceTypeRPC]; + // THe RPC payload will be created by the protocol object...it's weird and confusing, I know. + [self.protocol startServiceWithType:SDLServiceTypeRPC payload:nil]; if (self.startSessionTimer == nil) { self.startSessionTimer = [[SDLTimer alloc] initWithDuration:StartSessionTime repeat:NO]; @@ -215,12 +216,12 @@ - (void)onError:(NSString *)info exception:(NSException *)e { [self invokeMethodOnDelegates:@selector(onError:) withObject:e]; } -- (void)handleProtocolStartSessionACK:(SDLProtocolHeader *)header { +- (void)handleProtocolStartServiceACKMessage:(SDLProtocolMessage *)startServiceACK { // Turn off the timer, the start session response came back [self.startSessionTimer cancel]; - SDLLogV(@"StartSession (response)\nSessionId: %d for serviceType %d", header.sessionID, header.serviceType); + SDLLogV(@"StartSession (response)\nSessionId: %d for serviceType %d", startServiceACK.header.sessionID, startServiceACK.header.serviceType); - if (header.serviceType == SDLServiceTypeRPC) { + if (startServiceACK.header.serviceType == SDLServiceTypeRPC) { [self invokeMethodOnDelegates:@selector(onProxyOpened) withObject:nil]; } } @@ -243,12 +244,6 @@ - (void)sendRPC:(SDLRPCMessage *)message { } } -- (void)sendRPCRequest:(SDLRPCMessage *)msg { - if ([msg isKindOfClass:SDLRPCRequest.class]) { - [self sendRPC:msg]; - } -} - - (void)handleProtocolMessage:(SDLProtocolMessage *)incomingMessage { // Convert protocol message to dictionary NSDictionary *rpcMessageAsDictionary = [incomingMessage rpcDictionary]; @@ -312,10 +307,6 @@ - (void)handleRPCDictionary:(NSDictionary *)dict { } } -- (void)handleRpcMessage:(NSDictionary *)msg { - [self handleRPCDictionary:msg]; -} - #pragma mark - RPC Handlers diff --git a/SmartDeviceLink/SDLShow.h b/SmartDeviceLink/SDLShow.h index 5c44548ae..8eef691a6 100644 --- a/SmartDeviceLink/SDLShow.h +++ b/SmartDeviceLink/SDLShow.h @@ -48,8 +48,6 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initWithMainField1:(nullable NSString *)mainField1 mainField2:(nullable NSString *)mainField2 alignment:(nullable SDLTextAlignment)alignment statusBar:(nullable NSString *)statusBar mediaClock:(nullable NSString *)mediaClock mediaTrack:(nullable NSString *)mediaTrack; -- (instancetype)initWithMainField1:(nullable NSString *)mainField1 mainField2:(nullable NSString *)mainField2 mainField3:(nullable NSString *)mainField3 mainField4:(nullable NSString *)mainField4 alignment:(nullable SDLTextAlignment)alignment statusBar:(nullable NSString *)statusBar mediaClock:(nullable NSString *)mediaClock mediaTrack:(nullable NSString *)mediaTrack graphic:(nullable SDLImage *)graphic softButtons:(nullable NSArray *)softButtons customPresets:(nullable NSArray *)customPresets __deprecated_msg(("Use initWithMainField1:(NSString *)mainField1 (NSString *)mainField2 (NSString *)mainField3 (NSString *)mainField4 (SDLTextAlignment *)alignment (NSString *)statusBar (NSString *)mediaClock (NSString *)mediaTrack (SDLImage *)graphic (NSArray *)softButtons (NSArray *)customPresets (SDLMetadataStruct *)metadata instead")); - - (instancetype)initWithMainField1:(nullable NSString *)mainField1 mainField2:(nullable NSString *)mainField2 mainField3:(nullable NSString *)mainField3 mainField4:(nullable NSString *)mainField4 alignment:(nullable SDLTextAlignment)alignment statusBar:(nullable NSString *)statusBar mediaClock:(nullable NSString *)mediaClock mediaTrack:(nullable NSString *)mediaTrack graphic:(nullable SDLImage *)graphic softButtons:(nullable NSArray *)softButtons customPresets:(nullable NSArray *)customPresets textFieldMetadata:(nullable SDLMetadataTags *)metadata; /** diff --git a/SmartDeviceLink/SDLShow.m b/SmartDeviceLink/SDLShow.m index 80f4f9d18..388865d24 100644 --- a/SmartDeviceLink/SDLShow.m +++ b/SmartDeviceLink/SDLShow.m @@ -73,27 +73,6 @@ - (instancetype)initWithMainField1:(nullable NSString *)mainField1 mainField2:(n return [self initWithMainField1:mainField1 mainField2:mainField2 mainField3:nil mainField4:nil alignment:alignment statusBar:statusBar mediaClock:mediaClock mediaTrack:mediaTrack graphic:nil softButtons:nil customPresets:nil textFieldMetadata:nil]; } -- (instancetype)initWithMainField1:(nullable NSString *)mainField1 mainField2:(nullable NSString *)mainField2 mainField3:(nullable NSString *)mainField3 mainField4:(nullable NSString *)mainField4 alignment:(nullable SDLTextAlignment)alignment statusBar:(nullable NSString *)statusBar mediaClock:(nullable NSString *)mediaClock mediaTrack:(nullable NSString *)mediaTrack graphic:(nullable SDLImage *)graphic softButtons:(nullable NSArray *)softButtons customPresets:(nullable NSArray *)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; -} - - (instancetype)initWithMainField1:(nullable NSString *)mainField1 mainField2:(nullable NSString *)mainField2 mainField3:(nullable NSString *)mainField3 mainField4:(nullable NSString *)mainField4 alignment:(nullable SDLTextAlignment)alignment statusBar:(nullable NSString *)statusBar mediaClock:(nullable NSString *)mediaClock mediaTrack:(nullable NSString *)mediaTrack graphic:(nullable SDLImage *)graphic softButtons:(nullable NSArray *)softButtons customPresets:(nullable NSArray *)customPresets textFieldMetadata:(nullable SDLMetadataTags *)metadata { self = [self init]; if (!self) { diff --git a/SmartDeviceLink/SDLSyncMsgVersion.h b/SmartDeviceLink/SDLSyncMsgVersion.h index de5050889..87af0c1d3 100644 --- a/SmartDeviceLink/SDLSyncMsgVersion.h +++ b/SmartDeviceLink/SDLSyncMsgVersion.h @@ -14,10 +14,7 @@ NS_ASSUME_NONNULL_BEGIN @interface SDLSyncMsgVersion : SDLRPCStruct -// TODO: (Alex M.)[2016-12-1] Change from NSInteger to UInt8 -- (instancetype)initWithMajorVersion:(NSInteger)majorVersion minorVersion:(NSInteger)minorVersion __deprecated_msg("Use initWithMajorVersion:minorVersion:patchVersion: instead"); - -- (instancetype)initWithMajorVersion:(NSInteger)majorVersion minorVersion:(NSInteger)minorVersion patchVersion:(NSInteger)patchVersion; +- (instancetype)initWithMajorVersion:(UInt8)majorVersion minorVersion:(UInt8)minorVersion patchVersion:(UInt8)patchVersion; /** * @abstract The major version indicates versions that is not-compatible to previous versions diff --git a/SmartDeviceLink/SDLSyncMsgVersion.m b/SmartDeviceLink/SDLSyncMsgVersion.m index 780edb2fe..7d256ce14 100644 --- a/SmartDeviceLink/SDLSyncMsgVersion.m +++ b/SmartDeviceLink/SDLSyncMsgVersion.m @@ -11,20 +11,7 @@ @implementation SDLSyncMsgVersion -- (instancetype)initWithMajorVersion:(NSInteger)majorVersion minorVersion:(NSInteger)minorVersion { - self = [self init]; - if (!self) { - return nil; - } - - self.majorVersion = @(majorVersion); - self.minorVersion = @(minorVersion); - self.patchVersion = @(0); - - return self; -} - -- (instancetype)initWithMajorVersion:(NSInteger)majorVersion minorVersion:(NSInteger)minorVersion patchVersion:(NSInteger)patchVersion { +- (instancetype)initWithMajorVersion:(UInt8)majorVersion minorVersion:(UInt8)minorVersion patchVersion:(UInt8)patchVersion { self = [self init]; if (!self) { return nil; diff --git a/SmartDeviceLink/SDLTimer.h b/SmartDeviceLink/SDLTimer.h index 0382b7f67..cba9efefa 100644 --- a/SmartDeviceLink/SDLTimer.h +++ b/SmartDeviceLink/SDLTimer.h @@ -13,7 +13,7 @@ NS_ASSUME_NONNULL_BEGIN @property (assign, nonatomic) float duration; - (instancetype)init; -- (instancetype)initWithDuration:(float)duration __deprecated; +- (instancetype)initWithDuration:(float)duration; - (instancetype)initWithDuration:(float)duration repeat:(BOOL)repeat; - (void)start; - (void)cancel; diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLConfigurationSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLConfigurationSpec.m index 358e9f816..6afb1f3cf 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLConfigurationSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLConfigurationSpec.m @@ -5,6 +5,7 @@ #import "SDLLifecycleConfiguration.h" #import "SDLLogConfiguration.h" #import "SDLLockScreenConfiguration.h" +#import "SDLStreamingMediaConfiguration.h" QuickSpecBegin(SDLConfigurationSpec) @@ -15,6 +16,7 @@ __block SDLLifecycleConfiguration *someLifecycleConfig = nil; __block SDLLockScreenConfiguration *someLockscreenConfig = nil; __block SDLLogConfiguration *someLogConfig = nil; + __block SDLStreamingMediaConfiguration *someStreamingConfig = nil; __block NSString *someAppName = nil; __block NSString *someAppId = nil; @@ -30,14 +32,43 @@ someLifecycleConfig = [SDLLifecycleConfiguration defaultConfigurationWithAppName:someAppName appId:someAppId]; someLockscreenConfig = [SDLLockScreenConfiguration enabledConfigurationWithAppIcon:someImage backgroundColor:someBackgroundColor]; someLogConfig = [SDLLogConfiguration defaultConfiguration]; - - testConfig = [SDLConfiguration configurationWithLifecycle:someLifecycleConfig lockScreen:someLockscreenConfig logging:someLogConfig]; + someStreamingConfig = [SDLStreamingMediaConfiguration insecureConfiguration]; }); - it(@"should contain the correct configs", ^{ + it(@"should create correctly with initWithLifecycle:lockScreen:logging:", ^{ + testConfig = [[SDLConfiguration alloc] initWithLifecycle:someLifecycleConfig lockScreen:someLockscreenConfig logging:someLogConfig]; + + expect(testConfig.lifecycleConfig).to(equal(someLifecycleConfig)); + expect(testConfig.lockScreenConfig).to(equal(someLockscreenConfig)); + expect(testConfig.loggingConfig).to(equal(someLogConfig)); + expect(testConfig.streamingMediaConfig).to(beNil()); + }); + + it(@"should create correctly with configurationWithLifecycle:lockScreen:logging:", ^{ + testConfig = [SDLConfiguration configurationWithLifecycle:someLifecycleConfig lockScreen:someLockscreenConfig logging:someLogConfig]; + + expect(testConfig.lifecycleConfig).to(equal(someLifecycleConfig)); + expect(testConfig.lockScreenConfig).to(equal(someLockscreenConfig)); + expect(testConfig.loggingConfig).to(equal(someLogConfig)); + expect(testConfig.streamingMediaConfig).to(beNil()); + }); + + it(@"should create correctly with initWithLifecycle:lockScreen:logging:streamingMedia:", ^{ + testConfig = [[SDLConfiguration alloc] initWithLifecycle:someLifecycleConfig lockScreen:someLockscreenConfig logging:someLogConfig streamingMedia:nil]; + + expect(testConfig.lifecycleConfig).to(equal(someLifecycleConfig)); + expect(testConfig.lockScreenConfig).to(equal(someLockscreenConfig)); + expect(testConfig.loggingConfig).to(equal(someLogConfig)); + expect(testConfig.streamingMediaConfig).to(beNil()); + }); + + it(@"should create correctly with configurationWithLifecycle:lockScreen:logging:streamingMedia:", ^{ + testConfig = [SDLConfiguration configurationWithLifecycle:someLifecycleConfig lockScreen:someLockscreenConfig logging:someLogConfig streamingMedia:nil]; + expect(testConfig.lifecycleConfig).to(equal(someLifecycleConfig)); expect(testConfig.lockScreenConfig).to(equal(someLockscreenConfig)); expect(testConfig.loggingConfig).to(equal(someLogConfig)); + expect(testConfig.streamingMediaConfig).to(beNil()); }); }); }); diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m index 48a8e690d..f858906d4 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m @@ -12,6 +12,7 @@ #import "SDLLifecycleConfiguration.h" #import "SDLLockScreenConfiguration.h" #import "SDLLockScreenManager.h" +#import "SDLLogConfiguration.h" #import "SDLManagerDelegate.h" #import "SDLNotificationDispatcher.h" #import "SDLOnHashChange.h" @@ -79,7 +80,7 @@ + (void)configure:(Configuration *)configuration { testLifecycleConfig.shortAppName = @"Short Name"; testLifecycleConfig.appType = SDLAppHMITypeNavigation; - testConfig = [SDLConfiguration configurationWithLifecycle:testLifecycleConfig lockScreen:[SDLLockScreenConfiguration disabledConfiguration]]; + testConfig = [SDLConfiguration configurationWithLifecycle:testLifecycleConfig lockScreen:[SDLLockScreenConfiguration disabledConfiguration] logging:[SDLLogConfiguration defaultConfiguration]]; testManager = [[SDLLifecycleManager alloc] initWithConfiguration:testConfig delegate:managerDelegateMock]; testManager.lockScreenManager = lockScreenManagerMock; testManager.fileManager = fileManagerMock; diff --git a/SmartDeviceLinkTests/ProtocolSpecs/HeaderSpecs/SDLV2ProtocolHeaderSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/HeaderSpecs/SDLV2ProtocolHeaderSpec.m index f62ddf57d..74969e062 100644 --- a/SmartDeviceLinkTests/ProtocolSpecs/HeaderSpecs/SDLV2ProtocolHeaderSpec.m +++ b/SmartDeviceLinkTests/ProtocolSpecs/HeaderSpecs/SDLV2ProtocolHeaderSpec.m @@ -68,36 +68,6 @@ }); }); -describe(@"compressed deprecated spec", ^{ - describe(@"setting encrypted", ^{ - __block BOOL value = NO; - beforeEach(^{ - testHeader.encrypted = value; - }); - - it(@"should give the same value for compressed", ^{ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - expect(@(testHeader.compressed)).to(equal(@(value))); -#pragma clang diagnostic pop - }); - }); - - describe(@"setting compressed", ^{ - __block BOOL value = YES; - beforeEach(^{ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - testHeader.compressed = value; -#pragma clang diagnostic pop - }); - - it(@"should give the same value for compressed", ^{ - expect(@(testHeader.encrypted)).to(equal(@(value))); - }); - }); -}); - describe(@"Data Tests", ^ { it (@"Should convert to byte data correctly", ^ { expect(testHeader.data).to(equal(testData));