BluetoothGattServerRequest constructor
const
BluetoothGattServerRequest({})
创建 GATT Server 请求事件。
参数:
event:事件名称,无默认值。常见值包括serviceAdded、connectionState、characteristicRead、characteristicWrite、descriptorRead、descriptorWrite、subscribed、unsubscribed、notificationSent。deviceId:中心设备标识,无默认值;iOS/macOS 为 central UUID,Android 为设备地址。serviceUuid:服务 UUID,默认null。characteristicUuid:特征 UUID,默认null。descriptorUuid:描述符 UUID,默认null。requestId:Android GATT 请求 ID,默认null;iOS/macOS 通常为空。offset:读写偏移,默认0。value:请求或响应字节数组,默认const <int>[]。preparedWrite:是否 prepared write,默认false;主要 Android 有意义。responseNeeded:是否需要响应,默认false。raw:原生完整字段,默认const <String, dynamic>{}。
Implementation
const BluetoothGattServerRequest({
required this.event,
required this.deviceId,
this.serviceUuid,
this.characteristicUuid,
this.descriptorUuid,
this.requestId,
this.offset = 0,
this.value = const <int>[],
this.preparedWrite = false,
this.responseNeeded = false,
this.raw = const <String, dynamic>{},
});