fwupd 0.2.2 copy "fwupd: ^0.2.2" to clipboard
fwupd: ^0.2.2 copied to clipboard

PlatformLinux

Provides a client to connect to fwupd - the service that does firmware updates on Linux.

example/example.dart

import 'package:fwupd/fwupd.dart';

void main() async {
  var client = FwupdClient();
  await client.connect();
  print('Running fwupd ${client.daemonVersion}');
  print('Devices:');
  var devices = await client.getDevices();
  for (var device in devices) {
    print(device.name);
    try {
      var upgrades = await client.getUpgrades(device.deviceId);
      if (upgrades.isNotEmpty) {
        print('  Upgrades:');
        for (var upgrade in upgrades) {
          print('  ${upgrade.name} ${upgrade.version}');
        }
      }
    } on FwupdException {
      // No upgrades available.
    }
    try {
      var downgrades = await client.getDowngrades(device.deviceId);
      if (downgrades.isNotEmpty) {
        print('  Downgrades:');
        for (var downgrade in downgrades) {
          print('  ${downgrade.name} ${downgrade.version}');
        }
      }
    } on FwupdException {
      // No downgrades available.
    }
  }
  await client.close();
}
7
likes
140
pub points
64%
popularity

Publisher

verified publishercanonical.com

Provides a client to connect to fwupd - the service that does firmware updates on Linux.

Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

MPL-2.0 (license)

Dependencies

collection, dbus, meta

More

Packages that depend on fwupd