RTKAccessoryManager.h
1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//
// RTKAccessoryManager.h
// RTKLEFoundation
//
// Created by jerome_gu on 2020/3/3.
// Copyright © 2020 jerome_gu. All rights reserved.
//
#import <Foundation/Foundation.h>
#ifdef RTK_SDK_IS_STATIC_LIBRARY
#import "RTKAccessory.h"
#else
#import <RTKLEFoundation/RTKAccessory.h>
#endif
NS_ASSUME_NONNULL_BEGIN
@class RTKAccessoryManager;
@protocol RTKAccessoryManagerConnectionListener <NSObject>
/**
* Tell the delegate object that a new accessory connection occured.
*/
- (void)accessoryManager:(RTKAccessoryManager *)manager didDetectConnectionOf:(RTKAccessory *)accessory;
/**
* Tell the delegate object that an accessory disconnected.
*/
- (void)accessoryManager:(RTKAccessoryManager *)manager didDetectDisconnectionOf:(RTKAccessory *)accessory;
@end
/**
* An object that monitoring iAP accessory connection and disconnection events.
*/
@interface RTKAccessoryManager : NSObject
/**
* Initilize with specific protocol.
*/
- (instancetype)initWithProtocolString:(nullable NSString *)protocol;
/**
* A list of all connected accessories that using the same protocol.
*/
@property (nonatomic, readonly) NSArray <RTKAccessory*> *connectedAccessories;
/**
* The delegate object to notify connection events.
*/
@property (weak) id <RTKAccessoryManagerConnectionListener> delegate;
/**
* The specfic protocol this manager interest in.
*/
@property (nonatomic, readonly) NSString *protocol;
@end
NS_ASSUME_NONNULL_END