I gave this talk in Jerusalem, Israel, and Palestine in 2016 with following schedule:
- July 25, 2016 Azrieli College, Jerusalem
- July 26, 2016 Google Campus - Tel Aviv, Israel
- July 27, 2016 SigmaLabs - Tel Aviv, Israel
- July 28, 2016 Birzeit University - Palestine
These events were hosted by Embassy of Japan in Israel.
[Description]
While introducing Japanese technologies (products) such as WHILL, Moff, BONX, and etc. which Mr. Tsutsumi was involved in inventing the applications, he will talk about how BLE, a key technology of IoT, is utilized in those products.
1 of 71
Download to read offline
More Related Content
Building iOS apps using "Bluetooth Low Energy"
1. Building iOS apps using
"Bluetooth Low Energy"
Shuichi Tsutsumi @shu223
July 25, 2016 Azrieli College, Jerusalem
July 26, 2016 Google Campus - Tel Aviv, Israel
July 27, 2016 SigmaLabs - Tel Aviv, Israel
July 28, 2016 Birzeit University - Palestine
4. Overview
? Basics of BLE
? Practical Tips to build apps using BLE
with Japanse Products
9. The iOS API ‘Core Bluetooth’
is open for developers
? API for Classic BT is NOT open.
- Requires MFi certification.
10. BLE is almost the ONLY way
to enable iOS apps to communicate
with external hardware
without infrastructure or MFi.
11. konashi moff band sensortag
External HW
? Simple
→ Small, Low cost & Long life
Smart Phone
? High Performance
? Internet Connection
? Easy to program
? etc…
Communicate
with BLE
19. 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)
20. 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!”)
}
42. 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
43. 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
44. 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
45. 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
51. You would have to always keep the app
in the foreground, while snowboarding!
52. You would have to launch the app
whenever you go driving!
53. What functions can be used
in the background in iOS?
? Scanning peripherals
? Connecting with peripherals
? Reading characteristics’ value
? Writing characteristics’ value
? Receiving notifications
Almost all functions can be used
even in the background!
54. 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)
55. If the app in the background
is killed by the system…
57. 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 callback method.
→ The app can handle BLE events!
58. 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!
60. 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
61. Development Kit
Can start development without
creating a circuit ourselves
BLE Module
Display
USB interface
Battery box
70. Recap
? What is Bluetooth Low Energy?
? Basics of BLE with ‘Moff’.
? Japanese Hardware Products I’ve worked on
? Practical Tips to build apps using BLE
- Defining GATT
- Defining background behaviors
- Testing without HW prototypes
- App Review