小程序
小游戏
企业微信
微信支付
扫描小程序码分享
- 使用小程序蓝牙文档中的示例程序,运行之后搜索不到蓝牙设备
- 首页头像点进去,点击开始搜索,搜索不到附近已开启的蓝牙设备
12 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
定位权限以及定位开关打开了么?部分手机会因为没有定位权限搜索不到设备。
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
定位权限打开了
请问解决了吗
请问一下我也是用官方文档的示例代码 也是搜索不到想要的设备 不能搜索其他手机的蓝牙吗
手机不能连接手机吗,楼主
手机,小米mix2,微信版本:7.0.16,使用小程序搜索蓝牙设备,一堆未知设备,手机能够搜索到的,小程序根据搜索不到,定位与蓝牙全部打开了
我也是搜索不到取得身份证的蓝牙设备
全是未知设备很操蛋啊...什么都搜不到...蓝牙耳机,电脑,手机..
onLoad:
function
(){},
taponce:
(){
var
deviceId;
i = 0;
serviceId = [];
characteristicId = [];
wx.openBluetoothAdapter({
success:
(res) {
console.log(res,
"success"
);
wx.startBluetoothDevicesDiscovery({
services: [],
console.log(res)
},
fail:
console.log(
"fail"
)
})
}),
wx.getBluetoothDevices({
"getBluetoothDevices"
,res)
while
(res.devices[i]) {
"i"
,i);
console.log(res.devices[i].name, res.devices[i].deviceId);
if
(res.devices[i].name ==
'YahBoom_BL'
) {
deviceId = res.devices[i].deviceId;
console.log(deviceId);
}
i++;
wx.getBLEDeviceServices({
deviceId: deviceId,
"getBLEDeviceServices.services"
,res.services);
(res.services[i]) {
serviceId[i] = res.services[i].uuid;
console.log(serviceId[i]);
wx.getBLEDeviceCharacteristics({
serviceId: serviceId[1],
(res.characteristics[i]) {
characteristicId[i] = res.characteristics[i].uuid;
console.log(characteristicId[i]);
请问楼主,这个小程序的蓝牙是不是只能搜索除手机以外的蓝牙设备???
手机搜不到,有的蓝牙耳机也搜不到
我的代码没调试好,设备搜不到
嗯嗯,我也试了好多手机,以为自己文档错了,后来才发现是手机根本不能搜手机,蓝牙耳机还没测试。
文档里也没有说明,还有待完善
嗯嗯,这样的话就专注测蓝牙设备了,就不用纠结为啥搜不到手机了,多谢LZ
手机搜索手机不可以,需要搜索蓝牙耳机、蓝牙电子称等其他低功耗设备。
我之前测试这个用手机搜索手机一直搜索不到,后来搜到了邻居的蓝牙电子称。
我测测,谢谢
要用低功耗的蓝牙设备才可以搜到,连接
你好,普通手机、笔记本开启的蓝牙搜索不到吗?
当时我是测蓝牙打印机,手机搜不到,手表,耳机可以,打印机也可以
我试试,谢谢
正在加载...
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
定位权限以及定位开关打开了么?部分手机会因为没有定位权限搜索不到设备。
定位权限打开了
请问解决了吗
请问一下我也是用官方文档的示例代码 也是搜索不到想要的设备 不能搜索其他手机的蓝牙吗
手机不能连接手机吗,楼主
手机,小米mix2,微信版本:7.0.16,使用小程序搜索蓝牙设备,一堆未知设备,手机能够搜索到的,小程序根据搜索不到,定位与蓝牙全部打开了
我也是搜索不到取得身份证的蓝牙设备
全是未知设备很操蛋啊...什么都搜不到...蓝牙耳机,电脑,手机..
onLoad:
function
(){},
taponce:
function
(){
var
deviceId;
var
i = 0;
var
serviceId = [];
var
characteristicId = [];
wx.openBluetoothAdapter({
success:
function
(res) {
console.log(res,
"success"
);
wx.startBluetoothDevicesDiscovery({
services: [],
success:
function
(res) {
console.log(res)
},
fail:
function
(res) {
console.log(
"fail"
)
},
})
},
fail:
function
(res) {
console.log(
"fail"
)
},
}),
wx.getBluetoothDevices({
success:
function
(res) {
console.log(
"getBluetoothDevices"
,res)
i = 0;
while
(res.devices[i]) {
console.log(
"i"
,i);
console.log(res.devices[i].name, res.devices[i].deviceId);
if
(res.devices[i].name ==
'YahBoom_BL'
) {
deviceId = res.devices[i].deviceId;
console.log(deviceId);
}
i++;
}
}
}),
wx.getBLEDeviceServices({
deviceId: deviceId,
success:
function
(res) {
console.log(
"getBLEDeviceServices.services"
,res.services);
i = 0;
while
(res.services[i]) {
serviceId[i] = res.services[i].uuid;
console.log(serviceId[i]);
i++;
}
},
}),
wx.getBLEDeviceCharacteristics({
deviceId: deviceId,
serviceId: serviceId[1],
success:
function
(res) {
i = 0;
while
(res.characteristics[i]) {
characteristicId[i] = res.characteristics[i].uuid;
console.log(characteristicId[i]);
i++;
}
}
})
请问楼主,这个小程序的蓝牙是不是只能搜索除手机以外的蓝牙设备???
手机搜不到,有的蓝牙耳机也搜不到
我的代码没调试好,设备搜不到
嗯嗯,我也试了好多手机,以为自己文档错了,后来才发现是手机根本不能搜手机,蓝牙耳机还没测试。
文档里也没有说明,还有待完善
嗯嗯,这样的话就专注测蓝牙设备了,就不用纠结为啥搜不到手机了,多谢LZ
手机搜索手机不可以,需要搜索蓝牙耳机、蓝牙电子称等其他低功耗设备。
我之前测试这个用手机搜索手机一直搜索不到,后来搜到了邻居的蓝牙电子称。
我测测,谢谢
要用低功耗的蓝牙设备才可以搜到,连接
你好,普通手机、笔记本开启的蓝牙搜索不到吗?
当时我是测蓝牙打印机,手机搜不到,手表,耳机可以,打印机也可以
我试试,谢谢