-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAPBeaconManager.h
56 lines (46 loc) · 2.14 KB
/
APBeaconManager.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
51
52
53
54
55
56
//
// APBeaconManager.h
// APBeacons
//
// Created by Ashutosh Priyadarshy on 10/28/13.
// Copyright (c) 2013 EEMe labs. All rights reserved.
//
//
// [P0], [P1], ... [PN]
//
// if (Pi is APBeacon) { Pi in scannedPeripherals }
// if
@import Foundation;
@import CoreBluetooth;
#import "APBeaconRegion.h"
#import "APMutableBeacon.h"
@class APBeaconManager;
@protocol APBeaconManagerDelegate <NSObject>
/*
* When acting as a client send these messages to a client.
*/
- (void)beaconManager:(APBeaconManager *)manager didRangeBeacons:(NSArray *)beacons inRegion:(APBeaconRegion *)region;
- (void)beaconManager:(APBeaconManager *)manager didEnterRegion:(APBeaconRegion *)region;
- (void)beaconManager:(APBeaconManager *)manager didExitRegion:(APBeaconRegion *)region;
- (void)beaconManager:(APBeaconManager *)manager didDetermineState:(APBeaconRegionState)state forRegion:(APBeaconRegion *)region;
/*
* When acting as a server send these messages to a delegate.
*/
- (void)beaconManager:(APBeaconManager *)manager didStartAdvertisingRegion:(APBeaconRegion *)beaconRegion;
- (void)beaconManager:(APBeaconManager *)manager failedToAdvertiseRegion:(APBeaconRegion *)beaconRegion;
@end
@interface APBeaconManager : NSObject <CBCentralManagerDelegate, CBPeripheralManagerDelegate, CBPeripheralDelegate>
@property (weak, nonatomic) id<APBeaconManagerDelegate> delegate;
@property (strong, nonatomic, readonly) CBPeripheralManager *peripheralManager;
@property (strong, nonatomic, readonly) CBCentralManager *centralManager;
@property (strong, nonatomic, readonly) APBeaconRegion *beaconRegion;
@property (strong, nonatomic, readonly) APBeaconService *wildcardBeaconService;
@property (strong, nonatomic, readonly) CBPeripheral *readablePeripheral;
@property (strong, nonatomic, readonly) NSTimer *scanTimer;
@property (strong, nonatomic, readonly) NSMutableDictionary *scannedPeripherals;
@property (strong, nonatomic, readonly) NSMutableDictionary *verifiedAndPopulatedPeripherals;
// Caller uses this to start broadcasting the APBeacon.
-(id)initWithDelegate:(id)delegate;
-(void)startBroadcastingBeaconRegion:(APBeaconRegion *)beaconRegion;
-(void)beginScanningForBeacons;
@end