Skip to content

Class

Defined in: src/drivers/base/class.ts:24

A device class, i.e. /sys/class/<name>. Devices with a class are linked into it, and live in /sys/devices/virtual/<name> unless they have a parent.

new Class(name, init?): Class

Defined in: src/drivers/base/class.ts:30

string

ClassInit = {}

Class

KObject.constructor

attributes: Map<string, Attribute>

Defined in: src/kobject.ts:21

These attributes use the kobject’s show and store.

KObject.attributes


children: Map<string, KEntry>

Defined in: src/kobject.ts:16

KObject.children


readonly class_attrs: Record<string, ClassAttribute>

Defined in: src/drivers/base/class.ts:25


readonly dev_attrs: Record<string, DeviceAttribute>

Defined in: src/drivers/base/class.ts:26


optional dev_node?: (device) => DevNode | undefined

Defined in: src/drivers/base/class.ts:28

Device

DevNode | undefined


name: string

Defined in: src/kobject.ts:24

KObject.name


optional parent?: KObject | null

Defined in: src/kobject.ts:25

KObject.parent

get path(): string

Defined in: src/kobject.ts:34

The path of this kobject, relative to the root of sysfs.

string

KObject.path

[dispose](): void

Defined in: src/kobject.ts:72

void

KObject.[dispose]


add_uevent_attr(): void

Defined in: src/kobject.ts:115

void

KObject.add_uevent_attr


create_attribute(name, show?, store?, mode?): Attribute

Defined in: src/kobject.ts:132

string

((kobj) => string) | null

((kobj, value) => void) | null

number = ...

Defaults based on which of show and store were passed.

Attribute

KObject.create_attribute


dispose(): void

Defined in: src/kobject.ts:64

void

KObject.dispose


keys(): Iterable<string>

Defined in: src/kobject.ts:60

The names of everything in this kobject.

Iterable<string>

KObject.keys


lookup(name): KEntry | undefined

Defined in: src/kobject.ts:44

Resolve a single entry by name. Attributes that use this kobject’s show and store are bound before being returned.

string

KEntry | undefined

KObject.lookup


notify_uevent(action, env?): void

Defined in: src/kobject.ts:82

Notify listeners that something happened to kobj.

"add" | "remove" | "change" | "move" | "online" | "offline" | "bind" | "unbind"

UEventEnv = {}

void

KObject.notify_uevent


send_uevent(text): void

Defined in: src/kobject.ts:100

Send a uevent described by text, an action optionally followed by KEY=VALUE pairs. This is what writing to a uevent attribute does.

string

void

KObject.send_uevent


optional show(attr): string

Defined in: src/kobject.ts:76

Attribute

string

KObject.show


optional store(attr, value): void

Defined in: src/kobject.ts:77

Attribute

string

void

KObject.store


optional uevent(env): void

Defined in: src/kobject.ts:127

Add variables to the environment of uevents sent for this kobject and its descendants.

UEventEnv

void

notify_uevent

KObject.uevent