Practical Core Bluetooth in IoT & Wearable projects @ UIKonf 2016

4,880 views

Published on

In recent years, "IoT" or "Wearable" are one of buzzwords, so many people might have interests in building hardware products. But learning how to develop electric circuits, mechanical systems or embedded systems etc. from zero is so difficult. However, iOS developers can contribute to projects of hardware products with the knowledge of Core Bluetooth / Bluetooth Low Energy (BTLE), even if they are not familiar with hardware layer. In this session, he will introduce BTLE, show easy examples of Core Bluetooth, and share knowledges with his experiences developing more than 10 apps for IoT and Wearable products.

What is Bluetooth Low Energy? Why use this?
Very easy examples of how to communicate using Core Bluetooth
What part was my responsibility in the projects? Communication with firmware engineer.
Designing GATT
Designing the behavior of the app in background
Limitations in background. What are possible and impossible?
State Preservation and Restoration
Develop without prototypes of the hardware
BTLE Module's Developer Kit
Prototyping tools
Build emulator apps
Trouble Shootings
Debugging tools
Each cases: Can't find / connect / send or receive information

Published in: Technology
0 Comments
7 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,880
On SlideShare
0
From Embeds
0
Number of Embeds
3,681
Actions
Shares
0
Downloads
30
Comments
0
Likes
7
Embeds 0
No embeds

No notes for slide

