SlideShare une entreprise Scribd logo
1  sur  14
BLE Device Prototyping
Nordic nRF51822 based
BVMCN5103-CEAA-BK
Elias Hasnat
Dated: October 12, 2015
IoT基板ソフトウエア開発課⻑
Senior Manager, IoT Foundation Software Development
BLE 開発キット
BVMCN5103-CFAC-BK KIT
BLE Prototype with GW Layer
AWS Thing Shadow Prototype
BVMCN5103-CEAA-BK
Bluetooth Low Energyの
データ通信プロトコルの基本
• 接続処理が完了すると、マスター、スレーブともにデータチャ
ネルに移ります。どちらかがサーバになり、もう⼀⽅がクライ
アントになります。通常は、アドバータイズをしている側(ス
レーブ側)が、サーバになります。そのサーバに対して、ス
マートフォンなどのクライアントがアクセスに⾏くことになり
ます(1つの機器で、サーバの役割、クライアントの役割とも
持つことが可能です)。
• 下記のようなプロトコルスタックになっています。正確には
GAPからLinkLayerにアクセスするケース(スキャン時、接続
時)など例外的なパスはありますが、おおよそこの図で説明で
きます。
Bluetooth Low Energyの
データ通信プロトコルの基本
Bluetooth Low Energyの
データ通信プロトコルの基本
なお、上記のプロトコルスタック図は、サーバ側、クライアント
側の両⽅で共通です。
LinkLayerは、LLと略すこともあります。HCIは、Host Control
Interfaceの略ですが、昔はこのレイヤでHost CPUとBluetooth
デバイスがUART等で接続され制御していたのですが、現在はす
べてSingle Chipで処理されていますので、このレイヤはなく
なっています。
ATTは、Attribute Protocolの略です。GATTは、Generic
Attribute Profileの略です。GAPは、Generic Access Profileの略
です。これらの詳しい説明は、以降で⾏います。Layerとか
ProfileとかProtocolとかいろいろな名称が使われてますが、通信
ですので中⾝はプロトコル(約束事)です。
属性(Attribute)
サーバには属性(Attribute)というデータの箱があり、それにクライアント側からアクセスします。
この属性のやり取りをするプロトコルをATT(Attribute)プロトコルと呼んでいます。さらに、この属
性(Attribute)を複数組み合わせて、GATTデータベースというものを作ります。そのGATTデータ
ベースにアクセスするプロトコルをGATTプロトコルと呼んでいます。
属性(Attribute)は、下記の集まりです。これらはサーバ内部で保存しておく値ですので、どのような
形で保存しておいてもかまいません。
• Attributeハンドル(2Byte)
• Attributeタイプ(2 or 16Byte)
• Attribute値(0-512Byte)
• Attributeパーミッション
Attributeハンドルは、通し番号です。Attributeタイプは、UUIDという識別⼦で、その値によって
サービス名(Service)を⽰したり、キャラクタリスティック(Characteristic)と⾔われるものを⽰した
りします(なお、ServiceとかCharacteristicというのは、GATTでの概念で、ATTでは定義されてい
ません)。Attribute値は、アプリケーションレイヤが利⽤するデータが⼊ります。Attributeパーミッ
ションは、読み書きできるとか、読み込みのみとか、暗号化ありとかの属性です。この属性
(Attribute)が、いくつも集まりGATTデータベースとなっています。
ATTプロトコル
属性(Attribute)にアクセスするATTプロトコルで使われるパケッ
トフォーマットです。
• Read Request, Write Request, Handle Value Notification,
Handle Value Indicationなどのハンドルを操作する場合は、上
記Attribute Parametersに、Handle番号が⼊ります。
• ATTプロトコルでは主に下記の操作ができます。カッコの中は、
実際のAttribute OpCode値です。
ATTプロトコル
• Error Handling
• Error Response(0x01)
• Server Configuration
• Exchange MTU Request(0x02)
• Exchange MTU Response(0x03)
• Find Information
• Find Information Request(0x04)
• Find Information Response(0x05)
• Find By Type Value Request(0x06)
• Find By Type Value Response(0x07)
• Reading Attributes
• Read By Type Request(0x08)
• Read By Type Response(0x09)
• Read Request(0x0A)
• Read Response(0x0B)
• Read Blob Request(0x0C)
• Read Blob Response(0x0D)
• Read Multiple Request(0x0E)
• Read Multiple Response(0x0F)
• Read by Group Type Request(0x10)
• Read by Group Type Response(0x11)
• Writing Attributes
• W rite Request(0x12)
• W rite Response(0x13)
• W rite command(0x14)
• Prepare W rite Request(0x16)
• Prepare W rite Response(0x17)
• Execute W rite Request(0x18)
• Execute W rite Response(0x19)
• Signed W rite command(0xD2)
• Server Initiated
• Handle Value Notification(0x1B)
• Handle Value Indication(0x1D)
• Handle Value Confirmation(0x1E)
ATTプロトコル
• 例えば、Reading Attributesの中のコマンドの1つで、クライ
アントがサーバのデータを読む場合は、Read
Request(Attribute OpCode:0x0A)というのをクライアントから
サーバに送り、サーバがRead Response(Attribute
OpCode:0x0B)というのを返してきます。
• このATTプロトコルは低レベルのプロトコルなので、温度計
の値を読みこむとかの操作はできません。センサーの値を読む
ときなどは、⼀つ上のレイヤのGATTプロトコルが必要になり
ます。
GATTデータベース
• 属性(Attribute)を集めたGATTデータ
ベースですが、イメージがしづらい
ので、実際のセンサーの値を格納し
たデータベースで説明します。
Bluetooth Low Energy規格では、こ
の辺が⾮常に理解しずらいです。理
解しづらいのは、サービスの宣⾔ま
でが、1つの属性(Attribute)に割
り当てられてしまっているからです。
通信の世界ではなく、MySQL等の
データベースの世界になっています。
• 具体的な温度計のGATTデータ
ベースは下記のようになります。1
⾏ずつは、属性(Attribute)になって
ます。
GATTデータベース
実際は、サービスは、キャラクタリス
ティックの集まりとして定義されてい
ます。
さらに、キャラクタリスティックは、
Characteristic Declaration、
Characteristic Value、Characteristic
Descriptorの集まりとして定義されま
す。
そのため、上記は、下記のような構造
になります。
GATTプロトコル
GATTプロトコルは、GATTデータベースにアクセスするプロトコルで
す。いくつかのATTプロトコルの組み合わせで実現します。
よく使われる操作には下記のようなものがあります。
• Discover Characteristic:クライアントがCharacteristicを探す
• Read Characteristic Value:クライアントがCharacteristic値を読む
• Write Characteristic Value:クライアントがCharacteristic値を書く
• Notify Characteristic Value:サーバがCharacteristic値を通知する
ありがとうございます

