forked from revned/proximity
-
Notifications
You must be signed in to change notification settings - Fork 2
/
ProximityBluetoothMonitor.h
48 lines (37 loc) · 1.4 KB
/
ProximityBluetoothMonitor.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
//
// ProximityBluetoothMonitor.h
// Proximity
//
// Created by Dominik Pich on 8/1/12.
//
//
#import <Cocoa/Cocoa.h>
//#import <IOBluetooth/IOBluetooth.h>
//#import <IOBluetoothUI/IOBluetoothUI.h>
#import <IOBluetoothUI/objc/IOBluetoothDeviceSelectorController.h>
//typedef enum _ProximityBluetoothStatus {
// ProximityBluetoothStatusUndefined
// ProximityBluetoothStatusInRange,
// ProximityBluetoothStatusOutOfRange
//} ProximityBluetoothStatus;
NS_ENUM(NSInteger, ProximityBluetoothStatus) {
ProximityBluetoothStatusUndefined,
ProximityBluetoothStatusInRange,
ProximityBluetoothStatusOutOfRange
} ProximityBluetoothStatus;
@class ProximityBluetoothMonitor;
@protocol ProximityBluetoothMonitorDelegate <NSObject>
- (void)proximityBluetoothMonitor:(ProximityBluetoothMonitor*)monitor foundDevice:(IOBluetoothDevice*)device;
- (void)proximityBluetoothMonitor:(ProximityBluetoothMonitor*)monitor lostDevice:(IOBluetoothDevice*)device;
@end
@interface ProximityBluetoothMonitor : NSObject
@property(weak) id<ProximityBluetoothMonitorDelegate> delegate;
@property(nonatomic, assign) NSTimeInterval timeInterval;
@property(assign) BOOL requiredSignalStrength;
@property(retain) IOBluetoothDevice *device; // could be an array and statuses too
@property(readonly) enum ProximityBluetoothStatus priorStatus;
@property(readonly) enum ProximityBluetoothStatus status;
- (void)start;
- (void)stop;
- (void)refresh;
@end