├── README.md
├── .DS_Store
├── BLEDemo.xcodeproj
├── xcuserdata
│ └── aaron.xcuserdatad
│ │ ├── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── BLEDemo.xcscheme
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcuserdata
│ │ └── aaron.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
└── project.pbxproj
├── BLEDemo
├── ViewController.h
├── CentralViewController.h
├── PeripheralViewController.h
├── AppDelegate.h
├── main.m
├── ViewController.m
├── Header.h
├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
├── Info.plist
├── AppDelegate.m
├── PeripheralViewController.m
└── CentralViewController.m
├── BLEDemoTests
├── Info.plist
└── BLEDemoTests.m
└── BLEDemoUITests
├── Info.plist
└── BLEDemoUITests.m
/README.md:
--------------------------------------------------------------------------------
1 | # CoreBluetoothDemo
2 | CoreBluetoothDemo做的Demo
3 |
--------------------------------------------------------------------------------
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aaron-2015/CoreBluetoothDemo/HEAD/.DS_Store
--------------------------------------------------------------------------------
/BLEDemo.xcodeproj/xcuserdata/aaron.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/BLEDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/BLEDemo.xcodeproj/project.xcworkspace/xcuserdata/aaron.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aaron-2015/CoreBluetoothDemo/HEAD/BLEDemo.xcodeproj/project.xcworkspace/xcuserdata/aaron.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/BLEDemo/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // BLEDemo
4 | //
5 | // Created by aaron on 16/4/8.
6 | // Copyright © 2016年 aaron. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/BLEDemo/CentralViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // CentralViewController.h
3 | // BLEDemo
4 | //
5 | // Created by aaron on 16/4/8.
6 | // Copyright © 2016年 aaron. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface CentralViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/BLEDemo/PeripheralViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // PeripheralViewController.h
3 | // BLEDemo
4 | //
5 | // Created by aaron on 16/4/8.
6 | // Copyright © 2016年 aaron. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface PeripheralViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/BLEDemo/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // BLEDemo
4 | //
5 | // Created by aaron on 16/4/8.
6 | // Copyright © 2016年 aaron. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 |
16 | @end
17 |
18 |
--------------------------------------------------------------------------------
/BLEDemo/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // BLEDemo
4 | //
5 | // Created by aaron on 16/4/8.
6 | // Copyright © 2016年 aaron. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/BLEDemo/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // BLEDemo
4 | //
5 | // Created by aaron on 16/4/8.
6 | // Copyright © 2016年 aaron. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import
11 |
12 | @interface ViewController ()
13 |
14 | @end
15 |
16 | @implementation ViewController
17 |
18 | - (void)viewDidLoad {
19 | [super viewDidLoad];
20 | // Do any additional setup after loading the view, typically from a nib.
21 | }
22 |
23 | - (void)didReceiveMemoryWarning {
24 | [super didReceiveMemoryWarning];
25 | // Dispose of any resources that can be recreated.
26 | }
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/BLEDemo/Header.h:
--------------------------------------------------------------------------------
1 | //
2 | // Header.h
3 | // BLEDemo
4 | //
5 | // Created by aaron on 16/4/9.
6 | // Copyright © 2016年 aaron. All rights reserved.
7 | //
8 |
9 | #ifndef Header_h
10 | #define Header_h
11 |
12 | #define kPeripheralName @"aaron's Device" //外围设备名称
13 | #define kServiceUUID @"D5DC3450-27EF-4C3F-94D3-1F4AB15631FF" //服务的UUID
14 | #define kNotifyUUID @"6A3D4B29-123D-4F2A-12A8-D5E211411400" //特征的UUID
15 | #define kReadUUID @"6A3D4B29-123D-4F2A-12A8-D5E211411401" //特征的UUID
16 | #define kWriteUUID @"6A3D4B29-123D-4F2A-12A8-D5E211411402" //特征的UUID
17 | #define kRestoreIdentifierKey @"aaron's demo"
18 | #define k2A56 @"2A56" //骑行相关配置数据,此数据包由手机通过 Characteristic Write 的方法传递给码表
19 |
20 |
21 | #endif /* Header_h */
22 |
--------------------------------------------------------------------------------
/BLEDemoTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/BLEDemoUITests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/BLEDemo.xcodeproj/xcuserdata/aaron.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | BLEDemo.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 938906501CB78E590058DC6C
16 |
17 | primary
18 |
19 |
20 | 938906691CB78E590058DC6C
21 |
22 | primary
23 |
24 |
25 | 938906741CB78E590058DC6C
26 |
27 | primary
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/BLEDemoTests/BLEDemoTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // BLEDemoTests.m
3 | // BLEDemoTests
4 | //
5 | // Created by aaron on 16/4/8.
6 | // Copyright © 2016年 aaron. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface BLEDemoTests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation BLEDemoTests
16 |
17 | - (void)setUp {
18 | [super setUp];
19 | // Put setup code here. This method is called before the invocation of each test method in the class.
20 | }
21 |
22 | - (void)tearDown {
23 | // Put teardown code here. This method is called after the invocation of each test method in the class.
24 | [super tearDown];
25 | }
26 |
27 | - (void)testExample {
28 | // This is an example of a functional test case.
29 | // Use XCTAssert and related functions to verify your tests produce the correct results.
30 | }
31 |
32 | - (void)testPerformanceExample {
33 | // This is an example of a performance test case.
34 | [self measureBlock:^{
35 | // Put the code you want to measure the time of here.
36 | }];
37 | }
38 |
39 | @end
40 |
--------------------------------------------------------------------------------
/BLEDemoUITests/BLEDemoUITests.m:
--------------------------------------------------------------------------------
1 | //
2 | // BLEDemoUITests.m
3 | // BLEDemoUITests
4 | //
5 | // Created by aaron on 16/4/8.
6 | // Copyright © 2016年 aaron. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface BLEDemoUITests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation BLEDemoUITests
16 |
17 | - (void)setUp {
18 | [super setUp];
19 |
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 |
22 | // In UI tests it is usually best to stop immediately when a failure occurs.
23 | self.continueAfterFailure = NO;
24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
25 | [[[XCUIApplication alloc] init] launch];
26 |
27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
28 | }
29 |
30 | - (void)tearDown {
31 | // Put teardown code here. This method is called after the invocation of each test method in the class.
32 | [super tearDown];
33 | }
34 |
35 | - (void)testExample {
36 | // Use recording to get started writing UI tests.
37 | // Use XCTAssert and related functions to verify your tests produce the correct results.
38 | }
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/BLEDemo/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "ipad",
35 | "size" : "29x29",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "ipad",
40 | "size" : "29x29",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "40x40",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "40x40",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "76x76",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "76x76",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "83.5x83.5",
66 | "scale" : "2x"
67 | }
68 | ],
69 | "info" : {
70 | "version" : 1,
71 | "author" : "xcode"
72 | }
73 | }
--------------------------------------------------------------------------------
/BLEDemo/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/BLEDemo/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UIBackgroundModes
34 |
35 | bluetooth-central
36 | bluetooth-peripheral
37 |
38 | UISupportedInterfaceOrientations
39 |
40 | UIInterfaceOrientationPortrait
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 | UISupportedInterfaceOrientations~ipad
45 |
46 | UIInterfaceOrientationPortrait
47 | UIInterfaceOrientationPortraitUpsideDown
48 | UIInterfaceOrientationLandscapeLeft
49 | UIInterfaceOrientationLandscapeRight
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/BLEDemo/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // BLEDemo
4 | //
5 | // Created by aaron on 16/4/8.
6 | // Copyright © 2016年 aaron. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 | #import "Header.h"
11 |
12 | @interface AppDelegate ()
13 |
14 | @end
15 |
16 | @implementation AppDelegate
17 |
18 |
19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
20 | // Override point for customization after application launch.
21 |
22 | NSArray *peripheralManagerIdentifiers = launchOptions[UIApplicationLaunchOptionsBluetoothPeripheralsKey];
23 | NSArray *centraManagerIdentifiers = launchOptions[UIApplicationLaunchOptionsBluetoothCentralsKey];
24 |
25 | for (NSString *identifier in centraManagerIdentifiers) {
26 | if ([identifier isEqualToString:kRestoreIdentifierKey]) {
27 |
28 | }
29 | }
30 |
31 | return YES;
32 | }
33 |
34 | - (void)applicationWillResignActive:(UIApplication *)application {
35 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
36 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
37 | }
38 |
39 | - (void)applicationDidEnterBackground:(UIApplication *)application {
40 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
41 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
42 | }
43 |
44 | - (void)applicationWillEnterForeground:(UIApplication *)application {
45 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
46 | }
47 |
48 | - (void)applicationDidBecomeActive:(UIApplication *)application {
49 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
50 | }
51 |
52 | - (void)applicationWillTerminate:(UIApplication *)application {
53 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
54 | }
55 |
56 | @end
57 |
--------------------------------------------------------------------------------
/BLEDemo.xcodeproj/xcuserdata/aaron.xcuserdatad/xcschemes/BLEDemo.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
43 |
49 |
50 |
51 |
52 |
53 |
59 |
60 |
61 |
62 |
63 |
64 |
74 |
76 |
82 |
83 |
84 |
85 |
86 |
87 |
93 |
95 |
101 |
102 |
103 |
104 |
106 |
107 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/BLEDemo/PeripheralViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // PeripheralViewController.m
3 | // BLEDemo
4 | //
5 | // Created by aaron on 16/4/8.
6 | // Copyright © 2016年 aaron. All rights reserved.
7 | //
8 |
9 | #import "PeripheralViewController.h"
10 | #import
11 | #import "Header.h"
12 |
13 |
14 | @interface PeripheralViewController ()
15 | @property (strong, nonatomic) CBPeripheralManager *peripheralManager; //外围设备管理器
16 | @property (strong, nonatomic) NSMutableArray *centralList; //订阅此外围设备特征的中心设备
17 | @property (strong, nonatomic) CBMutableCharacteristic *characteristic; //特征
18 | @property (strong, nonatomic) CBMutableService *service; //服务
19 |
20 | @property (weak, nonatomic) IBOutlet UITextView *logText;
21 |
22 | @end
23 |
24 | @implementation PeripheralViewController
25 |
26 | #pragma mark - life cycle
27 |
28 | - (void)viewDidLoad {
29 | [super viewDidLoad];
30 | // Do any additional setup after loading the view.
31 | }
32 |
33 | #pragma mark - acton
34 |
35 | - (IBAction)start:(UIButton *)sender {
36 |
37 | NSLog(@"启动外设");
38 |
39 | if (_peripheralManager == nil) {
40 | _peripheralManager = [[CBPeripheralManager alloc] initWithDelegate:self queue:nil];
41 | _centralList = [NSMutableArray array];
42 | }
43 |
44 | }
45 |
46 | - (IBAction)update:(UIButton *)sender {
47 |
48 | NSLog(@"更新特征值");
49 | [self updataCharacteristic];
50 | }
51 |
52 | - (void)writeToLogWithText:(NSString *)text{
53 |
54 | NSLog(@"%@",text);
55 | self.logText.text = [NSString stringWithFormat:@"%@\n%@",self.logText.text,text];
56 | }
57 |
58 | #pragma mark - CBPeripheralManagerDelegate
59 |
60 | - (void)peripheralManagerDidUpdateState:(CBPeripheralManager *)peripheral{
61 |
62 |
63 | switch (peripheral.state) {
64 | case CBPeripheralManagerStatePoweredOn:
65 | [self writeToLogWithText:@"外围设备BLE已打开"];
66 |
67 | [self setupService];
68 | break;
69 |
70 | default:
71 | [self writeToLogWithText:@"此设备不支持BLE或未打开蓝牙功能,无法作为外围设备"];
72 | break;
73 | }
74 | }
75 |
76 | - (void)peripheralManager:(CBPeripheralManager *)peripheral didAddService:(CBService *)service error:(nullable NSError *)error{
77 |
78 | NSDictionary *dict = @{CBAdvertisementDataLocalNameKey:kPeripheralName};
79 | [_peripheralManager startAdvertising:dict];
80 | [self writeToLogWithText:@"向外围设备添加了服务"];
81 | }
82 |
83 | - (void)peripheralManagerDidStartAdvertising:(CBPeripheralManager *)peripheral error:(nullable NSError *)error{
84 |
85 | [self writeToLogWithText:@"启动广播..."];
86 | }
87 |
88 |
89 | //订阅特征
90 | - (void)peripheralManager:(CBPeripheralManager *)peripheral central:(CBCentral *)central didSubscribeToCharacteristic:(CBCharacteristic *)characteristic{
91 |
92 | [self writeToLogWithText:[NSString stringWithFormat:@"中心设备:%@ 已订阅特征:%@.",central.identifier.UUIDString,characteristic.UUID]];
93 | if (![_centralList containsObject:central]) {
94 | [_centralList addObject:central];
95 | }
96 |
97 | }
98 |
99 | //取消订阅
100 | - (void)peripheralManager:(CBPeripheralManager *)peripheral central:(CBCentral *)central didUnsubscribeFromCharacteristic:(CBCharacteristic *)characteristic{
101 |
102 | [self writeToLogWithText:[NSString stringWithFormat:@"中心设备:%@ 已取消订阅特征:%@.",central.identifier.UUIDString,characteristic.UUID]];
103 | }
104 |
105 | - (void)peripheralManager:(CBPeripheralManager *)peripheral didReceiveReadRequest:(CBATTRequest *)request{
106 |
107 | [self writeToLogWithText:@"中心设备读外设数据"];
108 | [self writeToLogWithText:[[NSString alloc] initWithData:request.value encoding:NSUTF8StringEncoding]];
109 | }
110 |
111 | -(void)peripheralManager:(CBPeripheralManager *)peripheral willRestoreState:(NSDictionary *)dict{
112 |
113 | [self writeToLogWithText:@"willRestoreState"];
114 | }
115 |
116 | - (void)peripheralManager:(CBPeripheralManager *)peripheral didReceiveWriteRequests:(NSArray *)requests{
117 |
118 | [self writeToLogWithText:@"收到中心写来的数据"];
119 | CBATTRequest *request = requests.lastObject;
120 | [self writeToLogWithText:[[NSString alloc] initWithData:request.value encoding:NSUTF8StringEncoding]];
121 | [peripheral respondToRequest:request withResult:CBATTErrorSuccess];
122 |
123 | }
124 |
125 |
126 | #pragma mark - private method
127 |
128 | //创建服务,特征并添加服务到外围设备
129 | - (void)setupService{
130 |
131 | //可通知的特征
132 | // CBUUID *characteristicUUID = [CBUUID UUIDWithString:kNotifyUUID];
133 | // _characteristic = [[CBMutableCharacteristic alloc] initWithType:characteristicUUID properties:CBCharacteristicPropertyNotify value:nil permissions:CBAttributePermissionsReadable];
134 |
135 | //可读写的特征
136 | CBUUID *UUID2 = [CBUUID UUIDWithString:kWriteUUID];
137 | _characteristic = [[CBMutableCharacteristic alloc] initWithType:UUID2 properties:CBCharacteristicPropertyWrite|CBCharacteristicPropertyNotify value:nil permissions:CBAttributePermissionsWriteEncryptionRequired];
138 | //
139 | //只读的特征
140 | // CBUUID *UUID3 = [CBUUID UUIDWithString:kReadUUID];
141 | // NSData *characteristicValue = [@"aaron才" dataUsingEncoding:NSUTF8StringEncoding];
142 | // _characteristic = [[CBMutableCharacteristic alloc] initWithType:UUID3 properties:CBCharacteristicPropertyRead value:characteristicValue permissions:CBAttributePermissionsReadable];
143 |
144 | CBUUID *serviceUUID = [CBUUID UUIDWithString:kServiceUUID];
145 | _service = [[CBMutableService alloc] initWithType:serviceUUID primary:YES];
146 | [_service setCharacteristics:@[_characteristic]];
147 |
148 | [_peripheralManager addService:_service];
149 |
150 |
151 | }
152 |
153 | - (void)updataCharacteristic{
154 |
155 | NSString *valueStr = [NSString stringWithFormat:@"%@: %@",kPeripheralName,[NSDate date]];
156 | NSData *data = [valueStr dataUsingEncoding:NSUTF8StringEncoding];
157 | [_peripheralManager updateValue:data forCharacteristic:_characteristic onSubscribedCentrals:nil];
158 |
159 | [self writeToLogWithText:[NSString stringWithFormat:@"更新特征值:%@",valueStr]];
160 | }
161 |
162 | @end
163 |
--------------------------------------------------------------------------------
/BLEDemo/CentralViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // CentralViewController.m
3 | // BLEDemo
4 | //
5 | // Created by aaron on 16/4/8.
6 | // Copyright © 2016年 aaron. All rights reserved.
7 | //
8 |
9 | #import "CentralViewController.h"
10 | #import
11 | #import
12 | #import
13 | #import
14 | #import
15 | #import "Header.h"
16 | extern NSString *CTSettingCopyMyPhoneNumber();
17 |
18 | @interface CentralViewController ()
19 |
20 |
21 | @property (nonatomic, strong) CBCentralManager *centralManager; //中心管理者
22 | @property (nonatomic, strong) NSMutableArray *peripherals; //连接的外围设备
23 | @property (nonatomic, strong) CBCharacteristic *curCharacter; //当前服务的特征
24 | @property (nonatomic, strong) CBCharacteristic *teleCharacter; //来电提醒特征
25 | @property (nonatomic, strong) CBCharacteristic *cleanCharacter; //清除数据特征
26 | @property (nonatomic, strong) CBCharacteristic *rideCharacter; //骑行数据特征
27 | @property (nonatomic, strong) CBPeripheral *curPeripherals;
28 |
29 | @property (nonatomic, strong) NSTimer *timer;
30 |
31 | //电话状态
32 | @property (nonatomic, strong) CTCallCenter *callCenter;
33 |
34 | @property (weak, nonatomic) IBOutlet UITextView *logText;
35 |
36 | @property (weak, nonatomic) IBOutlet UITextField *speedText;
37 | @end
38 |
39 | @implementation CentralViewController
40 |
41 | #pragma mark - life cycle
42 |
43 | - (void)viewDidLoad {
44 | [super viewDidLoad];
45 | // Do any additional setup after loading the view.
46 |
47 | //01,设置info.plist
48 | // UIBackgroundModes
49 | //
50 | // bluetooth-central
51 | // bluetooth-peripheral
52 | //
53 |
54 |
55 | //02 ,改变出初始化方式
56 | _centralManager = [[CBCentralManager alloc] initWithDelegate:self
57 | queue:nil
58 | options:@{CBCentralManagerOptionRestoreIdentifierKey:kRestoreIdentifierKey}];
59 | _peripherals = [NSMutableArray array];
60 |
61 | [self getCarrierInfo];
62 | }
63 |
64 | - (void)dealloc{
65 | [_timer invalidate];
66 | }
67 |
68 | - (void)getCarrierInfo {
69 | // 获取运营商信息
70 | CTTelephonyNetworkInfo *info = [[CTTelephonyNetworkInfo alloc] init];
71 | CTCarrier *carrier = info.subscriberCellularProvider;
72 | NSLog(@"carrier:%@", [carrier description]);
73 |
74 | // 如果运营商变化将更新运营商输出
75 | info.subscriberCellularProviderDidUpdateNotifier = ^(CTCarrier *carrier) {
76 | NSLog(@"carrier:%@", [carrier description]);
77 | };
78 |
79 | // 输出手机的数据业务信息
80 | NSLog(@"Radio Access Technology:%@", info.currentRadioAccessTechnology);
81 |
82 | // 监控通话信息
83 | CTCallCenter *center = [[CTCallCenter alloc] init];
84 | _callCenter = center;
85 | center.callEventHandler = ^(CTCall *call) {
86 | NSSet *curCalls = _callCenter.currentCalls;
87 | NSLog(@"current calls:%@", curCalls);
88 | NSLog(@"call:%@", [call description]);
89 | NSLog(@"Number:%@", [self myNumber]);
90 |
91 | if ([call.callState isEqualToString:CTCallStateIncoming]) { //来电
92 | [self UDID2A57WriteforCharacteristic:_teleCharacter withState:CTCallStateIncoming];
93 | [self pause:nil];
94 | }
95 | else if ([call.callState isEqualToString:CTCallStateDisconnected]){ //挂断
96 | [self UDID2A57WriteforCharacteristic:_teleCharacter withState:CTCallStateDisconnected];
97 | [self resume:nil];
98 | }
99 |
100 | };
101 | }
102 |
103 | - (NSString *)myNumber{
104 | return CTSettingCopyMyPhoneNumber();
105 | }
106 |
107 | - (void)writeToLogWithText:(NSString *)text{
108 |
109 | NSLog(@"%@",text);
110 | self.logText.text = [NSString stringWithFormat:@"%@\n%@",self.logText.text,text];
111 | }
112 |
113 | #pragma mark - private method
114 |
115 | - (IBAction)cancelDidClick:(UIButton *)sender {
116 |
117 | [self cancelNotify];
118 | }
119 |
120 | - (IBAction)confignotify:(UIButton *)sender {
121 |
122 | [self configNotify];
123 | }
124 |
125 | - (IBAction)sendData:(UIButton *)sender {
126 |
127 | if (_curCharacter != nil && _curPeripherals !=nil) {
128 | [_curPeripherals writeValue:[@"hello,外设" dataUsingEncoding:NSUTF8StringEncoding] forCharacteristic:_curCharacter type:CBCharacteristicWriteWithResponse];
129 | [self writeToLogWithText:@"写数据给外设"];
130 | }
131 | }
132 |
133 | - (IBAction)start:(UIButton *)sender {
134 | if (![_timer isValid]) {
135 | _timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(UDID2A5BWriteforCharacteristic) userInfo:nil repeats:YES];
136 | }
137 | }
138 |
139 | - (IBAction)pause:(id)sender {
140 | [_timer setFireDate:[NSDate distantFuture]];
141 | }
142 |
143 | - (IBAction)resume:(id)sender {
144 | [_timer setFireDate:[NSDate date]];
145 | }
146 |
147 | - (IBAction)claen:(UIButton *)sender {
148 | [self UDID2A58ReadforCharacteristic];
149 | }
150 |
151 |
152 | //取消订阅
153 | - (void)cancelNotify{
154 |
155 | CBPeripheral *peripheral = _peripherals.firstObject;
156 | [peripheral setNotifyValue:NO forCharacteristic:_curCharacter];
157 | [self writeToLogWithText:@"取消订阅特征通知"];
158 | }
159 |
160 | //订阅特征
161 | - (void)configNotify{
162 |
163 | CBPeripheral *peripheral = _peripherals.firstObject;
164 | [peripheral setNotifyValue:YES forCharacteristic:_curCharacter];
165 | [self writeToLogWithText:@"订阅特征通知"];
166 | }
167 |
168 | #pragma mark - CBCentralManagerDelegate
169 |
170 | - (void)centralManager:(CBCentralManager *)central willRestoreState:(NSDictionary *)dict{
171 |
172 | // NSArray *scanServices = dict[CBCentralManagerRestoredStateScanServicesKey];
173 | // NSArray *scanOptions = dict[CBCentralManagerRestoredStateScanOptionsKey];
174 |
175 | NSArray *peripherals = dict[CBCentralManagerRestoredStatePeripheralsKey];
176 | for (CBPeripheral *peripheral in peripherals) {
177 | [self.peripherals addObject:peripheral];
178 | peripheral.delegate = self;
179 | }
180 | }
181 |
182 | - (void)centralManagerDidUpdateState:(CBCentralManager *)central{
183 |
184 | if (central.state == CBCentralManagerStatePoweredOn) {
185 | [self writeToLogWithText:@"中心设备已打开"];
186 | [_centralManager scanForPeripheralsWithServices:nil options:nil];
187 |
188 | //03,检查是否restore connected peripherals
189 | for (CBPeripheral *peripheral in _peripherals) {
190 | if (peripheral.state == CBPeripheralStateConnected) {
191 | NSUInteger serviceIdx = [peripheral.services indexOfObjectPassingTest:^BOOL(CBService * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
192 | return [obj.UUID isEqual:kServiceUUID];
193 | }];
194 |
195 | if (serviceIdx == NSNotFound) {
196 | [peripheral discoverServices:@[kServiceUUID]];
197 | continue;
198 | }
199 |
200 | CBService *service = peripheral.services[serviceIdx];
201 | NSUInteger charIdx = [service.characteristics indexOfObjectPassingTest:^BOOL(CBCharacteristic * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
202 | return [obj.UUID isEqual:kNotifyUUID];
203 | }];
204 |
205 | if (charIdx == NSNotFound) {
206 | [peripheral discoverCharacteristics:@[kNotifyUUID] forService:service];
207 | continue;
208 | }
209 |
210 | CBCharacteristic *characteristic = service.characteristics[charIdx];
211 | if (!characteristic.isNotifying) {
212 | [peripheral setNotifyValue:YES forCharacteristic:characteristic];
213 | }
214 | }
215 | }
216 |
217 | }else{
218 | [_peripherals removeAllObjects];
219 | }
220 | }
221 |
222 | - (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI{
223 |
224 | [self writeToLogWithText:[NSString stringWithFormat:@"发现外围设备:%@",peripheral]];
225 | // [_centralManager stopScan];
226 | // if ([peripheral.name hasPrefix:@"iP"]|| [peripheral.name hasPrefix:@"aaron"]) {
227 | // if (![_peripherals containsObject:peripheral]) {
228 | // [_peripherals addObject:peripheral];
229 | // }
230 | // [self writeToLogWithText:[NSString stringWithFormat:@"开始连接外围设备--%@",peripheral]];
231 | // [_centralManager connectPeripheral:peripheral options:nil];
232 | // }
233 |
234 | if ([peripheral.name hasPrefix:@"XINGZHE"]) {
235 | [self writeToLogWithText:[NSString stringWithFormat:@"开始连接行者--%@",peripheral]];
236 | [_peripherals addObject:peripheral];
237 | [_centralManager connectPeripheral:peripheral options:nil];
238 | }
239 | }
240 |
241 | - (void)centralManager:(CBCentralManager *)central didConnectPeripheral:(CBPeripheral *)peripheral{
242 |
243 | [_centralManager stopScan];
244 | [self writeToLogWithText:@"连接设备成功"];
245 | peripheral.delegate = self;
246 | _curPeripherals = peripheral;
247 | //外围设备开始寻找服务
248 | [peripheral discoverServices:nil];
249 | }
250 |
251 | #pragma mark - CBPeripheralDelegate
252 |
253 | - (void)peripheral:(CBPeripheral *)peripheral didDiscoverServices:(NSError *)error{
254 |
255 | for (CBService *service in peripheral.services) {
256 | //外围设备查找指定服务中的特征
257 | if ([service.UUID.UUIDString isEqualToString:@"3958"]) {
258 | [self writeToLogWithText:@"已发现可用服务3958"];
259 | [peripheral discoverCharacteristics:nil forService:service]; //指定service UDID
260 | }
261 | }
262 | }
263 |
264 | - (void)peripheral:(CBPeripheral *)peripheral didDiscoverCharacteristicsForService:(nonnull CBService *)service error:(nullable NSError *)error{
265 |
266 | [self writeToLogWithText:@"已发现可用特征"];
267 | for (CBCharacteristic *characteristic in service.characteristics) {
268 |
269 | //情景一:读取
270 | // if (characteristic.properties & CBCharacteristicPropertyRead) {
271 | // if ([characteristic.UUID.UUIDString isEqualToString:kReadUUID]) {
272 | // [peripheral readValueForCharacteristic:characteristic];
273 | // if (characteristic.value) {
274 | // NSString *value=[[NSString alloc]initWithData:characteristic.value encoding:NSUTF8StringEncoding];
275 | // NSLog(@"读取到特征值:%@",value);
276 | // }
277 | // }
278 | // }
279 |
280 | //情景二:通知
281 | // if (characteristic.properties & CBCharacteristicPropertyNotify) {
282 | // if ([characteristic.UUID.UUIDString isEqualToString:kNotifyUUID] || [characteristic.UUID.UUIDString isEqualToString:kWriteUUID]) {
283 | // _curCharacter = characteristic;
284 | // [peripheral setNotifyValue:YES forCharacteristic:characteristic];
285 | // [self writeToLogWithText:@"已订阅特征通知"];
286 | // }
287 | // }
288 |
289 | //情景二:写数据
290 | // if (characteristic.properties & CBCharacteristicPropertyWrite) {
291 | // if ([characteristic.UUID.UUIDString isEqualToString:kWriteUUID]) {
292 | // [peripheral writeValue:[@"hello,外设" dataUsingEncoding:NSUTF8StringEncoding] forCharacteristic:characteristic type:CBCharacteristicWriteWithResponse];
293 | // [self writeToLogWithText:@"写数据给外设"];
294 | //
295 | // _curPeripherals = peripheral;
296 | // _curCharacter = characteristic;
297 | // }
298 | // }
299 |
300 | //2A56
301 | if ( (characteristic.properties & CBCharacteristicPropertyWrite) && [characteristic.UUID.UUIDString isEqualToString:@"2A56"]) {
302 | [self UDID2A56WriteforCharacteristic:characteristic];
303 | }
304 |
305 | //2A57,来电提醒功能
306 | if ( (characteristic.properties & CBCharacteristicPropertyWrite) && [characteristic.UUID.UUIDString isEqualToString:@"2A57"]) {
307 | _teleCharacter = characteristic;
308 | }
309 |
310 | //2A58,清除运动数据功能
311 | if ( (characteristic.properties & CBCharacteristicPropertyRead) && [characteristic.UUID.UUIDString isEqualToString:@"2A58"]) {
312 | _cleanCharacter = characteristic;
313 | }
314 |
315 | //2A5B
316 | if ((characteristic.properties & CBCharacteristicPropertyWrite) &&[characteristic.UUID.UUIDString isEqualToString:@"2A5B"]) {
317 | [self writeToLogWithText:@"2A5B,写骑行数据包"];
318 | _rideCharacter = characteristic;
319 | }
320 | }
321 | }
322 |
323 | //2A5B
324 | - (void)UDID2A5BWriteforCharacteristic{
325 | if ([_rideCharacter.UUID.UUIDString isEqualToString:@"2A5B"]) {
326 |
327 | UInt8 Flag = 8;
328 | UInt16 speed = arc4random()%500;
329 | UInt32 ThirdDst = 100;
330 | UInt32 ThirdTime = 1024;
331 | UInt32 Calorie = 100;
332 | UInt16 Altilitude = 10010;
333 | UInt8 HeartRate = 90;
334 | UInt8 Cadence = 0;
335 | UInt8 AvgCadence = 0;
336 |
337 | Byte array[20];
338 | array[0] = Flag & 0xff;
339 |
340 | array[1] = speed & 0xff;
341 | array[2] = (speed >> 8) &0xff;
342 |
343 | array[3] = ThirdDst &0xff;
344 | array[4] = (ThirdDst >> 8) & 0xff;
345 | array[5] = (ThirdDst >> 16) & 0xff;
346 | array[6] = (ThirdDst >> 24) & 0xff;
347 |
348 | array[7] = ThirdTime &0xff;
349 | array[8] = (ThirdTime >> 8) & 0xff;
350 | array[9] = (ThirdTime >> 16) & 0xff;
351 | array[10] = (ThirdTime >> 24) & 0xff;
352 |
353 | array[11] = Calorie &0xff;
354 | array[12] = (Calorie >> 8) & 0xff;
355 | array[13] = (Calorie >> 16) & 0xff;
356 | array[14] = (Calorie >> 24) & 0xff;
357 |
358 | array[15] = Altilitude & 0xff;
359 | array[16] = (Altilitude >> 8) &0xff;
360 |
361 | array[17] = HeartRate;
362 |
363 | array[18] = Cadence;
364 |
365 | array[19] = AvgCadence;
366 |
367 | NSData *data = [NSData dataWithBytes:array length:20];
368 |
369 | [_curPeripherals writeValue:data forCharacteristic:_rideCharacter type:CBCharacteristicWriteWithResponse];
370 | }
371 | }
372 |
373 | //2A56
374 | - (void)UDID2A56WriteforCharacteristic:(CBCharacteristic *)characteristic{
375 |
376 | if ([characteristic.UUID.UUIDString isEqualToString:@"2A56"]) {
377 | [self writeToLogWithText:@"2A56,初始化骑行相关配置数据"];
378 |
379 | NSDate *date = [NSDate date];
380 | NSDateFormatter *dataFormatter = [[NSDateFormatter alloc] init];
381 | dataFormatter.dateFormat =@"HH:mm:ss";
382 | // NSDateComponents *cmps = [[NSDate date] deltaFromDate:createDate];
383 |
384 | UInt8 Hour = 8;
385 | UInt32 Time = 0;
386 | UInt8 Uint = 1;
387 | UInt16 Perimeter = 1000;
388 | UInt32 Weight = 60000;
389 |
390 | Byte array[12];
391 | array[0] = Hour & 0xff;
392 |
393 | array[1] = Time & 0xff;
394 | array[2] = (Time >> 8) &0xff;
395 | array[3] = (Time >> 16) &0xff;
396 | array[4] = (Time >> 24) &0xff;
397 |
398 | array[5] = Uint & 0xff;
399 |
400 | array[6] = Perimeter & 0xff;
401 | array[7] = (Perimeter >> 8) & 0xff;
402 |
403 | array[8] = Weight & 0xff;
404 | array[9] = (Weight >> 8) & 0xff;
405 | array[10] = (Weight >> 16) & 0xff;
406 | array[11] = (Weight >> 24) & 0xff;
407 |
408 | NSData *data = [NSData dataWithBytes:array length:sizeof(array)];
409 |
410 | [_curPeripherals writeValue:data forCharacteristic:characteristic type:CBCharacteristicWriteWithResponse];
411 | }
412 | }
413 |
414 | //2A57 来点提醒
415 | - (void)UDID2A57WriteforCharacteristic:(CBCharacteristic *)characteristic withState:(NSString *)CTCallState{
416 | if ([characteristic.UUID.UUIDString isEqualToString:@"2A57"]) {
417 |
418 | [self writeToLogWithText:@"来点提醒"];
419 |
420 | UInt8 Hour;
421 | NSString *content;
422 | if ([CTCallState isEqualToString:CTCallStateIncoming]) {
423 | Hour = 1;
424 | content = @"telephoneIncoming";
425 | } else {
426 | Hour = 0;
427 | content = @"telephoneDisconnected";
428 | }
429 |
430 | Byte array[1];
431 | array[0] = Hour;
432 |
433 | NSMutableData *data = [[NSMutableData alloc] init];
434 | [data appendBytes:array length:1];
435 | [data appendData:[content dataUsingEncoding:NSUTF8StringEncoding]];
436 |
437 | [_curPeripherals writeValue:data forCharacteristic:characteristic type:CBCharacteristicWriteWithResponse];
438 | }
439 | }
440 |
441 | //2A58
442 | - (void)UDID2A58ReadforCharacteristic{
443 | if ([_cleanCharacter.UUID.UUIDString isEqualToString:@"2A58"]) {
444 | [self writeToLogWithText:@"清除数据"];
445 | [_timer invalidate];
446 | [_curPeripherals readValueForCharacteristic:_cleanCharacter];
447 | }
448 | }
449 |
450 |
451 | //// int 2 byte
452 | //BYTE *Int2Byte(int nVal)
453 | //{
454 | // BYTE *pByte = new BYTE[4];
455 | // for (int i = 0; i<4;i++)
456 | // {
457 | // pByte[i] = (BYTE)(nVal >> 8*(3-i) & 0xff);
458 | // }
459 | // return pByte;
460 | //}
461 | //
462 | //// byte 2 int
463 | //int Byte2Int(BYTE *pb)
464 | //{
465 | // // assume the length of pb is 4
466 | // int nValue=0;
467 | // for(int i=0;i < 4; i++)
468 | // {
469 | // nValue += ( pb[i] & 0xFF)<<(8*(3-i));
470 | // }
471 | // return nValue;
472 | //}
473 |
474 | - (void)int2bytetest{
475 | Byte array[] = {0};
476 | int nval= 8;
477 | array[0] = nval & 0xff;
478 |
479 | NSLog(@"%s",array);
480 | }
481 |
482 | - (void)peripheral:(CBPeripheral *)peripheral didUpdateNotificationStateForCharacteristic:(nonnull CBCharacteristic *)characteristic error:(nullable NSError *)error{
483 |
484 | NSString *value=[[NSString alloc]initWithData:characteristic.value encoding:NSUTF8StringEncoding];
485 | [self writeToLogWithText:[NSString stringWithFormat:@"读取特征值:%@",value]];
486 | }
487 |
488 | - (void)peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(nonnull CBCharacteristic *)characteristic error:(nullable NSError *)error{
489 |
490 | NSString *value=[[NSString alloc]initWithData:characteristic.value encoding:NSUTF8StringEncoding];
491 | [self writeToLogWithText:[NSString stringWithFormat:@"读取特征值:%@",value]];
492 |
493 | if ([characteristic.UUID.UUIDString isEqualToString:@"2A58"]) {
494 | [self writeToLogWithText:@"清除数据功能"];
495 | }
496 | }
497 |
498 | - (void)peripheral:(CBPeripheral *)peripheral didWriteValueForCharacteristic:(nonnull CBCharacteristic *)characteristic error:(nullable NSError *)error{
499 |
500 | NSString *UDIDString = characteristic.UUID.UUIDString;
501 | [self writeToLogWithText:[NSString stringWithFormat:@"写数据到UDID:%@",UDIDString]];
502 | }
503 |
504 | @end
505 |
--------------------------------------------------------------------------------
/BLEDemo.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 938906561CB78E590058DC6C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 938906551CB78E590058DC6C /* main.m */; };
11 | 938906591CB78E590058DC6C /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 938906581CB78E590058DC6C /* AppDelegate.m */; };
12 | 9389065C1CB78E590058DC6C /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9389065B1CB78E590058DC6C /* ViewController.m */; };
13 | 9389065F1CB78E590058DC6C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9389065D1CB78E590058DC6C /* Main.storyboard */; };
14 | 938906611CB78E590058DC6C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 938906601CB78E590058DC6C /* Assets.xcassets */; };
15 | 938906641CB78E590058DC6C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 938906621CB78E590058DC6C /* LaunchScreen.storyboard */; };
16 | 9389066F1CB78E590058DC6C /* BLEDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 9389066E1CB78E590058DC6C /* BLEDemoTests.m */; };
17 | 9389067A1CB78E590058DC6C /* BLEDemoUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 938906791CB78E590058DC6C /* BLEDemoUITests.m */; };
18 | 93CF23B11CB89A7600662F5B /* CentralViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93CF23AE1CB89A7600662F5B /* CentralViewController.m */; };
19 | 93CF23B21CB89A7600662F5B /* PeripheralViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93CF23B01CB89A7600662F5B /* PeripheralViewController.m */; };
20 | /* End PBXBuildFile section */
21 |
22 | /* Begin PBXContainerItemProxy section */
23 | 9389066B1CB78E590058DC6C /* PBXContainerItemProxy */ = {
24 | isa = PBXContainerItemProxy;
25 | containerPortal = 938906491CB78E590058DC6C /* Project object */;
26 | proxyType = 1;
27 | remoteGlobalIDString = 938906501CB78E590058DC6C;
28 | remoteInfo = BLEDemo;
29 | };
30 | 938906761CB78E590058DC6C /* PBXContainerItemProxy */ = {
31 | isa = PBXContainerItemProxy;
32 | containerPortal = 938906491CB78E590058DC6C /* Project object */;
33 | proxyType = 1;
34 | remoteGlobalIDString = 938906501CB78E590058DC6C;
35 | remoteInfo = BLEDemo;
36 | };
37 | /* End PBXContainerItemProxy section */
38 |
39 | /* Begin PBXFileReference section */
40 | 935925821CB90E410085B62B /* Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Header.h; sourceTree = ""; };
41 | 938906511CB78E590058DC6C /* BLEDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BLEDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
42 | 938906551CB78E590058DC6C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
43 | 938906571CB78E590058DC6C /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
44 | 938906581CB78E590058DC6C /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
45 | 9389065A1CB78E590058DC6C /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
46 | 9389065B1CB78E590058DC6C /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
47 | 9389065E1CB78E590058DC6C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
48 | 938906601CB78E590058DC6C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
49 | 938906631CB78E590058DC6C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
50 | 938906651CB78E590058DC6C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
51 | 9389066A1CB78E590058DC6C /* BLEDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BLEDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
52 | 9389066E1CB78E590058DC6C /* BLEDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BLEDemoTests.m; sourceTree = ""; };
53 | 938906701CB78E590058DC6C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
54 | 938906751CB78E590058DC6C /* BLEDemoUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BLEDemoUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
55 | 938906791CB78E590058DC6C /* BLEDemoUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BLEDemoUITests.m; sourceTree = ""; };
56 | 9389067B1CB78E590058DC6C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
57 | 93CF23AD1CB89A7600662F5B /* CentralViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CentralViewController.h; sourceTree = ""; };
58 | 93CF23AE1CB89A7600662F5B /* CentralViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CentralViewController.m; sourceTree = ""; };
59 | 93CF23AF1CB89A7600662F5B /* PeripheralViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PeripheralViewController.h; sourceTree = ""; };
60 | 93CF23B01CB89A7600662F5B /* PeripheralViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PeripheralViewController.m; sourceTree = ""; };
61 | /* End PBXFileReference section */
62 |
63 | /* Begin PBXFrameworksBuildPhase section */
64 | 9389064E1CB78E590058DC6C /* Frameworks */ = {
65 | isa = PBXFrameworksBuildPhase;
66 | buildActionMask = 2147483647;
67 | files = (
68 | );
69 | runOnlyForDeploymentPostprocessing = 0;
70 | };
71 | 938906671CB78E590058DC6C /* Frameworks */ = {
72 | isa = PBXFrameworksBuildPhase;
73 | buildActionMask = 2147483647;
74 | files = (
75 | );
76 | runOnlyForDeploymentPostprocessing = 0;
77 | };
78 | 938906721CB78E590058DC6C /* Frameworks */ = {
79 | isa = PBXFrameworksBuildPhase;
80 | buildActionMask = 2147483647;
81 | files = (
82 | );
83 | runOnlyForDeploymentPostprocessing = 0;
84 | };
85 | /* End PBXFrameworksBuildPhase section */
86 |
87 | /* Begin PBXGroup section */
88 | 938906481CB78E590058DC6C = {
89 | isa = PBXGroup;
90 | children = (
91 | 938906531CB78E590058DC6C /* BLEDemo */,
92 | 9389066D1CB78E590058DC6C /* BLEDemoTests */,
93 | 938906781CB78E590058DC6C /* BLEDemoUITests */,
94 | 938906521CB78E590058DC6C /* Products */,
95 | );
96 | sourceTree = "";
97 | };
98 | 938906521CB78E590058DC6C /* Products */ = {
99 | isa = PBXGroup;
100 | children = (
101 | 938906511CB78E590058DC6C /* BLEDemo.app */,
102 | 9389066A1CB78E590058DC6C /* BLEDemoTests.xctest */,
103 | 938906751CB78E590058DC6C /* BLEDemoUITests.xctest */,
104 | );
105 | name = Products;
106 | sourceTree = "";
107 | };
108 | 938906531CB78E590058DC6C /* BLEDemo */ = {
109 | isa = PBXGroup;
110 | children = (
111 | 938906571CB78E590058DC6C /* AppDelegate.h */,
112 | 938906581CB78E590058DC6C /* AppDelegate.m */,
113 | 935925821CB90E410085B62B /* Header.h */,
114 | 9389065A1CB78E590058DC6C /* ViewController.h */,
115 | 9389065B1CB78E590058DC6C /* ViewController.m */,
116 | 9389065D1CB78E590058DC6C /* Main.storyboard */,
117 | 93CF23AD1CB89A7600662F5B /* CentralViewController.h */,
118 | 93CF23AE1CB89A7600662F5B /* CentralViewController.m */,
119 | 93CF23AF1CB89A7600662F5B /* PeripheralViewController.h */,
120 | 93CF23B01CB89A7600662F5B /* PeripheralViewController.m */,
121 | 938906621CB78E590058DC6C /* LaunchScreen.storyboard */,
122 | 938906651CB78E590058DC6C /* Info.plist */,
123 | 938906541CB78E590058DC6C /* Supporting Files */,
124 | );
125 | path = BLEDemo;
126 | sourceTree = "";
127 | };
128 | 938906541CB78E590058DC6C /* Supporting Files */ = {
129 | isa = PBXGroup;
130 | children = (
131 | 938906601CB78E590058DC6C /* Assets.xcassets */,
132 | 938906551CB78E590058DC6C /* main.m */,
133 | );
134 | name = "Supporting Files";
135 | sourceTree = "";
136 | };
137 | 9389066D1CB78E590058DC6C /* BLEDemoTests */ = {
138 | isa = PBXGroup;
139 | children = (
140 | 9389066E1CB78E590058DC6C /* BLEDemoTests.m */,
141 | 938906701CB78E590058DC6C /* Info.plist */,
142 | );
143 | path = BLEDemoTests;
144 | sourceTree = "";
145 | };
146 | 938906781CB78E590058DC6C /* BLEDemoUITests */ = {
147 | isa = PBXGroup;
148 | children = (
149 | 938906791CB78E590058DC6C /* BLEDemoUITests.m */,
150 | 9389067B1CB78E590058DC6C /* Info.plist */,
151 | );
152 | path = BLEDemoUITests;
153 | sourceTree = "";
154 | };
155 | /* End PBXGroup section */
156 |
157 | /* Begin PBXNativeTarget section */
158 | 938906501CB78E590058DC6C /* BLEDemo */ = {
159 | isa = PBXNativeTarget;
160 | buildConfigurationList = 9389067E1CB78E590058DC6C /* Build configuration list for PBXNativeTarget "BLEDemo" */;
161 | buildPhases = (
162 | 9389064D1CB78E590058DC6C /* Sources */,
163 | 9389064E1CB78E590058DC6C /* Frameworks */,
164 | 9389064F1CB78E590058DC6C /* Resources */,
165 | );
166 | buildRules = (
167 | );
168 | dependencies = (
169 | );
170 | name = BLEDemo;
171 | productName = BLEDemo;
172 | productReference = 938906511CB78E590058DC6C /* BLEDemo.app */;
173 | productType = "com.apple.product-type.application";
174 | };
175 | 938906691CB78E590058DC6C /* BLEDemoTests */ = {
176 | isa = PBXNativeTarget;
177 | buildConfigurationList = 938906811CB78E590058DC6C /* Build configuration list for PBXNativeTarget "BLEDemoTests" */;
178 | buildPhases = (
179 | 938906661CB78E590058DC6C /* Sources */,
180 | 938906671CB78E590058DC6C /* Frameworks */,
181 | 938906681CB78E590058DC6C /* Resources */,
182 | );
183 | buildRules = (
184 | );
185 | dependencies = (
186 | 9389066C1CB78E590058DC6C /* PBXTargetDependency */,
187 | );
188 | name = BLEDemoTests;
189 | productName = BLEDemoTests;
190 | productReference = 9389066A1CB78E590058DC6C /* BLEDemoTests.xctest */;
191 | productType = "com.apple.product-type.bundle.unit-test";
192 | };
193 | 938906741CB78E590058DC6C /* BLEDemoUITests */ = {
194 | isa = PBXNativeTarget;
195 | buildConfigurationList = 938906841CB78E590058DC6C /* Build configuration list for PBXNativeTarget "BLEDemoUITests" */;
196 | buildPhases = (
197 | 938906711CB78E590058DC6C /* Sources */,
198 | 938906721CB78E590058DC6C /* Frameworks */,
199 | 938906731CB78E590058DC6C /* Resources */,
200 | );
201 | buildRules = (
202 | );
203 | dependencies = (
204 | 938906771CB78E590058DC6C /* PBXTargetDependency */,
205 | );
206 | name = BLEDemoUITests;
207 | productName = BLEDemoUITests;
208 | productReference = 938906751CB78E590058DC6C /* BLEDemoUITests.xctest */;
209 | productType = "com.apple.product-type.bundle.ui-testing";
210 | };
211 | /* End PBXNativeTarget section */
212 |
213 | /* Begin PBXProject section */
214 | 938906491CB78E590058DC6C /* Project object */ = {
215 | isa = PBXProject;
216 | attributes = {
217 | LastUpgradeCheck = 0730;
218 | ORGANIZATIONNAME = aaron;
219 | TargetAttributes = {
220 | 938906501CB78E590058DC6C = {
221 | CreatedOnToolsVersion = 7.3;
222 | DevelopmentTeam = MZAV9G27FP;
223 | };
224 | 938906691CB78E590058DC6C = {
225 | CreatedOnToolsVersion = 7.3;
226 | TestTargetID = 938906501CB78E590058DC6C;
227 | };
228 | 938906741CB78E590058DC6C = {
229 | CreatedOnToolsVersion = 7.3;
230 | TestTargetID = 938906501CB78E590058DC6C;
231 | };
232 | };
233 | };
234 | buildConfigurationList = 9389064C1CB78E590058DC6C /* Build configuration list for PBXProject "BLEDemo" */;
235 | compatibilityVersion = "Xcode 3.2";
236 | developmentRegion = English;
237 | hasScannedForEncodings = 0;
238 | knownRegions = (
239 | en,
240 | Base,
241 | );
242 | mainGroup = 938906481CB78E590058DC6C;
243 | productRefGroup = 938906521CB78E590058DC6C /* Products */;
244 | projectDirPath = "";
245 | projectRoot = "";
246 | targets = (
247 | 938906501CB78E590058DC6C /* BLEDemo */,
248 | 938906691CB78E590058DC6C /* BLEDemoTests */,
249 | 938906741CB78E590058DC6C /* BLEDemoUITests */,
250 | );
251 | };
252 | /* End PBXProject section */
253 |
254 | /* Begin PBXResourcesBuildPhase section */
255 | 9389064F1CB78E590058DC6C /* Resources */ = {
256 | isa = PBXResourcesBuildPhase;
257 | buildActionMask = 2147483647;
258 | files = (
259 | 938906641CB78E590058DC6C /* LaunchScreen.storyboard in Resources */,
260 | 938906611CB78E590058DC6C /* Assets.xcassets in Resources */,
261 | 9389065F1CB78E590058DC6C /* Main.storyboard in Resources */,
262 | );
263 | runOnlyForDeploymentPostprocessing = 0;
264 | };
265 | 938906681CB78E590058DC6C /* Resources */ = {
266 | isa = PBXResourcesBuildPhase;
267 | buildActionMask = 2147483647;
268 | files = (
269 | );
270 | runOnlyForDeploymentPostprocessing = 0;
271 | };
272 | 938906731CB78E590058DC6C /* Resources */ = {
273 | isa = PBXResourcesBuildPhase;
274 | buildActionMask = 2147483647;
275 | files = (
276 | );
277 | runOnlyForDeploymentPostprocessing = 0;
278 | };
279 | /* End PBXResourcesBuildPhase section */
280 |
281 | /* Begin PBXSourcesBuildPhase section */
282 | 9389064D1CB78E590058DC6C /* Sources */ = {
283 | isa = PBXSourcesBuildPhase;
284 | buildActionMask = 2147483647;
285 | files = (
286 | 9389065C1CB78E590058DC6C /* ViewController.m in Sources */,
287 | 938906591CB78E590058DC6C /* AppDelegate.m in Sources */,
288 | 93CF23B11CB89A7600662F5B /* CentralViewController.m in Sources */,
289 | 93CF23B21CB89A7600662F5B /* PeripheralViewController.m in Sources */,
290 | 938906561CB78E590058DC6C /* main.m in Sources */,
291 | );
292 | runOnlyForDeploymentPostprocessing = 0;
293 | };
294 | 938906661CB78E590058DC6C /* Sources */ = {
295 | isa = PBXSourcesBuildPhase;
296 | buildActionMask = 2147483647;
297 | files = (
298 | 9389066F1CB78E590058DC6C /* BLEDemoTests.m in Sources */,
299 | );
300 | runOnlyForDeploymentPostprocessing = 0;
301 | };
302 | 938906711CB78E590058DC6C /* Sources */ = {
303 | isa = PBXSourcesBuildPhase;
304 | buildActionMask = 2147483647;
305 | files = (
306 | 9389067A1CB78E590058DC6C /* BLEDemoUITests.m in Sources */,
307 | );
308 | runOnlyForDeploymentPostprocessing = 0;
309 | };
310 | /* End PBXSourcesBuildPhase section */
311 |
312 | /* Begin PBXTargetDependency section */
313 | 9389066C1CB78E590058DC6C /* PBXTargetDependency */ = {
314 | isa = PBXTargetDependency;
315 | target = 938906501CB78E590058DC6C /* BLEDemo */;
316 | targetProxy = 9389066B1CB78E590058DC6C /* PBXContainerItemProxy */;
317 | };
318 | 938906771CB78E590058DC6C /* PBXTargetDependency */ = {
319 | isa = PBXTargetDependency;
320 | target = 938906501CB78E590058DC6C /* BLEDemo */;
321 | targetProxy = 938906761CB78E590058DC6C /* PBXContainerItemProxy */;
322 | };
323 | /* End PBXTargetDependency section */
324 |
325 | /* Begin PBXVariantGroup section */
326 | 9389065D1CB78E590058DC6C /* Main.storyboard */ = {
327 | isa = PBXVariantGroup;
328 | children = (
329 | 9389065E1CB78E590058DC6C /* Base */,
330 | );
331 | name = Main.storyboard;
332 | sourceTree = "";
333 | };
334 | 938906621CB78E590058DC6C /* LaunchScreen.storyboard */ = {
335 | isa = PBXVariantGroup;
336 | children = (
337 | 938906631CB78E590058DC6C /* Base */,
338 | );
339 | name = LaunchScreen.storyboard;
340 | sourceTree = "";
341 | };
342 | /* End PBXVariantGroup section */
343 |
344 | /* Begin XCBuildConfiguration section */
345 | 9389067C1CB78E590058DC6C /* Debug */ = {
346 | isa = XCBuildConfiguration;
347 | buildSettings = {
348 | ALWAYS_SEARCH_USER_PATHS = NO;
349 | CLANG_ANALYZER_NONNULL = YES;
350 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
351 | CLANG_CXX_LIBRARY = "libc++";
352 | CLANG_ENABLE_MODULES = YES;
353 | CLANG_ENABLE_OBJC_ARC = YES;
354 | CLANG_WARN_BOOL_CONVERSION = YES;
355 | CLANG_WARN_CONSTANT_CONVERSION = YES;
356 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
357 | CLANG_WARN_EMPTY_BODY = YES;
358 | CLANG_WARN_ENUM_CONVERSION = YES;
359 | CLANG_WARN_INT_CONVERSION = YES;
360 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
361 | CLANG_WARN_UNREACHABLE_CODE = YES;
362 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
363 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
364 | COPY_PHASE_STRIP = NO;
365 | DEBUG_INFORMATION_FORMAT = dwarf;
366 | ENABLE_STRICT_OBJC_MSGSEND = YES;
367 | ENABLE_TESTABILITY = YES;
368 | GCC_C_LANGUAGE_STANDARD = gnu99;
369 | GCC_DYNAMIC_NO_PIC = NO;
370 | GCC_NO_COMMON_BLOCKS = YES;
371 | GCC_OPTIMIZATION_LEVEL = 0;
372 | GCC_PREPROCESSOR_DEFINITIONS = (
373 | "DEBUG=1",
374 | "$(inherited)",
375 | );
376 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
377 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
378 | GCC_WARN_UNDECLARED_SELECTOR = YES;
379 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
380 | GCC_WARN_UNUSED_FUNCTION = YES;
381 | GCC_WARN_UNUSED_VARIABLE = YES;
382 | IPHONEOS_DEPLOYMENT_TARGET = 9.3;
383 | MTL_ENABLE_DEBUG_INFO = YES;
384 | ONLY_ACTIVE_ARCH = YES;
385 | SDKROOT = iphoneos;
386 | TARGETED_DEVICE_FAMILY = "1,2";
387 | };
388 | name = Debug;
389 | };
390 | 9389067D1CB78E590058DC6C /* Release */ = {
391 | isa = XCBuildConfiguration;
392 | buildSettings = {
393 | ALWAYS_SEARCH_USER_PATHS = NO;
394 | CLANG_ANALYZER_NONNULL = YES;
395 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
396 | CLANG_CXX_LIBRARY = "libc++";
397 | CLANG_ENABLE_MODULES = YES;
398 | CLANG_ENABLE_OBJC_ARC = YES;
399 | CLANG_WARN_BOOL_CONVERSION = YES;
400 | CLANG_WARN_CONSTANT_CONVERSION = YES;
401 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
402 | CLANG_WARN_EMPTY_BODY = YES;
403 | CLANG_WARN_ENUM_CONVERSION = YES;
404 | CLANG_WARN_INT_CONVERSION = YES;
405 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
406 | CLANG_WARN_UNREACHABLE_CODE = YES;
407 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
408 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
409 | COPY_PHASE_STRIP = NO;
410 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
411 | ENABLE_NS_ASSERTIONS = NO;
412 | ENABLE_STRICT_OBJC_MSGSEND = YES;
413 | GCC_C_LANGUAGE_STANDARD = gnu99;
414 | GCC_NO_COMMON_BLOCKS = YES;
415 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
416 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
417 | GCC_WARN_UNDECLARED_SELECTOR = YES;
418 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
419 | GCC_WARN_UNUSED_FUNCTION = YES;
420 | GCC_WARN_UNUSED_VARIABLE = YES;
421 | IPHONEOS_DEPLOYMENT_TARGET = 9.3;
422 | MTL_ENABLE_DEBUG_INFO = NO;
423 | SDKROOT = iphoneos;
424 | TARGETED_DEVICE_FAMILY = "1,2";
425 | VALIDATE_PRODUCT = YES;
426 | };
427 | name = Release;
428 | };
429 | 9389067F1CB78E590058DC6C /* Debug */ = {
430 | isa = XCBuildConfiguration;
431 | buildSettings = {
432 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
433 | CODE_SIGN_IDENTITY = "iPhone Developer";
434 | INFOPLIST_FILE = BLEDemo/Info.plist;
435 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
436 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
437 | PRODUCT_BUNDLE_IDENTIFIER = com.Biketo.BiketoRabbit;
438 | PRODUCT_NAME = "$(TARGET_NAME)";
439 | PROVISIONING_PROFILE = "";
440 | };
441 | name = Debug;
442 | };
443 | 938906801CB78E590058DC6C /* Release */ = {
444 | isa = XCBuildConfiguration;
445 | buildSettings = {
446 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
447 | CODE_SIGN_IDENTITY = "iPhone Developer";
448 | INFOPLIST_FILE = BLEDemo/Info.plist;
449 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
450 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
451 | PRODUCT_BUNDLE_IDENTIFIER = com.Biketo.BiketoRabbit;
452 | PRODUCT_NAME = "$(TARGET_NAME)";
453 | PROVISIONING_PROFILE = "";
454 | };
455 | name = Release;
456 | };
457 | 938906821CB78E590058DC6C /* Debug */ = {
458 | isa = XCBuildConfiguration;
459 | buildSettings = {
460 | BUNDLE_LOADER = "$(TEST_HOST)";
461 | INFOPLIST_FILE = BLEDemoTests/Info.plist;
462 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
463 | PRODUCT_BUNDLE_IDENTIFIER = BikeTo.BLEDemoTests;
464 | PRODUCT_NAME = "$(TARGET_NAME)";
465 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/BLEDemo.app/BLEDemo";
466 | };
467 | name = Debug;
468 | };
469 | 938906831CB78E590058DC6C /* Release */ = {
470 | isa = XCBuildConfiguration;
471 | buildSettings = {
472 | BUNDLE_LOADER = "$(TEST_HOST)";
473 | INFOPLIST_FILE = BLEDemoTests/Info.plist;
474 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
475 | PRODUCT_BUNDLE_IDENTIFIER = BikeTo.BLEDemoTests;
476 | PRODUCT_NAME = "$(TARGET_NAME)";
477 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/BLEDemo.app/BLEDemo";
478 | };
479 | name = Release;
480 | };
481 | 938906851CB78E590058DC6C /* Debug */ = {
482 | isa = XCBuildConfiguration;
483 | buildSettings = {
484 | INFOPLIST_FILE = BLEDemoUITests/Info.plist;
485 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
486 | PRODUCT_BUNDLE_IDENTIFIER = BikeTo.BLEDemoUITests;
487 | PRODUCT_NAME = "$(TARGET_NAME)";
488 | TEST_TARGET_NAME = BLEDemo;
489 | };
490 | name = Debug;
491 | };
492 | 938906861CB78E590058DC6C /* Release */ = {
493 | isa = XCBuildConfiguration;
494 | buildSettings = {
495 | INFOPLIST_FILE = BLEDemoUITests/Info.plist;
496 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
497 | PRODUCT_BUNDLE_IDENTIFIER = BikeTo.BLEDemoUITests;
498 | PRODUCT_NAME = "$(TARGET_NAME)";
499 | TEST_TARGET_NAME = BLEDemo;
500 | };
501 | name = Release;
502 | };
503 | /* End XCBuildConfiguration section */
504 |
505 | /* Begin XCConfigurationList section */
506 | 9389064C1CB78E590058DC6C /* Build configuration list for PBXProject "BLEDemo" */ = {
507 | isa = XCConfigurationList;
508 | buildConfigurations = (
509 | 9389067C1CB78E590058DC6C /* Debug */,
510 | 9389067D1CB78E590058DC6C /* Release */,
511 | );
512 | defaultConfigurationIsVisible = 0;
513 | defaultConfigurationName = Release;
514 | };
515 | 9389067E1CB78E590058DC6C /* Build configuration list for PBXNativeTarget "BLEDemo" */ = {
516 | isa = XCConfigurationList;
517 | buildConfigurations = (
518 | 9389067F1CB78E590058DC6C /* Debug */,
519 | 938906801CB78E590058DC6C /* Release */,
520 | );
521 | defaultConfigurationIsVisible = 0;
522 | defaultConfigurationName = Release;
523 | };
524 | 938906811CB78E590058DC6C /* Build configuration list for PBXNativeTarget "BLEDemoTests" */ = {
525 | isa = XCConfigurationList;
526 | buildConfigurations = (
527 | 938906821CB78E590058DC6C /* Debug */,
528 | 938906831CB78E590058DC6C /* Release */,
529 | );
530 | defaultConfigurationIsVisible = 0;
531 | defaultConfigurationName = Release;
532 | };
533 | 938906841CB78E590058DC6C /* Build configuration list for PBXNativeTarget "BLEDemoUITests" */ = {
534 | isa = XCConfigurationList;
535 | buildConfigurations = (
536 | 938906851CB78E590058DC6C /* Debug */,
537 | 938906861CB78E590058DC6C /* Release */,
538 | );
539 | defaultConfigurationIsVisible = 0;
540 | defaultConfigurationName = Release;
541 | };
542 | /* End XCConfigurationList section */
543 | };
544 | rootObject = 938906491CB78E590058DC6C /* Project object */;
545 | }
546 |
--------------------------------------------------------------------------------
/BLEDemo/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
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 |
50 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
96 |
104 |
112 |
123 |
131 |
139 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
238 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
--------------------------------------------------------------------------------