Contenu connexe

Similaire à BLE.pdf

インフラセキュリティブートキャンプ #seccamp
インフラセキュリティブートキャンプ #seccampインフラセキュリティブートキャンプ #seccamp
インフラセキュリティブートキャンプ #seccampMasahiro NAKAYAMA
 
ソフトバンクにおける Java による クラウドネイティブの実現
ソフトバンクにおける Java による クラウドネイティブの実現ソフトバンクにおける Java による クラウドネイティブの実現
ソフトバンクにおける Java による クラウドネイティブの実現Shigeru Tatsuta
 
Open stack reference architecture v1 2
Open stack reference architecture v1 2Open stack reference architecture v1 2
Open stack reference architecture v1 2Dell TechCenter Japan
 
[社内共有会]AWS NAT-GW導入と構成変化 2年運用して 同時接続数 秒間100->10万へ成長
[社内共有会]AWS NAT-GW導入と構成変化 2年運用して 同時接続数 秒間100->10万へ成長[社内共有会]AWS NAT-GW導入と構成変化 2年運用して 同時接続数 秒間100->10万へ成長
[社内共有会]AWS NAT-GW導入と構成変化 2年運用して 同時接続数 秒間100->10万へ成長Takahiro Moteki
 
YAPC::Asia 2008 Tokyo - Pathtraq - building a computation-centric web service
YAPC::Asia 2008 Tokyo - Pathtraq - building a computation-centric web serviceYAPC::Asia 2008 Tokyo - Pathtraq - building a computation-centric web service
YAPC::Asia 2008 Tokyo - Pathtraq - building a computation-centric web serviceKazuho Oku
 
Cloud Foundry Container-to-Container Networking
Cloud Foundry Container-to-Container NetworkingCloud Foundry Container-to-Container Networking
Cloud Foundry Container-to-Container NetworkingKazuto Kusama
 
Interop Tokyo 2021 - ShowNet を陰で支えた Azure Virtual WAN
Interop Tokyo 2021 - ShowNet を陰で支えた Azure Virtual WANInterop Tokyo 2021 - ShowNet を陰で支えた Azure Virtual WAN
Interop Tokyo 2021 - ShowNet を陰で支えた Azure Virtual WANShuheiUda
 
