//
//  YCKDataEngine.h
//  YCKit
//
//  Created by 徐家骏 on 2020/6/17.
//  Copyright © 2020 徐家骏. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <YCKSdwan/YCKSdwan.h>
#import "YCKDataFrameContext.h"
#import "YCKWhiteboard.h"

NS_ASSUME_NONNULL_BEGIN

@protocol YCKDataEngineDelegate <NSObject>

- (void)onDataReceived:(NSData *)data withContext:(YCKDataFrameContext *)frameContext from:(int64_t)from;

@end

@interface YCKDataEngine : NSObject<YCKTransportSessionDataDelegate>

@property (nonatomic, weak)  id<YCKDataEngineDelegate>     delegate;
@property (nonatomic, strong, nullable) YCKTransportSession *transportSession; //后改为strong，因为会引起crash

+ (instancetype)sharedInstance;
- (void)Start;
- (void)Stop;

- (void)sendData:(NSData *)data withContext:(YCKDataFrameContext *)frameContext;
- (void)sendData:(NSData *)data withContext:(YCKDataFrameContext *)frameContext to:(int64_t)uid;

- (void)registerWhiteboard:(YCKWhiteboard *)whiteboard forWid:(int)wid;
- (void)unRegisterWhiteboard:(YCKWhiteboard *)whiteboard forWid:(int)wid;

@end

NS_ASSUME_NONNULL_END
