summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLProtocolMessageAssembler.h
blob: e83737fb902eea6574d5f80e55f6d0b001a7f828 (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
//  SDLSmartDeviceLinkProtocolMessageAssembler.h
//

#import <Foundation/Foundation.h>

@class SDLProtocolMessage;

NS_ASSUME_NONNULL_BEGIN

typedef void (^SDLMessageAssemblyCompletionHandler)(BOOL done,  SDLProtocolMessage * _Nullable assembledMessage);


@interface SDLProtocolMessageAssembler : NSObject

@property (assign, readonly) UInt8 sessionID;
@property (assign) UInt32 frameCount; // number of consecutive frames required for reassembly
@property (assign) UInt32 expectedBytes;

- (instancetype)initWithSessionID:(UInt8)sessionID;
- (void)handleMessage:(SDLProtocolMessage *)message withCompletionHandler:(SDLMessageAssemblyCompletionHandler)completionHandler;

@end

NS_ASSUME_NONNULL_END