create method

ReactiveBleMobilePlatform create({
  1. Logger? logger,
})

Implementation

ReactiveBleMobilePlatform create({Logger? logger}) {
  const _bleMethodChannel = MethodChannel("flutter_reactive_ble_method");

  const connectedDeviceChannel =
      EventChannel("flutter_reactive_ble_connected_device");
  const charEventChannel = EventChannel("flutter_reactive_ble_char_update");
  const scanEventChannel = EventChannel("flutter_reactive_ble_scan");
  const bleStatusChannel = EventChannel("flutter_reactive_ble_status");

  return ReactiveBleMobilePlatform(
    protobufConverter: const ProtobufConverterImpl(),
    argsToProtobufConverter: const ArgsToProtobufConverterImpl(),
    bleMethodChannel: _bleMethodChannel,
    connectedDeviceChannel:
        connectedDeviceChannel.receiveBroadcastStream().cast<List<int>>(),
    charUpdateChannel:
        charEventChannel.receiveBroadcastStream().cast<List<int>>(),
    bleDeviceScanChannel:
        scanEventChannel.receiveBroadcastStream().cast<List<int>>(),
    bleStatusChannel:
        bleStatusChannel.receiveBroadcastStream().cast<List<int>>(),
    logger: logger,
  );
}