summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicoleYarroch <nicole@livio.io>2017-08-03 17:25:57 -0400
committerNicoleYarroch <nicole@livio.io>2017-08-03 17:25:57 -0400
commitfbbdb508e864dd40d1308b82aae62bebcf7ae07c (patch)
tree18f4bcb7afa8c7177fc55106b46738d986a87892
parent0a74258857070851d59c92aa0b252d17aa769c40 (diff)
downloadsdl_ios-fbbdb508e864dd40d1308b82aae62bebcf7ae07c.tar.gz
Added SDLSendHapticData class
Signed-off-by: NicoleYarroch <nicole@livio.io>
-rw-r--r--SmartDeviceLink-iOS.xcodeproj/project.pbxproj8
-rw-r--r--SmartDeviceLink/SDLNames.h2
-rw-r--r--SmartDeviceLink/SDLNames.m2
-rw-r--r--SmartDeviceLink/SDLSendHapticData.h37
-rw-r--r--SmartDeviceLink/SDLSendHapticData.m44
5 files changed, 93 insertions, 0 deletions
diff --git a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj
index 8ccc59fef..5a1caf2c3 100644
--- a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj
+++ b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj
@@ -903,6 +903,8 @@
88EED8381F33AE1700E6C42E /* SDLSpatialStruct.h in Headers */ = {isa = PBXBuildFile; fileRef = 88EED8361F33AE1700E6C42E /* SDLSpatialStruct.h */; };
88EED8391F33AE1700E6C42E /* SDLSpatialStruct.m in Sources */ = {isa = PBXBuildFile; fileRef = 88EED8371F33AE1700E6C42E /* SDLSpatialStruct.m */; };
88EED83B1F33BECB00E6C42E /* SDLSpatialStructSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 88EED83A1F33BECB00E6C42E /* SDLSpatialStructSpec.m */; };
+ 88EED83E1F33C5A400E6C42E /* SDLSendHapticData.h in Headers */ = {isa = PBXBuildFile; fileRef = 88EED83C1F33C5A400E6C42E /* SDLSendHapticData.h */; };
+ 88EED83F1F33C5A400E6C42E /* SDLSendHapticData.m in Sources */ = {isa = PBXBuildFile; fileRef = 88EED83D1F33C5A400E6C42E /* SDLSendHapticData.m */; };
8B7B319A1F2F7B5700BDC38D /* SDLVideoStreamingCodec.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B7B31981F2F7B5700BDC38D /* SDLVideoStreamingCodec.h */; };
8B7B319B1F2F7B5700BDC38D /* SDLVideoStreamingCodec.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B7B31991F2F7B5700BDC38D /* SDLVideoStreamingCodec.m */; };
8B7B319E1F2F7CF700BDC38D /* SDLVideoStreamingProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B7B319C1F2F7CF700BDC38D /* SDLVideoStreamingProtocol.h */; };
@@ -1975,6 +1977,8 @@
88EED8361F33AE1700E6C42E /* SDLSpatialStruct.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLSpatialStruct.h; sourceTree = "<group>"; };
88EED8371F33AE1700E6C42E /* SDLSpatialStruct.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLSpatialStruct.m; sourceTree = "<group>"; };
88EED83A1F33BECB00E6C42E /* SDLSpatialStructSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLSpatialStructSpec.m; sourceTree = "<group>"; };
+ 88EED83C1F33C5A400E6C42E /* SDLSendHapticData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLSendHapticData.h; sourceTree = "<group>"; };
+ 88EED83D1F33C5A400E6C42E /* SDLSendHapticData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLSendHapticData.m; sourceTree = "<group>"; };
8B7B31981F2F7B5700BDC38D /* SDLVideoStreamingCodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLVideoStreamingCodec.h; sourceTree = "<group>"; };
8B7B31991F2F7B5700BDC38D /* SDLVideoStreamingCodec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLVideoStreamingCodec.m; sourceTree = "<group>"; };
8B7B319C1F2F7CF700BDC38D /* SDLVideoStreamingProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLVideoStreamingProtocol.h; sourceTree = "<group>"; };
@@ -2780,6 +2784,8 @@
5D61FB771A84238B00846EE7 /* SDLResetGlobalProperties.m */,
5D61FB8E1A84238B00846EE7 /* SDLScrollableMessage.h */,
5D61FB8F1A84238B00846EE7 /* SDLScrollableMessage.m */,
+ 88EED83C1F33C5A400E6C42E /* SDLSendHapticData.h */,
+ 88EED83D1F33C5A400E6C42E /* SDLSendHapticData.m */,
5DCF76F31ACDBAD300BB647B /* SDLSendLocation.h */,
5DCF76F41ACDBAD300BB647B /* SDLSendLocation.m */,
5D61FB921A84238B00846EE7 /* SDLSetAppIcon.h */,
@@ -4113,6 +4119,7 @@
5D4D67B01D2FE2F900468B4A /* SDLResponseDispatcher.h in Headers */,
5D61FCF21A84238C00846EE7 /* SDLLockScreenStatus.h in Headers */,
5D00AC771F15283E004000D9 /* SDLNavigationCapability.h in Headers */,
+ 88EED83E1F33C5A400E6C42E /* SDLSendHapticData.h in Headers */,
5D61FCD31A84238C00846EE7 /* SDLImageResolution.h in Headers */,
8B7B319E1F2F7CF700BDC38D /* SDLVideoStreamingProtocol.h in Headers */,
5D61FD541A84238C00846EE7 /* SDLProxyListener.h in Headers */,
@@ -4680,6 +4687,7 @@
5D1665C91CF8CA3D00CC4CA1 /* SDLPermissionFilter.m in Sources */,
5D61FDBA1A84238C00846EE7 /* SDLSyncPDataResponse.m in Sources */,
5D61FDDC1A84238C00846EE7 /* SDLTriggerSource.m in Sources */,
+ 88EED83F1F33C5A400E6C42E /* SDLSendHapticData.m in Sources */,
5D16545B1D3E7A1600554D93 /* SDLLifecycleManager.m in Sources */,
E9C32B971AB20BA200F283AF /* SDLTimer.m in Sources */,
5D61FCB61A84238C00846EE7 /* SDLGetVehicleData.m in Sources */,
diff --git a/SmartDeviceLink/SDLNames.h b/SmartDeviceLink/SDLNames.h
index 3bddd9e41..dce38ddc2 100644
--- a/SmartDeviceLink/SDLNames.h
+++ b/SmartDeviceLink/SDLNames.h
@@ -138,6 +138,7 @@ extern SDLName const SDLNameGetWaypointsEnabled;
extern SDLName const SDLNameGPS;
extern SDLName const SDLNameGraphic;
extern SDLName const SDLNameGraphicSupported;
+extern SDLName const SDLNameHapticSpatialData;
extern SDLName const SDLNameHardware;
extern SDLName const SDLNameHashId;
extern SDLName const SDLNameHDOP;
@@ -350,6 +351,7 @@ extern SDLName const SDLNameSecondaryImage;
extern SDLName const SDLNameSecondaryText;
extern SDLName const SDLNameSecond;
extern SDLName const SDLNameSeconds;
+extern SDLName const SDLNameSendHapticData;
extern SDLName const SDLNameSendLocation;
extern SDLName const SDLNameSendLocationEnabled;
extern SDLName const SDLNameSetAppIcon;
diff --git a/SmartDeviceLink/SDLNames.m b/SmartDeviceLink/SDLNames.m
index 16de86756..4ca664188 100644
--- a/SmartDeviceLink/SDLNames.m
+++ b/SmartDeviceLink/SDLNames.m
@@ -135,6 +135,7 @@ SDLName const SDLNameGetWaypointsEnabled = @"getWayPointsEnabled";
SDLName const SDLNameGPS = @"gps";
SDLName const SDLNameGraphic = @"graphic";
SDLName const SDLNameGraphicSupported = @"graphicSupported";
+SDLName const SDLNameHapticSpatialData = @"hapticSpatialData";
SDLName const SDLNameHardware = @"hardware";
SDLName const SDLNameHashId = @"hashID";
SDLName const SDLNameHDOP = @"hdop";
@@ -348,6 +349,7 @@ SDLName const SDLNameSecondaryImage = @"secondaryImage";
SDLName const SDLNameSecondaryText = @"secondaryText";
SDLName const SDLNameSecond = @"second";
SDLName const SDLNameSeconds = @"seconds";
+SDLName const SDLNameSendHapticData = @"sendHapticData";
SDLName const SDLNameSendLocation = @"SendLocation";
SDLName const SDLNameSendLocationEnabled = @"sendLocationEnabled";
SDLName const SDLNameSetAppIcon = @"SetAppIcon";
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