summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2017-08-18 10:30:37 -0400
committerJoel Fischer <joeljfischer@gmail.com>2017-08-18 10:30:37 -0400
commite516eabe852c637bb2499a96ce14278f9c70f83c (patch)
tree4287888e36354c8fca0d411e0cae5bae76938a63
parent4687b311f77c532065a603a66e9e56f091070613 (diff)
downloadsdl_ios-e516eabe852c637bb2499a96ce14278f9c70f83c.tar.gz
Update for SDL-0075 updates
* https://github.com/smartdevicelink/sdl_evolution/pull/234
-rw-r--r--SmartDeviceLink/SDLNames.h1
-rw-r--r--SmartDeviceLink/SDLNames.m1
-rw-r--r--SmartDeviceLink/SDLVideoStreamingCapability.h6
-rw-r--r--SmartDeviceLink/SDLVideoStreamingCapability.m11
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSystemCapabilitySpec.m4
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVideoStreamingCapabilitySpec.m11
6 files changed, 26 insertions, 8 deletions
diff --git a/SmartDeviceLink/SDLNames.h b/SmartDeviceLink/SDLNames.h
index abe9fe4ad..0060abec9 100644
--- a/SmartDeviceLink/SDLNames.h
+++ b/SmartDeviceLink/SDLNames.h
@@ -139,6 +139,7 @@ extern SDLName const SDLNameGPS;
extern SDLName const SDLNameGraphic;
extern SDLName const SDLNameGraphicSupported;
extern SDLName const SDLNameHapticSpatialData;
+extern SDLName const SDLNameHapticSpatialDataSupported;
extern SDLName const SDLNameHardware;
extern SDLName const SDLNameHashId;
extern SDLName const SDLNameHDOP;
diff --git a/SmartDeviceLink/SDLNames.m b/SmartDeviceLink/SDLNames.m
index cd8002c77..7a3df991c 100644
--- a/SmartDeviceLink/SDLNames.m
+++ b/SmartDeviceLink/SDLNames.m
@@ -136,6 +136,7 @@ SDLName const SDLNameGPS = @"gps";
SDLName const SDLNameGraphic = @"graphic";
SDLName const SDLNameGraphicSupported = @"graphicSupported";
SDLName const SDLNameHapticSpatialData = @"hapticSpatialData";
+SDLName const SDLNameHapticSpatialDataSupported = @"hapticSpatialDataSupported";
SDLName const SDLNameHardware = @"hardware";
SDLName const SDLNameHashId = @"hashID";
SDLName const SDLNameHDOP = @"hdop";
diff --git a/SmartDeviceLink/SDLVideoStreamingCapability.h b/SmartDeviceLink/SDLVideoStreamingCapability.h
index a19ec1a68..86de1f1ac 100644
--- a/SmartDeviceLink/SDLVideoStreamingCapability.h
+++ b/SmartDeviceLink/SDLVideoStreamingCapability.h
@@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface SDLVideoStreamingCapability : SDLRPCStruct
-- (instancetype)initWithVideoStreaming:(nullable SDLImageResolution *)preferredResolution maxBitrate:(nullable NSNumber *)maxBitrate supportedFormats:(nullable NSArray<SDLVideoStreamingFormat *> *)supportedFormats;
+- (instancetype)initWithVideoStreaming:(nullable SDLImageResolution *)preferredResolution maxBitrate:(nullable NSNumber<SDLInt> *)maxBitrate supportedFormats:(nullable NSArray<SDLVideoStreamingFormat *> *)supportedFormats hapticDataSupported:(nullable NSNumber<SDLBool> *)hapticDataSupported;
/**
* @abstract The preferred resolution of a video stream for decoding and rendering on HMI, optional
*/
@@ -35,6 +35,10 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (nullable, strong, nonatomic) NSArray<SDLVideoStreamingFormat *> *supportedFormats;
+/**
+ True if the system can utilize the haptic spatial data from the source being streamed.
+ */
+@property (nullable, strong, nonatomic) NSNumber<SDLBool> *hapticSpatialDataSupported;
@end
diff --git a/SmartDeviceLink/SDLVideoStreamingCapability.m b/SmartDeviceLink/SDLVideoStreamingCapability.m
index cf4d33e98..75873a710 100644
--- a/SmartDeviceLink/SDLVideoStreamingCapability.m
+++ b/SmartDeviceLink/SDLVideoStreamingCapability.m
@@ -17,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN
@implementation SDLVideoStreamingCapability
-- (instancetype)initWithVideoStreaming:(nullable SDLImageResolution *)preferredResolution maxBitrate:(nullable NSNumber *)maxBitrate supportedFormats:(nullable NSArray<SDLVideoStreamingFormat *> *)supportedFormats {
+- (instancetype)initWithVideoStreaming:(nullable SDLImageResolution *)preferredResolution maxBitrate:(nullable NSNumber<SDLInt> *)maxBitrate supportedFormats:(nullable NSArray<SDLVideoStreamingFormat *> *)supportedFormats hapticDataSupported:(nullable NSNumber<SDLBool> *)hapticDataSupported {
self = [self init];
if (!self) {
return self;
@@ -26,6 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
self.maxBitrate = maxBitrate;
self.preferredResolution = preferredResolution;
self.supportedFormats = supportedFormats;
+ self.hapticSpatialDataSupported = hapticDataSupported;
return self;
}
@@ -54,6 +55,14 @@ NS_ASSUME_NONNULL_BEGIN
return [store sdl_objectsForName:SDLNameSupportedFormats ofClass:SDLVideoStreamingFormat.class];
}
+- (void)setHapticSpatialDataSupported:(nullable NSNumber<SDLBool> *)hapticSpatialDataSupported {
+ [store sdl_setObject:hapticSpatialDataSupported forName:SDLNameHapticSpatialDataSupported];
+}
+
+- (nullable NSNumber<SDLBool> *)hapticSpatialDataSupported {
+ return [store sdl_objectForName:SDLNameHapticSpatialDataSupported];
+}
+
@end
NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSystemCapabilitySpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSystemCapabilitySpec.m
index 0ab02a693..070eb774e 100644
--- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSystemCapabilitySpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSystemCapabilitySpec.m
@@ -82,12 +82,12 @@ describe(@"Initialization tests", ^{
});
it(@"should initialize correctly with initWithVideoStreamingCapability:", ^{
-
SDLImageResolution* resolution = [[SDLImageResolution alloc] init];
resolution.resolutionWidth = @600;
resolution.resolutionHeight = @500;
NSNumber *maxBitrate = @100;
+ NSNumber *hapticDataSupported = @YES;
SDLVideoStreamingFormat *format1 = [[SDLVideoStreamingFormat alloc] init];
format1.codec = SDLVideoStreamingCodecH264;
@@ -99,7 +99,7 @@ describe(@"Initialization tests", ^{
NSArray<SDLVideoStreamingFormat *> *formatArray = @[format1, format2];
- SDLVideoStreamingCapability *testVidStruct = [[SDLVideoStreamingCapability alloc] initWithVideoStreaming:resolution maxBitrate:maxBitrate supportedFormats:formatArray];
+ SDLVideoStreamingCapability *testVidStruct = [[SDLVideoStreamingCapability alloc] initWithVideoStreaming:resolution maxBitrate:maxBitrate supportedFormats:formatArray hapticDataSupported:hapticDataSupported];
SDLSystemCapability *testStruct = [[SDLSystemCapability alloc] initWithVideoStreamingCapability:testVidStruct];
expect(testStruct.systemCapabilityType).to(equal(SDLSystemCapabilityTypeVideoStreaming));
diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVideoStreamingCapabilitySpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVideoStreamingCapabilitySpec.m
index 1c1d4cee8..c977e0db7 100644
--- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVideoStreamingCapabilitySpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVideoStreamingCapabilitySpec.m
@@ -22,12 +22,12 @@ QuickSpecBegin(SDLVideoStreamingCapabilitySpec)
describe(@"Initialization tests", ^{
it(@"Should get correctly when initialized with a dictionary", ^ {
-
SDLImageResolution* resolution = [[SDLImageResolution alloc] init];
resolution.resolutionWidth = @600;
resolution.resolutionHeight = @500;
NSNumber *maxBitrate = @100;
+ NSNumber *hapticDataSupported = @NO;
SDLVideoStreamingFormat *format1 = [[SDLVideoStreamingFormat alloc] init];
format1.codec = SDLVideoStreamingCodecH264;
@@ -41,13 +41,15 @@ describe(@"Initialization tests", ^{
NSMutableDictionary* dict = [@{SDLNamePreferredResolution: resolution,
SDLNameMaxBitrate: maxBitrate,
- SDLNameSupportedFormats: formatArray} mutableCopy];
+ SDLNameSupportedFormats: formatArray,
+ SDLNameHapticSpatialDataSupported: hapticDataSupported} mutableCopy];
SDLVideoStreamingCapability* testStruct = [[SDLVideoStreamingCapability alloc] initWithDictionary:dict];
expect(testStruct.preferredResolution).to(equal(resolution));
expect(testStruct.maxBitrate).to(equal(maxBitrate));
expect(testStruct.supportedFormats).to(equal(formatArray));
+ expect(testStruct.hapticSpatialDataSupported).to(equal(hapticDataSupported));
});
it(@"Should return nil if not set", ^ {
@@ -59,12 +61,12 @@ describe(@"Initialization tests", ^{
});
it(@"Should initialize correctly with initWithVideoStreaming:(SDLImageResolution *)preferredResolution (NSNumber *)maxBitrate (NSArray<SDLVideoStreamingFormat *> *)suportedFormats", ^ {
-
SDLImageResolution* resolution = [[SDLImageResolution alloc] init];
resolution.resolutionWidth = @600;
resolution.resolutionHeight = @500;
NSNumber *maxBitrate = @100;
+ NSNumber *hapticDataSupported = @YES;
SDLVideoStreamingFormat *format1 = [[SDLVideoStreamingFormat alloc] init];
format1.codec = SDLVideoStreamingCodecH264;
@@ -76,11 +78,12 @@ describe(@"Initialization tests", ^{
NSArray<SDLVideoStreamingFormat *> *formatArray = @[format1, format2];
- SDLVideoStreamingCapability *testStruct = [[SDLVideoStreamingCapability alloc] initWithVideoStreaming:resolution maxBitrate:maxBitrate supportedFormats:formatArray];
+ SDLVideoStreamingCapability *testStruct = [[SDLVideoStreamingCapability alloc] initWithVideoStreaming:resolution maxBitrate:maxBitrate supportedFormats:formatArray hapticDataSupported:hapticDataSupported];
expect(testStruct.preferredResolution).to(equal(resolution));
expect(testStruct.maxBitrate).to(equal(maxBitrate));
expect(testStruct.supportedFormats).to(equal(formatArray));
+ expect(testStruct.hapticSpatialDataSupported).to(equal(hapticDataSupported));
});
});