summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicoleYarroch <nicole@livio.io>2019-03-05 12:31:46 -0500
committerNicoleYarroch <nicole@livio.io>2019-03-05 12:31:46 -0500
commit89b94b2c9f4bdd93946f8bda935f7304dbe28ccd (patch)
tree88b7d4ee1516ec29b4d8504948eb648914932aa7
parent772bf2395f979562c41426f4dbe264bc41a3248b (diff)
downloadsdl_ios-89b94b2c9f4bdd93946f8bda935f7304dbe28ccd.tar.gz
Added support for handling new RPC requests
Added support for handling `SetCloudAppProperties` and `GetCloudAppProperties` requests from Core
-rw-r--r--SmartDeviceLink/SDLNotificationConstants.h3
-rw-r--r--SmartDeviceLink/SDLNotificationConstants.m3
-rw-r--r--SmartDeviceLink/SDLNotificationDispatcher.m8
-rw-r--r--SmartDeviceLink/SDLProxyListener.h15
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLNotificationDispatcherSpec.m5
-rw-r--r--SmartDeviceLinkTests/ProtocolSpecs/SDLFunctionIDSpec.m2
6 files changed, 35 insertions, 1 deletions
diff --git a/SmartDeviceLink/SDLNotificationConstants.h b/SmartDeviceLink/SDLNotificationConstants.h
index b22623ef5..88ab06f9c 100644
--- a/SmartDeviceLink/SDLNotificationConstants.h
+++ b/SmartDeviceLink/SDLNotificationConstants.h
@@ -168,6 +168,9 @@ extern SDLNotificationName const SDLDidReceiveUnsubscribeButtonResponse;
extern SDLNotificationName const SDLDidReceiveUnsubscribeVehicleDataResponse;
extern SDLNotificationName const SDLDidReceiveUnsubscribeWaypointsResponse;
+extern SDLNotificationName const SDLDidReceiveSetCloudAppPropertiesRequest;
+extern SDLNotificationName const SDLDidReceiveGetCloudAppPropertiesRequest;
+
/**
* NSNotification names associated with specific RPC notifications.
*/
diff --git a/SmartDeviceLink/SDLNotificationConstants.m b/SmartDeviceLink/SDLNotificationConstants.m
index 6720f780d..43b4dfdf6 100644
--- a/SmartDeviceLink/SDLNotificationConstants.m
+++ b/SmartDeviceLink/SDLNotificationConstants.m
@@ -76,6 +76,9 @@ SDLNotificationName const SDLDidReceiveUnsubscribeButtonResponse = @"com.sdl.res
SDLNotificationName const SDLDidReceiveUnsubscribeVehicleDataResponse = @"com.sdl.response.unsubscribeVehicleData";
SDLNotificationName const SDLDidReceiveUnsubscribeWaypointsResponse = @"com.sdl.response.unsubscribeWaypoints";
+SDLNotificationName const SDLDidReceiveSetCloudAppPropertiesRequest = @"com.sdl.request.setCloudAppProperties";
+SDLNotificationName const SDLDidReceiveGetCloudAppPropertiesRequest = @"com.sdl.request.getCloudAppProperties";
+
#pragma mark - RPC Notifications
SDLNotificationName const SDLDidChangeDriverDistractionStateNotification = @"com.sdl.notification.changeDriverDistractionStateNotification";
SDLNotificationName const SDLDidChangeHMIStatusNotification = @"com.sdl.notification.changeHMIStatus";
diff --git a/SmartDeviceLink/SDLNotificationDispatcher.m b/SmartDeviceLink/SDLNotificationDispatcher.m
index 1f45ea1bd..9fd139d3d 100644
--- a/SmartDeviceLink/SDLNotificationDispatcher.m
+++ b/SmartDeviceLink/SDLNotificationDispatcher.m
@@ -76,6 +76,14 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark Optional Methods
+- (void)onSetCloudAppProperties:(SDLSetCloudAppProperties *)request {
+ // TODO: need to be able to send request
+}
+
+- (void)onGetCloudAppProperties:(SDLGetCloudAppProperties *)request {
+ // TODO: need to be able to send request
+}
+
- (void)onError:(NSException *)e {
NSError *error = [NSError sdl_lifecycle_unknownRemoteErrorWithDescription:e.name andReason:e.reason];
[self postNotificationName:SDLDidReceiveError infoObject:error];
diff --git a/SmartDeviceLink/SDLProxyListener.h b/SmartDeviceLink/SDLProxyListener.h
index b1b7e74b3..81d4fa461 100644
--- a/SmartDeviceLink/SDLProxyListener.h
+++ b/SmartDeviceLink/SDLProxyListener.h
@@ -19,6 +19,7 @@
@class SDLEncodedSyncPDataResponse;
@class SDLEndAudioPassThruResponse;
@class SDLGenericResponse;
+@class SDLGetCloudAppProperties;
@class SDLGetCloudAppPropertiesResponse;
@class SDLGetDTCsResponse;
@class SDLGetInteriorVehicleDataResponse;
@@ -109,6 +110,20 @@ NS_ASSUME_NONNULL_BEGIN
@optional
/**
+ * Called when a `SetCloudAppProperties` request is received from Core
+ *
+ * @param request A SDLSetCloudAppProperties object
+ */
+- (void)onSetCloudAppProperties:(SDLSetCloudAppProperties *)request;
+
+/**
+ * Called when a `GetCloudAppProperties` request is received from Core
+ *
+ * @param request A SDLGetCloudAppProperties object
+ */
+- (void)onGetCloudAppProperties:(SDLGetCloudAppProperties *)request;
+
+/**
* Called when an Add Command Response is received from Core
*
* @param response A SDLAddCommandResponse object
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLNotificationDispatcherSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLNotificationDispatcherSpec.m
index 1ad5bf461..975d55cb5 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLNotificationDispatcherSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLNotificationDispatcherSpec.m
@@ -16,7 +16,10 @@ describe(@"a notification dispatcher", ^{
it(@"should conform to SDLProxyListener", ^{
expect(@([testDispatcher conformsToProtocol:@protocol(SDLProxyListener)])).to(beTruthy());
-
+
+ expect(@([testDispatcher respondsToSelector:@selector(onSetCloudAppProperties:)])).to(beTruthy());
+ expect(@([testDispatcher respondsToSelector:@selector(onGetCloudAppProperties:)])).to(beTruthy());
+
expect(@([testDispatcher respondsToSelector:@selector(onOnDriverDistraction:)])).to(beTruthy());
expect(@([testDispatcher respondsToSelector:@selector(onOnHMIStatus:)])).to(beTruthy());
expect(@([testDispatcher respondsToSelector:@selector(onProxyClosed)])).to(beTruthy());
diff --git a/SmartDeviceLinkTests/ProtocolSpecs/SDLFunctionIDSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/SDLFunctionIDSpec.m
index 2e3b34b52..322c410eb 100644
--- a/SmartDeviceLinkTests/ProtocolSpecs/SDLFunctionIDSpec.m
+++ b/SmartDeviceLinkTests/ProtocolSpecs/SDLFunctionIDSpec.m
@@ -138,6 +138,8 @@ describe(@"GetFunctionID Tests", ^ {
expect([functionID functionIdForName:SDLNameUnsubscribeWayPoints]).to(equal(@47));
expect([functionID functionIdForName:SDLNameGetSystemCapability]).to(equal(@48));
expect([functionID functionIdForName:SDLNameSendHapticData]).to(equal(@49));
+ expect([functionID functionIdForName:SDLNameSetCloudAppProperties]).to(equal(@50));
+ expect([functionID functionIdForName:SDLNameGetCloudAppProperties]).to(equal(@51));
expect([functionID functionIdForName:SDLNameOnHMIStatus]).to(equal(@32768));
expect([functionID functionIdForName:SDLNameOnAppInterfaceUnregistered]).to(equal(@32769));
expect([functionID functionIdForName:SDLNameOnButtonEvent]).to(equal(@32770));