BluetoothAdvertisingSettings constructor

const BluetoothAdvertisingSettings({
  1. BluetoothAdvertisingMode mode = BluetoothAdvertisingMode.balanced,
  2. BluetoothTxPowerLevel txPowerLevel = BluetoothTxPowerLevel.medium,
  3. bool connectable = true,
  4. Duration? timeout,
})

创建广播设置。

参数:

  • mode:广播模式,默认 BluetoothAdvertisingMode.balanced,常规推荐。
  • txPowerLevel:发射功率,默认 BluetoothTxPowerLevel.medium,常规推荐。
  • connectable:是否可连接,默认 true。只做 beacon 广播可设为 false
  • timeout:广播超时,默认 null 表示不设置超时;Android 会转换为 0,iOS/macOS 当前忽略。

Implementation

const BluetoothAdvertisingSettings({
  this.mode = BluetoothAdvertisingMode.balanced,
  this.txPowerLevel = BluetoothTxPowerLevel.medium,
  this.connectable = true,
  this.timeout,
});