Android 5.0(Lollipop)引入的新BLE外设模式将不会在Nexus 4,5或7(https://code.google.com/p/android-developer-preview/issues/detail?id=1570#c52)上启用,但将在Nexus 6和9上启用 .

尽管Nexus 4/5/7中的蓝牙4.0兼容芯片组应该同时支持中央和外围模式,但Android 5.0通过添加布尔调用“BluetoothAdapter.isMultipleAdvertisementSupported()”来挑选外围广告功能 .

例如,此代码将显示Nexus 5不支持广告,但Nexus 9支持广告 .

BluetoothManager btMgr = (BluetoothManager) this.getSystemService(Context.BLUETOOTH_SERVICE);
BluetoothAdapter btAdptr = btMgr.getAdapter();

if (btAdptr.isMultipleAdvertisementSupported()) {
    Log.v(TAG, "advertisement is SUPPORTED on this chipset!");
} else {
    Log.v(TAG, "advertisement NOT supported on this chipset!");
}

AndroidManifest.xml至少应该有

<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-feature android:name="android.hardware.bluetooth_le" android:required="true"/>

每当我查看芯片组时,我只看到它“支持蓝牙4.0”,并且中央和外设支持之间没有区别 . 有没有办法告诉哪些蓝牙芯片组支持Android 5上的外设模式,而无需运行上述代码或访问其固件源?