//
//  AIRTCAPLinkProtocol.h
//  RTCXDeviceCenter
//
//  Created by guobingwei on 2026/5/6.
//

#import <Foundation/Foundation.h>
#import <RTCXDeviceCenter/AIRTCAPLinkModel.h>

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSInteger, AIRTCAPLinkError)
{
    AIRTCAPLinkError_NoError = 0,           // Never used
    AIRTCAPLinkError_BadConfigError,        // Invalid configuration
    AIRTCAPLinkError_BadParamError,         // Invalid parameter was passed
    AIRTCAPLinkError_ConnectTimeoutError,   // A connect operation timed out
    AIRTCAPLinkError_ReadTimeoutError,      // A read operation timed out
    AIRTCAPLinkError_WriteTimeoutError,     // A write operation timed out
    AIRTCAPLinkError_ReadMaxedOutError,     // Reached set maxLength without completing
    AIRTCAPLinkError_ClosedError,           // The remote peer closed the connection
    AIRTCAPLinkError_OtherError,            // Description provided in userInfo
};

typedef void (^AIRTCAPLinkConnectCallback)(BOOL isConnect, NSError * _Nonnull error);
typedef void (^AIRTCAPLinkResponseCallback)(BOOL success, id _Nullable response, NSError * _Nullable error);

@protocol AIRTCAPLinkProtocol <NSObject>

/**
 开始连接
 
 @param req  连接，可设置连接超时时间
 @param connectCallback  连接状态callback
 */
- (void)startConnectWithReq:(AIRTCAPLinkConnectReq *)req connectCallback:(AIRTCAPLinkConnectCallback)connectCallback;

/**
 断开连接
 */
- (void)disconnect;

/**
 发送配网信息
 
 @param req  请求参数对象
 @param responseCallback  发送配网信息响应回调
 */
- (void)sendNetworkingWithReq:(AIRTCAPLinkNetworkingReq *)req responseCallback:(AIRTCAPLinkResponseCallback)responseCallback;

@end

NS_ASSUME_NONNULL_END
