Bluetooth LE & iBeacons by Javier Chávarri (NSBarcelona)

21
Bluetooth LE & iBeacons 1 Javier Chávarri @javierwchavarri

description

 

Transcript of Bluetooth LE & iBeacons by Javier Chávarri (NSBarcelona)

Page 1: Bluetooth LE & iBeacons by Javier Chávarri (NSBarcelona)

Bluetooth LE & iBeacons

���1

Javier Chávarri @javierwchavarri

Page 2: Bluetooth LE & iBeacons by Javier Chávarri (NSBarcelona)

Bluetooth LE

• Aka Bluetooth Smart

• Released in June 2010

• Completely new specification (by Bluetooth SIG)

• Designed to enable very low power devices to run for years

• Asynchronous

• NOT connection oriented���2

Page 3: Bluetooth LE & iBeacons by Javier Chávarri (NSBarcelona)

What is Bluetooth LE good for?

• Connecting things we carry with us (watches, tags, body sensors)

• Accessing the things around us

• Low duty cycle M2M communication

• Communication within a system (wheels to car)

• Connecting anything that has intrinsic data to the Internet

���3

Page 4: Bluetooth LE & iBeacons by Javier Chávarri (NSBarcelona)

Prediction

•Bluetooth LE will be to smartphones what USB has been to desktop PCs: universal peripheral connectivity

���4

Page 5: Bluetooth LE & iBeacons by Javier Chávarri (NSBarcelona)

Our case

•Connect a BLE device to an iPhone

���5

Page 6: Bluetooth LE & iBeacons by Javier Chávarri (NSBarcelona)

iBeacons

• Region monitor

• Micro locations

• Range awareness

• Indoor

• Awake your app by push notifications using iBeacons

• In app notifications when user enters / leaves a region

���6

Page 7: Bluetooth LE & iBeacons by Javier Chávarri (NSBarcelona)

What can be an iBeacon?

• Third party BLE devices or iOS devices

���7

Page 8: Bluetooth LE & iBeacons by Javier Chávarri (NSBarcelona)

All iOS devices?• NO • Only these devices:

• iPhone 5 • iPhone 4S • iPad mini • iPad with Retina display (4th gen) • iPad (3rd gen) • iPod touch (5th gen) 

• with iOS Version 5.1.1 or above.

���8

Page 9: Bluetooth LE & iBeacons by Javier Chávarri (NSBarcelona)

Other devices

• Android devices with Bluetooth 4.0 and Android 4.3 and later (Samsung Galaxy S3/S4, Samsung Galaxy Note II, HTC One, Nexus 7 2013 edition, Nexus 4, HTC Butterfly, Droid DNA)

• MacIntosh computers equipped with OS X 10.9 (Mavericks) and Bluetooth 4.0 using the MacBeacon application from Radius Networks.

���9

Page 10: Bluetooth LE & iBeacons by Javier Chávarri (NSBarcelona)

CLBeaconRegion• Defines a type of region that is based on the device’s

proximity to a Bluetooth beacon (or many) • One “Region” does not mean physically close, could be all

over the world • proximityUUID: identifier that you use to identify your

company’s beacons • mayor: number could represent a group of beacons in the

region • minor: is the unique identifier for the beacon

���10

Page 11: Bluetooth LE & iBeacons by Javier Chávarri (NSBarcelona)

Emitter

���11

NSUUID *uuid = [[NSUUID alloc] initWithUUIDString:@"23542266-18D1-4FE4-B4A1-23F8195B9D39"]; ! self.beaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:uuid

major:1 minor:4 identifier:@"com.devfright.myRegion"];

Page 12: Bluetooth LE & iBeacons by Javier Chávarri (NSBarcelona)

Receiver

���12

- (void)initRegion { NSUUID *uuid = [[NSUUID alloc] initWithUUIDString:@"B9407F30-F5F8-466E-AFF9-25556B57FE6D"]; self.beaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:uuid identifier:@"com.devfright.myRegion"]; [self.locationManager startMonitoringForRegion:self.beaconRegion]; }

Page 14: Bluetooth LE & iBeacons by Javier Chávarri (NSBarcelona)

CLLocationManager delegate

���14

-(void)locationManager:(CLLocationManager *)manager didRangeBeacons:(NSArray *)beacons inRegion:(CLBeaconRegion *)region { CLBeacon *beacon = [[CLBeacon alloc] init]; beacon = [beacons lastObject]; self.beaconFoundLabel.text = @"Yes"; if (beacon.proximity == CLProximityUnknown) { NSLog(@"Unknown Proximity"); } else if (beacon.proximity == CLProximityImmediate) { NSLog(@"Immediate"); } else if (beacon.proximity == CLProximityNear) { NSLog(@"Near"); } else if (beacon.proximity == CLProximityFar) { NSLog(@"Far"); } } !

Page 16: Bluetooth LE & iBeacons by Javier Chávarri (NSBarcelona)

Case uses

Page 17: Bluetooth LE & iBeacons by Javier Chávarri (NSBarcelona)

Dynamic content updates���17

Page 18: Bluetooth LE & iBeacons by Javier Chávarri (NSBarcelona)

Find real world assistance���18

Page 19: Bluetooth LE & iBeacons by Javier Chávarri (NSBarcelona)

Sources

• http://www.devfright.com/ibeacons-tutorial-ios-7-clbeaconregion-clbeacon/

• http://www.slideshare.net/verifone/bluetooth-low-energy-beacons-and-retail-final

• Apple documentation on CLBeacon and CLBeaconRegion

• http://en.wikipedia.org/wiki/IBeacon

���19

Page 20: Bluetooth LE & iBeacons by Javier Chávarri (NSBarcelona)

An exampleTriangulation using iBeacons

Page 21: Bluetooth LE & iBeacons by Javier Chávarri (NSBarcelona)

THANKS!

@javierwchavarri http://javierchavarri.com

[email protected] http://mobilejazz.cat