diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2017-07-28 14:43:47 -0400 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2017-07-28 14:43:52 -0400 |
commit | 21e3334e53e5e102daa81acaa0098d2e4d503d2d (patch) | |
tree | 43d4c8e0c0535ddbff39b12a9cdd3921c2f311fc | |
parent | a43c36c6fa43a98b826f0ad9426858e3cc389468 (diff) | |
parent | 8395a62df2a82c251cf8f7ac6ca4aebbe6cb81e6 (diff) | |
download | sdl_ios-21e3334e53e5e102daa81acaa0098d2e4d503d2d.tar.gz |
Merge branch 'jamescs-feature/implement_SDL_0080_multisession_protocol' into release/5.0.0
# Conflicts:
# SmartDeviceLink/SDLIAPTransport.m
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | SmartDeviceLink/SDLGlobals.h | 1 | ||||
-rw-r--r-- | SmartDeviceLink/SDLIAPTransport.m | 14 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSyncMsgVersion.h | 6 | ||||
-rw-r--r-- | SmartDeviceLink_Example/Info.plist | 1 |
5 files changed, 13 insertions, 10 deletions
@@ -116,6 +116,7 @@ Your application must support a set of smartdevicelink protocol strings in order <string>com.smartdevicelink.prot1</string> <string>com.smartdevicelink.prot0</string> <string>com.ford.sync.prot0</string> +<string>com.smartdevicelink.multisession</string> </array> ``` diff --git a/SmartDeviceLink/SDLGlobals.h b/SmartDeviceLink/SDLGlobals.h index 367915d0c..15e08182f 100644 --- a/SmartDeviceLink/SDLGlobals.h +++ b/SmartDeviceLink/SDLGlobals.h @@ -11,6 +11,7 @@ NS_ASSUME_NONNULL_BEGIN #define SDL_SYSTEM_VERSION_LESS_THAN(version) ([[[UIDevice currentDevice] systemVersion] compare:version options:NSNumericSearch] == NSOrderedAscending) +#define SDL_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(version) ([[[UIDevice currentDevice] systemVersion] compare:version options:NSNumericSearch] != NSOrderedAscending) #define BLOCK_RETURN return @interface SDLGlobals : NSObject diff --git a/SmartDeviceLink/SDLIAPTransport.m b/SmartDeviceLink/SDLIAPTransport.m index 66a0ae2be..cb272e9a2 100644 --- a/SmartDeviceLink/SDLIAPTransport.m +++ b/SmartDeviceLink/SDLIAPTransport.m @@ -21,6 +21,7 @@ NS_ASSUME_NONNULL_BEGIN NSString *const LegacyProtocolString = @"com.ford.sync.prot0"; NSString *const ControlProtocolString = @"com.smartdevicelink.prot0"; NSString *const IndexedProtocolStringPrefix = @"com.smartdevicelink.prot"; +NSString *const MultiSessionProtocolString = @"com.smartdevicelink.multisession"; NSString *const BackgroundTaskName = @"com.sdl.transport.iap.backgroundTask"; int const createSessionRetries = 1; @@ -200,15 +201,18 @@ int const streamOpenTimeoutSeconds = 2; */ - (BOOL)sdl_connectAccessory:(EAAccessory *)accessory { BOOL connecting = NO; - - if ([accessory supportsProtocol:ControlProtocolString]) { + + if ([accessory supportsProtocol:MultiSessionProtocolString] && SDL_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"9")) { + [self sdl_createIAPDataSessionWithAccessory:accessory forProtocol:MultiSessionProtocolString]; + connecting = YES; + } else if ([accessory supportsProtocol:ControlProtocolString]) { [self sdl_createIAPControlSessionWithAccessory:accessory]; connecting = YES; } else if ([accessory supportsProtocol:LegacyProtocolString]) { [self sdl_createIAPDataSessionWithAccessory:accessory forProtocol:LegacyProtocolString]; connecting = YES; } - + return connecting; } @@ -230,7 +234,9 @@ int const streamOpenTimeoutSeconds = 2; } // Determine if we can start a multi-app session or a legacy (single-app) session - if ((sdlAccessory = [EAAccessoryManager findAccessoryForProtocol:ControlProtocolString])) { + if ((sdlAccessory = [EAAccessoryManager findAccessoryForProtocol:MultiSessionProtocolString]) && SDL_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"9")) { + [self sdl_createIAPDataSessionWithAccessory:sdlAccessory forProtocol:MultiSessionProtocolString]; + } else if ((sdlAccessory = [EAAccessoryManager findAccessoryForProtocol:ControlProtocolString])) { [self sdl_createIAPControlSessionWithAccessory:sdlAccessory]; } else if ((sdlAccessory = [EAAccessoryManager findAccessoryForProtocol:LegacyProtocolString])) { [self sdl_createIAPDataSessionWithAccessory:sdlAccessory forProtocol:LegacyProtocolString]; diff --git a/SmartDeviceLink/SDLSyncMsgVersion.h b/SmartDeviceLink/SDLSyncMsgVersion.h index 612c0db27..de5050889 100644 --- a/SmartDeviceLink/SDLSyncMsgVersion.h +++ b/SmartDeviceLink/SDLSyncMsgVersion.h @@ -38,12 +38,6 @@ NS_ASSUME_NONNULL_BEGIN */ @property (strong, nonatomic, nullable) NSNumber<SDLInt> *patchVersion; -/** - * @abstract Optional, allows backward-compatible fixes to the API without increasing the minor version of the interface - * - */ -@property (strong) NSNumber *patchVersion; - @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink_Example/Info.plist b/SmartDeviceLink_Example/Info.plist index bbcd2bd93..d3b02b4be 100644 --- a/SmartDeviceLink_Example/Info.plist +++ b/SmartDeviceLink_Example/Info.plist @@ -82,6 +82,7 @@ <string>com.smartdevicelink.prot1</string> <string>com.smartdevicelink.prot0</string> <string>com.ford.sync.prot0</string> + <string>com.smartdevicelink.multisession</string> </array> <key>UISupportedInterfaceOrientations</key> <array> |