eyeDrops  v2.3
A new approach to detecting eye blinks.
BLEDeviceManager.h
Go to the documentation of this file.
1 
31 #import <CoreBluetooth/CoreBluetooth.h>
32 #import <Foundation/Foundation.h>
33 #import "AppDelegate.h"
34 #import "UserProfile.h"
35 #import "Protocol.h"
36 #import "Settings.h"
37 
43 typedef enum CON_STATE : NSInteger {
50 } CON_STATE;
51 
57 typedef enum USER_NOTIFICATION : NSInteger {
65 
84 @interface BLEDeviceManager : NSObject <CBCentralManagerDelegate, CBPeripheralDelegate> {
85 
89  CBCentralManager *manager;
90 
94  CBPeripheral *peripheral;
95 
99  NSString *lastKnownDevice;
100 
104  CBPeripheral *lastKnownPeripheral;
105 
109  NSString *hardwareState;
110 
114  NSInteger state;
115 
119  bool autoScan;
120 
125 
130  CBCharacteristic *send_characteristic;
131 
136  CBCharacteristic *disconnect_characteristic;
137 
142 
147 
152 
157 
161  NSMutableArray *BLEDevices;
162 
166  NSTimer *repeatingTimer;
167 
171  NSUInteger enforcedBlinks;
172 
177 
182 
186  NSUInteger packageCounter;
187 
192 }
193 
194 
198 + (id)sharedInstance;
199 
203 - (void)scanForDevices;
204 
208 - (void)abortScanning;
209 
215 - (void)connectToDevice:(CBPeripheral *)device;
216 
220 - (void)disconnectFromDevice;
221 
231 - (void)setProfile:(UserProfile *)profile;
232 
240 
246 - (NSUInteger)getEnforcedBlinks;
247 
261 - (void)communicateMessage:(BLE_OUT_MESSAGE)message withData:(NSNumber *)data;
262 
268 - (CBPeripheral *)getConnectedDevice;
269 
275 
281 
287 - (void)calibrationComplete;
288 
295 - (void)wantsBlurring:(BOOL)blurring;
296 
302 - (bool)hasConnection;
303 
307 - (void)requestBatteryLevel;
308 
309 @end
Header file containing the shared settings class.
Header file containing the App Delegate class.
Definition: BLEDeviceManager.h:58
UserProfile * userProfile
Definition: BLEDeviceManager.h:176
A project specific user profile.
Definition: UserProfile.h:42
Definition: BLEDeviceManager.h:63
NSUInteger packageCounter
Definition: BLEDeviceManager.h:186
id sharedInstance()
Definition: BLEDeviceManager.m:39
Definition: BLEDeviceManager.h:45
Definition: BLEDeviceManager.h:59
CBPeripheral * peripheral
Definition: BLEDeviceManager.h:94
CBPeripheral * getConnectedDevice()
Definition: BLEDeviceManager.m:272
BLE_OUT_MESSAGE
This enumeration contains the byte decoded message values for outgoing BLE mesages.
Definition: Protocol.h:38
Definition: BLEDeviceManager.h:44
NSUInteger enforcedBlinks
Definition: BLEDeviceManager.h:171
void scanForDevices()
Definition: BLEDeviceManager.m:147
CON_STATE
This enumeration contains the connection state the device manger is currently in. ...
Definition: BLEDeviceManager.h:43
void requestBatteryLevel()
Definition: BLEDeviceManager.m:767
void disconnectFromDevice()
Definition: BLEDeviceManager.m:254
bool autoConnect
Definition: BLEDeviceManager.h:124
USER_NOTIFICATION
This enumeration contains the different user notification identifiers.
Definition: BLEDeviceManager.h:57
NSUInteger noBlinkTimeInterval
Definition: BLEDeviceManager.h:181
CBCharacteristic * disconnect_characteristic
Definition: BLEDeviceManager.h:136
Header file containing the communication protocol.
void calibrationComplete()
Definition: BLEDeviceManager.m:887
Definition: BLEDeviceManager.h:47
Definition: BLEDeviceManager.h:48
bool hasConnection()
Definition: BLEDeviceManager.m:202
CBPeripheral * lastKnownPeripheral
Definition: BLEDeviceManager.h:104
NSInteger state
Definition: BLEDeviceManager.h:114
float batteryLevel
Definition: BLEDeviceManager.h:191
CBCharacteristic * send_characteristic
Definition: BLEDeviceManager.h:130
Definition: BLEDeviceManager.h:62
NSString * lastKnownDevice
Definition: BLEDeviceManager.h:99
void startCalibrationWithDevice()
Definition: BLEDeviceManager.m:848
NSUInteger getEnforcedBlinks()
Definition: BLEDeviceManager.m:807
UserProfile * getCurrentProfile()
Definition: BLEDeviceManager.m:800
Header file containing the user profile class.
CBCentralManager * manager
Definition: BLEDeviceManager.h:89
bool isCalibrating
Definition: BLEDeviceManager.h:151
Definition: BLEDeviceManager.h:46
bool isConnected
Definition: BLEDeviceManager.h:146
Definition: BLEDeviceManager.h:60
The Bluetooth low energy device manager.
Definition: BLEDeviceManager.h:84
bool autoScan
Definition: BLEDeviceManager.h:119
void abortScanning()
Definition: BLEDeviceManager.m:167
bool loadedService
Definition: BLEDeviceManager.h:141
NSTimer * repeatingTimer
Definition: BLEDeviceManager.h:166
void stopCalibrationWithDevice()
Definition: BLEDeviceManager.m:866
bool wantsBlurring
Definition: BLEDeviceManager.h:156
NSString * hardwareState
Definition: BLEDeviceManager.h:109
NSMutableArray * BLEDevices
Definition: BLEDeviceManager.h:161
Definition: BLEDeviceManager.h:61
Definition: BLEDeviceManager.h:49