LoginSignup
18
20

More than 5 years have passed since last update.

AndroidでBLEのAdvertise modeを使えるかどうかのメモ

Last updated at Posted at 2015-09-15

知っていると便利なBLEの知識

15/9/15
BLE/iBeaconとは
http://qiita.com/miyatay/items/4d4ce4ccd7905ddc0144

前提条件

Android 5.0 以降のBLE搭載スマホ
BluetoothはONにしておく
manifestにbluetoothのpermissionを記載

使えるかどうかチェックするには

以下でadvertiseが使えるかチェックできるっぽい

[manifest]

[java]
bluetoothAdapter.isMultipleAdvertisementSupported();
bluetoothAdapter.isOffloadedFilteringSupported();
bluetoothAdapter.isOffloadedScanBatchingSupported();

試した機器リスト

Nexus5 5.1 全てfalse(2015.9.15)
Zenfone2 laser 5.0.2 全てtrue(2015.9.15)
Nexus7(2012) 4.4.2のため使えず(2015.9.15)
Nexus7(2013) 5.1.1 全てfalse(2015.9.16)

参考

15/9/15
BluetoothAdapterについて
http://developer.android.com/reference/android/bluetooth/BluetoothAdapter.html

15/9/15
【Android】BLE通信ざっくりまとめ
コードあり
http://qiita.com/Hide-Matsu/items/6a6758eca86500881126

15/9/15
advertiseについて
難しそう
http://yamataka.hatenablog.com/entry/2015/02/24/210233

15/9/15
BLE詳しい
http://yegang.hatenablog.com/entry/2014/08/09/195246

参考(Centralについて)

15/9/15
コードあり
http://mslgt.hatenablog.com/entry/2015/05/17/212257

peripheral

15/9/15
公式のサンプルコード
試す価値あり
https://developer.android.com/samples/BluetoothAdvertisements/index.html

参考(その他)

15/9/15
Android5.0におけるBLEについて
受信編
http://recruit.gmo.jp/engineer/jisedai/blog/android5-scan-ble/
送信編
成功したみたいだが機種がわからない
http://recruit.gmo.jp/engineer/jisedai/blog/android5-advertise-ble/

15/9/15
これはアドバタイズに関して詳しい
端末に内蔵されているBluetoothのモジュールが対応していなければ使用できません。
例えばAdvertiseに関しては、Nexus5はAdvertiseできませんが、Nexus9ならAdvertiseできるというような状態です。(2014年12月末時点)
http://engineer.recruit-lifestyle.co.jp/techblog/2015-01-15-using-ibeacon-on-android5/

15/9/15
BLEペリフェラルについて
コードのみ
http://qiita.com/anzai_k/items/131373caa0a6294efdd4

BLEのモジュール

BCM4339
Nexus5のbluetoothモジュール?
http://ja.broadcom.com/products/bcm4339

15/9/15
Nexus6はペリフェラル可能っぽい?
http://qiita.com/mugicha/items/1f1c00599cebf53bdb51

15/9/15
Nexus7(2013)でアドバタイズ可能っぽい?
https://groups.google.com/forum/#!topic/android-group-japan/D47jKbNnAwo

15/9/15
Nexus7は2回目以降onLeScan()が呼ばれない、となるようです。Non-ConnectableだとNexus5もNexus7もアクティブスキャンせず、アドバタイズ受け取る毎にonLeScan()を呼ぶようです。
https://twitter.com/maimuzo/status/568631671341203456

15/9/15
advertise
Nexus5はアドバタイズ無理っぽい?
http://qiita.com/Hide-Matsu/items/6a6758eca86500881126
CastClassExceptionが出たがコードあり
http://masaru.hateblo.jp/entry/2015/01/29/233328
現在はBroadcomのチップ依存になるらしい
http://qiita.com/eggman/items/6a13f5be7deb363c800d

15/9/15
BLE advertiseの要件
Broadcomの独自仕様であるmultiple advertisementのHCIコマンドを使用できるチップである必要があります。
http://qiita.com/eggman/items/6a13f5be7deb363c800d

15/9/15
以下でadvertiseが使えるかチェックできるっぽい
[manifest]

[java]
bluetoothAdapter.isMultipleAdvertisementSupported(); bluetoothAdapter.isOffloadedFilteringSupported(); bluetoothAdapter.isOffloadedScanBatchingSupported();
http://stackoverflow.com/questions/26482611/chipsets-devices-supporting-android-5-ble-peripheral-mode

感想

初投稿なので体裁が整っていないため見にくいかもしれない
Markdownにあまり慣れていないためちょっと勉強してから書き直す
他にも調べたことがあるので時間があり次第、まとめることにする

18
20
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
18
20