Ionic framework 离子型低能蓝牙设备未列出

Ionic framework 离子型低能蓝牙设备未列出,ionic-framework,connection,bluetooth-lowenergy,Ionic Framework,Connection,Bluetooth Lowenergy,我正在尝试构建一个在Android上运行的原型Ionic应用程序,我只想通过低能耗蓝牙查看已连接设备的列表。我使用的物理设备是智能手表Ticwatch,它通过蓝牙v4.1/BLE连接到我的手机。当我运行应用程序时,它显示有0台设备通过蓝牙v4.1/BLE连接。下面是代码。有人能帮我吗 (我不熟悉typescript和javascript——偶尔会写几行代码,所以也可能有代码错误) import { Component } from '@angular/core'; import { NavCon

我正在尝试构建一个在Android上运行的原型Ionic应用程序,我只想通过低能耗蓝牙查看已连接设备的列表。我使用的物理设备是智能手表Ticwatch,它通过蓝牙v4.1/BLE连接到我的手机。当我运行应用程序时,它显示有0台设备通过蓝牙v4.1/BLE连接。下面是代码。有人能帮我吗

(我不熟悉typescript和javascript——偶尔会写几行代码,所以也可能有代码错误)

import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';


import { BluetoothLE, DeviceInfo } from '@ionic-native/bluetooth-le';
import { Platform } from 'ionic-angular';
import { Toast } from '@ionic-native/toast';

@Component({
 selector: 'page-home',
 templateUrl: 'home.html'
})
export class HomePage {

 foundDevices = [];

 constructor(public navCtrl: NavController, public bluetoothle: BluetoothLE, public plt: Platform,
   private toast: Toast
 ) {
   let connectedObj: DeviceInfo[] = [];

   this.plt.ready().then((readySource) => {

     bluetoothle.requestPermission().then(dataTemp => {
       console.log('Platform ready from', readySource);

       this.toast.show("Platform ready from", '5000', 'center').subscribe(
         toast => {
           console.log(toast);
         }
       );
        this.bluetoothle.initialize().then(ble => {

         console.log('ble', ble.status) // logs 'enabled'
          this.toast.show(ble.status, '15000', 'center').subscribe(
           toast => {
             console.log(toast);
           });


         this.bluetoothle.retrieveConnected().then(connectedObj => {
            this.toast.show("Length: " + connectedObj.devices.length, '25000', 'center').subscribe(
             toast => {
               console.log(toast);
             });

          });

        });
     });

   });

 }