-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGlobalCacheBox.h
50 lines (42 loc) · 1.78 KB
/
GlobalCacheBox.h
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
/*
* GlobalCacheBox.h
* libGlobalCache
*
* Created on 6/27/09.
* Copyright (c) 2009-2013 by NSDex. All rights reserved.
*/
#import <Foundation/Foundation.h>
#import "LLThreadQueue.h"
#import "GCCommand.h"
#import "GCEvent.h"
@interface GlobalCacheBox : NSObject {
NSThread *parentThread; NSObject *parent;
SEL boxConnectionCallback;
NSThread *connectionHandler;
GCBoxModel boxType;
NSString *boxAddress;
NSString *boxMAC;
NSString *boxName;
NSInputStream *iStream;
NSOutputStream *oStream;
NSMutableData *current;
LLThreadQueue *commandQueue;
GCCommand *activeCommand; //Thread Lock
int currentIRID;
bool ready; NSLock *readyLock; //Thread Lock
NSTimer *failTimer;
}
- (id)initWithParent:(NSObject*)p withAddress:(NSString*)address withMAC:(NSString*)mac withName:(NSString*)name ofType:(GCBoxModel)model withCallback:(SEL)cb;
- (void)connect;
- (BOOL)commandsAreWaiting;
- (BOOL)removeCommandFromStack:(GCCommand*)command;
//Commands
- (GCCommand*)getDevices:(id)sender callback:(SEL)cb context:(NSObject*)ct;
- (GCCommand*)getVersion:(int)module sender:(id)sender callback:(SEL)cb context:(NSObject*)ct;
- (GCCommand*)blink:(BOOL)shouldBlink sender:(id)sender callback:(SEL)cb context:(NSObject*)ct;
- (GCCommand*)sendir:(int)module connector:(int)connector frequency:(NSUInteger)frequency count:(int)count offset:(int)offset data:(char*)data
sender:(id)sender callback:(SEL)cb context:(NSObject*)ct;
- (GCCommand*)stopir:(int)module connector:(int)connector sender:(id)sender callback:(SEL)cb context:(NSObject*)ct;
- (GCCommand*)getState:(int)module connector:(int)connector sender:(id)sender callback:(SEL)cb context:(NSObject*)ct;
- (GCCommand*)setState:(BOOL)closed module:(int)module connector:(int)connector sender:(id)sender callback:(SEL)cb context:(NSObject*)ct;
@end