Practical Core Bluetooth in IoT & Wearable projects @ UIKonf 2016

  1. 1. Practical Core Bluetooth in IoT & Wearable projects Shuichi Tsutsumi @shu223 iOS Freelancer UIKonf 2016 - Berlin
  2. 2. Overview • Basics of Core Bluetooth • Practical Core Bluetooth
  3. 3. Bluetooth Low Energy?
  4. 4. Bluetooth Low Energy (BLE) • Wireless technology - no network infrastructure required
  5. 5. Bluetooth Low Energy (BLE) • Wireless technology - no network infrastructure required Wi-Fi
  6. 6. Bluetooth Low Energy (BLE) • Wireless technology - no network infrastructure required BLE
  7. 7. • Low energy
  8. 8. • Low energy • NOT compatible with Classic BT
  9. 9. • Low energy • NOT compatible with Classic BT • Uses 2.4 GHz radio frequencies
  10. 10. • Low energy • NOT compatible with Classic BT • Uses 2.4 GHz radio frequencies • Marketed by the Bluetooth SIG
  11. 11. • Low energy • NOT compatible with Classic BT • Uses 2.4 GHz radio frequencies • Marketed by the Bluetooth SIG • etc…
  12. 12. • Low energy • NOT compatible with Classic BT • Uses 2.4 GHz radio frequencies • Marketed by the Bluetooth SIG • etc…
  13. 13. The most important thing for iOS developers
  14. 14. The API ‘Core Bluetooth’ is open for developers
  15. 15. The API ‘Core Bluetooth’ is open for developers • API for Classic BT is NOT open. - Requires MFi certification.
  16. 16. BLE is almost the ONLY way to enable iOS apps to communicate with external hardware without infrastructure or MFi.
  17. 17. Basics of Core Bluetooth
  18. 18. Moff Band Moff App
  19. 19. Moff Band Moff App BLE Connection
  20. 20. Moff Band Moff App BLE Connection Sensors - Gyroscope - Accelerometer
  21. 21. Moff Band Moff App Sensor Data BLE Connection Sensors - Gyroscope - Accelerometer
  22. 22. Moff Band Moff App Sensor Data BLE Connection Sensors - Gyroscope - Accelerometer Analyze sensor data
  23. 23. Moff Band Moff App Sensor Data BLE Connection Sensors - Gyroscope - Accelerometer Analyze sensor data Recognize - Gesture - Posture
  24. 24. Moff Band Moff App Sensor Data BLE Connection Sensors - Gyroscope - Accelerometer Analyze sensor data Recognize - Gesture - Posture Play sounds
  25. 25. Sensor Data How sensor data is sent with Core Bluetooth BLE Connection
  26. 26. Step 1. Scan
  27. 27. Step 1. Scan: Search for nearby BLE devices
  28. 28. Step 1. Scan: Search for nearby BLE devices
  29. 29. Step 1. Scan Advertise : Search for nearby BLE devices
  30. 30. Scan Step 1. Scan Advertise : Search for nearby BLE devices
  31. 31. Scan Step 1. Scan Advertise : Search for nearby BLE devices centralManager.scanForPeripheralsWithServices(nil, options: nil)
  32. 32. Scan Step 1. Scan Advertise Discover : Search for nearby BLE devices
  33. 33. Scan Step 1. Scan Advertise Discover : Search for nearby BLE devices func centralManager(central: CBCentralManager, didDiscoverPeripheral peripheral: CBPeripheral, advertisementData: [String : AnyObject], RSSI: NSNumber!) { print(“Discovered a BLE device!”) }
  34. 34. Scan Step 1. Scan Advertise Discover : Search for nearby BLE devices func centralManager(central: CBCentralManager, didDiscoverPeripheral peripheral: CBPeripheral, advertisementData: [String : AnyObject], RSSI: NSNumber!) { print(“Discovered a BLE device!”) } Central
  35. 35. Scan Step 1. Scan Advertise Discover : Search for nearby BLE devices func centralManager(central: CBCentralManager, didDiscoverPeripheral peripheral: CBPeripheral, advertisementData: [String : AnyObject], RSSI: NSNumber!) { print(“Discovered a BLE device!”) } Peripheral Central
  36. 36. Step 2. Connect
  37. 37. Connect Step 2. Connect
  38. 38. Connect Step 2. Connect centralManager.connectPeripheral(peripheral, options: nil)
  39. 39. Connect Step 2. Connect centralManager.connectPeripheral(peripheral, options: nil) func centralManager(central: CBCentralManager, didConnectPeripheral peripheral: CBPeripheral) { print(“Connected!”) }
  40. 40. Step 3. Subscribe
  41. 41. Step 3. Subscribe: Ready to receive data
  42. 42. Step 3. Subscribe: Ready to receive data GATT = Generic Attribute Profile
  43. 43. Moff Service xx Service Step 3. Subscribe: Ready to receive data GATT = Generic Attribute Profile
  44. 44. Moff Service xx Service Button Characteristic xx Characteristic Sensor Characteristic Step 3. Subscribe: Ready to receive data GATT = Generic Attribute Profile
  45. 45. Moff Service xx Service Button Characteristic xx Characteristic Sensor Characteristic Subscribe (Request to be notified) Step 3. Subscribe: Ready to receive data GATT = Generic Attribute Profile
  46. 46. Moff Service xx Service Button Characteristic xx Characteristic Sensor Characteristic Subscribe (Request to be notified) Step 3. Subscribe: Ready to receive data GATT = Generic Attribute Profile peripheral.setNotifyValue(true, forCharacteristic: c)
  47. 47. Step 4. Notify Moff Service Sensor Characteristic xxxx Characteristic
  48. 48. Step 4. Notify Moff Service Sensor Characteristic xxxx Characteristic Update the value
  49. 49. Step 4. Notify Notify subscribers Moff Service Sensor Characteristic xxxx Characteristic Update the value
  50. 50. Step 4. Notify Notify subscribers Moff Service Sensor Characteristic xxxx Characteristic Update the value func peripheral(peripheral: CBPeripheral, didUpdateValueForCharacteristic characteristic: CBCharacteristic, error: NSError?) { print(“Received sensor data!”) }
  51. 51. Step 4. Notify Notify subscribers Moff Service Sensor Characteristic xxxx Characteristic Update the value func peripheral(peripheral: CBPeripheral, didUpdateValueForCharacteristic characteristic: CBCharacteristic, error: NSError?) { print(“Received sensor data!”) }
  52. 52. Hardware Side?
  53. 53. Hardware Side? I’m sorry, I don’t know…
  54. 54. BLE
  55. 55. BLE iOS Engineer
  56. 56. BLE iOS Engineer
  57. 57. BLE Firmware Engineer iOS Engineer
  58. 58. BLE Firmware Engineer iOS Engineer
  59. 59. HW Projects I’ve worked on as an iOS engineer
  60. 60. Wheelchair ‘WHILL’
  61. 61. Wheelchair ‘WHILL’
  62. 62. Wearable Walkie-Talkie ‘BONX’
  63. 63. Wearable Walkie-Talkie ‘BONX’
  64. 64. Wearable Walkie-Talkie ‘BONX’
  65. 65. Group conversation system with VoIP - Detects the human voice - Cuts out all background noise
  66. 66. → Can be used even in areas with poor coverage! Group conversation system with VoIP - Detects the human voice - Cuts out all background noise
  67. 67. BLE for BONX
  68. 68. BLE for BONX
  69. 69. BLE for BONX
  70. 70. IoT for Cars ‘SmartDrive’
  71. 71. Printable Open-Source Humanoid “PLEN2”
  72. 72. Music for the Deaf Daito Manabe/Motoi Ishibashi/Teruoka Masaki/Shuichi Tsutsumi x SOUL FAMILY
  73. 73. Music for the Deaf Daito Manabe/Motoi Ishibashi/Teruoka Masaki/Shuichi Tsutsumi x SOUL FAMILY iPhone
  74. 74. Music for the Deaf Daito Manabe/Motoi Ishibashi/Teruoka Masaki/Shuichi Tsutsumi x SOUL FAMILY Electronic Stimulation DeviceiPhone
  75. 75. Music for the Deaf Daito Manabe/Motoi Ishibashi/Teruoka Masaki/Shuichi Tsutsumi x SOUL FAMILY Commands Electronic Stimulation DeviceiPhone
  76. 76. Music for the Deaf Daito Manabe/Motoi Ishibashi/Teruoka Masaki/Shuichi Tsutsumi x SOUL FAMILY
  77. 77. Practical Core Bluetooth
  78. 78. Defining GATT
  79. 79. GATT to send sensor data Foo Service Sensor Data Characteristic UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Bar Service xx Characteristic UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Properties: Notify Value: acc x, acc y, acc z, gyro x, gyro y, gyro z (2bytes for each) xx Characteristic
  80. 80. GATT to send sensor data Foo Service Sensor Data Characteristic UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Bar Service xx Characteristic UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Properties: Notify Value: acc x, acc y, acc z, gyro x, gyro y, gyro z (2bytes for each) xx Characteristic
  81. 81. GATT to send sensor data Foo Service Sensor Data Characteristic UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Bar Service xx Characteristic UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Properties: Notify Value: acc x, acc y, acc z, gyro x, gyro y, gyro z (2bytes for each) xx Characteristic
  82. 82. GATT to send sensor data Foo Service Sensor Data Characteristic UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Bar Service xx Characteristic UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Properties: Notify Value: acc x, acc y, acc z, gyro x, gyro y, gyro z (2bytes for each) xx Characteristic
  83. 83. GATT to send sensor data Foo Service Sensor Data Characteristic UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Bar Service xx Characteristic UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Properties: Notify Value: acc x, acc y, acc z, gyro x, gyro y, gyro z (2bytes for each) xx Characteristic
  84. 84. GATT to send sensor data Foo Service Sensor Data Characteristic UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Bar Service xx Characteristic UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Properties: Notify Value: acc x, acc y, acc z, gyro x, gyro y, gyro z (2bytes for each) xx Characteristic
  85. 85. GATT to send button interactions Foo Service Button Control Characteristic UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Properties: Notify Value: 0x01 or 0x00
  86. 86. GATT to send button interactions Foo Service Button Control Characteristic UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Properties: Notify Value: 0x01 or 0x00
  87. 87. GATT to send button interactions Foo Service Button Control Characteristic UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Properties: Notify Value: 0x01 or 0x00
  88. 88. GATT to send button interactions Foo Service Button Control Characteristic UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Properties: Notify Value: 0x01 or 0x00 Button interactions
  89. 89. GATT to send button interactions Foo Service Button Control Characteristic UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Properties: Notify Value: 0x01 or 0x00 Button interactions
  90. 90. GATT to send button interactions Foo Service Button Control Characteristic UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Properties: Notify Value: 0x01 or 0x00 Button interactions
  91. 91. GATT to send button interactions Foo Service Button Control Characteristic UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Properties: Notify Value: 0x01 or 0x00 Button interactions 0x01: Pushed 0x00: Released
  92. 92. GATT for remote control Foo Service Remote Control Characteristic UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Properties: Write Value: Horizontal (-100 ~ 100), Vertical (-100 ~ 100)
  93. 93. GATT for remote control Foo Service Remote Control Characteristic UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Properties: Write Value: Horizontal (-100 ~ 100), Vertical (-100 ~ 100)
  94. 94. GATT for remote control Foo Service Remote Control Characteristic UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Properties: Write Value: Horizontal (-100 ~ 100), Vertical (-100 ~ 100) values
  95. 95. GATT for remote control Foo Service Remote Control Characteristic UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Properties: Write Value: Horizontal (-100 ~ 100), Vertical (-100 ~ 100) values
  96. 96. GATT for remote control Foo Service Remote Control Characteristic UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Properties: Write Value: Horizontal (-100 ~ 100), Vertical (-100 ~ 100) values
  97. 97. How to define GATT 1. Create UUID for the service & characteristic 2. Define the properties (Read, Notify, Write, etc.) Peripheral → Central: Notify 
 Central → Peripheral: Write 3. Define the value format Usually limited to 20 bytes $ uuidgen CEEA31BC-BEAC-4A78-B7ED-FC96B6254D4C
  98. 98. Reference: GATT profiles by Bluetooth SIG
  99. 99. Defining background behaviors
  100. 100. Background behaviors on iOS • Very limited - Listening to music - Getting location data - Downloading data
  101. 101. Imagine
  102. 102. If BLE didn’t work in the background…
  103. 103. You would have to always keep the app in the foreground, while snowboarding!
  104. 104. You would have to launch the app whenever you go driving!
  105. 105. What functions can be used in the background?
  106. 106. What functions can be used in the background? • Scanning peripherals
  107. 107. What functions can be used in the background? • Scanning peripherals • Connecting with peripherals
  108. 108. What functions can be used in the background? • Scanning peripherals • Connecting with peripherals • Reading characteristics’ value
  109. 109. What functions can be used in the background? • Scanning peripherals • Connecting with peripherals • Reading characteristics’ value • Writing characteristics’ value
  110. 110. What functions can be used in the background? • Scanning peripherals • Connecting with peripherals • Reading characteristics’ value • Writing characteristics’ value • Receiving notifications
  111. 111. What functions can be used in the background? • Scanning peripherals • Connecting with peripherals • Reading characteristics’ value • Writing characteristics’ value • Receiving notifications Almost all functions can be used even in the background!
  112. 112. How to support background mode
  113. 113. Just check this box!
  114. 114. Limitations
  115. 115. Limitations • Longer intervals for scanning
  116. 116. Limitations • Longer intervals for scanning • Must explicitly specify one or more services to scan
  117. 117. Limitations • Longer intervals for scanning • Must explicitly specify one or more services to scan • CBCentralManagerOptionShowPowerAlertKey option is ignored
  118. 118. Limitations • Longer intervals for scanning • Must explicitly specify one or more services to scan • CBCentralManagerOptionShowPowerAlertKey option is ignored Resources - Core Bluetooth Programming Guide - Core Bluetooth Framework Reference (also in headers)
  119. 119. If the app in the background is killed by the system…
  120. 120. State Preservation and Restoration
  121. 121. State Preservation and Restoration The system takes over the BLE tasks even after the app is killed.
  122. 122. State Preservation and Restoration The system takes over the BLE tasks even after the app is killed. - Preserves the state of the app’s central managers and continues the BLE tasks on their behalf.
  123. 123. State Preservation and Restoration The system takes over the BLE tasks even after the app is killed. - Preserves the state of the app’s central managers and continues the BLE tasks on their behalf. - Relaunches the app into the background and calls the corresponding delegate method.
  124. 124. State Preservation and Restoration The system takes over the BLE tasks even after the app is killed. - Preserves the state of the app’s central managers and continues the BLE tasks on their behalf. - Relaunches the app into the background and calls the corresponding delegate method. → The app can handle BLE events!
  125. 125. • The app is killed by the system
  126. 126. • The app is killed by the system • The user pushes the button on the peripheral device
  127. 127. • The app is killed by the system • The user pushes the button on the peripheral device • The system receives the notification
  128. 128. • The app is killed by the system • The user pushes the button on the peripheral device • The system receives the notification • The app is relaunched in the BG and the delegate method is called.
  129. 129. func peripheral(peripheral: CBPeripheral, didUpdateValueForCharacteristic characteristic: CBCharacteristic, error: NSError?) { print(“Received the characteristic data!”) } • The app is killed by the system • The user pushes the button on the peripheral device • The system receives the notification • The app is relaunched in the BG and the delegate method is called.
  130. 130. func peripheral(peripheral: CBPeripheral, didUpdateValueForCharacteristic characteristic: CBCharacteristic, error: NSError?) { print(“Received the characteristic data!”) } • The app is killed by the system • The user pushes the button on the peripheral device • The system receives the notification • The app is relaunched in the BG and the delegate method is called. The app can process the button interaction!
  131. 131. Implementation
  132. 132. Implementation • Add an option when initializing the CBCentralManager object. let options = [ CBCentralManagerOptionRestoreIdentifierKey: "somekey" ] centralManager = CBCentralManager( delegate: self, queue: queue, options: options)
  133. 133. Implementation • Implement the delegate method which is called when the app is restored. func centralManager(central: CBCentralManager, willRestoreState dict: [String : AnyObject]) { print("Restored") }
  134. 134. Testing the restoration
  135. 135. Testing the restoration • Kill the app as if it was killed by the iOS kill(getpid(), SIGKILL);
  136. 136. How to test without HW prototypes
  137. 137. Did the HW prototypes exist when develop the apps? Projects HW prototypes existed? Moff YES WHILL NO BONX NO SmartDrive YES PLEN2 NO Music for the Deaf NO
  138. 138. Development Kit
  139. 139. Development Kit BLE Module
  140. 140. Development Kit BLE Module Display
  141. 141. Development Kit BLE Module Display USB interface
  142. 142. Development Kit BLE Module Display USB interface Battery box
  143. 143. Development Kit Can start development without creating a circuit ourselves BLE Module Display USB interface Battery box
  144. 144. Development Kit
  145. 145. Development Kit App
  146. 146. Development Kit App BLE
  147. 147. Horizontal (-100~100) / Vertical (-100~100) Development Kit App BLE
  148. 148. Emulator App
  149. 149. Emulator App • Develop another iOS app as the alternative to the peripheral device
  150. 150. Emulator App • Develop another iOS app as the alternative to the peripheral device • Use CBPeripheralManager
  151. 151. Emulator App • Develop another iOS app as the alternative to the peripheral device • Use CBPeripheralManager • Easier for iOS engineers
  152. 152. =
  153. 153. Multi-Function Control • Single Tap • Double Tap • Long Press • Very Long Press =
  154. 154. Troubleshooting
  155. 155. Can’t find the peripheral Scan ?
  156. 156. Can’t connect Find
  157. 157. Can’t connect Connect ×
  158. 158. • Connection dropped
  159. 159. • Connection dropped • Can’t discover services or characteristics
  160. 160. • Connection dropped • Can’t discover services or characteristics • Fail to write
  161. 161. • Connection dropped • Can’t discover services or characteristics • Fail to write • Incorrect characteristic values
  162. 162. • Connection dropped • Can’t discover services or characteristics • Fail to write • Incorrect characteristic values • Incorrect behaviors in the background
  163. 163. • Connection dropped • Can’t discover services or characteristics • Fail to write • Incorrect characteristic values • Incorrect behaviors in the background • etc…
  164. 164. Identify which side the problem is on Is the problem on the central side or on the peripheral side? → Compare with another iOS app like ‘LightBlue’
  165. 165. Can’t find the peripheral • Scanning, but can’t find the peripheral device
  166. 166. Can’t find the peripheral • Scanning, but can’t find the peripheral device Scan
  167. 167. Can’t find the peripheral • Scanning, but can’t find the peripheral device Scan but ‘didDiscover’ method isn’t called
  168. 168. Can’t find the peripheral • Scan with another iOS app Scan
  169. 169. Can’t find the peripheral • Scan with another iOS app Scan Discovered peripherals
  170. 170. Can’t connect, etc. Connect
  171. 171. Can’t connect, etc. Connect Services & Characteristics
  172. 172. Other debugging tools
  173. 173. Bluetooth Explorer
  174. 174. Bluetooth Explorer An OS X app made by Apple
  175. 175. Low Energy Devices
  176. 176. Low Energy Devices Scan, Connect
  177. 177. Low Energy Devices Scan, Connect Details of services and characteristics
  178. 178. Low Energy Devices Scan, Connect Details of services and characteristics Write, Read, Register Notify (Subscribe)
  179. 179. func centralManager( central: CBCentralManager, didDiscoverPeripheral peripheral: CBPeripheral, advertisementData: [String : AnyObject], RSSI: NSNumber!) { print(advertisementData) }
  180. 180. func centralManager( central: CBCentralManager, didDiscoverPeripheral peripheral: CBPeripheral, advertisementData: [String : AnyObject], RSSI: NSNumber!) { print(advertisementData) } Filtered by iOS!
  181. 181. func centralManager( central: CBCentralManager, didDiscoverPeripheral peripheral: CBPeripheral, advertisementData: [String : AnyObject], RSSI: NSNumber!) { print(advertisementData) } Filtered by iOS! → Can’t see all of the advertisement data
  182. 182. func centralManager( central: CBCentralManager, didDiscoverPeripheral peripheral: CBPeripheral, advertisementData: [String : AnyObject], RSSI: NSNumber!) { print(advertisementData) } Filtered by iOS! e.g. Can’t see the ‘Manufacture Data’ field of iBeacon → Can’t see all of the advertisement data
  183. 183. Not filtered → Can see the ‘Manufacture Data’ field of iBeacon
  184. 184. Packet Logger
  185. 185. Packet Logger An OS X app made by Apple
  186. 186. How to get
  187. 187. How to get
  188. 188. How to get Download ‘Hardware IO Tools for Xcode’
  189. 189. How to get Download ‘Hardware IO Tools for Xcode’
  190. 190. How to get Download ‘Hardware IO Tools for Xcode’
  191. 191. How to get Download ‘Hardware IO Tools for Xcode’
  192. 192. App Review
  193. 193. MSRP $13,995
  194. 194. Costing too much
  195. 195. Not enough devices when submitting
  196. 196. Videos for review
  197. 197. Videos for review • Show how the app works with the peripheral device
  198. 198. Videos for review • Show how the app works with the peripheral device • Not need to be cool!
  199. 199. • Shoot with iPhone
  200. 200. • Shoot with iPhone • Edit with iMovie
  201. 201. Recap • What is Bluetooth Low Energy? • Basics of Core Bluetooth with an actual product • Practical Core Bluetooth with specific examples - Defining GATT - Defining background behaviors - Testing without HW prototypes - Troubleshooting - App Review
  202. 202. 束:31mm 表 4 表 1 iOS×BLE Core Bluetooth プログラミング iOS×BLECoreBluetooth プ ロ グ ラ ミ ン グ 堤 修 一 松 村 礼 央 = 著 堤修一×松村礼央=著 Shuichi TSUTSUMI×Reo MATSUMURA iOS×BLE Core Bluetooth Programming iOS×BLE 定価:本体4,000円(税別) Resources • 500 pages about iOS x BLE • Japanese only
  203. 203. Resources • Getting Started with Bluetooth Low Energy - Covers large area of BLE • Core Bluetooth Programming Guide - Good to know the overview of Core Bluetooth • Core Bluetooth Framework Reference - Details of Core Bluetooth • Bluetooth Accessory Design Guidelines for Apple Products - For HW side, but helpful also for iOS engineers to know specs or limitations due to HW side such as connection intervals.
  204. 204. Resources • WWDC 2012 - Session 703 - Core Bluetooth 101 - Helpful to know about BLE • WWDC 2012 - Session 705 - Advanced Core Bluetooth - Connection interval, Caching, etc… • WWDC 2013 - Session 703 - Core Bluetooth - Retrieving peripherals, State preservation & restoration etc.. - Includes advanced and detailed information • Bluetooth Core Specification by Bluetooth SIG - The official specification / Total 2000 pages…
  205. 205. Thank you! Shuichi Tsutsumi - iOS Freelancer • Twitter: @shu223 • GitHub: shu223 • Blog: https://medium.com/@shu223/ • Email: shuichi0526@gmail.com

×