Neutron Icehouse Update (Japanese)
Neutron Icehouse Update (Japanese)Neutron Icehouse Update (Japanese)
Neutron Icehouse Update (Japanese)Akihiro Motoki
 
Network as a Service - Data plane evolution and abstraction by NSM
Network as a Service - Data plane evolution and abstraction by NSMNetwork as a Service - Data plane evolution and abstraction by NSM
Network as a Service - Data plane evolution and abstraction by NSMMiya Kohno
 
Oracle Cloud Infrastructure 最新情報(Oracle Cloudウェビナーシリーズ: 2020年9月3日)
Oracle Cloud Infrastructure 最新情報(Oracle Cloudウェビナーシリーズ: 2020年9月3日)Oracle Cloud Infrastructure 最新情報(Oracle Cloudウェビナーシリーズ: 2020年9月3日)
Oracle Cloud Infrastructure 最新情報(Oracle Cloudウェビナーシリーズ: 2020年9月3日)オラクルエンジニア通信
 
今日から使えるCouchbaseシステムアーキテクチャデザインパターン集
今日から使えるCouchbaseシステムアーキテクチャデザインパターン集今日から使えるCouchbaseシステムアーキテクチャデザインパターン集
今日から使えるCouchbaseシステムアーキテクチャデザインパターン集Couchbase Japan KK
 
GKE に飛んでくるトラフィックを 自由自在に操る力 | 第 10 回 Google Cloud INSIDE Games & Apps Online
GKE に飛んでくるトラフィックを 自由自在に操る力 | 第 10 回 Google Cloud INSIDE Games & Apps OnlineGKE に飛んでくるトラフィックを 自由自在に操る力 | 第 10 回 Google Cloud INSIDE Games & Apps Online
GKE に飛んでくるトラフィックを 自由自在に操る力 | 第 10 回 Google Cloud INSIDE Games & Apps OnlineGoogle Cloud Platform - Japan
 
ディペンダブルなクラウドコンピューティング基盤を目指して
ディペンダブルなクラウドコンピューティング基盤を目指してディペンダブルなクラウドコンピューティング基盤を目指して
ディペンダブルなクラウドコンピューティング基盤を目指してKazuhiko Kato
 
【第5回東京SoftLayer勉強会】LT7 SoftLayerでOpenStackを動かしてみた
【第5回東京SoftLayer勉強会】LT7 SoftLayerでOpenStackを動かしてみた【第5回東京SoftLayer勉強会】LT7 SoftLayerでOpenStackを動かしてみた
【第5回東京SoftLayer勉強会】LT7 SoftLayerでOpenStackを動かしてみたNobuyuki Matsui
 
Azure Stack 受け入れ準備_20180630
Azure Stack 受け入れ準備_20180630Azure Stack 受け入れ準備_20180630
Azure Stack 受け入れ準備_20180630Hiroshi Matsumoto
 
[AWS Summit 2012] クラウドデザインパターン#4 CDP VPC移行編
[AWS Summit 2012] クラウドデザインパターン#4 CDP VPC移行編[AWS Summit 2012] クラウドデザインパターン#4 CDP VPC移行編
[AWS Summit 2012] クラウドデザインパターン#4 CDP VPC移行編Amazon Web Services Japan
 
Cld018 コンテナ go_~あなた
Cld018 コンテナ go_~あなたCld018 コンテナ go_~あなた
Cld018 コンテナ go_~あなたTech Summit 2016
 

Similaire à BLE.pdf (20)

インフラセキュリティブートキャンプ #seccamp
インフラセキュリティブートキャンプ #seccampインフラセキュリティブートキャンプ #seccamp
インフラセキュリティブートキャンプ #seccamp
 
ソフトバンクにおける Java による クラウドネイティブの実現
ソフトバンクにおける Java による クラウドネイティブの実現ソフトバンクにおける Java による クラウドネイティブの実現
ソフトバンクにおける Java による クラウドネイティブの実現
 
Open stack reference architecture v1 2
Open stack reference architecture v1 2Open stack reference architecture v1 2
Open stack reference architecture v1 2
 
[社内共有会]AWS NAT-GW導入と構成変化 2年運用して 同時接続数 秒間100->10万へ成長
[社内共有会]AWS NAT-GW導入と構成変化 2年運用して 同時接続数 秒間100->10万へ成長[社内共有会]AWS NAT-GW導入と構成変化 2年運用して 同時接続数 秒間100->10万へ成長
[社内共有会]AWS NAT-GW導入と構成変化 2年運用して 同時接続数 秒間100->10万へ成長
 
