//
//  RYAggregationAccessory.h
//  SDK
//
//  Created by ldc on 2024/1/8.
//

#import <Foundation/Foundation.h>
#import <RYCommunication/RYResolver.h>
#import <RYCommunication/RYBleAccessory.h>
#import <ExternalAccessory/ExternalAccessory.h>
#import <RYCommunication/RYSocketAccessory.h>
#import <RYCommunication/RYExternalAccessory.h>
#import <RYCommunication/RYSessionManager.h>

NS_ASSUME_NONNULL_BEGIN

@protocol RYAccessory;

__attribute__((deprecated("use RYSharedAccessory")))
@interface RYAggregationAccessory : NSObject <RYAccessory>

@property (nonatomic, assign, readonly) BOOL isBLE;

@property (nonatomic, assign, readonly) BOOL isExternAccessory;

@property (nonatomic, assign, readonly) BOOL isSocket;

@property (nonatomic, strong) id<RYAccessory> accessory;

@property (nonatomic, strong) RYSessionManager *sessionManager;

/**
 *  \~chinese
 *
 *  Session 超时时间
 *
 *  \~english
 *
 *  Session timeout
 *
 */
@property (nonatomic, assign) NSTimeInterval timeout;

/**
 *  \~chinese
 *
 *  创建socket设备对象
 *
 *  @param ip ip
 *  @param port port
 *
 *  \~english
 *
 *  Create socket accessory object
 *
 *  @param ip ip
 *  @param port port
 *
 */
- (instancetype)initWith:(NSString *)ip port:(NSInteger)port;

/**
 *  \~chinese
 *
 *  创建MFI设备对象
 *  @param accessory 系统外设对象
 *  @param protocolString 设备协议
 *
 *  \~english
 *
 *  Create MFI RYExternalAccessory object
 *
 *  @param accessory EAAccessory
 *  @param protocolString MFI protocol
 *
 */
- (instancetype)initWithAccessory:(EAAccessory *)accessory forProtocol:(NSString *)protocolString;

- (instancetype)initWithBleAccessory:(RYBleAccessory *)accessory;

- (instancetype)initWith:(id<RYAccessory>)accessory;

@end

NS_ASSUME_NONNULL_END
