BluetoothAdvertisingSettings constructor
const
BluetoothAdvertisingSettings({
- BluetoothAdvertisingMode mode = BluetoothAdvertisingMode.balanced,
- BluetoothTxPowerLevel txPowerLevel = BluetoothTxPowerLevel.medium,
- bool connectable = true,
- 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,
});