summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLProtocolListener.h
blob: 35d6a7623ea5976088cc35974b0551f948a495eb (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
79
80
81
82
83
84
85
//  SDLProtocolListener.h
//

#import "SDLProtocolHeader.h"

@class SDLProtocolMessage;

NS_ASSUME_NONNULL_BEGIN

@protocol SDLProtocolListener <NSObject>

@optional

#pragma mark - v4.7.0 protocol handlers

/**
 *  Called when the message is a start service success message.
 *
 *  @param startServiceACK  A SDLProtocolMessage object
 */
- (void)handleProtocolStartServiceACKMessage:(SDLProtocolMessage *)startServiceACK;

/**
 *  Called when the message is a start service failed message.
 *
 *  @param startServiceNAK  A SDLProtocolMessage object
 */
- (void)handleProtocolStartServiceNAKMessage:(SDLProtocolMessage *)startServiceNAK;

/**
 *  Called when the message is a end service success message.
 *
 *  @param endServiceACK   A SDLProtocolMessage object
 */
- (void)handleProtocolEndServiceACKMessage:(SDLProtocolMessage *)endServiceACK;

/**
 *  Called when the message is a end service failed message.
 *
 *  @param endServiceNAK   A SDLProtocolMessage object
 */
- (void)handleProtocolEndServiceNAKMessage:(SDLProtocolMessage *)endServiceNAK;

#pragma mark - Older protocol handlers

/**
 *  Called when the message is a heartbeat message.
 *
 *  @param session Session number
 */
- (void)handleHeartbeatForSession:(Byte)session;

/**
 *  Called when the message is a heartbeat success message.
 */
- (void)handleHeartbeatACK;

/**
 *  Called when the message is protocol message.
 *
 *  @param msg A SDLProtocolMessage object
 */
- (void)onProtocolMessageReceived:(SDLProtocolMessage *)msg;

/**
 *  Called when the message is a protocol opened message.
 */
- (void)onProtocolOpened;

/**
 *  Called when the message is a protocol closed message.
 */
- (void)onProtocolClosed;

/**
 *  Called when the message is an error message.
 *
 *  @param info The error info message
 *  @param e    The exception
 */
- (void)onError:(NSString *)info exception:(NSException *)e;

@end

NS_ASSUME_NONNULL_END