summaryrefslogtreecommitdiff
path: root/SmartDeviceLink-iOS/SmartDeviceLink/SDLProxyFactory.m
blob: 24bd520acfc92922b42754dfb32fa0e1a11e8457 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//  SDLSyncProxyFactory.m
//
//  Copyright (c) 2014 Ford Motor Company. All rights reserved.

#import "SDLProxyFactory.h"

#import "SDLDebugTool.h"
#import "SDLIAPTransport.h"
#import "SDLTCPTransport.h"
#import "SDLProtocol.h"

@implementation SDLProxyFactory

+(SDLProxy*) buildSDLProxyWithListener:(NSObject<SDLProxyListener>*) delegate {
    SDLIAPTransport* transport = [[SDLIAPTransport alloc] init];
    SDLProtocol* protocol = [[SDLProtocol alloc] init];
    SDLProxy *ret = [[SDLProxy alloc] initWithTransport:transport protocol:protocol delegate:delegate];

	return ret;
}

+(SDLProxy*) buildSDLProxyWithListener:(NSObject<SDLProxyListener>*) delegate
                              tcpIPAddress: (NSString*) ipaddress
                                   tcpPort: (NSString*) port {
    
    SDLTCPTransport* transport = [[SDLTCPTransport alloc] initWithEndpoint:ipaddress endpointParam:port];
    SDLProtocol* protocol = [[SDLProtocol alloc] init];
    SDLProxy *ret = [[SDLProxy alloc] initWithTransport:transport protocol:protocol delegate:delegate];

	return ret;
}

@end