findAll static method

Stream<Router> findAll({
  1. bool silent = true,
  2. bool unique = true,
  3. bool enableIpv4Only = true,
  4. Duration timeout = const Duration(seconds: 10),
})

Implementation

static Stream<Router> findAll(
    {bool silent: true,
    bool unique: true,
    bool enableIpv4Only: true,
    Duration timeout: const Duration(seconds: 10)}) async* {
  var discovery = DeviceDiscoverer();
  await discovery.start(ipv4: true, ipv6: !enableIpv4Only);
  await for (DiscoveredClient client in discovery.quickDiscoverClients(
      timeout: timeout, query: CommonDevices.WAN_ROUTER, unique: unique)) {
    try {
      var device = await client.getDevice();
      var router = Router._(device);
      await router.init();
      yield router;
    } catch (e) {
      if (!silent) {
        rethrow;
      }
    }
  }
}