BluetoothAdapterInfo constructor

const BluetoothAdapterInfo({
  1. required bool isSupported,
  2. required BluetoothAdapterState state,
  3. String? name,
  4. String? address,
  5. bool isBleSupported = false,
  6. bool isMultipleAdvertisementSupported = false,
  7. bool isOffloadedFilteringSupported = false,
  8. bool isOffloadedScanBatchingSupported = false,
  9. bool isLe2MPhySupported = false,
  10. bool isLeCodedPhySupported = false,
  11. bool isLeExtendedAdvertisingSupported = false,
  12. bool isLePeriodicAdvertisingSupported = false,
  13. bool isDiscovering = false,
  14. Map<String, dynamic> raw = const <String, dynamic>{},
})

创建适配器信息。

参数:

  • isSupported:是否支持蓝牙,无默认值。
  • state:当前适配器状态,无默认值。
  • name:适配器名称,默认 null。Android 需要连接权限;Linux 可能返回 BlueZ 名称; iOS/macOS/Windows/Web 通常不公开。
  • address:适配器地址,默认 null。Android 可能受系统限制;Linux/Windows 可能返回本机蓝牙地址; iOS/macOS/Web 不公开。
  • isBleSupported:是否支持 BLE,默认 false
  • isMultipleAdvertisementSupported:是否支持多广播,默认 false;主要 Android 能力。
  • isOffloadedFilteringSupported:是否支持硬件离线过滤,默认 false;Android 能力。
  • isOffloadedScanBatchingSupported:是否支持硬件批量扫描,默认 false;Android 能力。
  • isLe2MPhySupported:是否支持 LE 2M PHY,默认 false;Android 8.0+ 能力。
  • isLeCodedPhySupported:是否支持 LE Coded PHY,默认 false;Android 8.0+ 能力。
  • isLeExtendedAdvertisingSupported:是否支持扩展广播,默认 false;Android 8.0+ 能力。
  • isLePeriodicAdvertisingSupported:是否支持周期广播,默认 false;Android 8.0+ 能力。
  • isDiscovering:当前是否正在扫描/发现,默认 false;Web 仅表示设备选择器是否打开。
  • raw:原生完整字段,默认 const <String, dynamic>{}

Implementation

const BluetoothAdapterInfo({
  required this.isSupported,
  required this.state,
  this.name,
  this.address,
  this.isBleSupported = false,
  this.isMultipleAdvertisementSupported = false,
  this.isOffloadedFilteringSupported = false,
  this.isOffloadedScanBatchingSupported = false,
  this.isLe2MPhySupported = false,
  this.isLeCodedPhySupported = false,
  this.isLeExtendedAdvertisingSupported = false,
  this.isLePeriodicAdvertisingSupported = false,
  this.isDiscovering = false,
  this.raw = const <String, dynamic>{},
});