YAPC::Asia 2008 Tokyo - Pathtraq - building a computation-centric web service
YAPC::Asia 2008 Tokyo - Pathtraq - building a computation-centric web serviceYAPC::Asia 2008 Tokyo - Pathtraq - building a computation-centric web service
YAPC::Asia 2008 Tokyo - Pathtraq - building a computation-centric web service
 
Cloud Foundry Container-to-Container Networking
Cloud Foundry Container-to-Container NetworkingCloud Foundry Container-to-Container Networking
Cloud Foundry Container-to-Container Networking
 
Interop Tokyo 2021 - ShowNet を陰で支えた Azure Virtual WAN
Interop Tokyo 2021 - ShowNet を陰で支えた Azure Virtual WANInterop Tokyo 2021 - ShowNet を陰で支えた Azure Virtual WAN
Interop Tokyo 2021 - ShowNet を陰で支えた Azure Virtual WAN
 
Neutron Icehouse Update (Japanese)
Neutron Icehouse Update (Japanese)Neutron Icehouse Update (Japanese)
Neutron Icehouse Update (Japanese)
 
Network as a Service - Data plane evolution and abstraction by NSM
Network as a Service - Data plane evolution and abstraction by NSMNetwork as a Service - Data plane evolution and abstraction by NSM
Network as a Service - Data plane evolution and abstraction by NSM
 
Oracle Cloud Infrastructure 最新情報(Oracle Cloudウェビナーシリーズ: 2020年9月3日)
Oracle Cloud Infrastructure 最新情報(Oracle Cloudウェビナーシリーズ: 2020年9月3日)Oracle Cloud Infrastructure 最新情報(Oracle Cloudウェビナーシリーズ: 2020年9月3日)
Oracle Cloud Infrastructure 最新情報(Oracle Cloudウェビナーシリーズ: 2020年9月3日)
 
今日から使えるCouchbaseシステムアーキテクチャデザインパターン集
今日から使えるCouchbaseシステムアーキテクチャデザインパターン集今日から使えるCouchbaseシステムアーキテクチャデザインパターン集
今日から使えるCouchbaseシステムアーキテクチャデザインパターン集
 
GKE に飛んでくるトラフィックを 自由自在に操る力 | 第 10 回 Google Cloud INSIDE Games & Apps Online
GKE に飛んでくるトラフィックを 自由自在に操る力 | 第 10 回 Google Cloud INSIDE Games & Apps OnlineGKE に飛んでくるトラフィックを 自由自在に操る力 | 第 10 回 Google Cloud INSIDE Games & Apps Online
GKE に飛んでくるトラフィックを 自由自在に操る力 | 第 10 回 Google Cloud INSIDE Games & Apps Online
 
OpenStack and ACI
OpenStack and ACIOpenStack and ACI
OpenStack and ACI
 
【de:code 2020】 Azure インフラ 最新アップデート!!
【de:code 2020】 Azure インフラ 最新アップデート!!【de:code 2020】 Azure インフラ 最新アップデート!!
【de:code 2020】 Azure インフラ 最新アップデート!!
 
ディペンダブルなクラウドコンピューティング基盤を目指して
ディペンダブルなクラウドコンピューティング基盤を目指してディペンダブルなクラウドコンピューティング基盤を目指して
ディペンダブルなクラウドコンピューティング基盤を目指して
 
【第5回東京SoftLayer勉強会】LT7 SoftLayerでOpenStackを動かしてみた
【第5回東京SoftLayer勉強会】LT7 SoftLayerでOpenStackを動かしてみた【第5回東京SoftLayer勉強会】LT7 SoftLayerでOpenStackを動かしてみた
【第5回東京SoftLayer勉強会】LT7 SoftLayerでOpenStackを動かしてみた
 
Azure Stack 受け入れ準備_20180630
Azure Stack 受け入れ準備_20180630Azure Stack 受け入れ準備_20180630
Azure Stack 受け入れ準備_20180630
 
[AWS Summit 2012] クラウドデザインパターン#4 CDP VPC移行編
[AWS Summit 2012] クラウドデザインパターン#4 CDP VPC移行編[AWS Summit 2012] クラウドデザインパターン#4 CDP VPC移行編
[AWS Summit 2012] クラウドデザインパターン#4 CDP VPC移行編
 
20200528.jaws ug kyushu
20200528.jaws ug kyushu20200528.jaws ug kyushu
20200528.jaws ug kyushu
 
Cld018 コンテナ go_~あなた
Cld018 コンテナ go_~あなたCld018 コンテナ go_~あなた
Cld018 コンテナ go_~あなた
 

Plus de Elias Hasnat

