Development Models
• 準備跟 Smart Phone 說分手?淺談 BLE 開發模式
• 從 BLE 開發模式切入,探討進入物聯網需跨越的門檻
• 開發模式
▪ 純嵌入式
▪ 手機 App
▪ BLE Gateway 應用
13
Slide 14
Slide 14 text
Develop with Embedded SoCs
• 適用於周邊節點開發
• 點對點應用 (如 gecko switch)
• 開發工具
▪ IC vendor 提供 SDK 與 HDK 開發板
TI CC2540 Development Kit
Bluetooth Smart Starter Development Kit
14
圖片來源: 1, 2, 3, 4
一對一控制
Slide 15
Slide 15 text
Develop with Smart Phones/Pads
• 適用於個人型網路應用
▪ 智慧手環、手錶、運動配件
▪ 智慧插座、電燈
• 開發工具
▪ 手機作業系統提供與底層藍芽晶片溝通的 Library 或 APIs
▪ Android - Bluetooth network stack
▪ iOS - Bluetooth for Developers
15
圖片來源: 1, 2, 3
Slide 16
Slide 16 text
• 適用於小型區域網路
▪ 智慧家庭
▪ 工廠自動化
• 開發工具
▪ TI - Bluetooth Smart-to-Wi-Fi Gateway solution
▪ RedBear Duo - A small and powerful Wi-Fi+BLEIoT board
Develop with Gateways
16
圖片來源: 1, 2
Slide 17
Slide 17 text
Compatibility
17
?
圖片來源: 1, 2, 3
Slide 18
Slide 18 text
SIG’s Positive Response
18
“We heard the demand for gateway
functionality, not just from our members, but
from consumers, who want a connected home
but are not satisfied with current capabilities.”
- Steve Hegenderfer
Director
Developer programs,
Bluetooth SIG
Slide 19
Slide 19 text
Bluetooth Secure Gateway
• SIG 今年 2 月初發布了 BLE Gateway 解決方案
19
圖片來源: 1
Node.js
15 RESTful APIs
Node.js Web Frameworks
• 前/後端皆使用 JavaScript
▪ Google V8 Engine (Client: Chrome, Server: Node.js)
• 框架 – 在別人搭好的舞台上表演
▪ 框架為開發者定義好整體架構並實作部分功能,減輕開發
者的負擔,加快開發流程
• Back-end Web Frameworks
▪ 建立大規模、real-time、可擴展 Web 應用程式 (webapps)
21
Slide 22
Slide 22 text
Web Front-end Frameworks
• Web Application (網路版應用程式)
• Front-end Web Frameworks / CSS / DOM / Tools
▪ 因前端技術繁多,以下只是列出其中一部分
22
Slide 23
Slide 23 text
We are Family
• 仍有困難需克服
▪ 手機開發不利於物聯網應用
▪ 進入 BLE Gateway 開發有門檻
▪ 傳統 BLE Gateway 無法實作應用
▪ BLE 裝置間沒有相容性
23
是 BLE 刷存在感的時候了
BLE 裝置要能上網!
也可以漫步在雲端!
黏踢踢的手機也需要被解放!
Slide 24
Slide 24 text
BLE Shepherd Can Help
• BLE 開發應用框架
• 它是驅動程式 (HCI Host)
• 它是 BLE 應用程式環境,也是 BLE 網路管理器
• 可以接上 http 伺服器,很容易跟其他前端框架整合
• 也可以讓 BLE 裝置們通通上雲端
• 你能設計 RESTful 介面,從網外存取網內 BLE 裝置
24
https://github.com/bluetoother/ble-shepherd
Slide 25
Slide 25 text
No Smart Phone? Kidding Me?
25
那用什麼開發?
JavaScript & HTML5 + BLE Shepherd
真的!不蓋你!
而且,複雜的底層封包處理,它全包辦了!
還免費贈送 BLE 網管功能!
Slide 26
Slide 26 text
26
BLE Shepherd 有很重要的使命
成為將 BLE 內嵌於多協定物聯網閘道器的先驅
解放阿公、阿嬤健康照護周邊小玩意兒!
Slide 27
Slide 27 text
BLE Shepherd (BShep)
• BLE central device 之擴充
• 基於 Node.js
• 無痛建立 BLE 機器網路
27
BShep
BLE App
TI CC254X BLE
Network Processor
BLE4.0
USB Adapter
cc-bnp noble
Hardware
& PHY
HCI
Controller
Driver
@Node.js
HCI
Host
Network Control and
Management Layer
Application Layer
Slide 28
Slide 28 text
Bluetooth Machine Network
28
Read / Write
BLE Peripheral
Bluetooth device
User
Cloud
Ind / Notif
App server
BLE Gateway
ble-shepherd
Manage
Control
Local area
Monitor
BLE Central
小型/區域網路 系統化
智慧物件模型
管理介面
SIG Gateway v.s. BLE Shepherd
30
BLE Secure Gateway ble-shepherd
Security
RESTful APIs
GATT
GAP
noble
HTTP Server
peripheral
central
Web Application
Security
Management APIs
peripheral
Application Server (BLE Apps)
GATT
BIPSO
GAP
central
cc-bnp noble
Web Application
Slide 31
Slide 31 text
GATT Table on BLE Device
• 如何規劃 GATT Table
▪ SIG-defined GATT Services
▪ SIG-defined GATT Characteristics
▪ User-defined Services & Characteristics
• Mix Them Up
▪ 組成描述裝置所需的資料體
31
但是,這樣的彈性卻是一把雙面刃!
各家廠商定義自己的私有規範
裝置之間沒有任何相容性
Slide 32
Slide 32 text
IPSO – IP-based Smart Object
• IPSO Alliance & IPSO Model
▪ 對真實世界的物件資料模型進行標準化
▪ 已定義 51 種 Smart Objects,增加中
▪ 採用階層化資料模型 (Object, Object Instance, Resource)
32
Slide 33
Slide 33 text
Unified Data Model for BLE
• BLE 的資料模型混亂
▪ SIG 定義的 Characteristic 不易套用至實際 IoT 裝置
▪ 自由度高,廠商大多自訂且彼此不能相容,僅能自家使用
• BIPSO 借鏡 IPSO 模型,試圖解決相容性問題
▪ 定義 Characteristics-SmartObject 映射,共 51 種
▪ 曾與 IPSO 聯盟與 OCF 進行討論,BIPSO 是國際標準
組織的資料模型制定參考之一
33
BLE Shepherd 原生支援!無縫接軌!