udev

Creator: coderz1093

Last updated:

0 purchases

udev Image
udev Images

Languages

Categories

Add to Cart

Description:

udev

udev.dart #


udev — API for enumerating and introspecting local devices
Querying devices #
print(UdevDevice.fromSyspath('/sys/devices/<...>'));
print(UdevDevice.fromDevnum('b', 66304));
print(UdevDevice.fromSubsystemSysname('net', 'eth0'));
print(UdevDevice.fromDeviceId('c128:1'));
copied to clipboard
Enumerating devices #
final context = UdevContext();

final syspaths = context.enumerateDevices(subsystems: ['usb']);
for (final syspath in syspaths) {
final device = UdevDevice.fromSyspath(syspath, context: context);
print(device);
}
copied to clipboard
Monitoring devices #
final context = UdevContext();

final stream = context.monitorDevices(subsystems: ['usb'])
stream.timeout(const Duration(seconds: 60), onTimeout: (sink) => sink.close())
.listen(print);
copied to clipboard
Contributing to udev.dart #
We welcome contributions! See the contribution guide for more details.

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.