|
[BUG]
bluetooth 模块不能用一直报错
[复制链接]
我新建了一个移动开发 然后添加插件‘bluetooth’和‘ble’
在开发中使用
- function closeble(){
- var bluetooth = api.require('bluetooth');
- bluetooth.cancel();
- }
- function openble(){
- var bluetooth = api.require('bluetooth');
- bluetooth.connect({
- codeType: 'utf-8',
- }, function(ret, err) {
- if (ret) {
- api.alert({msg: JSON.stringify(ret)});
- } else {
- api.alert({msg: JSON.stringify(err)});
- }
- });
- }
复制代码 测试返回错误
[2024-1-3 9:55:38][ERROR] Uncaught TypeError: Cannot read properties of undefined (reading 'connect') at main.html:68
请问如何解决?
|
|