summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/private/SDLConnectionManagerType.h
blob: 21cd8d3ab116d567386c17fb770b0c592f9ecdd5 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//
//  SDLConnectionManagerType.h
//  SmartDeviceLink-iOS
//
//  Created by Joel Fischer on 10/21/15.
//  Copyright © 2015 smartdevicelink. All rights reserved.
//

#import "SDLNotificationConstants.h"
#import <Foundation/Foundation.h>

@class SDLRPCRequest;
@class SDLRPCMessage;
@class SDLRegisterAppInterfaceResponse;
@class SDLSystemInfo;

NS_ASSUME_NONNULL_BEGIN

@protocol SDLConnectionManagerType <NSObject>

/// An object describing the properties of the connected module
@property (strong, nonatomic, nullable) SDLSystemInfo *systemInfo;

/**
 *  A special method on the connection manager which is used by managers that must bypass the default block on RPC sends before managers complete setup.
 *
 *  @param request The RPC request to be sent to the remote head unit.
 *  @param handler A completion block called when the response is received.
 */
- (void)sendConnectionManagerRequest:(__kindof SDLRPCRequest *)request withResponseHandler:(nullable SDLResponseHandler)handler;

/**
 *  Sends an RPC of type `SDLRPCRequest` without bypassing the block on RPC sends before managers complete setup.
 *
 *  @param request An RPC of type `SDLRPCRequest` be sent to Core.
 *  @param handler Called when the response is received by Core
 */
- (void)sendConnectionRequest:(__kindof SDLRPCRequest *)request withResponseHandler:(nullable SDLResponseHandler)handler;

/**
 *  Sends an RPC of type `SDLRPCResponse` or `SDLRPCNotification` without bypassing the block on RPC sends before managers complete setup. Unlike requests, responses and notifications sent to Core do not get a response from Core, so no handler is needed.
 *
 *  Do not use to send an RPC of type `SDLRPCRequest`. Instead use `sendConnectionRequest:withResponseHandler:` to send a request.
 *
 *  @param rpc An RPC of type `SDLRPCResponse` or `SDLRPCNotification` to be sent to Core.
 */
- (void)sendConnectionRPC:(__kindof SDLRPCMessage *)rpc;

/**
*  Sends an RPC of type `SDLRPCResponse` or `SDLRPCNotification` and bypasses the block on RPC sends before managers complete setup. Unlike requests, responses and notifications sent to Core do not get a response from Core, so no handler is needed.
*
*  Do not use to send an RPC of type `SDLRPCRequest`. Instead use `sendConnectionRequest:withResponseHandler:` to send a request.
*
*  @param rpc An RPC of type `SDLRPCResponse` or `SDLRPCNotification` to be sent to Core.
*/
- (void)sendConnectionManagerRPC:(__kindof SDLRPCMessage *)rpc;

/**
 *  Sends an array of RPCs of type `Request` asynchronously. The requests are sent without bypassing the block on RPC sends before managers complete setup.
 *
 *  @param requests             An array of RPCs of type `Request`
 *  @param progressHandler      The progress handler is called as each request gets a response from Core.
 *  @param completionHandler    The completion handler is called when all requests have a response from Core.
 */
- (void)sendRequests:(NSArray<SDLRPCRequest *> *)requests progressHandler:(nullable SDLMultipleAsyncRequestProgressHandler)progressHandler completionHandler:(nullable SDLMultipleRequestCompletionHandler)completionHandler;

/**
 *  Sends an array of RPCs of type `Request` sequentially. The requests are sent without bypassing the block on RPC sends before managers complete setup.
 *
 *  @param requests             An array of RPCs of type `Request`
 *  @param progressHandler      The progress handler is called as each request gets a response from Core.
 *  @param completionHandler    The completion handler is called when all requests have a response from Core.
 */
- (void)sendSequentialRequests:(NSArray<SDLRPCRequest *> *)requests progressHandler:(nullable SDLMultipleSequentialRequestProgressHandler)progressHandler completionHandler:(nullable SDLMultipleRequestCompletionHandler)completionHandler;

@end

NS_ASSUME_NONNULL_END