Skip to content

Commit

Permalink
Refactor other sendRPCRequest methods to be more generic with sendRPC
Browse files Browse the repository at this point in the history
  • Loading branch information
joeljfischer committed Jan 20, 2015
1 parent a407a76 commit 5cf4cd0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
3 changes: 2 additions & 1 deletion sdl_ios/SmartDeviceLink/SDLInterfaceProtocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- (void)handleBytesFromTransport:(NSData *)receivedData;
- (void)sendStartSessionWithType:(SDLServiceType)sessionType;
- (void)sendEndSessionWithType:(SDLServiceType)sessionType sessionID:(Byte)sessionID;
- (void)sendRPCRequest:(SDLRPCRequest *)rpcRequest;
- (void)sendRPC:(SDLRPCMessage *)message;
- (void)sendRPCRequest:(SDLRPCRequest *)rpcRequest __deprecated_msg("use sendRPC: instead");

@end
4 changes: 3 additions & 1 deletion sdl_ios/SmartDeviceLink/SDLProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
-(void) dispose;
-(void) addDelegate:(NSObject<SDLProxyListener>*) delegate;

-(void) sendRPCRequest:(SDLRPCMessage*) msg;
-(void) sendRPCRequest:(SDLRPCMessage*) msg __deprecated_msg("use sendRPC: instead");
-(void) sendRPC:(SDLRPCMessage *)message;

-(void) handleRpcMessage:(NSDictionary*) msg;

-(NSString*) getProxyVersion;
Expand Down
9 changes: 9 additions & 0 deletions sdl_ios/SmartDeviceLink/SDLProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,15 @@ - (void) onProtocolMessageReceived:(SDLProtocolMessage*) msgData {


#pragma mark - Message sending and recieving
- (void)sendRPC:(SDLRPCMessage *)message {
@try {
[self.protocol sendRPC:message];
} @catch (NSException *exception) {
NSString *logMessage = [NSString stringWithFormat:@"Proxy: Failed to send RPC message: %@", message.name];
[SDLDebugTool logInfo:logMessage withType:SDLDebugType_Debug toOutput:SDLDebugOutput_All toGroup:self.debugConsoleGroupName];
}
}

-(void) sendRPCRequest:(SDLRPCMessage*) msg {
if ([msg isKindOfClass:SDLRPCRequest.class]) {
[self sendRPCRequestPrivate:(SDLRPCRequest *)msg];
Expand Down

0 comments on commit 5cf4cd0

Please sign in to comment.