summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicoleYarroch <nicole@livio.io>2019-03-07 13:24:38 -0500
committerNicoleYarroch <nicole@livio.io>2019-03-07 13:24:38 -0500
commitfde471b55134061ac3288e190857c268a8b4122c (patch)
tree9bd81e3a61159accf7d255441ce21a1d838bdcce
parent7555bfad168e548b2daad681d5670ef396859888 (diff)
downloadsdl_ios-fde471b55134061ac3288e190857c268a8b4122c.tar.gz
System capability manager now gets app services capability
The system capability manager now gets and stores the app services capability
-rw-r--r--SmartDeviceLink/SDLSystemCapabilityManager.h12
-rw-r--r--SmartDeviceLink/SDLSystemCapabilityManager.m4
-rw-r--r--SmartDeviceLinkTests/SDLSystemCapabilityManagerSpec.m5
3 files changed, 20 insertions, 1 deletions
diff --git a/SmartDeviceLink/SDLSystemCapabilityManager.h b/SmartDeviceLink/SDLSystemCapabilityManager.h
index 36f58a735..11e31a1c2 100644
--- a/SmartDeviceLink/SDLSystemCapabilityManager.h
+++ b/SmartDeviceLink/SDLSystemCapabilityManager.h
@@ -14,6 +14,7 @@
#import "SDLSystemCapabilityType.h"
#import "SDLVrCapabilities.h"
+@class SDLAppServicesCapabilities;
@class SDLAudioPassThruCapabilities;
@class SDLButtonCapabilities;
@class SDLDisplayCapabilities;
@@ -124,6 +125,15 @@ typedef void (^SDLUpdateCapabilityHandler)(NSError * _Nullable error, SDLSystemC
@property (nullable, strong, nonatomic, readonly) SDLAudioPassThruCapabilities *pcmStreamCapability;
/**
+ * If returned, the platform supports app services
+ *
+ * @see SDLAppServicesCapabilities
+ *
+ * Optional
+ */
+@property (nullable, strong, nonatomic, readonly) SDLAppServicesCapabilities *appServicesCapabilities;
+
+/**
* If returned, the platform supports navigation
*
* @see SDLNavigationCapability
@@ -181,7 +191,7 @@ typedef void (^SDLUpdateCapabilityHandler)(NSError * _Nullable error, SDLSystemC
- (void)stop;
/**
- * Retrieves a capability type from the remote system. This function must be called in order to retrieve the values of `navigationCapability`, `phoneCapability`, `videoStreamingCapability` and `remoteControlCapability`. If you do not call this method first, those values will be nil. After calling this method, assuming there is no error in the handler, you may retrieve the capability you requested from the manager within the handler.
+ * Retrieves a capability type from the remote system. This function must be called in order to retrieve the values for `navigationCapability`, `phoneCapability`, `videoStreamingCapability`, `remoteControlCapability`, and `appServicesCapabilities`. If you do not call this method first, those values will be nil. After calling this method, assuming there is no error in the handler, you may retrieve the capability you requested from the manager within the handler.
*
* @param type The type of capability to retrieve
* @param handler The handler to be called when the retrieval is complete
diff --git a/SmartDeviceLink/SDLSystemCapabilityManager.m b/SmartDeviceLink/SDLSystemCapabilityManager.m
index cd9db463a..108b008b9 100644
--- a/SmartDeviceLink/SDLSystemCapabilityManager.m
+++ b/SmartDeviceLink/SDLSystemCapabilityManager.m
@@ -8,6 +8,7 @@
#import "SDLSystemCapabilityManager.h"
+#import "SDLAppServicesCapabilities.h"
#import "SDLConnectionManagerType.h"
#import "SDLGenericResponse.h"
#import "SDLGetSystemCapability.h"
@@ -38,6 +39,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, assign, readwrite) BOOL vrCapability;
@property (nullable, copy, nonatomic, readwrite) NSArray<SDLAudioPassThruCapabilities *> *audioPassThruCapabilities;
@property (nullable, strong, nonatomic, readwrite) SDLAudioPassThruCapabilities *pcmStreamCapability;
+@property (nullable, strong, nonatomic, readwrite) SDLAppServicesCapabilities *appServicesCapabilities;
@property (nullable, strong, nonatomic, readwrite) SDLNavigationCapability *navigationCapability;
@property (nullable, strong, nonatomic, readwrite) SDLPhoneCapability *phoneCapability;
@property (nullable, strong, nonatomic, readwrite) SDLVideoStreamingCapability *videoStreamingCapability;
@@ -131,6 +133,8 @@ NS_ASSUME_NONNULL_BEGIN
self.remoteControlCapability = systemCapabilityResponse.remoteControlCapability;
} else if ([systemCapabilityType isEqualToEnum:SDLSystemCapabilityTypeVideoStreaming]) {
self.videoStreamingCapability = systemCapabilityResponse.videoStreamingCapability;
+ } else if ([systemCapabilityType isEqualToEnum:SDLSystemCapabilityTypeAppServices]) {
+ self.appServicesCapabilities = systemCapabilityResponse.appServicesCapabilities;
} else {
SDLLogW(@"Received response for unknown System Capability Type: %@", systemCapabilityType);
}
diff --git a/SmartDeviceLinkTests/SDLSystemCapabilityManagerSpec.m b/SmartDeviceLinkTests/SDLSystemCapabilityManagerSpec.m
index ee395a545..a3bb55c58 100644
--- a/SmartDeviceLinkTests/SDLSystemCapabilityManagerSpec.m
+++ b/SmartDeviceLinkTests/SDLSystemCapabilityManagerSpec.m
@@ -51,6 +51,7 @@ describe(@"System capability manager", ^{
expect(testSystemCapabilityManager.navigationCapability).to(beNil());
expect(testSystemCapabilityManager.videoStreamingCapability).to(beNil());
expect(testSystemCapabilityManager.remoteControlCapability).to(beNil());
+ expect(testSystemCapabilityManager.appServicesCapabilities).to(beNil());
});
context(@"When notified of a register app interface response", ^{
@@ -169,6 +170,7 @@ describe(@"System capability manager", ^{
expect(testSystemCapabilityManager.navigationCapability).to(beNil());
expect(testSystemCapabilityManager.videoStreamingCapability).to(beNil());
expect(testSystemCapabilityManager.remoteControlCapability).to(beNil());
+ expect(testSystemCapabilityManager.appServicesCapabilities).to(beNil());
});
});
@@ -250,6 +252,7 @@ describe(@"System capability manager", ^{
expect(testSystemCapabilityManager.navigationCapability).to(beNil());
expect(testSystemCapabilityManager.videoStreamingCapability).to(beNil());
expect(testSystemCapabilityManager.remoteControlCapability).to(beNil());
+ expect(testSystemCapabilityManager.appServicesCapabilities).to(beNil());
});
});
@@ -349,6 +352,7 @@ describe(@"System capability manager", ^{
expect(testSystemCapabilityManager.navigationCapability).to(beNil());
expect(testSystemCapabilityManager.videoStreamingCapability).to(beNil());
expect(testSystemCapabilityManager.remoteControlCapability).to(beNil());
+ expect(testSystemCapabilityManager.appServicesCapabilities).to(beNil());
});
});
@@ -388,6 +392,7 @@ describe(@"System capability manager", ^{
expect(testSystemCapabilityManager.navigationCapability).to(beNil());
expect(testSystemCapabilityManager.videoStreamingCapability).to(beNil());
expect(testSystemCapabilityManager.remoteControlCapability).to(beNil());
+ expect(testSystemCapabilityManager.appServicesCapabilities).to(beNil());
});
});
});