SlideShare a Scribd company logo
1 of 30
Using Bluetooth to connect your
iOS app to The Internet of
Things
Robert Kerr
Founder, Mobile Toolworks
robkerr@mobiletoolworks.com
copyright (c) 2015 Mobile Toolworks, LLC
About Me
Rob is the founder of Mobile Toolworks, where he helps
startup and established companies reinvent their businesses
using cloud-enabled mobile technologies.
Rob became an entrepreneur early on, starting a custom
software business while in college. Subsequently he played
instrumental roles helping build a series of successful
technology companies.
He received a degree in Computer Information Systems from
Western Michigan University, holds patents in connected
device sensor analysis, was awarded Microsoft’s Most
Valued Professional (MVP) for his tech community
contributions, and held software engineering, consulting and
executive-level management positions prior to founding
Mobile Toolworks. Robert Kerr
Founder, Mobile Toolworks
robkerr@mobiletoolworks.com
copyright (c) 2015 Mobile Toolworks, LLC
Agenda
 Begin with a demo!
 Bluetooth Intro for Application Developers
 Core Bluetooth Development: Centrals and Peripherals
 Application Architecture
 Real-world Example : a custom peripheral in Swift (iPhone/Apple
Watch)
 What makes an iBeacon an iBeacon?
 Using your iBeacon vendor’s API rather than Core Bluetooth
 Real-world Example : using iBeacons to enhance the customer
experiences (iPhone)
Begin with a demo!
copyright (c) 2015 Mobile Toolworks, LLC
Demo #1 – iBeacon Proximity
Food
Images
iBeacon
Location
& Analytics
iPhone 6
Pool Area
Restaurant
Bar
3m
15m
25m
copyright (c) 2015 Mobile Toolworks, LLC
Demo #2 – Controlling BLE Firmware
with an iPhone
Red Bear BT Module
(Nordic Semi Chip)
“Robot” is “running”
when light is green
Light Sensor
Temperature
Sensor
BLE GATT
copyright (c) 2015 Mobile Toolworks, LLC
Demo #3 – Controlling BLE Firmware
with an Apple Watch Extension
BT Pairing
BLE GATT
Bluetooth Intro for
Application Developers
copyright (c) 2015 Mobile Toolworks, LLC
Wireless for Peripherals – c.1996
Business-RF
MC-Link
Low Power RF
I explained that Bluetooth was borrowed from the 10th century, second
King of Denmark, King Harald Bluetooth; who was famous for uniting
Scandinavia just as we intended to unite the PC and cellular industries
with a short-range wireless link.
-- Jim Kardach, Intel
http://www.eetimes.com/document.asp?doc_id=1269737
copyright (c) 2015 Mobile Toolworks, LLC
Bluetooth Evolution
1.0
Bugs &
Problems
Bug Fixes
1.1
721 kbit/s
Freq
Hopping
1.2
2000 2002 2005
2.0 2.1 3.0
2004 2007 2009
3 mbit/s
EDR
Secure
Simple
Pairing
24 mbit/s
(802.11)
Remember Pairing by Entering “0000”?
4.0 4.1 4.2
2010 2013 2014
BLE Stack
Co-
Existence
IoT
Features
BLE Stack can connect without pairing
“Just Works” (user confirms OK) or Out-of-band Paring (NFC chip, etc.)
iOS 5.0 Core Bluetooth
(BLE Feature Stack)
This is where it
gets interesting
iOS 7.0 Core BT
Revised
(Yay!)
Core Bluetooth Development:
Centrals & Peripherals
copyright (c) 2015 Mobile Toolworks, LLC
Centrals & Peripherals
Central
(a/k/a/ “Client”)
iPhone/iPad
Proximity
Beacon
Raspberry Pi + BT Module
Heart Monitor
Environmental Sensor
Peripheral
(a/k/a/ “Server”)
copyright (c) 2015 Mobile Toolworks, LLC
Centrals communicate with Peripherals
using UUIDs
Peripheral
Service
713D0000-503E-4C75-BA94-3148F18D941E
Characteristic 1
713D0000-4001-4C75-BA94-3148F18D941E
713D0000-4002-4C75-BA94-3148F18D941E
Characteristic 2
Characteristic n
.
.
9FE4 4D29
UUID Mfg Data (optional)
nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn
peripheral
broadcasts its
service info
Central
connects to
peripheral
to interact with
characteristics
copyright (c) 2015 Mobile Toolworks, LLC
Using Core Bluetooth APIs
CBCentralManager
func scanForPeripheralsWithServices(..)
func stopScan()
func connectPeripheral(..)
func cancelPeripheralConnection(..)
CBPeripheral
func discoverServices(..)
func discoverCharacteristics(..)
func writeValueForCharacteristic(..)
MyAppObject : CBPeripheralDelegate
func DidDiscoverServices(..)
func
DidDiscoverCharacteristicsForService(..)
func DidUpdateValueForCharacteristic(..)
func DidUpdateValueForCharacteristic(..)
MyAppObject : CBCentralManagerDelegate
fund DidUpdateState(..)
func DidDiscoverPeripheral()
func DidConnectPeripheral
func DidFailToConnectPeripheral(..)
func DidDisconnectPeripheral(..)
Core Bluetooth API Your Objects
Central
Ops
Peripheral
Ops
copyright (c) 2015 Mobile Toolworks, LLC
Typical Peripheral Interop Process
scanForPeripheralsWithServic
e
didDiscoverPeripheral
connectPeripheral
didConnectPeripheral
discoverServices
didDiscoverServices
discoverCharacteristicsForService
didDiscoverCharacteristicsForService
writeValueForCharacteristic...)
didWriteValueForCharacteristic
didUpdateValueForCharacteristic
readValueforCharacteristic(..)
didUpdateValueForCharacteristic
cancelPeripheralConnection
Application Architecture
copyright (c) 2015 Mobile Toolworks, LLC
Pattern for app with only foreground
scanning
BTDiscoveryService
:
CBCentralManagerDelegate
BTPeripheralService
:
CBPeripheralDelegate
AppDelegate
ViewController
: BTDiscoveryServiceDelegate,
BTPeripheralServiceDelegate
Notify VC
of BT events
Discovery service
is factory for connected
peripheral objects
copyright (c) 2015 Mobile Toolworks, LLC
Pattern for app with background
scanning
BTDiscoveryService
:
CBCentralManagerDelegate
BTPeripheralService
: CBPeripheralDelegate
AppDelegate
: BTDiscoveryServiceDelegate
(Singleton in global scope)
ViewController
: BTDiscoveryServiceDelegate,
BTPeripheralServiceDelegate
Notify delegates
of BT events Discovery service
is factory for connected
peripheral objects
copyright (c) 2015 Mobile Toolworks, LLC
Things to know about
 Your app can scan on-demand, or scan at all times in the background
 Scanning can continue even when the device is in standby
 In this case, iOS throttles down some features to conserve battery
 Core Bluetooth launches your app when BLE services of interest to it are
