source: orbit/iOS/Orbit/Orbit/TGAccessoryManager.h

Last change on this file was 66477ef, checked in by Jonathon Horsman <jonathon@…>, 9 years ago

Initial checkin of working iOS app

  • Property mode set to 100644
File size: 1.9 KB
Line 
1//
2//  TGAccessoryManager.h
3//
4//  Copyright 2012 NeuroSky, Inc.. All rights reserved.
5//
6//  The TGAccessoryManager class handles ThinkGear-enabled accessories connected to a device,
7//  sending accessory connect/disconnect and data receipt notifications to a designated delegate.
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
18enum {
19    TGAccessoryTypeDongle = 0,
20    TGAccessoryTypeSimulated = 2,
21    TGAccessoryTypeStream = 3
22};
23typedef 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
Note: See TracBrowser for help on using the repository browser.