summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLLifecycleManager.m
diff options
context:
space:
mode:
authorNicoleYarroch <nicole@livio.io>2019-02-19 15:52:31 -0500
committerNicoleYarroch <nicole@livio.io>2019-02-19 15:52:31 -0500
commitb459bd9a75a4d483f599fa0e76c48c9a7c5accfc (patch)
treec16537d6009509094efee37fe61d7e9e57799957 /SmartDeviceLink/SDLLifecycleManager.m
parent4943b8f68f9ff3a9231be05c02361ac616902387 (diff)
downloadsdl_ios-b459bd9a75a4d483f599fa0e76c48c9a7c5accfc.tar.gz
reverted edits to AsynchronousRPCRequestOperation
* reverted uneeded changes made to `SDLAsynchronousRPCRequestOperation` * reverted changes made to `SDLLifecycleManager`’s `sendRequest`
Diffstat (limited to 'SmartDeviceLink/SDLLifecycleManager.m')
-rw-r--r--SmartDeviceLink/SDLLifecycleManager.m17
1 files changed, 13 insertions, 4 deletions
diff --git a/SmartDeviceLink/SDLLifecycleManager.m b/SmartDeviceLink/SDLLifecycleManager.m
index 1e20d8e5c..a543cf890 100644
--- a/SmartDeviceLink/SDLLifecycleManager.m
+++ b/SmartDeviceLink/SDLLifecycleManager.m
@@ -521,12 +521,21 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready";
#pragma mark Sending Requests
- (void)sendRequest:(__kindof SDLRPCMessage *)request {
- [self sendRequest:request withResponseHandler:nil];
+ // Add a correlation ID to the request
+ if ([request isKindOfClass:[SDLRPCRequest class]]) {
+ SDLRPCRequest *requestRPC = (SDLRPCRequest *)request;
+ [self sendRequest:requestRPC withResponseHandler:nil];
+ } else if ([request isKindOfClass:[SDLRPCResponse class]] || [request isKindOfClass:[SDLRPCNotification class]]) {
+
+ } else {
+ SDLLogE(@"Sending an unknown RPC type. The request should be of type request, response or notification");
+ }
+
+ // [self sendRequest:request withResponseHandler:nil];
}
-- (void)sendRequest:(__kindof SDLRPCMessage *)request withResponseHandler:(nullable SDLResponseHandler)handler {
- SDLAsynchronousRPCRequestOperation *op = [[SDLAsynchronousRPCRequestOperation alloc] initWithConnectionManager:self rpc:request responseHandler:handler];
-// SDLAsynchronousRPCRequestOperation *op = [[SDLAsynchronousRPCRequestOperation alloc] initWithConnectionManager:self request:request responseHandler:handler];
+- (void)sendRequest:(SDLRPCRequest *)request withResponseHandler:(nullable SDLResponseHandler)handler {
+ SDLAsynchronousRPCRequestOperation *op = [[SDLAsynchronousRPCRequestOperation alloc] initWithConnectionManager:self request:request responseHandler:handler];
[self.rpcOperationQueue addOperation:op];
}