summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2017-07-28 14:43:47 -0400
committerJoel Fischer <joeljfischer@gmail.com>2017-07-28 14:43:52 -0400
commit21e3334e53e5e102daa81acaa0098d2e4d503d2d (patch)
tree43d4c8e0c0535ddbff39b12a9cdd3921c2f311fc
parenta43c36c6fa43a98b826f0ad9426858e3cc389468 (diff)
parent8395a62df2a82c251cf8f7ac6ca4aebbe6cb81e6 (diff)
downloadsdl_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.md1
-rw-r--r--SmartDeviceLink/SDLGlobals.h1
-rw-r--r--SmartDeviceLink/SDLIAPTransport.m14
-rw-r--r--SmartDeviceLink/SDLSyncMsgVersion.h6
-rw-r--r--SmartDeviceLink_Example/Info.plist1
5 files changed, 13 insertions, 10 deletions
diff --git a/README.md b/README.md
index 0a84a7701..beff7d1d8 100644
--- a/README.md
+++ b/README.md
@@ -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>