//
//  RTCXDataChannelDelegate.h
//  RTCXMedia
//
//  Created by Apple on 2025/10/23.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN
@class RTCXDataChannelClient;

/**
 DataChannel通道连接状态枚举
 */
typedef NS_ENUM (NSInteger, RTCXDataChannelConnectState){
    RTCXDataChannelConnected = 1,///< 已连接
    RTCXDataChannelDisconnected = 2,///< 已断连
    RTCXDataChannelConnecting = 3,///< 连接中
};

@protocol RTCXDataChannelDelegate <NSObject>

@optional
/**
 设备透传数据回调
 */
- (void)dataChannelClient:(RTCXDataChannelClient *)dataChannelClient customDataMessageResponse:(RTCXDCCustomDataTransfer *)response;
/**
 通道连接状态回调
 */
- (void)dataChannelClient:(RTCXDataChannelClient *)dataChannelClient connectState:(RTCXDataChannelConnectState)state code:(NSDictionary *)codeDic;
/**
 通道发生错误回调
 */
- (void)dataChannelClient:(RTCXDataChannelClient *)dataChannelClient channelError:(NSDictionary *)errorDic;
@end

NS_ASSUME_NONNULL_END
