我是个新手
我通过NRF connect获取服务的UUID,但我一直在等待
this.device=null;
this.server=null;
function connect() {
return navigator.bluetooth.requestDevice({filters:[{services:[ '0000ffb0-0000-1000-8000-00805f9b34fb' ]}]})
.then(device => {
this.device = device;
return device.gatt.connect();
})
.then(server => {
this.server = server;
return Promise.all([
//Keep waiting
server.getPrimaryService('0000ffb0-0000-1000-8000-00805f9b34fb').then(service => {
this.service = service;
console.log(service);
return Promise.all([
//this._cacheCharacteristic(service,''),
])
})
]);
})
}发布于 2020-08-21 11:58:52
我测试了一个小时“”server.getPrimaryService (0x1800);“”,只测试了一次剩下的时间
https://stackoverflow.com/questions/63515526
复制相似问题