FacialRecognition-May-8-2020.pdf
FacialRecognition-May-8-2020.pdfFacialRecognition-May-8-2020.pdf
FacialRecognition-May-8-2020.pdfElias Hasnat
 
Smart City IoT Solution Improved
Smart City IoT Solution ImprovedSmart City IoT Solution Improved
Smart City IoT Solution ImprovedElias Hasnat
 
Connected vehicle mobility as a service (maas)
Connected vehicle mobility as a service (maas)Connected vehicle mobility as a service (maas)
Connected vehicle mobility as a service (maas)Elias Hasnat
 
Lorawan for agriculture, haccp hazard analysis and critical control point
Lorawan for agriculture, haccp hazard analysis and critical control pointLorawan for agriculture, haccp hazard analysis and critical control point
Lorawan for agriculture, haccp hazard analysis and critical control pointElias Hasnat
 
IoT Security with Azure
IoT Security with AzureIoT Security with Azure
IoT Security with AzureElias Hasnat
 
産業向け AWS IoT ソリューション
産業向け AWS IoT ソリューション産業向け AWS IoT ソリューション
産業向け AWS IoT ソリューションElias Hasnat
 
AIIoT組み込みシステム向けIEEE1888通信スタック
AIIoT組み込みシステム向けIEEE1888通信スタックAIIoT組み込みシステム向けIEEE1888通信スタック
AIIoT組み込みシステム向けIEEE1888通信スタックElias Hasnat
 
IoT security reference architecture
IoT security  reference architectureIoT security  reference architecture
IoT security reference architectureElias Hasnat
 
Intelligent video stream detection platform
Intelligent video stream detection platformIntelligent video stream detection platform
Intelligent video stream detection platformElias Hasnat
 
Machine Learning Algorithms
Machine Learning AlgorithmsMachine Learning Algorithms
Machine Learning AlgorithmsElias Hasnat
 
Reinforcement learning
Reinforcement learningReinforcement learning
Reinforcement learningElias Hasnat
 
China Mobile Market
China Mobile MarketChina Mobile Market
China Mobile MarketElias Hasnat
 

Plus de Elias Hasnat (20)

FacialRecognition-May-8-2020.pdf
FacialRecognition-May-8-2020.pdfFacialRecognition-May-8-2020.pdf
FacialRecognition-May-8-2020.pdf
 
Smart City IoT Solution Improved
Smart City IoT Solution ImprovedSmart City IoT Solution Improved
Smart City IoT Solution Improved
 
Connected vehicle mobility as a service (maas)
Connected vehicle mobility as a service (maas)Connected vehicle mobility as a service (maas)
Connected vehicle mobility as a service (maas)
 
Lorawan for agriculture, haccp hazard analysis and critical control point
Lorawan for agriculture, haccp hazard analysis and critical control pointLorawan for agriculture, haccp hazard analysis and critical control point
Lorawan for agriculture, haccp hazard analysis and critical control point
 
IoT Security with Azure
IoT Security with AzureIoT Security with Azure
IoT Security with Azure
 
産業向け AWS IoT ソリューション
産業向け AWS IoT ソリューション産業向け AWS IoT ソリューション
産業向け AWS IoT ソリューション
 
Soap vs REST-API
Soap vs REST-APISoap vs REST-API
Soap vs REST-API
 
AIIoT組み込みシステム向けIEEE1888通信スタック
AIIoT組み込みシステム向けIEEE1888通信スタックAIIoT組み込みシステム向けIEEE1888通信スタック
AIIoT組み込みシステム向けIEEE1888通信スタック
 
IoT security reference architecture
IoT security  reference architectureIoT security  reference architecture
IoT security reference architecture
 
Intelligent video stream detection platform
Intelligent video stream detection platformIntelligent video stream detection platform
Intelligent video stream detection platform
 
Machine Learning Algorithms
Machine Learning AlgorithmsMachine Learning Algorithms
Machine Learning Algorithms
 
REST API
REST APIREST API
REST API
 
Mqtt
MqttMqtt
Mqtt
 
Reinforcement learning
Reinforcement learningReinforcement learning
Reinforcement learning
 
Java8 features
Java8 featuresJava8 features
Java8 features
 
Dalvikよりart
DalvikよりartDalvikよりart
Dalvikよりart
 
K means
K meansK means
K means
 
Unity sdk-plugin
Unity sdk-pluginUnity sdk-plugin
Unity sdk-plugin
 
Cocos2dx
Cocos2dxCocos2dx
Cocos2dx
 
China Mobile Market
China Mobile MarketChina Mobile Market
China Mobile Market
 

BLE.pdf