Skip to content

Commit

Permalink
Merge pull request #683 from smartdevicelink/feature/SDL_0075_OEM_spe…
Browse files Browse the repository at this point in the history
…cific_HID_support

Implement SDL 0075 OEM Specific Human Interface Device
  • Loading branch information
joeljfischer authored Aug 23, 2017
2 parents 60e8185 + 5977dcd commit a4f1cbe
Show file tree
Hide file tree
Showing 28 changed files with 755 additions and 12 deletions.
8 changes: 6 additions & 2 deletions SmartDeviceLink-iOS.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ s.public_header_files = [
'SmartDeviceLink/SDLRegisterAppInterface.h',
'SmartDeviceLink/SDLResetGlobalProperties.h',
'SmartDeviceLink/SDLScrollableMessage.h',
'SmartDeviceLink/SDLSendHapticData.h',
'SmartDeviceLink/SDLSendLocation.h',
'SmartDeviceLink/SDLSetAppIcon.h',
'SmartDeviceLink/SDLSetDisplayLayout.h',
Expand Down Expand Up @@ -115,6 +116,7 @@ s.public_header_files = [
'SmartDeviceLink/SDLRegisterAppInterfaceResponse.h',
'SmartDeviceLink/SDLResetGlobalPropertiesResponse.h',
'SmartDeviceLink/SDLScrollableMessageResponse.h',
'SmartDeviceLink/SDLSendHapticDataResponse.h',
'SmartDeviceLink/SDLSendLocationResponse.h',
'SmartDeviceLink/SDLSetAppIconResponse.h',
'SmartDeviceLink/SDLSetDisplayLayoutResponse.h',
Expand Down Expand Up @@ -176,13 +178,15 @@ s.public_header_files = [
'SmartDeviceLink/SDLImageResolution.h',
'SmartDeviceLink/SDLKeyboardProperties.h',
'SmartDeviceLink/SDLMenuParams.h',
'SmartDeviceLink/SDLMetadataTags.h',
'SmartDeviceLink/SDLMyKey.h',
'SmartDeviceLink/SDLNavigationCapability.h',
'SmartDeviceLink/SDLOasisAddress.h',
'SmartDeviceLink/SDLParameterPermissions.h',
'SmartDeviceLink/SDLPermissionItem.h',
'SmartDeviceLink/SDLPhoneCapability.h',
'SmartDeviceLink/SDLPresetBankCapabilities.h',
'SmartDeviceLink/SDLRectangle.h',
'SmartDeviceLink/SDLScreenParams.h',
'SmartDeviceLink/SDLSingleTireStatus.h',
'SmartDeviceLink/SDLSoftButton.h',
Expand Down Expand Up @@ -242,6 +246,7 @@ s.public_header_files = [
'SmartDeviceLink/SDLLockScreenStatus.h',
'SmartDeviceLink/SDLMaintenanceModeStatus.h',
'SmartDeviceLink/SDLMediaClockFormat.h',
'SmartDeviceLink/SDLMetadataType.h',
'SmartDeviceLink/SDLPRNDL.h',
'SmartDeviceLink/SDLPermissionStatus.h',
'SmartDeviceLink/SDLPowerModeQualificationStatus.h',
Expand All @@ -254,6 +259,7 @@ s.public_header_files = [
'SmartDeviceLink/SDLResult.h',
'SmartDeviceLink/SDLSamplingRate.h',
'SmartDeviceLink/SDLSoftButtonType.h',
'SmartDeviceLink/SDLHapticRect.h',
'SmartDeviceLink/SDLSpeechCapabilities.h',
'SmartDeviceLink/SDLSystemAction.h',
'SmartDeviceLink/SDLSystemCapabilityType.h',
Expand Down Expand Up @@ -295,8 +301,6 @@ s.public_header_files = [
'SmartDeviceLink/SDLRequestHandler.h',
'SmartDeviceLink/SDLRPCNotificationNotification.h',
'SmartDeviceLink/SDLRPCResponseNotification.h',
'SmartDeviceLink/SDLMetadataTags.h',
'SmartDeviceLink/SDLMetadataType.h'
]

end
50 changes: 49 additions & 1 deletion SmartDeviceLink-iOS.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions SmartDeviceLink.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ s.public_header_files = [
'SmartDeviceLink/SDLRegisterAppInterface.h',
'SmartDeviceLink/SDLResetGlobalProperties.h',
'SmartDeviceLink/SDLScrollableMessage.h',
'SmartDeviceLink/SDLSendHapticData.h',
'SmartDeviceLink/SDLSendLocation.h',
'SmartDeviceLink/SDLSetAppIcon.h',
'SmartDeviceLink/SDLSetDisplayLayout.h',
Expand Down Expand Up @@ -115,6 +116,7 @@ s.public_header_files = [
'SmartDeviceLink/SDLRegisterAppInterfaceResponse.h',
'SmartDeviceLink/SDLResetGlobalPropertiesResponse.h',
'SmartDeviceLink/SDLScrollableMessageResponse.h',
'SmartDeviceLink/SDLSendHapticDataResponse.h',
'SmartDeviceLink/SDLSendLocationResponse.h',
'SmartDeviceLink/SDLSetAppIconResponse.h',
'SmartDeviceLink/SDLSetDisplayLayoutResponse.h',
Expand Down Expand Up @@ -184,6 +186,7 @@ s.public_header_files = [
'SmartDeviceLink/SDLPermissionItem.h',
'SmartDeviceLink/SDLPhoneCapability.h',
'SmartDeviceLink/SDLPresetBankCapabilities.h',
'SmartDeviceLink/SDLRectangle.h',
'SmartDeviceLink/SDLScreenParams.h',
'SmartDeviceLink/SDLSingleTireStatus.h',
'SmartDeviceLink/SDLSoftButton.h',
Expand Down Expand Up @@ -256,6 +259,7 @@ s.public_header_files = [
'SmartDeviceLink/SDLResult.h',
'SmartDeviceLink/SDLSamplingRate.h',
'SmartDeviceLink/SDLSoftButtonType.h',
'SmartDeviceLink/SDLHapticRect.h',
'SmartDeviceLink/SDLSpeechCapabilities.h',
'SmartDeviceLink/SDLSystemAction.h',
'SmartDeviceLink/SDLSystemCapabilityType.h',
Expand Down
2 changes: 1 addition & 1 deletion SmartDeviceLink/SDLFunctionID.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ @implementation SDLFunctionID
- (instancetype)init {
if (self = [super init]) {
functionIDs = [NSDictionary dictionaryWithObjectsAndKeys:
NAMES_reserved, @"0", NAMES_RegisterAppInterface, @"1", NAMES_UnregisterAppInterface, @"2", NAMES_SetGlobalProperties, @"3", NAMES_ResetGlobalProperties, @"4", NAMES_AddCommand, @"5", NAMES_DeleteCommand, @"6", NAMES_AddSubMenu, @"7", NAMES_DeleteSubMenu, @"8", NAMES_CreateInteractionChoiceSet, @"9", NAMES_PerformInteraction, @"10", NAMES_DeleteInteractionChoiceSet, @"11", NAMES_Alert, @"12", NAMES_Show, @"13", NAMES_Speak, @"14", NAMES_SetMediaClockTimer, @"15", NAMES_PerformAudioPassThru, @"16", NAMES_EndAudioPassThru, @"17", NAMES_SubscribeButton, @"18", NAMES_UnsubscribeButton, @"19", NAMES_SubscribeVehicleData, @"20", NAMES_UnsubscribeVehicleData, @"21", NAMES_GetVehicleData, @"22", NAMES_ReadDID, @"23", NAMES_GetDTCs, @"24", NAMES_ScrollableMessage, @"25", NAMES_Slider, @"26", NAMES_ShowConstantTBT, @"27", NAMES_AlertManeuver, @"28", NAMES_UpdateTurnList, @"29", NAMES_ChangeRegistration, @"30", NAMES_GenericResponse, @"31", NAMES_PutFile, @"32", NAMES_DeleteFile, @"33", NAMES_ListFiles, @"34", NAMES_SetAppIcon, @"35", NAMES_SetDisplayLayout, @"36", NAMES_DiagnosticMessage, @"37", NAMES_SystemRequest, @"38", NAMES_SendLocation, @"39", NAMES_DialNumber, @"40", NAMES_GetWaypoints, @"45", NAMES_SubscribeWaypoints, @"46", NAMES_UnsubscribeWaypoints, @"47", NAMES_GetSystemCapability, @"48", NAMES_OnHMIStatus, @"32768", NAMES_OnAppInterfaceUnregistered, @"32769", NAMES_OnButtonEvent, @"32770", NAMES_OnButtonPress, @"32771", NAMES_OnVehicleData, @"32772", NAMES_OnCommand, @"32773", NAMES_OnTBTClientState, @"32774", NAMES_OnDriverDistraction, @"32775", NAMES_OnPermissionsChange, @"32776", NAMES_OnAudioPassThru, @"32777", NAMES_OnLanguageChange, @"32778", NAMES_OnKeyboardInput, @"32779", NAMES_OnTouchEvent, @"32780", NAMES_OnSystemRequest, @"32781", NAMES_OnHashChange, @"32782", NAMES_OnWaypointChange, @"32784",
NAMES_reserved, @"0", NAMES_RegisterAppInterface, @"1", NAMES_UnregisterAppInterface, @"2", NAMES_SetGlobalProperties, @"3", NAMES_ResetGlobalProperties, @"4", NAMES_AddCommand, @"5", NAMES_DeleteCommand, @"6", NAMES_AddSubMenu, @"7", NAMES_DeleteSubMenu, @"8", NAMES_CreateInteractionChoiceSet, @"9", NAMES_PerformInteraction, @"10", NAMES_DeleteInteractionChoiceSet, @"11", NAMES_Alert, @"12", NAMES_Show, @"13", NAMES_Speak, @"14", NAMES_SetMediaClockTimer, @"15", NAMES_PerformAudioPassThru, @"16", NAMES_EndAudioPassThru, @"17", NAMES_SubscribeButton, @"18", NAMES_UnsubscribeButton, @"19", NAMES_SubscribeVehicleData, @"20", NAMES_UnsubscribeVehicleData, @"21", NAMES_GetVehicleData, @"22", NAMES_ReadDID, @"23", NAMES_GetDTCs, @"24", NAMES_ScrollableMessage, @"25", NAMES_Slider, @"26", NAMES_ShowConstantTBT, @"27", NAMES_AlertManeuver, @"28", NAMES_UpdateTurnList, @"29", NAMES_ChangeRegistration, @"30", NAMES_GenericResponse, @"31", NAMES_PutFile, @"32", NAMES_DeleteFile, @"33", NAMES_ListFiles, @"34", NAMES_SetAppIcon, @"35", NAMES_SetDisplayLayout, @"36", NAMES_DiagnosticMessage, @"37", NAMES_SystemRequest, @"38", NAMES_SendLocation, @"39", NAMES_DialNumber, @"40", NAMES_GetWaypoints, @"45", NAMES_SubscribeWaypoints, @"46", NAMES_UnsubscribeWaypoints, @"47", NAMES_GetSystemCapability, @"48", NAMES_SendHapticData, @"49", NAMES_OnHMIStatus, @"32768", NAMES_OnAppInterfaceUnregistered, @"32769", NAMES_OnButtonEvent, @"32770", NAMES_OnButtonPress, @"32771", NAMES_OnVehicleData, @"32772", NAMES_OnCommand, @"32773", NAMES_OnTBTClientState, @"32774", NAMES_OnDriverDistraction, @"32775", NAMES_OnPermissionsChange, @"32776", NAMES_OnAudioPassThru, @"32777", NAMES_OnLanguageChange, @"32778", NAMES_OnKeyboardInput, @"32779", NAMES_OnTouchEvent, @"32780", NAMES_OnSystemRequest, @"32781", NAMES_OnHashChange, @"32782", NAMES_OnWaypointChange, @"32784",

NAMES_EncodedSyncPData,
@"65536",
Expand Down
53 changes: 53 additions & 0 deletions SmartDeviceLink/SDLHapticRect.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
//
// SDLHapticRect.h
// SmartDeviceLink-iOS
//
// Created by Nicole on 8/2/17.
// Copyright © 2017 smartdevicelink. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "SDLRPCStruct.h"

@class SDLRectangle;

/**
* Defines spatial for each user control object for video streaming application
*/
@interface SDLHapticRect : SDLRPCStruct

/**
* @abstract Constructs a newly allocated SDLHapticRect object
*/
- (instancetype)init;

/**
* @abstract Constructs a newly allocated SDLHapticRect object indicated by the dictionary parameter
* @param dict The dictionary to use
*/
- (instancetype)initWithDictionary:(NSMutableDictionary *)dict;

/**
Create a SpatialStruct
@param id The id of the rectangle
@param rect The SDLRectangle to use as the bounding rectangle
@return An new SDLHapticRect object
*/
- (instancetype)initWithId:(NSNumber *)id rect:(SDLRectangle *)rect;

/**
* A user control spatial identifier
* Required, Integer, 0 - 2,000,000,000
*/
@property (strong, nonatomic) NSNumber *id;

/**
The position of the haptic rectangle to be highlighted. The center of this rectangle will be "touched" when a press occurs.
Required
*/
@property (strong, nonatomic) SDLRectangle *rect;

@end
69 changes: 69 additions & 0 deletions SmartDeviceLink/SDLHapticRect.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
//
// SDLHapticRect.m
// SmartDeviceLink-iOS
//
// Created by Nicole on 8/2/17.
// Copyright © 2017 smartdevicelink. All rights reserved.
//

#import "SDLHapticRect.h"

#import "SDLNames.h"
#import "SDLRectangle.h"

@implementation SDLHapticRect

- (instancetype)init {
if (self = [super init]) {
}
return self;
}

- (instancetype)initWithDictionary:(NSMutableDictionary *)dict {
if (self = [super initWithDictionary:dict]) {
}
return self;
}

- (instancetype)initWithId:(NSNumber *)id rect:(SDLRectangle *)rect {
self = [self init];
if (!self) {
return nil;
}

self.id = id;
self.rect = rect;

return self;
}

- (void)setId:(NSNumber *)id {
if (id != nil) {
[store setObject:id forKey:NAMES_id];
} else {
[store removeObjectForKey:NAMES_id];
}
}

- (NSNumber *)id {
return [store objectForKey:NAMES_id];
}

- (void)setRect:(SDLRectangle *)rect {
if (rect != nil) {
[store setObject:rect forKey:NAMES_rect];
} else {
[store removeObjectForKey:NAMES_rect];
}
}

- (SDLRectangle *)rect {
NSObject *obj = store[NAMES_rect];
if (obj == nil || [obj isKindOfClass:SDLRectangle.class]) {
return (SDLRectangle *)obj;
} else {
return [[SDLRectangle alloc] initWithDictionary:(NSMutableDictionary *)obj];
}
}

@end
6 changes: 6 additions & 0 deletions SmartDeviceLink/SDLNames.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,11 @@
#define NAMES_gps @"gps"
#define NAMES_graphic @"graphic"
#define NAMES_graphicSupported @"graphicSupported"
#define NAMES_hapticRectData @"hapticRectData"
#define NAMES_hapticSpatialDataSupported @"hapticSpatialDataSupported"
#define NAMES_hardware @"hardware"
#define NAMES_hashID @"hashID"
#define NAMES_height @"height"
#define NAMES_hdop @"hdop"
#define NAMES_heading @"heading"
#define NAMES_headLampStatus @"headLampStatus"
Expand Down Expand Up @@ -308,6 +311,7 @@
#define NAMES_rearLeftDoorAjar @"rearLeftDoorAjar"
#define NAMES_rearRightDoorAjar @"rearRightDoorAjar"
#define NAMES_reason @"reason"
#define NAMES_rect @"rect"
#define NAMES_RegisterAppInterface @"RegisterAppInterface"
#define NAMES_request @"request"
#define NAMES_requestType @"requestType"
Expand Down Expand Up @@ -340,6 +344,8 @@
#define NAMES_secondaryText @"secondaryText"
#define NAMES_second @"second"
#define NAMES_seconds @"seconds"
#define NAMES_SendHapticData @"SendHapticData"
#define NAMES_SendHapticDataResponse @"SendHapticDataResponse"
#define NAMES_SendLocation @"SendLocation"
#define NAMES_sendLocationEnabled @"sendLocationEnabled"
#define NAMES_SetAppIcon @"SetAppIcon"
Expand Down
1 change: 1 addition & 0 deletions SmartDeviceLink/SDLNotificationConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,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;
Expand Down
2 changes: 2 additions & 0 deletions SmartDeviceLink/SDLNotificationConstants.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
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";
Expand Down Expand Up @@ -117,6 +118,7 @@ @implementation SDLNotificationConstants
SDLDidReceiveRegisterAppInterfaceResponse,
SDLDidReceiveResetGlobalPropertiesResponse,
SDLDidReceiveScrollableMessageResponse,
SDLDidReceiveSendHapticDataResponse,
SDLDidReceiveSendLocationResponse,
SDLDidReceiveSetAppIconResponse,
SDLDidReceiveSetDisplayLayoutResponse,
Expand Down
4 changes: 4 additions & 0 deletions SmartDeviceLink/SDLNotificationDispatcher.m
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ - (void)onScrollableMessageResponse:(SDLScrollableMessageResponse *)response {
[self postRPCResponseNotification:SDLDidReceiveScrollableMessageResponse response:response];
}

- (void)onSendHapticDataResponse:(SDLSendHapticDataResponse *)response {
[self postRPCResponseNotification:SDLDidReceiveSendHapticDataResponse response:response];
}

- (void)onSendLocationResponse:(SDLSendLocationResponse *)response {
[self postRPCResponseNotification:SDLDidReceiveSendLocationResponse response:response];
}
Expand Down
2 changes: 2 additions & 0 deletions SmartDeviceLink/SDLProxyListener.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
@class SDLRegisterAppInterfaceResponse;
@class SDLResetGlobalPropertiesResponse;
@class SDLScrollableMessageResponse;
@class SDLSendHapticDataResponse;
@class SDLSendLocationResponse;
@class SDLSetAppIconResponse;
@class SDLSetDisplayLayoutResponse;
Expand Down Expand Up @@ -125,6 +126,7 @@
- (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;
Expand Down
70 changes: 70 additions & 0 deletions SmartDeviceLink/SDLRectangle.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
//
// SDLRectangle.h
// SmartDeviceLink-iOS
//
// Created by Joel Fischer on 8/23/17.
// Copyright © 2017 smartdevicelink. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "SDLRPCStruct.h"

@interface SDLRectangle : SDLRPCStruct

/**
* @abstract Constructs a newly allocated SDLRectangle object
*/
- (instancetype)init;

/**
* @abstract Constructs a newly allocated SDLRectangle object indicated by the dictionary parameter
* @param dict The dictionary to use
*/
- (instancetype)initWithDictionary:(NSMutableDictionary *)dict;

/**
Create a Rectangle
@param x The top-left x value
@param y The top-left y value
@param width The width
@param height The height
@return An new SDLRectangle object
*/
- (instancetype)initWithX:(NSNumber *)x y:(NSNumber *)y width:(NSNumber *)width height:(NSNumber *)height;

/**
Create a Rectangle from a CGRect
@param rect The rectangle to use
@return An new SDLRectangle object
*/
- (instancetype)initWithCGRect:(CGRect)rect;

/**
* The upper left X-coordinate of the rectangle
* Required, Float
*/
@property (strong, nonatomic) NSNumber *x;

/**
* The upper left Y-coordinate of the rectangle
* Required, Float
*/
@property (strong, nonatomic) NSNumber *y;

/**
* The width of the rectangle
* Required, Float
*/
@property (strong, nonatomic) NSNumber *width;

/**
* The height of the rectangle
* Required, Float
*/
@property (strong, nonatomic) NSNumber *height;


@end
Loading

0 comments on commit a4f1cbe

Please sign in to comment.