相关疑难解决方法(0)

使用android 4.4.2在Nexus 7(ME370T)上进行BLE

我一直试图使用来自sdk(sdk\samples\android-18\legacy\BluetoothLeGatt)的样本将BLE设备与我的Nexus 7(ME370T)配对.但我得到的信息"不支持Ble".我正在寻找解决方案,我只发现:

NB!带有Android 4.3的Nexus 7(2012)未启用BLE.要在此设备上使用BLE,您将需要Bluetooth Low Energy Enabler工具.此工作的先决条件是设备已植根,并且>已安装BusyBox应用程序.

我找不到有关4.4.2支持或任何4.4.2启用的信息.我才能找到

以防其他人在Nexus 7上搜索BLE - 这个ROM在4.4 KitKat上有一个工作BLE.几乎> Stock ROM称为'纯度'.PURITY ROM(链接:http://forum.xda-developers.com/showthread.php? t = 2222374 ).

问题是我需要将我的Nexus 7和4.4.2连接到另一个ROM来启用BLE吗?mod之后会起作用吗?

android bluetooth bluetooth-lowenergy nexus-7

14
推荐指数
1
解决办法
3万
查看次数

蓝牙LE广告在启动和循环停止时失败

我已经尝试过蓝牙LE广告,即使用Android手机作为BLE"外围设备".启动和停止持续广告一旦正常工作,但如果我想实际传输一些不同的数据,我需要在一个周期内启动,停止和重新启动广告,并始终更改广告包.

我当然使用这些方法:
BluetoothLeAdvertiser.startAdvertising()
BluetoothLeAdvertiser.stopAdvertising()

至少在摩托罗拉Moto G 4G第二代.(XT1072)与Android 5.0.2的循环只运行一段时间,然后蓝牙堆栈出现问题,无法再启动新的广告.当快速运行循环时,这很快发生,如果运行缓慢,则需要更多时间,因此可能与某些缓冲区填满有关.

我的问题是:这是否也发生在摩托罗拉以外的其他设备上?

(当然,欢迎任何其他相关评论.)

从理论上讲,它可能依赖于一些制造商特定的HAL实现等.所以我想知道我是否应该让其他设备能够解决这个问题,因为谷歌/摩托罗拉的任何修复都需要一些时间.

这个测试应用程序 可以用来试试这个:

https://bitbucket.org/MarkusKauppinen/bleadvertisertest

如果一切顺利,它将乐意继续广告,如果这个问题再现,它将在几分钟左右的时间内显示一个对话框.如果您的设备根本不支持蓝牙LE广告或BLE,它就会崩溃.(这只是一个快速而肮脏的测试应用程序.)

另一种简单的方法是从https://github.com/devunwired/accessory-samples运行"bluetoothadvertiser"应用程序,并快速点击UI上的"更新广告"按钮一段时间.

额外细节:

蓝牙LE外设模式支持(广告需要)在Lollipop中添加,在4.x中不可用.只有某些设备具有外设模式支持.兼容性至少包含在:

https://altbeacon.github.io/android-beacon-library/beacon-transmitter-devices.html 支持Android 5 BLE外设模式 芯片组的芯片组/设备支持Android 5上的BLE外设角色

例如,这些设备应该得到支持:摩托罗拉Moto E 4G(2015),摩托罗拉Moto G 4G(第二代),索尼Xperia M4 Aqua,中兴Blade S6,摩托罗拉Moto X(2014),三星Galaxy S6,谷歌Nexus 6 ,谷歌Nexus 9,HTC One M9,三星Galaxy S6 Edge.

至于"脏细节",在此之前我总是可以在LogCat中看到"GKI_Exception":

GKI_exception():65524 getbuf:缓冲区外

在第一个"GKI_Exception"之后不久,广告以AdvertiseCallback.ADVERTISE_FAILED_INTERNAL_ERROR失败.这条线......

E/BtGatt.btif?### ASSERT:external/bluetooth/bluedroid/main /../ btif/src/btif_gatt_client.c 803行上下文传输失败!(3)###

......可能很重要,但我不熟悉BlueDroid.所述断言在这里:

https://android.googlesource.com/platform/external/bluetooth/bluedroid/+/android-5.0.2_r1/btif/src/btif_gatt_client.c#803

一些可能相关的问题:
https://code.google.com/p/android/issues/detail?id = 65455 < - 我在此添加了一些注释和日志文件.
https://code.google.com/p/android-developer-preview/issues/detail?id=1753 在三星S4上
扫描大量BLE标签
蓝牙崩溃

android bluetooth-lowenergy android-bluetooth

9
推荐指数
1
解决办法
2211
查看次数

Android中的BLE广告

我正在开发和应用程序在Android中发送BLE广告包.我使用AdvertiseData和AdverstiseSettings类来生成广告包.但是,当我执行StartAdvertising时,它总是给我一个错误,错误代码为"2","ADVERTISE_FAILED_TOO_MANY_ADVERTISERS","由于没有广告实例可用,因此无法开始投放广告."

下面是我的MainActivity.JAVA代码

package rockwellcollins.blutooth_advertise;

import android.bluetooth.BluetoothAdapter;
import android.bluetooth.le.AdvertiseCallback;
import android.bluetooth.le.AdvertiseData;
import android.bluetooth.le.AdvertiseSettings;
import android.bluetooth.le.BluetoothLeAdvertiser;
import android.bluetooth.le.BluetoothLeScanner;
import android.bluetooth.le.ScanCallback;
import android.bluetooth.le.ScanResult;
import android.os.Bundle;
import android.os.ParcelUuid;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import java.util.List;
import java.util.UUID;

public class MainActivity extends AppCompatActivity {
    private BluetoothLeScanner mBluetoothLeScanner;
    private TextView textView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); …
Run Code Online (Sandbox Code Playgroud)

android ads bluetooth-lowenergy

4
推荐指数
2
解决办法
5872
查看次数

getBluetoothLeAdvertiser()返回null

BluetoothLeAdvertiser advertiser = BluetoothAdapter.getDefaultAdapter().getBluetoothLeAdvertiser();
Run Code Online (Sandbox Code Playgroud)

返回null.我已尝试使用API​​ 21和API 23设备,但结果相同.我不知道我错过了什么?

该应用程序构建和运行正常,直到当然使用广告客户和应用程序崩溃.

我感谢您提供的任何帮助!:)

android bluetooth-lowenergy android-bluetooth

2
推荐指数
1
解决办法
2259
查看次数