diff options
Diffstat (limited to 'SmartDeviceLink')
-rw-r--r-- | SmartDeviceLink/SDLFunctionID.m | 1 | ||||
-rw-r--r-- | SmartDeviceLink/SDLNames.h | 5 | ||||
-rw-r--r-- | SmartDeviceLink/SDLNames.m | 5 | ||||
-rw-r--r-- | SmartDeviceLink/SDLNotificationConstants.h | 1 | ||||
-rw-r--r-- | SmartDeviceLink/SDLNotificationConstants.m | 2 | ||||
-rw-r--r-- | SmartDeviceLink/SDLNotificationDispatcher.m | 4 | ||||
-rw-r--r-- | SmartDeviceLink/SDLProxyListener.h | 2 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSendHapticData.h | 37 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSendHapticData.m | 44 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSendHapticDataResponse.h | 19 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSendHapticDataResponse.m | 25 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSpatialStruct.h | 52 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSpatialStruct.m | 74 | ||||
-rw-r--r-- | SmartDeviceLink/SDLVideoStreamingCapability.h | 6 | ||||
-rw-r--r-- | SmartDeviceLink/SDLVideoStreamingCapability.m | 11 | ||||
-rw-r--r-- | SmartDeviceLink/SmartDeviceLink.h | 3 |
16 files changed, 289 insertions, 2 deletions
diff --git a/SmartDeviceLink/SDLFunctionID.m b/SmartDeviceLink/SDLFunctionID.m index 58ff9c479..ed8f32d02 100644 --- a/SmartDeviceLink/SDLFunctionID.m +++ b/SmartDeviceLink/SDLFunctionID.m @@ -75,6 +75,7 @@ NS_ASSUME_NONNULL_BEGIN @46: SDLNameSubscribeWaypoints, @47: SDLNameUnsubscribeWaypoints, @48: SDLNameGetSystemCapability, + @49: SDLNameSendHapticData, @32768: SDLNameOnHMIStatus, @32769: SDLNameOnAppInterfaceUnregistered, @32770: SDLNameOnButtonEvent, diff --git a/SmartDeviceLink/SDLNames.h b/SmartDeviceLink/SDLNames.h index 5bdcc52e5..e611743b6 100644 --- a/SmartDeviceLink/SDLNames.h +++ b/SmartDeviceLink/SDLNames.h @@ -138,11 +138,14 @@ extern SDLName const SDLNameGetWaypointsEnabled; 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; extern SDLName const SDLNameHeading; extern SDLName const SDLNameHeadLampStatus; +extern SDLName const SDLNameHeight; extern SDLName const SDLNameHelpPrompt; extern SDLName const SDLNameHighBeamsOn; extern SDLName const SDLNameHMIDisplayLanguage; @@ -354,6 +357,8 @@ extern SDLName const SDLNameSecondaryImage; extern SDLName const SDLNameSecondaryText; extern SDLName const SDLNameSecond; extern SDLName const SDLNameSeconds; +extern SDLName const SDLNameSendHapticData; +extern SDLName const SDLNameSendHapticDataResponse; extern SDLName const SDLNameSendLocation; extern SDLName const SDLNameSendLocationEnabled; extern SDLName const SDLNameSetAppIcon; diff --git a/SmartDeviceLink/SDLNames.m b/SmartDeviceLink/SDLNames.m index 995cc20bf..a8a527383 100644 --- a/SmartDeviceLink/SDLNames.m +++ b/SmartDeviceLink/SDLNames.m @@ -135,11 +135,14 @@ SDLName const SDLNameGetWaypointsEnabled = @"getWayPointsEnabled"; 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"; SDLName const SDLNameHeading = @"heading"; SDLName const SDLNameHeadLampStatus = @"headLampStatus"; +SDLName const SDLNameHeight = @"height"; SDLName const SDLNameHelpPrompt = @"helpPrompt"; SDLName const SDLNameHighBeamsOn = @"highBeamsOn"; SDLName const SDLNameHMIDisplayLanguage = @"hmiDisplayLanguage"; @@ -348,6 +351,8 @@ SDLName const SDLNameSecondaryImage = @"secondaryImage"; SDLName const SDLNameSecondaryText = @"secondaryText"; SDLName const SDLNameSecond = @"second"; SDLName const SDLNameSeconds = @"seconds"; +SDLName const SDLNameSendHapticData = @"sendHapticData"; +SDLName const SDLNameSendHapticDataResponse = @"sendHapticDataResponse"; SDLName const SDLNameSendLocation = @"SendLocation"; SDLName const SDLNameSendLocationEnabled = @"sendLocationEnabled"; SDLName const SDLNameSetAppIcon = @"SetAppIcon"; diff --git a/SmartDeviceLink/SDLNotificationConstants.h b/SmartDeviceLink/SDLNotificationConstants.h index 9c9edca13..d313edb39 100644 --- a/SmartDeviceLink/SDLNotificationConstants.h +++ b/SmartDeviceLink/SDLNotificationConstants.h @@ -114,6 +114,7 @@ extern SDLNotificationName const SDLDidReceiveReadDIDResponse; extern SDLNotificationName const SDLDidReceiveRegisterAppInterfaceResponse; extern SDLNotificationName const SDLDidReceiveResetGlobalPropertiesResponse; extern SDLNotificationName const SDLDidReceiveScrollableMessageResponse; +extern SDLNotificationName const SDLDidReceiveSendHapticDataResponse; extern SDLNotificationName const SDLDidReceiveSendLocationResponse; extern SDLNotificationName const SDLDidReceiveSetAppIconResponse; extern SDLNotificationName const SDLDidReceiveSetDisplayLayoutResponse; diff --git a/SmartDeviceLink/SDLNotificationConstants.m b/SmartDeviceLink/SDLNotificationConstants.m index b444a8857..1952f397b 100644 --- a/SmartDeviceLink/SDLNotificationConstants.m +++ b/SmartDeviceLink/SDLNotificationConstants.m @@ -47,6 +47,7 @@ SDLNotificationName const SDLDidReceiveReadDIDResponse = @"com.sdl.response.read SDLNotificationName const SDLDidReceiveRegisterAppInterfaceResponse = @"com.sdl.response.registerAppInterface"; SDLNotificationName const SDLDidReceiveResetGlobalPropertiesResponse = @"com.sdl.response.resetGlobalProperties"; SDLNotificationName const SDLDidReceiveScrollableMessageResponse = @"com.sdl.response.scrollableMessage"; +SDLNotificationName const SDLDidReceiveSendHapticDataResponse = @"com.sdl.response.sendHapticData"; SDLNotificationName const SDLDidReceiveSendLocationResponse = @"com.sdl.response.sendLocation"; SDLNotificationName const SDLDidReceiveSetAppIconResponse = @"com.sdl.response.setAppIcon"; SDLNotificationName const SDLDidReceiveSetDisplayLayoutResponse = @"com.sdl.response.setDisplayLayout"; @@ -117,6 +118,7 @@ SDLNotificationName const SDLDidReceiveWaypointNotification = @"com.sdl.notifica SDLDidReceiveRegisterAppInterfaceResponse, SDLDidReceiveResetGlobalPropertiesResponse, SDLDidReceiveScrollableMessageResponse, + SDLDidReceiveSendHapticDataResponse, SDLDidReceiveSendLocationResponse, SDLDidReceiveSetAppIconResponse, SDLDidReceiveSetDisplayLayoutResponse, diff --git a/SmartDeviceLink/SDLNotificationDispatcher.m b/SmartDeviceLink/SDLNotificationDispatcher.m index 00ae1f962..81fbeee76 100644 --- a/SmartDeviceLink/SDLNotificationDispatcher.m +++ b/SmartDeviceLink/SDLNotificationDispatcher.m @@ -186,6 +186,10 @@ NS_ASSUME_NONNULL_BEGIN [self postRPCResponseNotification:SDLDidReceiveScrollableMessageResponse response:response]; } +- (void)onSendHapticDataResponse:(SDLSendHapticDataResponse *)response { + [self postRPCResponseNotification:SDLDidReceiveSendHapticDataResponse response:response]; +} + - (void)onSendLocationResponse:(SDLSendLocationResponse *)response { [self postRPCResponseNotification:SDLDidReceiveSendLocationResponse response:response]; } diff --git a/SmartDeviceLink/SDLProxyListener.h b/SmartDeviceLink/SDLProxyListener.h index b3d29825c..a4b1e3c43 100644 --- a/SmartDeviceLink/SDLProxyListener.h +++ b/SmartDeviceLink/SDLProxyListener.h @@ -50,6 +50,7 @@ @class SDLRegisterAppInterfaceResponse; @class SDLResetGlobalPropertiesResponse; @class SDLScrollableMessageResponse; +@class SDLSendHapticDataResponse; @class SDLSendLocationResponse; @class SDLSetAppIconResponse; @class SDLSetDisplayLayoutResponse; @@ -126,6 +127,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)onRegisterAppInterfaceResponse:(SDLRegisterAppInterfaceResponse *)response; - (void)onResetGlobalPropertiesResponse:(SDLResetGlobalPropertiesResponse *)response; - (void)onScrollableMessageResponse:(SDLScrollableMessageResponse *)response; +- (void)onSendHapticDataResponse:(SDLSendHapticDataResponse *)response; - (void)onSendLocationResponse:(SDLSendLocationResponse *)response; - (void)onSetAppIconResponse:(SDLSetAppIconResponse *)response; - (void)onSetDisplayLayoutResponse:(SDLSetDisplayLayoutResponse *)response; diff --git a/SmartDeviceLink/SDLSendHapticData.h b/SmartDeviceLink/SDLSendHapticData.h new file mode 100644 index 000000000..5c6b9ec6c --- /dev/null +++ b/SmartDeviceLink/SDLSendHapticData.h @@ -0,0 +1,37 @@ +// +// SDLSendHapticData.h +// SmartDeviceLink-iOS +// +// Created by Nicole on 8/3/17. +// Copyright © 2017 smartdevicelink. All rights reserved. +// + +#import <Foundation/Foundation.h> +#import "SDLRPCRequest.h" + +@class SDLSpatialStruct; + +NS_ASSUME_NONNULL_BEGIN + +/** + * Sends the spatial data gathered from SDLCarWindow or VirtualDisplayEncoder to the HMI. This data will be utilized by the HMI to determine how and when haptic events should occur. + */ +@interface SDLSendHapticData : SDLRPCRequest + +/** + * Constructs a new SDLSendHapticData object indicated by the hapticSpatialData parameter + * + * @param hapticSpatialData Array of spatial data structures + */ +- (instancetype)initWithHapticSpatialData:(NSArray<SDLSpatialStruct *> *)hapticSpatialData; + +/** + * Array of spatial data structures that represent the locations of all user controls present on the HMI. This data should be updated if/when the application presents a new screen. When a request is sent, if successful, it will replace all spatial data previously sent through RPC. If an empty array is sent, the existing spatial data will be cleared + * + * Optional, Array of SDLSpatialStruct, Array size 0 - 1,000 + */ +@property (strong, nonatomic, nullable) NSArray<SDLSpatialStruct *> *hapticSpatialData; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLSendHapticData.m b/SmartDeviceLink/SDLSendHapticData.m new file mode 100644 index 000000000..48d5b897a --- /dev/null +++ b/SmartDeviceLink/SDLSendHapticData.m @@ -0,0 +1,44 @@ +// +// SDLSendHapticData.m +// SmartDeviceLink-iOS +// +// Created by Nicole on 8/3/17. +// Copyright © 2017 smartdevicelink. All rights reserved. +// + +#import "NSMutableDictionary+Store.h" +#import "SDLNames.h" +#import "SDLSendHapticData.h" + +NS_ASSUME_NONNULL_BEGIN + +@implementation SDLSendHapticData + +- (instancetype)init { + if (self = [super initWithName:SDLNameSendHapticData]) { + } + return self; +} + +- (instancetype)initWithHapticSpatialData:(NSArray<SDLSpatialStruct *> *)hapticSpatialData { + self = [self init]; + if (!self) { + return nil; + } + + self.hapticSpatialData = [hapticSpatialData mutableCopy]; + + return self; +} + +- (void)setHapticSpatialData:(nullable NSArray<SDLSpatialStruct *> *)hapticSpatialData { + [parameters sdl_setObject:hapticSpatialData forName:SDLNameHapticSpatialData]; +} + +- (nullable NSArray<SDLSpatialStruct *> *)hapticSpatialData { + return [parameters sdl_objectForName:SDLNameHapticSpatialData]; +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLSendHapticDataResponse.h b/SmartDeviceLink/SDLSendHapticDataResponse.h new file mode 100644 index 000000000..c811c0e22 --- /dev/null +++ b/SmartDeviceLink/SDLSendHapticDataResponse.h @@ -0,0 +1,19 @@ +// +// SDLSendHapticDataResponse.h +// SmartDeviceLink-iOS +// +// Created by Nicole on 8/4/17. +// Copyright © 2017 smartdevicelink. All rights reserved. +// + +#import "SDLRPCResponse.h" + +NS_ASSUME_NONNULL_BEGIN +/** + * SDLSendHapticDataResponse is sent when SDLSendHapticData has been called + */ +@interface SDLSendHapticDataResponse : SDLRPCResponse + +@end + +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLSendHapticDataResponse.m b/SmartDeviceLink/SDLSendHapticDataResponse.m new file mode 100644 index 000000000..b1fa03607 --- /dev/null +++ b/SmartDeviceLink/SDLSendHapticDataResponse.m @@ -0,0 +1,25 @@ + +// +// SDLSendHapticDataResponse.m +// SmartDeviceLink-iOS +// +// Created by Nicole on 8/4/17. +// Copyright © 2017 smartdevicelink. All rights reserved. +// + +#import "SDLNames.h" +#import "SDLSendHapticDataResponse.h" + +NS_ASSUME_NONNULL_BEGIN + +@implementation SDLSendHapticDataResponse + +- (instancetype)init { + if (self = [super initWithName:SDLNameSendHapticDataResponse]) { + } + return self; +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLSpatialStruct.h b/SmartDeviceLink/SDLSpatialStruct.h new file mode 100644 index 000000000..e32e25da8 --- /dev/null +++ b/SmartDeviceLink/SDLSpatialStruct.h @@ -0,0 +1,52 @@ +// +// SDLSpatialStruct.h +// SmartDeviceLink-iOS +// +// Created by Nicole on 8/3/17. +// Copyright © 2017 smartdevicelink. All rights reserved. +// + +#import "SDLRPCStruct.h" + +NS_ASSUME_NONNULL_BEGIN + +/** + * Defines spatial for each user control object for video streaming application + */ +@interface SDLSpatialStruct : SDLRPCStruct + +- (instancetype)initWithId:(UInt32)id x:(NSNumber *)x y:(NSNumber *)y width:(NSNumber *)width height:(NSNumber *)height; + +/** + * A user control spatial identifier + * Required, Integer, 0 - 2,000,000,000 + */ +@property (strong, nonatomic) NSNumber<SDLUInt> *id; + +/** + * The X-coordinate of the user control + * Required, Float + */ +@property (strong, nonatomic) NSNumber<SDLFloat> *x; + +/** + * The Y-coordinate of the user control + * Required, Float + */ +@property (strong, nonatomic) NSNumber<SDLFloat> *y; + +/** + * The width of the user control's bounding rectangle + * Required, Float + */ +@property (strong, nonatomic) NSNumber<SDLFloat> *width; + +/** + * The height of the user control's bounding rectangle + * Required, Float + */ +@property (strong, nonatomic) NSNumber<SDLFloat> *height; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLSpatialStruct.m b/SmartDeviceLink/SDLSpatialStruct.m new file mode 100644 index 000000000..c3cd93e02 --- /dev/null +++ b/SmartDeviceLink/SDLSpatialStruct.m @@ -0,0 +1,74 @@ +// +// SDLSpatialStruct.m +// SmartDeviceLink-iOS +// +// Created by Nicole on 8/3/17. +// Copyright © 2017 smartdevicelink. All rights reserved. +// + +#import "NSMutableDictionary+Store.h" +#import "SDLSpatialStruct.h" +#import "SDLNames.h" + +NS_ASSUME_NONNULL_BEGIN + +@implementation SDLSpatialStruct + +- (instancetype)initWithId:(UInt32)id x:(NSNumber<SDLFloat> *)x y:(NSNumber<SDLFloat> *)y width:(NSNumber<SDLFloat> *)width height:(NSNumber<SDLFloat> *)height { + self = [self init]; + if (!self) { + return nil; + } + + self.id = @(id); + self.x = x; + self.y = y; + self.width = width; + self.height = height; + + return self; +} + +- (void)setId:(NSNumber<SDLInt> *)id { + [store sdl_setObject:id forName:SDLNameId]; +} + +- (NSNumber<SDLInt> *)id { + return [store sdl_objectForName:SDLNameId]; +} + +- (void)setX:(NSNumber<SDLFloat> *)x { + [store sdl_setObject:x forName:SDLNameX]; +} + +- (NSNumber<SDLFloat> *)x { + return [store sdl_objectForName:SDLNameX]; +} + +- (void)setY:(NSNumber<SDLFloat> *)y { + [store sdl_setObject:y forName:SDLNameY]; +} + +- (NSNumber<SDLFloat> *)y { + return [store sdl_objectForName:SDLNameY]; +} + +- (void)setWidth:(NSNumber<SDLFloat> *)width { + [store sdl_setObject:width forName:SDLNameWidth]; +} + +- (NSNumber<SDLFloat> *)width { + return [store sdl_objectForName:SDLNameWidth]; +} + +- (void)setHeight:(NSNumber<SDLFloat> *)height { + [store sdl_setObject:height forName:SDLNameHeight]; +} + +- (NSNumber<SDLFloat> *)height { + return [store sdl_objectForName:SDLNameHeight]; +} + +@end + +NS_ASSUME_NONNULL_END 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/SmartDeviceLink/SmartDeviceLink.h b/SmartDeviceLink/SmartDeviceLink.h index 7f9e4cc40..bc87a7e92 100644 --- a/SmartDeviceLink/SmartDeviceLink.h +++ b/SmartDeviceLink/SmartDeviceLink.h @@ -72,6 +72,7 @@ FOUNDATION_EXPORT const unsigned char SmartDeviceLinkVersionString[]; #import "SDLRegisterAppInterface.h" #import "SDLResetGlobalProperties.h" #import "SDLScrollableMessage.h" +#import "SDLSendHapticData.h" #import "SDLSendLocation.h" #import "SDLSetAppIcon.h" #import "SDLSetDisplayLayout.h" @@ -119,6 +120,7 @@ FOUNDATION_EXPORT const unsigned char SmartDeviceLinkVersionString[]; #import "SDLRegisterAppInterfaceResponse.h" #import "SDLResetGlobalPropertiesResponse.h" #import "SDLScrollableMessageResponse.h" +#import "SDLSendHapticDataResponse.h" #import "SDLSendLocationResponse.h" #import "SDLSetAppIconResponse.h" #import "SDLSetDisplayLayoutResponse.h" @@ -198,6 +200,7 @@ FOUNDATION_EXPORT const unsigned char SmartDeviceLinkVersionString[]; #import "SDLSingleTireStatus.h" #import "SDLSoftButton.h" #import "SDLSoftButtonCapabilities.h" +#import "SDLSpatialStruct.h" #import "SDLStartTime.h" #import "SDLSyncMsgVersion.h" #import "SDLSystemCapability.h" |