observed
 Being in “scanning mode” does consume battery, but with BLE mode not
very much (see next slide)
 Still, don’t scan when you don’t need to – you’re wasting battery life with no
value provided to the user
 Stay connected to a peripheral for as short a duration as possible
 Only one Central can be connected at the same time. Connect, interop, and
disconnect
 If developing your own firmware, use the “manufacturer data” in the
advertising frame to avoid the need for Central apps to connect at all.
copyright (c) 2015 Mobile Toolworks, LLC
Battery drain when scanning
http://www.aislelabs.com/reports/ibeacon-battery-drain-iphones/
Code Review
Controlling a custom firmware peripheral
using Swift on iPhone & Apple Watch
What makes an
iBeacon an iBeacon?
copyright (c) 2015 Mobile Toolworks, LLC
iBeacons from various manufacturers
Estimote
Gimbal
Red Bear
PassKit
BlueCats
Roximity
Kontact.io
Radius
Beacon
BlueUp
copyright (c) 2015 Mobile Toolworks, LLC
Inside an iBeacon
http://beekn.net/2013/11/whats-inside-an-estimote/
copyright (c) 2015 Mobile Toolworks, LLC
Inside an iBeacon
Nordic Semi SoC
(32-bit ARM Coretex CPU with
Bluetooth LE Radio)
Antenna
Accelerometer
copyright (c) 2015 Mobile Toolworks, LLC
What is an iBeacon?
 iBeacon is just a specification for a peripheral
 The advertisement frame identifies a beacon, and provides enough
information to enable a proximity application
713D0000-503E-4C75-BA94-3148F18D941E 9FE4
UUID MajorCompany ID
4C00
Data Type
02
Data Length
21
Minor
4D29
Power@1
M
5C
☞
 Some beacons go further, providing temperature, accelerometer, and
enhancements
 Use the Beacon vendor’s SDK to access extensions
copyright (c) 2015 Mobile Toolworks, LLC
Do I use Core Bluetooth or the vendor
SDK?
 If the beacon follows iBeacon, then you should be able to use Core
Bluetooth vanilla.
 Or you can use the SDK provided by your iBeacon vendor if one is
provided
 Can be an abstraction layer over Core Bluetooth
 Less coding for you (?)
 But maybe less control as well
 The SDK provides access to extensions not necessarily part of the iBeacon
specification
 Some vendors include cloud-based analytics and opportunities to use other
beacons and/or “rent” the use of your beacons to others (especially Gimbal)
 The vendor SDK is almost certainly necessary to leverage these value-
