Skip to Main Content
物联网设备安全
book

物联网设备安全

by Nitesh Dhanjani
March 2017
Intermediate to advanced content levelIntermediate to advanced
262 pages
5h 26m
Chinese
China Machine Press
Content preview from 物联网设备安全
安全原型
——
littleBits
cloudBit
201
7.2.3
一个令牌即可解决问题
cloudBit
配置完成之后,就可以访问
http://control.littlebitscloud.cc
网站,点击“
Settings
获取分配给
cloudBit
Device ID
AccessToken
,如图
7-22
所示。
7-22:获取分配给 cloudBit AccessToken
AccessToken
用于
cloudBit
的远程交互。例如,
https://api-http.littlebitscloud.cc/devices/
DeviceID/input?access_token=AccessToken& token_type=bearer
形式的链接显示了
cloudBit
的状态。它每秒钟使用了
cloudBit API
来查询
cloudBit
的状态。图
7-23
输出中
的第一列列举的值都是百分比为
100
的值,这是因为连接到
cloudBit
上的按钮是按下的,
从而导致正输入被发送给了
cloudBit
。第二列列举的值都是
0
,表示按钮再没有被按下。
当我们使用
API
查询
cloudBit
的信息时,需要
DeviceID
AccessToken
。然而,如果我
们只知道
AccessToken
也可以通过如下与用户有关的方式获取
DeviceID
$
curl -i -XGET -H "Authorization: Bearer [AccessToken DELETED]"-H
"Accept: application/vnd.littlebits.v2+json" ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

数据科学之编程技术:使用R进行数据清理、分析与可视化

数据科学之编程技术:使用R进行数据清理、分析与可视化

迈克尔 弗里曼, 乔尔 罗斯
手把手教会你linux

手把手教会你linux

桑德.范.乌格特
C语言核心技术(原书第2版)

C语言核心技术(原书第2版)

Peter Prinz, Tony Crawford

Publisher Resources

ISBN: 9787111558668