首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Android蓝牙Ble Ble阻止对请求

Android蓝牙Ble Ble阻止对请求
EN

Stack Overflow用户
提问于 2016-11-08 13:03:13
回答 1查看 377关注 0票数 1

谢谢你查查我的问题。

我使用android开发人员中的代码来连接ble:

代码语言:javascript
复制
BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address);
    if (device == null) {
        Log.w(TAG, "Device not found.  Unable to connect.");
        return false;
    }
    // We want to directly connect to the device, so we are setting the autoConnect
    // parameter to false.
    if (mBluetoothGatt != null) {
        mBluetoothGatt.close();
        mBluetoothGatt = null;
    }
    mBluetoothGatt = device.connectGatt(this, false, mGattCallback);

但是在代码工作之后,对对话框就会出现,而我实际上并不需要这对工作,我只需要连接客户端,然后发送数据(我需要连接的远程设备已经被设置为“不需要对”),有什么方法可以避免对调用吗?

谢谢!

EN

回答 1

Stack Overflow用户

发布于 2016-11-08 21:44:49

只有当远程设备实际发送“安全请求”数据包时,才会设置配对对话框,表明它希望配对。所以你的“不需要对”设置由于某种原因似乎不能正常工作.

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40487662

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档