1 | |
---|
2 | |
---|
3 | |
---|
4 | |
---|
5 | |
---|
6 | |
---|
7 | |
---|
8 | |
---|
9 | |
---|
10 | #import "TGAccessoryDelegate.h" |
---|
11 | |
---|
12 | #import <Foundation/Foundation.h> |
---|
13 | #import <ExternalAccessory/ExternalAccessory.h> |
---|
14 | #import <UIKit/UIKit.h> |
---|
15 | |
---|
16 | #pragma mark ThinkGear accessory types |
---|
17 | |
---|
18 | enum { |
---|
19 | TGAccessoryTypeDongle = 0, |
---|
20 | TGAccessoryTypeSimulated = 2, |
---|
21 | TGAccessoryTypeStream = 3 |
---|
22 | }; |
---|
23 | typedef NSUInteger TGAccessoryType; |
---|
24 | |
---|
25 | @interface TGAccessoryManager : NSObject <EAAccessoryDelegate, NSStreamDelegate> { |
---|
26 | EAAccessory * accessory; |
---|
27 | |
---|
28 | id<TGAccessoryDelegate> delegate; |
---|
29 | NSTimeInterval dispatchInterval; |
---|
30 | |
---|
31 | BOOL connected; |
---|
32 | BOOL rawEnabled; |
---|
33 | BOOL logEnabled; |
---|
34 | |
---|
35 | TGAccessoryType accessoryType; |
---|
36 | |
---|
37 | NSString * protocolString; |
---|
38 | |
---|
39 | int inputAge; |
---|
40 | } |
---|
41 | |
---|
42 | #pragma mark - |
---|
43 | #pragma mark Properties |
---|
44 | |
---|
45 | @property (nonatomic, readonly) EAAccessory * accessory; |
---|
46 | @property (nonatomic, readonly) BOOL connected; |
---|
47 | @property (nonatomic, assign) id<TGAccessoryDelegate> delegate; |
---|
48 | @property (nonatomic, assign) NSTimeInterval dispatchInterval; |
---|
49 | @property (nonatomic, copy) NSString * protocolString; |
---|
50 | |
---|
51 | @property BOOL rawEnabled; |
---|
52 | @property int inputAge; |
---|
53 | |
---|
54 | #pragma mark - |
---|
55 | #pragma mark Messages |
---|
56 | |
---|
57 | + (TGAccessoryManager *)sharedTGAccessoryManager; |
---|
58 | - (void)setupManagerWithInterval:(NSTimeInterval)dispatchIntervalOrNil; |
---|
59 | - (void)setupManagerWithInterval:(NSTimeInterval)dispatchIntervalOrNil forAccessoryType:(TGAccessoryType)type; |
---|
60 | - (void)setupManagerWithInputStream:(NSInputStream *)input OutputStream:(NSOutputStream *)output; |
---|
61 | - (void)teardownManager; |
---|
62 | - (void)startStream; |
---|
63 | - (void)stopStream; |
---|
64 | - (int)getVersion; |
---|
65 | |
---|
66 | - (NSString *)enableLogging; |
---|
67 | - (NSString *)enableLoggingWithOptions:(uint)options; |
---|
68 | - (NSString *)enableLoggingWithPath:(NSString *)path withOptions:(uint)options; |
---|
69 | - (void)stopLogging; |
---|
70 | @end |
---|