【问题标题】:flutter_blue can't find HC-05 Bluetooth Moduleflutter_blue 找不到 HC-05 蓝牙模块
【发布时间】:2020-10-28 10:05:05
【问题描述】:

我正在为 Android 应用程序使用 flutter_blue。我已授予所有必需的权限,并在手机上启用了 GPS。当它开始扫描时,我可以看到一个蓝牙设备列表,但我找不到我的 HC-05 蓝牙模块。但是当我直接使用手机时可以找到HC-05模块。谁能帮帮我?

这是我的扫描代码:

FlutterBlue flb = _bluetoothService.getInstance();
    flb
        .startScan(timeout: Duration(seconds: 20), scanMode: ScanMode.lowPower)
        .then((x) {
      List<ScanResult> r = x as List<ScanResult>;
      r.forEach((a) {
        print('<<<<<');
        print('${a.device.id.id}');
        print(a.rssi);
      });
    });

【问题讨论】:

    标签: android flutter bluetooth bluetooth-lowenergy hc-05


    【解决方案1】:

    HC-05 是蓝牙经典模块,而不是蓝牙低功耗 (BLE) 模块。这就是您可以通过手机操作系统中通常的蓝牙经典搜索找到它的原因,而不是使用 BLE 库 flutter_blue。

    您必须使用 BLE 模块或其他 Flutter 库,例如 flutter_bluetooth_serial

    【讨论】:

      猜你喜欢
      • 2022-01-22
      • 1970-01-01
      • 1970-01-01
      • 2020-04-15
      • 2018-02-19
      • 2018-03-10
      • 1970-01-01
      • 2017-07-22
      • 1970-01-01
      相关资源
      最近更新 更多