added capabilities
copyright (c) 2015 Mobile Toolworks, LLC
Analytics when using Estimote SDK
with Estimote iBeacons
Code Review
Using iBeacons to enhance
the customer experiences (iPhone)
Questions?

More Related Content

Recently uploaded

why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 

Recently uploaded (20)

why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Use Bluetooth to connect your iOS app to the Internet of Things

  • 1. Using Bluetooth to connect your iOS app to The Internet of Things Robert Kerr Founder, Mobile Toolworks robkerr@mobiletoolworks.com
  • 2. copyright (c) 2015 Mobile Toolworks, LLC About Me Rob is the founder of Mobile Toolworks, where he helps startup and established companies reinvent their businesses using cloud-enabled mobile technologies. Rob became an entrepreneur early on, starting a custom software business while in college. Subsequently he played instrumental roles helping build a series of successful technology companies. He received a degree in Computer Information Systems from Western Michigan University, holds patents in connected device sensor analysis, was awarded Microsoft’s Most Valued Professional (MVP) for his tech community contributions, and held software engineering, consulting and executive-level management positions prior to founding Mobile Toolworks. Robert Kerr Founder, Mobile Toolworks robkerr@mobiletoolworks.com
  • 3. copyright (c) 2015 Mobile Toolworks, LLC Agenda  Begin with a demo!  Bluetooth Intro for Application Developers  Core Bluetooth Development: Centrals and Peripherals  Application Architecture  Real-world Example : a custom peripheral in Swift (iPhone/Apple Watch)  What makes an iBeacon an iBeacon?  Using your iBeacon vendor’s API rather than Core Bluetooth  Real-world Example : using iBeacons to enhance the customer experiences (iPhone)
  • 4. Begin with a demo!
  • 5. copyright (c) 2015 Mobile Toolworks, LLC Demo #1 – iBeacon Proximity Food Images iBeacon Location & Analytics iPhone 6 Pool Area Restaurant Bar 3m 15m 25m
  • 6. copyright (c) 2015 Mobile Toolworks, LLC Demo #2 – Controlling BLE Firmware with an iPhone Red Bear BT Module (Nordic Semi Chip) “Robot” is “running” when light is green Light Sensor Temperature Sensor BLE GATT
  • 7. copyright (c) 2015 Mobile Toolworks, LLC Demo #3 – Controlling BLE Firmware with an Apple Watch Extension BT Pairing BLE GATT
  • 9. copyright (c) 2015 Mobile Toolworks, LLC Wireless for Peripherals – c.1996 Business-RF MC-Link Low Power RF I explained that Bluetooth was borrowed from the 10th century, second King of Denmark, King Harald Bluetooth; who was famous for uniting Scandinavia just as we intended to unite the PC and cellular industries with a short-range wireless link. -- Jim Kardach, Intel http://www.eetimes.com/document.asp?doc_id=1269737
  • 10. copyright (c) 2015 Mobile Toolworks, LLC Bluetooth Evolution 1.0 Bugs & Problems Bug Fixes 1.1 721 kbit/s Freq Hopping 1.2 2000 2002 2005 2.0 2.1 3.0 2004 2007 2009 3 mbit/s EDR Secure Simple Pairing 24 mbit/s (802.11) Remember Pairing by Entering “0000”? 4.0 4.1 4.2 2010 2013 2014 BLE Stack Co- Existence IoT Features BLE Stack can connect without pairing “Just Works” (user confirms OK) or Out-of-band Paring (NFC chip, etc.) iOS 5.0 Core Bluetooth (BLE Feature Stack) This is where it gets interesting iOS 7.0 Core BT Revised (Yay!)
  • 12. copyright (c) 2015 Mobile Toolworks, LLC Centrals & Peripherals Central (a/k/a/ “Client”) iPhone/iPad Proximity Beacon Raspberry Pi + BT Module Heart Monitor Environmental Sensor Peripheral (a/k/a/ “Server”)
  • 13. copyright (c) 2015 Mobile Toolworks, LLC Centrals communicate with Peripherals using UUIDs Peripheral Service 713D0000-503E-4C75-BA94-3148F18D941E Characteristic 1 713D0000-4001-4C75-BA94-3148F18D941E 713D0000-4002-4C75-BA94-3148F18D941E Characteristic 2 Characteristic n . . 9FE4 4D29 UUID Mfg Data (optional) nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn peripheral broadcasts its service info Central connects to peripheral to interact with characteristics
  • 14. copyright (c) 2015 Mobile Toolworks, LLC Using Core Bluetooth APIs CBCentralManager func scanForPeripheralsWithServices(..) func stopScan() func connectPeripheral(..) func cancelPeripheralConnection(..) CBPeripheral func discoverServices(..) func discoverCharacteristics(..) func writeValueForCharacteristic(..) MyAppObject : CBPeripheralDelegate func DidDiscoverServices(..) func DidDiscoverCharacteristicsForService(..) func DidUpdateValueForCharacteristic(..) func DidUpdateValueForCharacteristic(..) MyAppObject : CBCentralManagerDelegate fund DidUpdateState(..) func DidDiscoverPeripheral() func DidConnectPeripheral func DidFailToConnectPeripheral(..) func DidDisconnectPeripheral(..) Core Bluetooth API Your Objects Central Ops Peripheral Ops
  • 15. copyright (c) 2015 Mobile Toolworks, LLC Typical Peripheral Interop Process scanForPeripheralsWithServic e didDiscoverPeripheral connectPeripheral didConnectPeripheral discoverServices didDiscoverServices discoverCharacteristicsForService didDiscoverCharacteristicsForService writeValueForCharacteristic...) didWriteValueForCharacteristic didUpdateValueForCharacteristic readValueforCharacteristic(..) didUpdateValueForCharacteristic cancelPeripheralConnection
  • 17. copyright (c) 2015 Mobile Toolworks, LLC Pattern for app with only foreground scanning BTDiscoveryService : CBCentralManagerDelegate BTPeripheralService : CBPeripheralDelegate AppDelegate ViewController : BTDiscoveryServiceDelegate, BTPeripheralServiceDelegate Notify VC of BT events Discovery service is factory for connected peripheral objects
  • 18. copyright (c) 2015 Mobile Toolworks, LLC Pattern for app with background scanning BTDiscoveryService : CBCentralManagerDelegate BTPeripheralService : CBPeripheralDelegate AppDelegate : BTDiscoveryServiceDelegate (Singleton in global scope) ViewController : BTDiscoveryServiceDelegate, BTPeripheralServiceDelegate Notify delegates of BT events Discovery service is factory for connected peripheral objects
  • 19. copyright (c) 2015 Mobile Toolworks, LLC Things to know about  Your app can scan on-demand, or scan at all times in the background  Scanning can continue even when the device is in standby  In this case, iOS throttles down some features to conserve battery  Core Bluetooth launches your app when BLE services of interest to it are observed  Being in “scanning mode” does consume battery, but with BLE mode not very much (see next slide)  Still, don’t scan when you don’t need to – you’re wasting battery life with no value provided to the user  Stay connected to a peripheral for as short a duration as possible  Only one Central can be connected at the same time. Connect, interop, and disconnect  If developing your own firmware, use the “manufacturer data” in the advertising frame to avoid the need for Central apps to connect at all.
  • 20. copyright (c) 2015 Mobile Toolworks, LLC Battery drain when scanning http://www.aislelabs.com/reports/ibeacon-battery-drain-iphones/
  • 21. Code Review Controlling a custom firmware peripheral using Swift on iPhone & Apple Watch
  • 22. What makes an iBeacon an iBeacon?
  • 23. copyright (c) 2015 Mobile Toolworks, LLC iBeacons from various manufacturers Estimote Gimbal Red Bear PassKit BlueCats Roximity Kontact.io Radius Beacon BlueUp
  • 24. copyright (c) 2015 Mobile Toolworks, LLC Inside an iBeacon http://beekn.net/2013/11/whats-inside-an-estimote/
  • 25. copyright (c) 2015 Mobile Toolworks, LLC Inside an iBeacon Nordic Semi SoC (32-bit ARM Coretex CPU with Bluetooth LE Radio) Antenna Accelerometer
  • 26. copyright (c) 2015 Mobile Toolworks, LLC What is an iBeacon?  iBeacon is just a specification for a peripheral  The advertisement frame identifies a beacon, and provides enough information to enable a proximity application 713D0000-503E-4C75-BA94-3148F18D941E 9FE4 UUID MajorCompany ID 4C00 Data Type 02 Data Length 21 Minor 4D29 Power@1 M 5C ☞  Some beacons go further, providing temperature, accelerometer, and enhancements  Use the Beacon vendor’s SDK to access extensions
  • 27. copyright (c) 2015 Mobile Toolworks, LLC Do I use Core Bluetooth or the vendor SDK?  If the beacon follows iBeacon, then you should be able to use Core Bluetooth vanilla.  Or you can use the SDK provided by your iBeacon vendor if one is provided  Can be an abstraction layer over Core Bluetooth  Less coding for you (?)  But maybe less control as well  The SDK provides access to extensions not necessarily part of the iBeacon specification  Some vendors include cloud-based analytics and opportunities to use other beacons and/or “rent” the use of your beacons to others (especially Gimbal)  The vendor SDK is almost certainly necessary to leverage these value- added capabilities
  • 28. copyright (c) 2015 Mobile Toolworks, LLC Analytics when using Estimote SDK with Estimote iBeacons
  • 29. Code Review Using iBeacons to enhance the customer experiences (iPhone)