notifyGattServerCharacteristic method

Future<bool> notifyGattServerCharacteristic({
  1. String? deviceId,
  2. required String serviceUuid,
  3. required String characteristicUuid,
  4. required List<int> value,
  5. bool confirm = false,
})

通过本地 GATT Server 主动通知/指示特征值。

参数:

  • deviceId:目标中心设备 ID,默认 null 表示尽量发给所有已连接/已订阅设备。 Android 支持指定设备;iOS/macOS 当前忽略该参数并发给已订阅中心设备;Linux/Windows/Web 返回 false
  • serviceUuid:本地服务 UUID,无默认值。
  • characteristicUuid:本地特征 UUID,无默认值。
  • value:要发送的字节数组,无默认值。
  • confirm:是否使用需要确认的 indication,默认 false。Android 支持;iOS/macOS 当前忽略; Linux/Windows/Web 返回 false。需要可靠送达时可设为 true,高频数据推荐保持 false

Implementation

Future<bool> notifyGattServerCharacteristic({
  String? deviceId,
  required String serviceUuid,
  required String characteristicUuid,
  required List<int> value,
  bool confirm = false,
}) {
  throw UnimplementedError(
    'notifyGattServerCharacteristic() has not been implemented.',
  );
}