• User Space實作
–1. Establish a handler for the signal delivered by the signal-driven I/O
mechanism;
–signal(SIGIO, signal_handler);
– Open Btn Device ;
– fd = open(dev_name ,O_RDWR);
– Set the owner of the file;
–fcntl(fd, F_SETOWN, getpid());
– Enable signal-driven I/O by turning on the FASYNC open file status flag
–fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | FASYNC);
Button Interrupt
19.
IOT網路連線
• 以雲端BaaS(Back endas a Service)作為資料儲存層
• 透過HTTP協定傳遞資料,呼叫儲存層REST API處理
• 以JSON格式封裝資料
• 封裝JSON/REST API, 簡化模組儲存及提取資料工序
• 藉由改變實作方式,可因應需求抽換不同儲存後端
功能簡介
20.
• Data storage
•30 request/sec, $100/10 requests
• 20G file storage, $0.03/GB extra
• 20G DB storage, $200/20GB extra
• 2TB data transfer,$0.10/GB extra
• Pushing service
• 1M unique recipients
• Social integration
• Twitter auth
• FaceBook auth
• Cloud Code
• node.js
• Web Hosting
BaaS(http://www.parse.com)
IOT網路連線
21.
• 一種設計風格,非標準,相較於SOAP、XML-RPC簡潔
• 基於使用HTTP、URI、XML、HTML等廣泛使用協議或標準
•資源由URI指定
• Ex. http://example.com/resources
• 對應HTTP協議的GET/POST/PUT/DELETE方法
• Ex. GET http://example.com/resource
• Ex. POST http://example.com/order
<purchase-order> <item> ... </item1> </purchase-order>
RESTful (Representational State Transfer)
IOT網路連線